public static int constructor(IntPtr l)
    {
        int result;

        try
        {
            GoodsType goodsTypeId;
            LuaObject.checkEnum <GoodsType>(l, 2, out goodsTypeId);
            int contentId;
            LuaObject.checkType(l, 3, out contentId);
            int nums;
            LuaObject.checkType(l, 4, out nums);
            ulong instanceId;
            LuaObject.checkType(l, 5, out instanceId);
            EnchantStoneBagItem o = new EnchantStoneBagItem(goodsTypeId, contentId, nums, instanceId);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Beispiel #2
0
        // Token: 0x0600FB53 RID: 64339 RVA: 0x00421884 File Offset: 0x0041FA84
        public void InitEquipmentDepotListItemInfo(BagItemBase bagItem, bool canWear)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_InitEquipmentDepotListItemInfoBagItemBaseBoolean_hotfix != null)
            {
                this.m_InitEquipmentDepotListItemInfoBagItemBaseBoolean_hotfix.call(new object[]
                {
                    this,
                    bagItem,
                    canWear
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            base.gameObject.SetActive(true);
            base.gameObject.name = bagItem.ListItemName;
            this.BagItem         = bagItem;
            EquipmentBagItem    equipmentBagItem    = bagItem as EquipmentBagItem;
            EnchantStoneBagItem enchantStoneBagItem = bagItem as EnchantStoneBagItem;

            this.EquipmentInstanceId = this.BagItem.InstanceId;
            if (equipmentBagItem != null)
            {
                ConfigDataEquipmentInfo equipmentInfo = equipmentBagItem.EquipmentInfo;
                this.m_icon.sprite    = AssetUtility.Instance.GetSprite(equipmentInfo.Icon);
                this.m_bgFrame.sprite = AssetUtility.Instance.GetSprite(UIUtility.GetGoodsFrameNameByRank(equipmentInfo.Rank));
                this.m_SSREffect.SetActive(UIUtility.IsRankSSR(equipmentInfo.Rank));
                UIUtility.SetGameObjectChildrenActiveCount(this.m_starGroup, equipmentBagItem.StarLevel);
                this.m_lvValueText.text = equipmentBagItem.Level.ToString();
                ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
                IConfigDataLoader     configDataLoader      = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;
                int wearedEquipmentHeroIdByEquipmentId      = projectLPlayerContext.GetWearedEquipmentHeroIdByEquipmentId(this.EquipmentInstanceId);
                this.IsEquiped = (wearedEquipmentHeroIdByEquipmentId > 0);
                if (this.IsEquiped)
                {
                    ConfigDataHeroInfo      configDataHeroInfo = configDataLoader.GetConfigDataHeroInfo(wearedEquipmentHeroIdByEquipmentId);
                    ConfigDataCharImageInfo charImageInfo      = configDataHeroInfo.GetCharImageInfo(configDataHeroInfo.Star);
                    if (charImageInfo != null)
                    {
                        this.m_equipingTagHeadIcon.sprite = AssetUtility.Instance.GetSprite(charImageInfo.SmallHeadImage);
                    }
                    this.m_stateCtrl.SetToUIState("Equiped", false, true);
                }
                else
                {
                    this.m_stateCtrl.SetToUIState("UnEquiped", false, true);
                }
                this.m_lockImage.SetActive(equipmentBagItem.Locked);
                this.m_mask.SetActive(!canWear);
                this.m_enchantmentIcon.gameObject.SetActive(equipmentBagItem.IsEnchant());
                if (equipmentBagItem.IsEnchant())
                {
                    ConfigDataResonanceInfo configDataResonanceInfo = configDataLoader.GetConfigDataResonanceInfo(equipmentBagItem.ResonanceId);
                    this.m_enchantmentIcon.sprite = AssetUtility.Instance.GetSprite(configDataResonanceInfo.SmallIcon);
                }
            }
            else
            {
                ConfigDataEnchantStoneInfo enchantStoneInfo = enchantStoneBagItem.EnchantStoneInfo;
                this.m_icon.sprite    = AssetUtility.Instance.GetSprite(enchantStoneInfo.Icon);
                this.m_bgFrame.sprite = AssetUtility.Instance.GetSprite(UIUtility.GetGoodsFrameNameByRank(enchantStoneInfo.Rank));
                this.m_SSREffect.SetActive(UIUtility.IsRankSSR(enchantStoneInfo.Rank));
                this.m_countText.text = UIUtility.GetGoodsCount(this.BagItem.GoodsTypeId, this.BagItem.ContentId).ToString();
                this.m_stateCtrl.SetToUIState("Enchant", false, true);
                this.m_enchantmentIcon.gameObject.SetActive(false);
                this.m_checkImageMask.SetActive(false);
            }
        }