Example #1
0
 public override void SetActive(Boolean p_active)
 {
     base.SetActive(p_active);
     if (p_active)
     {
         m_sprite.atlas      = m_itemSlot.ItemTexture.atlas;
         m_sprite.spriteName = m_itemSlot.ItemTexture.spriteName;
         MMGUI.ItemSlot.UpdateItemBackground(m_itemBackground, m_item);
     }
     if (m_item is Consumable)
     {
         Consumable consumable = (Consumable)m_item;
         if (m_item is Scroll)
         {
             m_sprite.spriteName       = "ITM_consumable_scroll";
             m_scrollSprite.spriteName = m_item.Icon;
             NGUITools.SetActiveSelf(m_scrollSprite.gameObject, p_active);
         }
         NGUITools.SetActiveSelf(m_itemCounter.gameObject, p_active);
         m_itemCounter.text = consumable.Counter.ToString();
     }
     else if (m_item is GoldStack)
     {
         GoldStack goldStack = (GoldStack)m_item;
         NGUITools.SetActiveSelf(m_itemCounter.gameObject, p_active);
         m_itemCounter.text = goldStack.Amount.ToString();
     }
 }
 public Boolean AddItem(BaseItem p_item)
 {
     if (p_item != null)
     {
         if (p_item is GoldStack)
         {
             GoldStack goldStack = (GoldStack)p_item;
             m_goldAmount += goldStack.Amount;
             return(true);
         }
         p_item.PriceMultiplicator = LegacyLogic.Instance.WorldManager.ItemResellMultiplicator;
     }
     return(m_inventory.AddItem(p_item));
 }
 public void AddItem(BaseItem p_item, Int32 p_slot)
 {
     if (p_item != null)
     {
         if (p_item is GoldStack)
         {
             GoldStack goldStack = (GoldStack)p_item;
             m_goldAmount += goldStack.Amount;
             return;
         }
         p_item.PriceMultiplicator = LegacyLogic.Instance.WorldManager.ItemResellMultiplicator;
     }
     m_inventory.AddItem(p_item, p_slot);
 }
        public Boolean AddItem(BaseItem p_item)
        {
            if (p_item != null)
            {
                if (p_item is GoldStack)
                {
                    GoldStack goldStack = (GoldStack)p_item;
                    m_party.ChangeGold(goldStack.Amount);
                    return(true);
                }
                p_item.PriceMultiplicator = LegacyLogic.Instance.WorldManager.ItemResellMultiplicator;
            }
            Boolean flag = m_inventory.AddItem(p_item);

            if (flag && p_item is Equipment && ((Equipment)p_item).IsRelic())
            {
                LegacyLogic.Instance.WorldManager.HintManager.TriggerHint(EHintType.RELICS);
            }
            return(flag);
        }