Example #1
0
        // USERGUIDEACTION INTERFACE

        protected override bool OnExecute()
        {
            if (base.OnExecute() == false)
            {
                return(false);
            }

            E_WeaponID  weaponID  = ItemType == GuiShop.E_ItemType.Weapon ? (E_WeaponID)ItemId : E_WeaponID.None;
            E_ItemID    itemID    = ItemType == GuiShop.E_ItemType.Item ? (E_ItemID)ItemId : E_ItemID.None;
            E_UpgradeID upgradeID = ItemType == GuiShop.E_ItemType.Upgrade ? (E_UpgradeID)ItemId : E_UpgradeID.None;
            E_PerkID    perkID    = ItemType == GuiShop.E_ItemType.Perk ? (E_PerkID)ItemId : E_PerkID.None;

            ResearchItem[] items = ResearchSupport.Instance.GetItems();

            foreach (var item in items)
            {
                if (item.weaponID == weaponID && weaponID != E_WeaponID.None ||
                    item.itemID == itemID && itemID != E_ItemID.None ||
                    item.upgradeID == upgradeID && upgradeID != E_UpgradeID.None ||
                    item.perkID == perkID && perkID != E_PerkID.None)
                {
                    Item = item;
                    break;
                }
            }

            return(true);
        }
 public PreviewItem(E_UpgradeID upgradeID)
 {
     if (upgradeID != E_UpgradeID.None)
     {
         UpgradeSettings settings = UpgradeSettingsManager.Instance.Get(upgradeID);
         m_ItemDescription = TextDatabase.instance[settings.Description];
     }
 }
Example #3
0
 // -----
 public bool OwnsUpgrade(E_UpgradeID upgradeID)
 {
     foreach (UpgradeData data in Upgrades)
     {
         if (data.ID == upgradeID)
         {
             return(true);
         }
     }
     return(false);
 }