CODE |
if (m_Title1 != null) { list.Add(1060660, "Title\t{0}",m_Title1); // ~1_val~:~2_val~ } |
QUOTE |
private string m_Title1; [CommandProperty( AccessLevel.GameMaster )] public string Title1 { get{ return m_Title1; } set{ m_Title1= value; InvalidateProperties(); } } |
QUOTE |
Note that if you added those custom properties, then you would also need to Serialize and Deserialize them. |
CODE |
private string m_Title1; [CommandProperty( AccessLevel.GameMaster )] public string Title1 { get{ return m_Title1; } set{ m_Title1= value; } } |
CODE |
private string m_Title1; [CommandProperty(AccessLevel.GameMaster)] public string Title1 { get { if (m_Title1 == null) { // find the value on the XmlData attachment XmlData a = (XmlData)XmlAttach.FindAttachment(this, typeof(XmlData), "Title1"); if (a != null) { m_Title1 = a.Data; } } return m_Title1; } set { m_Title1 = value; // find the value on the XmlData attachment XmlData a = (XmlData)XmlAttach.FindAttachment(this, typeof(XmlData), "Title1"); if (a == null) { // if none exist, then add one a = new XmlData("Title1", m_Title1); XmlAttach.AttachTo(this, a); } // store the new title in the Data property if (a != null) { a.Data = m_Title1; } InvalidateProperties(); } } |
CODE |
using Server.Engines.XmlSpawner2; |
CODE |
private string m_Title1; [CommandProperty(AccessLevel.GameMaster)] public string Title1 { get { if (m_Title1 == null) { // find the value on the XmlData attachment XmlData a = (XmlData)XmlAttach.FindAttachment(this, typeof(XmlData), "Title1"); if (a != null) { m_Title1 = a.Data; } } return m_Title1; } set { m_Title1 = value; // find the value on the XmlData attachment XmlData a = (XmlData)XmlAttach.FindAttachment(this, typeof(XmlData), "Title1"); if (a == null) { // if none exist, then add one a = new XmlData("Title1", m_Title1); XmlAttach.AttachTo(this, a); } // store the new title in the Data property if (a != null) { a.Data = m_Title1; } InvalidateProperties(); } } |
CODE |
private string m_Title2; [CommandProperty(AccessLevel.GameMaster)] public string Title2 { get { if (m_Title2 == null) { // find the value on the XmlData attachment XmlData a = (XmlData)XmlAttach.FindAttachment(this, typeof(XmlData), "Title2"); if (a != null) { m_Title2 = a.Data; } } return m_Title2; } set { m_Title2 = value; // find the value on the XmlData attachment XmlData a = (XmlData)XmlAttach.FindAttachment(this, typeof(XmlData), "Title2"); if (a == null) { // if none exist, then add one a = new XmlData("Title2", m_Title2); XmlAttach.AttachTo(this, a); } // store the new title in the Data property if (a != null) { a.Data = m_Title2; } InvalidateProperties(); } } |
CODE |
list.Add(1060660, "Title\t{0}\n{1}", m_Title1, m_Title2); // ~1_val~:~2_val~ |