protected void CheckItem(GossipMenuItemBase item) { if (item.SubMenu != null) { var sub = item.SubMenu; sub.m_parent = this; } }
protected void CheckItem(GossipMenuItemBase item) { if (item.SubMenu == null) { return; } item.SubMenu.m_parent = this; }
public void AddItem(GossipMenuItemBase item) { if (this.m_gossipItems == null) { this.m_gossipItems = new List <GossipMenuItemBase>(1); } this.CheckItem(item); this.m_gossipItems.Add(item); }
public void AddItem(GossipMenuItemBase item) { if (m_gossipItems == null) { m_gossipItems = new List <GossipMenuItemBase>(1); } CheckItem(item); m_gossipItems.Add(item); }
public void AddItem(int index, GossipMenuItemBase item) { if (m_gossipItems == null) { m_gossipItems = new List <GossipMenuItemBase>(1); } if (item != null) { CheckItem(item); m_gossipItems.Insert(index, item); } }
public void AddItem(int index, GossipMenuItemBase item) { if (this.m_gossipItems == null) { this.m_gossipItems = new List <GossipMenuItemBase>(1); } if (item == null) { return; } this.CheckItem(item); this.m_gossipItems.Insert(index, item); }
/// <summary> /// Replaces the item at the given index with the given item. /// If index == count, appends item to end. /// </summary> public void SetItem(int index, GossipMenuItemBase item) { if (this.m_gossipItems == null) { this.m_gossipItems = new List <GossipMenuItemBase>(1); } this.CheckItem(item); if (index == this.m_gossipItems.Count) { this.m_gossipItems.Add(item); } else { this.m_gossipItems[index] = item; } }
/// <summary> /// Replaces the item at the given index with the given item. /// If index == count, appends item to end. /// </summary> public void SetItem(int index, GossipMenuItemBase item) { if (m_gossipItems == null) { m_gossipItems = new List <GossipMenuItemBase>(1); } CheckItem(item); if (index == m_gossipItems.Count) { // append to end m_gossipItems.Add(item); } else { // replace m_gossipItems[index] = item; } }
/// <summary>Handles selection of item in menu by player</summary> /// <param name="itemID">ID of selected item</param> /// <param name="extra">additional parameter supplied by user</param> public void HandleSelectedItem(uint itemID, string extra) { IList <GossipMenuItemBase> gossipItems = CurrentMenu.GossipItems; if (itemID >= gossipItems.Count) { return; } GossipMenuItemBase gossipMenuItemBase = gossipItems[(int)itemID]; if (gossipMenuItemBase == null) { return; } if (gossipMenuItemBase.Action != null && gossipMenuItemBase.Action.CanUse(this)) { GossipMenu currentMenu = CurrentMenu; gossipMenuItemBase.Action.OnSelect(this); if (currentMenu != CurrentMenu || gossipMenuItemBase.Action.Navigates) { return; } } if (gossipMenuItemBase.SubMenu != null) { DisplayMenu(gossipMenuItemBase.SubMenu); } else if (StayOpen) { DisplayCurrentMenu(); } else { CurrentMenu.NotifyClose(this); Dispose(); } }
public bool RemoveItem(GossipMenuItemBase item) { return(m_gossipItems.Remove(item)); }
public bool RemoveItem(GossipMenuItemBase item) { return m_gossipItems.Remove(item); }
public void AddItem(int index, GossipMenuItemBase item) { if (m_gossipItems == null) m_gossipItems = new List<GossipMenuItemBase>(1); if (item != null) { CheckItem(item); m_gossipItems.Insert(index, item); } }
/// <summary> /// Replaces the item at the given index with the given item. /// If index == count, appends item to end. /// </summary> public void SetItem(int index, GossipMenuItemBase item) { if (m_gossipItems == null) { m_gossipItems = new List<GossipMenuItemBase>(1); } CheckItem(item); if (index == m_gossipItems.Count) { // append to end m_gossipItems.Add(item); } else { // replace m_gossipItems[index] = item; } }
public void AddItem(GossipMenuItemBase item) { if (m_gossipItems == null) { m_gossipItems = new List<GossipMenuItemBase>(1); } CheckItem(item); m_gossipItems.Add(item); }