Esempio n. 1
0
 internal void PushSubKindByName(string name, GameObjectList list)
 {
     if ((list != null) && (list.Count != 0))
     {
         if (this.SubKinds.Count == 0)
         {
             this.RightClickClose   = false;
             this.RootListKind.Kind = this.listKindToDisplay;
             this.RootListKind.List = this.gameObjectList;
         }
         this.SetObjectList(list);
         this.listKindToDisplay = this.GetListKindByName(name);
         if (this.listKindToDisplay != null)
         {
             this.ReCalculate();
             SubKind item = new SubKind {
                 Kind = this.listKindToDisplay,
                 List = list
             };
             this.SubKinds.Push(item);
         }
     }
 }
Esempio n. 2
0
 internal void PopSubKind()
 {
     if (this.SubKinds.Count > 0)
     {
         SubKind rootListKind;
         this.SubKinds.Pop();
         if (this.SubKinds.Count > 0)
         {
             rootListKind = this.SubKinds.Peek();
         }
         else
         {
             rootListKind = this.RootListKind;
         }
         this.SetObjectList(rootListKind.List);
         this.listKindToDisplay = rootListKind.Kind;
         this.ReCalculate();
     }
     else
     {
         this.RightClickClose = true;
     }
 }
 internal void PushSubKindByName(string name, GameObjectList list)
 {
     if ((list != null) && (list.Count != 0))
     {
         if (this.SubKinds.Count == 0)
         {
             this.RightClickClose = false;
             this.RootListKind.Kind = this.listKindToDisplay;
             this.RootListKind.List = this.gameObjectList;
         }
         this.SetObjectList(list);
         this.listKindToDisplay = this.GetListKindByName(name);
         if (this.listKindToDisplay != null)
         {
             this.ReCalculate();
             SubKind item = new SubKind {
                 Kind = this.listKindToDisplay,
                 List = list
             };
             this.SubKinds.Push(item);
         }
     }
 }
 internal void PopSubKind()
 {
     if (this.SubKinds.Count > 0)
     {
         SubKind rootListKind;
         this.SubKinds.Pop();
         if (this.SubKinds.Count > 0)
         {
             rootListKind = this.SubKinds.Peek();
         }
         else
         {
             rootListKind = this.RootListKind;
         }
         this.SetObjectList(rootListKind.List);
         this.listKindToDisplay = rootListKind.Kind;
         this.ReCalculate();
     }
     else
     {
         this.RightClickClose = true;
     }
 }
 public void SetListKindByName(string Name, bool showCheckBox, bool multiSelecting)
 {
     this.listKindToDisplay = this.GetListKindByName(Name);
     this.MultiSelecting = multiSelecting;
     if (this.listKindToDisplay != null)
     {
         this.SetShowCheckBox(showCheckBox);
     }
 }
 public void SetListKindByID(int ID, bool showCheckBox, bool multiSelecting)
 {
     this.listKindToDisplay = this.GetListKindByID(ID);
     this.MultiSelecting = multiSelecting;
     if (this.listKindToDisplay != null)
     {
         this.SetShowCheckBox(showCheckBox);
     }
 }
 //读取xml里的列表文件样式,包括tablist 和 listkind
 public void LoadFromXMLNode(XmlNode rootNode)
 {
     this.rowHeight = int.Parse(rootNode.Attributes.GetNamedItem("RowHeight").Value);
     this.defaultFrameWidth = int.Parse(rootNode.Attributes.GetNamedItem("FrameWidth").Value);
     this.defaultFrameHeight = int.Parse(rootNode.Attributes.GetNamedItem("FrameHeight").Value);
     this.client.X = int.Parse(rootNode.Attributes.GetNamedItem("ClientX").Value);
     this.client.Y = int.Parse(rootNode.Attributes.GetNamedItem("ClientY").Value);
     this.client.Width = int.Parse(rootNode.Attributes.GetNamedItem("ClientWidth").Value);
     this.client.Height = int.Parse(rootNode.Attributes.GetNamedItem("ClientHeight").Value);
     this.defaultOKButtonPosition.X = int.Parse(rootNode.Attributes.GetNamedItem("OKButtonX").Value);
     this.defaultOKButtonPosition.Y = int.Parse(rootNode.Attributes.GetNamedItem("OKButtonY").Value);
     this.defaultCancelButtonPosition.X = int.Parse(rootNode.Attributes.GetNamedItem("CancelButtonX").Value);
     this.defaultCancelButtonPosition.Y = int.Parse(rootNode.Attributes.GetNamedItem("CancelButtonY").Value);
     this.defaultMapViewSelectorButtonPosition.X = int.Parse(rootNode.Attributes.GetNamedItem("MapViewSelectorButtonX").Value);
     this.defaultMapViewSelectorButtonPosition.Y = int.Parse(rootNode.Attributes.GetNamedItem("MapViewSelectorButtonY").Value);
     foreach (XmlNode node in rootNode.ChildNodes)
     {
         ListKind item = new ListKind(this) {
             ID = int.Parse(node.Attributes.GetNamedItem("ID").Value),
             Name = node.Attributes.GetNamedItem("Name").Value,
             DisplayName = node.Attributes.GetNamedItem("DisplayName").Value,
             ShowPortrait = bool.Parse(node.Attributes.GetNamedItem("ShowPortrait").Value)
         };
         item.LoadFromXMLNode(node);
         this.ListKinds.Add(item);
     }
 }