Exemplo n.º 1
0
 protected void CheckItem(GossipMenuItemBase item)
 {
     if (item.SubMenu != null)
     {
         var sub = item.SubMenu;
         sub.m_parent = this;
     }
 }
Exemplo n.º 2
0
 protected void CheckItem(GossipMenuItemBase item)
 {
     if (item.SubMenu == null)
     {
         return;
     }
     item.SubMenu.m_parent = this;
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 public void AddItem(GossipMenuItemBase item)
 {
     if (m_gossipItems == null)
     {
         m_gossipItems = new List <GossipMenuItemBase>(1);
     }
     CheckItem(item);
     m_gossipItems.Add(item);
 }
Exemplo n.º 5
0
        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);
            }
        }
Exemplo n.º 6
0
 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);
 }
Exemplo n.º 7
0
 /// <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;
     }
 }
Exemplo n.º 8
0
        /// <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;
            }
        }
Exemplo n.º 9
0
        /// <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();
            }
        }
Exemplo n.º 10
0
 public bool RemoveItem(GossipMenuItemBase item)
 {
     return(m_gossipItems.Remove(item));
 }
Exemplo n.º 11
0
		public bool RemoveItem(GossipMenuItemBase item)
		{
			return m_gossipItems.Remove(item);
		}
Exemplo n.º 12
0
		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);
			}
		}
Exemplo n.º 13
0
		/// <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;
			}
		}
Exemplo n.º 14
0
		public void AddItem(GossipMenuItemBase item)
		{
			if (m_gossipItems == null)
			{
				m_gossipItems = new List<GossipMenuItemBase>(1);
			}

			CheckItem(item);
			m_gossipItems.Add(item);
		}
Exemplo n.º 15
0
		protected void CheckItem(GossipMenuItemBase item)
		{
			if (item.SubMenu != null)
			{
				var sub = item.SubMenu;
				sub.m_parent = this;
			}
		}