예제 #1
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 IsEnchant(IntPtr l)
    {
        int result;

        try
        {
            EquipmentBagItem equipmentBagItem = (EquipmentBagItem)LuaObject.checkSelf(l);
            bool             b = equipmentBagItem.IsEnchant();
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, b);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
예제 #4
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);
            }
        }