protected void ChengeSkillType(int index, SkillItemTable.SkillItemData data, float percent)
 {
     //IL_006a: Unknown result type (might be due to invalid IL or missing references)
     //IL_009d: Unknown result type (might be due to invalid IL or missing references)
     ReleaseEffects();
     if (coolTimeGuage != null)
     {
         if (percent > 0f)
         {
             if (percent < 0.2f)
             {
                 percent = 0.2f;
             }
             coolTimeGuage.SetPercent(percent, false);
         }
         else
         {
             coolTimeGuage.SetPercent(percent, false);
         }
     }
     if (skillIconOff != null)
     {
         skillIconOff.get_gameObject().SetActive(true);
         ResourceLoad.LoadItemIconTexture(skillIconOff, data.iconID);
     }
     if (skillIconOn != null)
     {
         skillIconOn.get_gameObject().SetActive(true);
         ResourceLoad.LoadItemIconTexture(skillIconOn, data.iconID);
     }
     SetSlotType(data.type);
     skillTypeOFF.alpha = 1f;
     isPrevGaugeMax     = (percent <= 0f);
     maxEffect.Init(this);
     UpdateSilence();
 }
Пример #2
0
    public override void UpdateUI()
    {
        bool flag = MonoBehaviourSingleton <GachaManager> .I.selectGacha.num == 1;

        SetActive((Enum)UI.OBJ_SINGLE_ROOT, flag);
        SetActive((Enum)UI.OBJ_MULTI_ROOT, !flag);
        if (flag)
        {
            GachaResult.GachaReward      gachaReward   = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward[0];
            SkillItemTable.SkillItemData skillItemData = Singleton <SkillItemTable> .I.GetSkillItemData((uint)gachaReward.itemId);

            if (skillItemData == null)
            {
                SetActive((Enum)UI.OBJ_SINGLE_ROOT, false);
            }
            SetLabelText((Enum)UI.LBL_NAME, skillItemData.name);
            SetLabelText((Enum)UI.LBL_ATK, skillItemData.baseAtk.ToString());
            SetLabelText((Enum)UI.LBL_DEF, skillItemData.baseDef.ToString());
            SetLabelText((Enum)UI.LBL_HP, skillItemData.baseHp.ToString());
            SetLabelText((Enum)UI.LBL_DESCRIPTION, skillItemData.GetExplanationText(1));
            SetRenderSkillItemModel((Enum)UI.TEX_MODEL, skillItemData.id, true, false);
            SetRenderSkillItemSymbolModel((Enum)UI.TEX_INNER_MODEL, skillItemData.id, true);
            RARITY_TYPE[] array = (RARITY_TYPE[])Enum.GetValues(typeof(RARITY_TYPE));
            int           i     = 0;
            for (int num = array.Length; i < num; i++)
            {
                SetActive((Enum)rarityAnimRoot[i], skillItemData.rarity == array[i]);
            }
            ResetTween((Enum)rarityAnimRoot[(int)skillItemData.rarity], 0);
            ResetTween((Enum)UI.OBJ_RARITY_TEXT_ROOT, 0);
            if (skillItemData.rarity <= RARITY_TYPE.C)
            {
                ResetTween((Enum)UI.OBJ_RARITY_LIGHT, 0);
                PlayTween((Enum)UI.OBJ_RARITY_LIGHT, true, (EventDelegate.Callback)null, false, 0);
            }
            PlayTween((Enum)rarityAnimRoot[(int)skillItemData.rarity], true, (EventDelegate.Callback)null, false, 0);
            PlayTween((Enum)UI.OBJ_RARITY_TEXT_ROOT, true, (EventDelegate.Callback)null, false, 0);
            if (AnimationDirector.I is SkillGachaDirector)
            {
                (AnimationDirector.I as SkillGachaDirector).PlayUIRarityEffect(skillItemData.rarity, GetCtrl(UI.OBJ_RARITY_ROOT), GetCtrl(rarityAnimRoot[(int)skillItemData.rarity]));
            }
        }
        else
        {
            int index = 0;
            MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward.ForEach(delegate(GachaResult.GachaReward reward)
            {
                bool flag2     = false;
                Transform ctrl = GetCtrl(iconRootAry[index]);
                SkillItemTable.SkillItemData skillItemData2 = Singleton <SkillItemTable> .I.GetSkillItemData((uint)reward.itemId);
                if (skillItemData2 == null)
                {
                    SetActive(ctrl, false);
                }
                else
                {
                    SetActive(ctrl, true);
                    bool is_new       = flag2;
                    ItemIcon itemIcon = ItemIcon.CreateRewardItemIcon(REWARD_TYPE.SKILL_ITEM, (uint)reward.itemId, ctrl, -1, null, 0, is_new, -1, false, null, false, false, ItemIcon.QUEST_ICON_SIZE_TYPE.DEFAULT);
                    itemIcon.SetEnableCollider(false);
                    Transform ctrl2 = GetCtrl(magiNameAry[index]);
                    SetLabelText(ctrl2, skillItemData2.name);
                    SetEvent(GetCtrl(iconRootAry[index]), "SKILL_DETAIL", index);
                    index++;
                }
            });
        }
        int num2 = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.crystal;

        if (MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId > 0)
        {
            ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData((uint)MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId);

            UITexture[] array2 = new UITexture[3]
            {
                FindCtrl(GetCtrl(UI.OBJ_GACHA_DISABLE_ROOT), UI.TEX_TICKET).GetComponent <UITexture>(),
                FindCtrl(GetCtrl(UI.OBJ_GACHA_ENABLE_ROOT), UI.TEX_TICKET).GetComponent <UITexture>(),
                GetCtrl(UI.TEX_TICKET_HAVE).GetComponent <UITexture>()
            };
            UITexture[] array3 = array2;
            foreach (UITexture ui_tex in array3)
            {
                ResourceLoad.LoadItemIconTexture(ui_tex, itemData.iconID);
            }
            num2 = MonoBehaviourSingleton <InventoryManager> .I.GetItemNum((ItemInfo x) => x.tableData.id == itemData.id, 1, false);
        }
        SetActive(footerRoot, UI.SPR_CRYSTAL, MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId == 0);
        SetActive(footerRoot, UI.TEX_TICKET_HAVE, MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId > 0);
        SetLabelText(footerRoot, UI.LBL_CRYSTAL_NUM, num2.ToString());
        SetGachaButtonActive(!MonoBehaviourSingleton <GachaManager> .I.IsSelectTutorialGacha() && MonoBehaviourSingleton <GachaManager> .I.gachaResult.remainCount != 0);
    }
    public override void UpdateUI()
    {
        bool flag = MonoBehaviourSingleton <GachaManager> .I.selectGacha.num == 1;

        SetActive((Enum)UI.OBJ_SINGLE_ROOT, flag);
        SetActive((Enum)UI.OBJ_MULTI_ROOT, !flag);
        SetActive((Enum)UI.OBJ_BG_SINGLE, flag);
        SetActive((Enum)UI.OBJ_BG_MULTI, !flag);
        if (flag)
        {
            string text     = string.Empty;
            int    star_num = 0;
            GachaResult.GachaReward   gachaReward = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward[0];
            QuestTable.QuestTableData questData   = Singleton <QuestTable> .I.GetQuestData((uint)gachaReward.itemId);

            if (questData != null)
            {
                text     = questData.questText;
                star_num = (int)questData.difficulty;
            }
            SetLabelText((Enum)UI.LBL_NAME, text);
            RARITY_TYPE[] array = (RARITY_TYPE[])Enum.GetValues(typeof(RARITY_TYPE));
            int           i     = 0;
            for (int num = array.Length; i < num; i++)
            {
                SetActive((Enum)rarityAnimRoot[i], questData.rarity == array[i]);
            }
            SetGachaQuestDifficulty(UI.OBJ_DIFFICULTY_ROOT, star_num);
            ResetTween((Enum)UI.OBJ_DIFFICULTY_ROOT, 0);
            ResetTween((Enum)rarityAnimRoot[(int)questData.rarity], 0);
            ResetTween((Enum)UI.OBJ_RARITY_TEXT_ROOT, 0);
            if (questData.rarity <= RARITY_TYPE.C)
            {
                ResetTween((Enum)UI.OBJ_RARITY_LIGHT, 0);
                PlayTween((Enum)UI.OBJ_RARITY_LIGHT, true, (EventDelegate.Callback)null, false, 0);
            }
            PlayTween((Enum)UI.OBJ_RARITY_TEXT_ROOT, true, (EventDelegate.Callback)null, false, 0);
            PlayTween((Enum)rarityAnimRoot[(int)questData.rarity], true, (EventDelegate.Callback) delegate
            {
                PlayTween((Enum)UI.OBJ_DIFFICULTY_ROOT, true, (EventDelegate.Callback)null, false, 0);
            }, false, 0);
            QuestGachaDirectorBase questGachaDirectorBase = AnimationDirector.I as QuestGachaDirectorBase;
            if (questGachaDirectorBase != null)
            {
                questGachaDirectorBase.PlayRarityAudio(questData.rarity, true);
                questGachaDirectorBase.PlayUIRarityEffect(questData.rarity, GetCtrl(UI.OBJ_RARITY_ROOT), GetCtrl(rarityAnimRoot[(int)questData.rarity]));
            }
        }
        else
        {
            int index = 0;
            MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward.ForEach(delegate(GachaResult.GachaReward reward)
            {
                bool flag2 = false;
                int num3   = 0;
                QuestItemInfo questItem = MonoBehaviourSingleton <InventoryManager> .I.GetQuestItem((uint)reward.itemId);
                if (questItem != null)
                {
                    flag2 = GameSaveData.instance.IsNewItem(ITEM_ICON_TYPE.QUEST_ITEM, questItem.uniqueID);
                    flag2 = IsNewItemQuestEnemySpecies(questItem);
                    num3  = questItem.infoData.questData.tableData.GetMainEnemyLv();
                }
                bool is_new       = flag2;
                ItemIcon itemIcon = ItemIcon.CreateRewardItemIcon(REWARD_TYPE.QUEST_ITEM, (uint)reward.itemId, GetCtrl(iconRootAry[index]), -1, null, 0, is_new, -1, false, null, false, false, ItemIcon.QUEST_ICON_SIZE_TYPE.DEFAULT);
                itemIcon.SetEnableCollider(false);
                string text2 = string.Empty;
                if (num3 > 0)
                {
                    text2 = string.Format(StringTable.Get(STRING_CATEGORY.MAIN_STATUS, 1u), num3.ToString());
                }
                SetLabelText(GetCtrl(iconRootAry[index]), iconLevelAry[index], text2);
                SetEvent(GetCtrl(iconRootAry[index]), "QUEST_DETAIL", index);
                index++;
            });
        }
        int num2 = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.crystal;

        if (MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId > 0)
        {
            ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData((uint)MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId);

            UITexture[] array2 = new UITexture[3]
            {
                FindCtrl(FindCtrl(footerRoot, UI.OBJ_GACHA_DISABLE_ROOT), UI.TEX_TICKET).GetComponent <UITexture>(),
                FindCtrl(FindCtrl(footerRoot, UI.OBJ_GACHA_ENABLE_ROOT), UI.TEX_TICKET).GetComponent <UITexture>(),
                FindCtrl(footerRoot, UI.TEX_TICKET_HAVE).GetComponent <UITexture>()
            };
            UITexture[] array3 = array2;
            foreach (UITexture ui_tex in array3)
            {
                ResourceLoad.LoadItemIconTexture(ui_tex, itemData.iconID);
            }
            num2 = MonoBehaviourSingleton <InventoryManager> .I.GetItemNum((ItemInfo x) => x.tableData.id == itemData.id, 1, false);

            if (MonoBehaviourSingleton <GachaManager> .I.gachaResult.counter >= 0)
            {
                SetActive(footerRoot, UI.GACHATICKETCOUNTERSRESULT, false);
                SetActive(footerRoot, UI.S_COUNTER, false);
                SetActive(footerRoot, UI.S_AVAILABLE, true);
            }
            else if (MonoBehaviourSingleton <GachaManager> .I.gachaResult.counter > 0)
            {
                SetActive(footerRoot, UI.GACHATICKETCOUNTERSRESULT, true);
                SetActive(footerRoot, UI.S_COUNTER, true);
                SetActive(footerRoot, UI.S_AVAILABLE, false);
                SetActive(footerRoot, UI.NUMBER_COUNTER_IMG, true);
                FindCtrl(footerRoot, UI.NUMBER_COUNTER_IMG).GetComponent <UISprite>().spriteName = MonoBehaviourSingleton <GachaManager> .I.gachaResult.counter.ToString();

                FindCtrl(FindCtrl(footerRoot, UI.GACHATICKETCOUNTERSRESULT), UI.COUNTER_PROGRESSBAR_FOREGROUND).GetComponent <UISprite>().fillAmount = (float)(10 - MonoBehaviourSingleton <GachaManager> .I.gachaResult.counter) / 10f;
                SetLabelText(footerRoot, UI.COUNTER_LBL, MonoBehaviourSingleton <GachaManager> .I.gachaResult.counter);
            }
            else
            {
                SetActive(footerRoot, UI.GACHATICKETCOUNTERSRESULT, true);
                SetActive(footerRoot, UI.S_COUNTER, false);
                SetActive(footerRoot, UI.S_AVAILABLE, true);
            }
        }
        SetActive(footerRoot, UI.SPR_CRYSTAL, MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId == 0);
        SetActive(footerRoot, UI.TEX_TICKET_HAVE, MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId > 0);
        SetLabelText(footerRoot, UI.LBL_CRYSTAL_NUM, num2.ToString());
        if (MonoBehaviourSingleton <GachaManager> .I.gachaResult.gachaGuaranteeCampaignInfo == null)
        {
            SetGachaButtonActive(!MonoBehaviourSingleton <GachaManager> .I.IsSelectTutorialGacha() && MonoBehaviourSingleton <GachaManager> .I.gachaResult.remainCount != 0);
        }
        else
        {
            SetGachaButtonActive(!MonoBehaviourSingleton <GachaManager> .I.IsSelectTutorialGacha());
        }
    }
    public override void UpdateUI()
    {
        SetLabelText((Enum)UI.STR_TITLE, StringTable.Get(STRING_CATEGORY.COMMON, 103u));
        SetLabelText((Enum)UI.STR_TITLE_REFLECT, StringTable.Get(STRING_CATEGORY.COMMON, 103u));
        List <ItemInfo> itemList = MonoBehaviourSingleton <InventoryManager> .I.GetItemList((ItemInfo x) => x.tableData.type == ITEM_TYPE.TICKET, 0);

        ExpiredItem[] showList = GetItemList(itemList).ToArray();
        GetCtrl(UI.LBL_CAUTION).GetComponent <UILabel>().supportEncoding = true;
        string text = StringTable.Get(STRING_CATEGORY.SHOP, 14u);

        SetLabelText((Enum)UI.LBL_CAUTION, text);
        SetActive((Enum)UI.BTN_TO_GACHA, MonoBehaviourSingleton <GameSceneManager> .I.GetCurrentSceneName() != "ShopScene");
        SetActive((Enum)UI.GRD_LIST, showList.Length > 0);
        SetActive((Enum)UI.STR_ORDER_NON_LIST, showList.Length == 0);
        SetActive((Enum)UI.OBJ_ACTIVE_ROOT, showList.Length > 0);
        SetActive((Enum)UI.OBJ_INACTIVE_ROOT, showList.Length == 0);
        if (showList.Length == 0)
        {
            SetLabelText((Enum)UI.LBL_MAX, "0");
            SetLabelText((Enum)UI.LBL_NOW, "0");
            UIScrollView component = GetCtrl(UI.SCR_LIST).GetComponent <UIScrollView>();
            if (component != null)
            {
                component.set_enabled(false);
                component.verticalScrollBar.alpha = 0f;
            }
        }
        else
        {
            pageMax = 1 + (showList.Length - 1) / 10;
            bool flag = pageMax > 1;
            SetActive((Enum)UI.OBJ_ACTIVE_ROOT, flag);
            SetActive((Enum)UI.OBJ_INACTIVE_ROOT, !flag);
            SetLabelText((Enum)UI.LBL_MAX, pageMax.ToString());
            SetLabelText((Enum)UI.LBL_NOW, nowPage.ToString());
            int           num   = 10 * (nowPage - 1);
            int           num2  = (nowPage != pageMax) ? 10 : (showList.Length - num);
            ExpiredItem[] array = new ExpiredItem[num2];
            Array.Copy(showList, num, array, 0, num2);
            showList = array;
            SetGrid(UI.GRD_LIST, "GachaTicketListItem", showList.Length, true, delegate(int i, Transform t, bool is_recycle)
            {
                ExpiredItem expiredItem     = showList[i];
                ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData((uint)expiredItem.itemId);
                UITexture component2        = FindCtrl(t, UI.TEX_ICON).GetComponent <UITexture>();
                ResourceLoad.LoadItemIconTexture(component2, itemData.iconID);
                SetLabelText(t, UI.LBL_NAME, itemData.name);
                string empty  = string.Empty;
                string empty2 = string.Empty;
                if (string.IsNullOrEmpty(expiredItem.expiredAt))
                {
                    empty  = "-";
                    empty2 = "-";
                }
                else
                {
                    empty  = expiredItem.expiredAt;
                    empty2 = TimeManager.GetRemainTimeToText(expiredItem.expiredAt, 1);
                }
                SetLabelText(t, UI.LBL_LIMIT, empty);
                SetLabelText(t, UI.LBL_COUNTDOWN, empty2);
            });
        }
    }