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);
            EquipmentBagItem o = new EquipmentBagItem(goodsTypeId, contentId, nums, instanceId);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemplo n.º 2
0
        // Token: 0x06006F9F RID: 28575 RVA: 0x001F38C4 File Offset: 0x001F1AC4
        public List <BattleHero> GetBusinessCardHeroes()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_GetBusinessCardHeroes_hotfix != null)
            {
                return((List <BattleHero>) this.m_GetBusinessCardHeroes_hotfix.call(new object[]
                {
                    this
                }));
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            List <BattleHero> list = new List <BattleHero>();

            if (this.m_friendDS.BusinessCardSetInfo != null)
            {
                List <BusinessCardHeroSet> heroes = this.m_friendDS.BusinessCardSetInfo.Heroes;
                foreach (BusinessCardHeroSet businessCardHeroSet in heroes)
                {
                    Hero       hero       = this.m_hero.FindHero(businessCardHeroSet.HeroId);
                    BattleHero battleHero = BattleHero.HeroToBattleHero(hero);
                    foreach (ulong num in hero.EquipmentIds)
                    {
                        if (num != 0UL)
                        {
                            EquipmentBagItem equipmentBagItem = this.m_bag.FindBagItemByInstanceId(num) as EquipmentBagItem;
                            battleHero.Equipments.Add(equipmentBagItem.ToBattleHeroEquipment());
                        }
                    }
                    list.Add(battleHero);
                }
            }
            return(list);
        }
Exemplo n.º 3
0
        // Token: 0x0600A2F2 RID: 41714 RVA: 0x002DE7CC File Offset: 0x002DC9CC
        private void SetItemStateByType(GoodsType type)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetItemStateByTypeGoodsType_hotfix != null)
            {
                this.m_SetItemStateByTypeGoodsType_hotfix.call(new object[]
                {
                    this,
                    type
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            switch (type)
            {
            case GoodsType.GoodsType_JobMaterial:
                break;

            case GoodsType.GoodsType_Item:
                if (this.m_itemInfo.DisplayType == ItemDisplayType.ItemDisplayType_HeroFragment)
                {
                    this.m_iconImage.transform.localScale = new Vector3(1.3f, 1.3f);
                    this.m_bgImage.gameObject.SetActive(false);
                }
                break;

            case GoodsType.GoodsType_Equipment:
            {
                ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
                IConfigDataLoader     configDataLoader      = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;
                EquipmentBagItem      equipmentBagItem      = (EquipmentBagItem)this.BagItem;
                int wearedEquipmentHeroIdByEquipmentId      = projectLPlayerContext.GetWearedEquipmentHeroIdByEquipmentId(equipmentBagItem.InstanceId);
                if (wearedEquipmentHeroIdByEquipmentId > 0)
                {
                    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_equipingTag.SetActive(wearedEquipmentHeroIdByEquipmentId > 0);
                UIUtility.SetGameObjectChildrenActiveCount(this.m_starGroup, equipmentBagItem.StarLevel);
                this.m_lvValueText.text = equipmentBagItem.Level.ToString();
                this.m_lockImage.SetActive(equipmentBagItem.Locked);
                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);
                }
                break;
            }

            default:
                if (type != GoodsType.GoodsType_EnchantStone)
                {
                }
                break;
            }
        }
        // Token: 0x060105B4 RID: 66996 RVA: 0x00444B9C File Offset: 0x00442D9C
        public void InitHeroEquipmentItem(EquipmentBagItem equipment, int slot, int heroId)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_InitHeroEquipmentItemEquipmentBagItemInt32Int32_hotfix != null)
            {
                this.m_InitHeroEquipmentItemEquipmentBagItemInt32Int32_hotfix.call(new object[]
                {
                    this,
                    equipment,
                    slot,
                    heroId
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            base.gameObject.SetActive(true);
            this.Slot      = slot;
            this.Equipment = equipment;
            IConfigDataLoader       configDataLoader      = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;
            ProjectLPlayerContext   projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
            CommonUIStateController component             = base.gameObject.GetComponent <CommonUIStateController>();

            if (equipment != null)
            {
                ConfigDataEquipmentInfo equipmentInfo = this.Equipment.EquipmentInfo;
                component.SetToUIState("Have", false, true);
                this.m_iconImg.sprite = AssetUtility.Instance.GetSprite(equipmentInfo.Icon);
                this.m_iconBg.sprite  = AssetUtility.Instance.GetSprite(UIUtility.GetGoodsFrameNameByRank(equipmentInfo.Rank));
                this.m_nameText.text  = equipmentInfo.Name;
                int levelLimit = configDataLoader.GetConfigDataEquipmentLevelLimitInfo(equipment.StarLevel).LevelLimit;
                this.m_lvText.text = equipment.Level + "/" + levelLimit;
                UIUtility.SetGameObjectChildrenActiveCount(this.m_starGroupg, equipment.StarLevel);
                this.m_iconSSREffect.SetActive(UIUtility.IsRankSSR(equipmentInfo.Rank));
                if (equipment.IsEnchant())
                {
                    this.m_runeIconStateCtrl.gameObject.SetActive(true);
                    ConfigDataResonanceInfo configDataResonanceInfo = configDataLoader.GetConfigDataResonanceInfo(equipment.ResonanceId);
                    int equipmentResonanceNums = projectLPlayerContext.GetEquipmentResonanceNums(equipment.InstanceId);
                    if (equipmentResonanceNums >= 2)
                    {
                        this.m_runeIconStateCtrl.SetToUIState("Active", false, true);
                        this.m_runeActiveIcon.sprite = AssetUtility.Instance.GetSprite(configDataResonanceInfo.ActiveIcon);
                    }
                    else
                    {
                        this.m_runeIconStateCtrl.SetToUIState("Unactive", false, true);
                        this.m_runeInactiveIcon.sprite = AssetUtility.Instance.GetSprite(configDataResonanceInfo.InactiveIcon);
                    }
                }
                else
                {
                    this.m_runeIconStateCtrl.gameObject.SetActive(false);
                }
            }
            else
            {
                component.SetToUIState("NotHave", false, true);
            }
            this.m_redMarkGo.SetActive(projectLPlayerContext.HasBetterEquipmentBySlotId(heroId, slot));
        }
    public static int get_ResonanceId(IntPtr l)
    {
        int result;

        try
        {
            EquipmentBagItem equipmentBagItem = (EquipmentBagItem)LuaObject.checkSelf(l);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, equipmentBagItem.ResonanceId);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int IsEquipmentEnhanced(IntPtr l)
    {
        int result;

        try
        {
            EquipmentBagItem equipmentBagItem = (EquipmentBagItem)LuaObject.checkSelf(l);
            bool             b = equipmentBagItem.IsEquipmentEnhanced();
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, b);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int ToPBGoods(IntPtr l)
    {
        int result;

        try
        {
            EquipmentBagItem equipmentBagItem = (EquipmentBagItem)LuaObject.checkSelf(l);
            ProGoods         o = equipmentBagItem.ToPBGoods();
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int set_Locked(IntPtr l)
    {
        int result;

        try
        {
            EquipmentBagItem equipmentBagItem = (EquipmentBagItem)LuaObject.checkSelf(l);
            bool             locked;
            LuaObject.checkType(l, 2, out locked);
            equipmentBagItem.Locked = locked;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int set_StarLevel(IntPtr l)
    {
        int result;

        try
        {
            EquipmentBagItem equipmentBagItem = (EquipmentBagItem)LuaObject.checkSelf(l);
            int starLevel;
            LuaObject.checkType(l, 2, out starLevel);
            equipmentBagItem.StarLevel = starLevel;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int set_EnchantProperties(IntPtr l)
    {
        int result;

        try
        {
            EquipmentBagItem            equipmentBagItem = (EquipmentBagItem)LuaObject.checkSelf(l);
            List <CommonBattleProperty> enchantProperties;
            LuaObject.checkType <List <CommonBattleProperty> >(l, 2, out enchantProperties);
            equipmentBagItem.EnchantProperties = enchantProperties;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
    public static int IsEquipmentLevelUped(IntPtr l)
    {
        int result;

        try
        {
            EquipmentBagItem equipmentBagItem = (EquipmentBagItem)LuaObject.checkSelf(l);
            int bornStarLevel;
            LuaObject.checkType(l, 2, out bornStarLevel);
            bool b = equipmentBagItem.IsEquipmentLevelUped(bornStarLevel);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, b);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemplo n.º 12
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);
            }
        }
Exemplo n.º 13
0
 // Token: 0x06011162 RID: 69986 RVA: 0x0046D43C File Offset: 0x0046B63C
 protected void OnEquipmentEnchantSaveAck(int result, EquipmentBagItem equipmentBagItem)
 {
     base.Result       = result;
     this.EquipBagItem = equipmentBagItem;
     this.OnTransactionComplete();
 }