protected override void LocalInventory()
 {
     SetupEnableInventoryUI();
     if (localInventoryEquipData != null)
     {
         SetLabelText((Enum)UI.LBL_SORT, sortSettings.GetSortLabel());
         SetDynamicList((Enum)InventoryUI, (string)null, localInventoryEquipData.Length, false, (Func <int, bool>) delegate(int i)
         {
             SortCompareData sortCompareData = localInventoryEquipData[i];
             if (sortCompareData == null || !sortCompareData.IsPriority(sortSettings.orderTypeAsc))
             {
                 return(false);
             }
             return(true);
         }, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle)
         {
             uint tableID = localInventoryEquipData[i].GetTableID();
             if (tableID == 0)
             {
                 SetActive(t, false);
             }
             else
             {
                 SetActive(t, true);
                 EquipItemTable.EquipItemData equipItemData = Singleton <EquipItemTable> .I.GetEquipItemData(tableID);
                 EquipItemSortData equipItemSortData        = localInventoryEquipData[i] as EquipItemSortData;
                 EquipItemInfo equip             = equipItemSortData.GetItemData() as EquipItemInfo;
                 ITEM_ICON_TYPE iconType         = equipItemSortData.GetIconType();
                 bool is_new                     = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iconType, equipItemSortData.GetUniqID());
                 SkillSlotUIData[] skillSlotData = GetSkillSlotData(equip);
                 ItemIcon itemIcon               = CreateItemIconDetail(equipItemSortData, skillSlotData, IsShowMainStatus, t, "TRY_ON", i, equipItemSortData.GetIconStatus(), is_new, -1, false, -1);
                 itemIcon.SetItemID(equipItemSortData.GetTableID());
                 itemIcon.SetButtonColor(localInventoryEquipData[i].IsPriority(sortSettings.orderTypeAsc), true);
                 SetLongTouch(itemIcon.transform, "DETAIL", i);
             }
         });
     }
 }
    protected void ShowOrder()
    {
        if (MonoBehaviourSingleton <InventoryManager> .I.questItemInventory.GetCount() > 0)
        {
            List <QuestItemInfo> list = new List <QuestItemInfo>();
            MonoBehaviourSingleton <InventoryManager> .I.ForAllQuestInvetory(delegate(QuestItemInfo item)
            {
                if (IsSetQuestItemInfoByOrderQuest(item))
                {
                    if (isQuestItemDirty)
                    {
                        GetRemainingTimeAndExpiredNum(item, out float remainTime, out int expiredNum);
                        if (remainTime > 0f)
                        {
                            item.infoData.questData.num -= expiredNum;
                            if (item.infoData.questData.num > 0)
                            {
                                list.Add(item);
                            }
                        }
                    }
                    else if (item.infoData.questData.num > 0)
                    {
                        list.Add(item);
                    }
                }
            });

            Search(ref list);
            questItemAry = list.ToArray();
        }
        List <QuestGridData> list2 = new List <QuestGridData>();

        if (MonoBehaviourSingleton <PartyManager> .IsValid() && MonoBehaviourSingleton <PartyManager> .I.challengeInfo.IsEnable())
        {
            list2.Add(new QuestGridData(QuestGridData.ORDER_QUEST_TYPE.Challenge, null));
        }
        if (questItemAry != null && questItemAry.Length != 0)
        {
            QuestSortData[] array = sortSettings.CreateSortAry <QuestItemInfo, QuestSortData>(questItemAry);
            if (array != null)
            {
                int i = 0;
                for (int num = array.Length; i < num; i++)
                {
                    QuestSortData questSortData = array[i];
                    QuestInfoData info          = questSortData.itemData.infoData;
                    int           num2          = info.questData.num;
                    int           num3          = 0;
                    if (MonoBehaviourSingleton <UserInfoManager> .I.isGuildRequestOpen)
                    {
                        num3 = (from g in MonoBehaviourSingleton <GuildRequestManager> .I.guildRequestData.guildRequestItemList
                                where g.questId == (int)info.questData.tableData.questID
                                select g).Count();
                    }
                    int num4 = num2 - num3;
                    if (num4 > 0)
                    {
                        list2.Add(new QuestGridData(QuestGridData.ORDER_QUEST_TYPE.Quest, array[i]));
                    }
                }
            }
        }
        questGridDatas = list2.ToArray();
        if (questGridDatas == null || questGridDatas.Length == 0)
        {
            SetActive((Enum)UI.GRD_ORDER_QUEST, false);
            SetActive((Enum)UI.STR_ORDER_NON_LIST, true);
            SetActive((Enum)UI.OBJ_ACTIVE_ROOT, false);
            SetActive((Enum)UI.OBJ_INACTIVE_ROOT, true);
            SetLabelText((Enum)UI.LBL_MAX, "0");
            SetLabelText((Enum)UI.LBL_NOW, "0");
            UIScrollView component = GetCtrl(UI.SCR_ORDER_QUEST).GetComponent <UIScrollView>();
            if (component != null)
            {
                component.set_enabled(false);
                component.verticalScrollBar.alpha = 0f;
            }
        }
        else
        {
            if (questGridDatas.Length == 1 && questGridDatas[0].orderQuestType == QuestGridData.ORDER_QUEST_TYPE.Challenge)
            {
                SetActive((Enum)UI.STR_ORDER_NON_LIST, true);
            }
            else
            {
                SetActive((Enum)UI.STR_ORDER_NON_LIST, false);
            }
            SetActive((Enum)UI.GRD_ORDER_QUEST, true);
            SetLabelText((Enum)UI.LBL_SORT, sortSettings.GetSortLabel());
            SetToggle((Enum)UI.TGL_ICON_ASC, sortSettings.orderTypeAsc);
            pageMax = 1 + (questGridDatas.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());
            UITweener[] transitions = GetCtrl(UI.OBJ_FRAME).GetComponents <UITweener>();
            int         finishCount = 0;
            UITweener[] array2      = transitions;
            foreach (UITweener uITweener in array2)
            {
                uITweener.AddOnFinished(delegate
                {
                    finishCount++;
                    if (finishCount >= transitions.Length)
                    {
                        isTransitionFinished = true;
                    }
                });
            }
            int             num5             = 10 * (nowPage - 1);
            int             num6             = (nowPage != pageMax) ? 10 : (questGridDatas.Length - num5);
            QuestGridData[] destinationArray = new QuestGridData[num6];
            Array.Copy(questGridDatas, num5, destinationArray, 0, num6);
            questGridDatas = destinationArray;
            SetGrid(UI.GRD_ORDER_QUEST, string.Empty, 0, true, null, null);
            SetGrid(UI.GRD_ORDER_QUEST, "QuestListOrderItem", questGridDatas.Length, true, CreateGridListItem, UpdateGridListItem);
        }
    }
    protected virtual void ShowSelectUI()
    {
        //IL_0240: Unknown result type (might be due to invalid IL or missing references)
        //IL_024f: Unknown result type (might be due to invalid IL or missing references)
        int num  = (!isInGameScene && TutorialStep.HasQuestSpecialUnlocked()) ? 1 : 2;
        int num2 = (showMode != 0) ? num : 0;
        int num3 = (showMode != SHOW_MODE.QUEST) ? num : 0;
        int num4 = (showMode != SHOW_MODE.ORDER) ? num : 0;

        SetActive((Enum)UI.OBJ_DELIVERY_ROOT, showMode == SHOW_MODE.DELIVERY);
        SetActive((Enum)UI.OBJ_QUEST_ROOT, showMode == SHOW_MODE.QUEST);
        SetActive((Enum)UI.OBJ_ORDER_ROOT, showMode == SHOW_MODE.ORDER);
        SetButtonSprite((Enum)UI.BTN_DELIVERY, "QuestTabBtnBase" + SPR_ON_OFF[num2], true);
        SetSprite((Enum)UI.SPR_DELIVERY_TEXT, "QuestTabBtnText" + SPR_INDEX[0] + SPR_ON_OFF[num2]);
        SetSprite((Enum)UI.SPR_DELIVERY_ICON, "QuestTabBtnIcon" + SPR_INDEX[0] + SPR_ON_OFF[num2]);
        SetButtonSprite((Enum)UI.BTN_QUEST, "QuestTabBtnBase" + SPR_ON_OFF[num3], true);
        SetSprite((Enum)UI.SPR_QUEST_TEXT, "QuestTabBtnText" + SPR_INDEX[1] + SPR_ON_OFF[num3]);
        SetSprite((Enum)UI.SPR_QUEST_ICON, "QuestTabBtnIcon" + SPR_INDEX[1] + SPR_ON_OFF[num3]);
        SetButtonSprite((Enum)UI.BTN_ORDER, "QuestTabBtnBase" + SPR_ON_OFF[num4], true);
        SetSprite((Enum)UI.SPR_ORDER_TEXT, "QuestTabBtnText" + SPR_INDEX[2] + SPR_ON_OFF[num4]);
        SetSprite((Enum)UI.SPR_ORDER_ICON, "QuestTabBtnIcon" + SPR_INDEX[2] + SPR_ON_OFF[num4]);
        if (!TutorialStep.HasQuestSpecialUnlocked())
        {
            SetButtonEnabled((Enum)UI.BTN_QUEST, false);
            SetButtonEnabled((Enum)UI.BTN_ORDER, false);
            SetActive((Enum)UI.BTN_EVENT, false);
        }
        if (!isInGameScene)
        {
            SetRenderNPCModel((Enum)UI.TEX_NPCMODEL, 0, MonoBehaviourSingleton <OutGameSettingsManager> .I.homeScene.questCenterNPCPos, MonoBehaviourSingleton <OutGameSettingsManager> .I.homeScene.questCenterNPCRot, MonoBehaviourSingleton <OutGameSettingsManager> .I.homeScene.questCenterNPCFOV, (Action <NPCLoader>)null);
            SetLabelText((Enum)UI.LBL_NPC_MESSAGE, npcText);
        }
        SetActive((Enum)UI.OBJ_NPC_MESSAGE, !isInGameScene);
        if (showMode == SHOW_MODE.DELIVERY)
        {
            SetActive((Enum)UI.SPR_TAB_NORMAL, UI.BTN_TAB_NORMAL == selectedTab);
            SetActive((Enum)UI.SPR_TAB_DAILY, UI.BTN_TAB_DAILY == selectedTab);
            SetActive((Enum)UI.SPR_TAB_WEEKLY, UI.BTN_TAB_WEEKLY == selectedTab);
            SetButtonSprite((Enum)UI.BTN_TAB_NORMAL, (selectedTab != UI.BTN_TAB_NORMAL) ? "PickeShopBtn_Normal_off" : "PickeShopBtn_Green_on", false);
            SetButtonSprite((Enum)UI.BTN_TAB_DAILY, (selectedTab != UI.BTN_TAB_DAILY) ? "PickeShopBtn_Normal_off" : "PickeShopBtn_Green_on", false);
            SetButtonSprite((Enum)UI.BTN_TAB_WEEKLY, (selectedTab != UI.BTN_TAB_WEEKLY) ? "PickeShopBtn_Normal_off" : "PickeShopBtn_Green_on", false);
            SetNPCMessage(selectedTab);
            switch (selectedTab)
            {
            case UI.BTN_TAB_NORMAL:
                SetDeliveryList(normalDeliveryInfo);
                break;

            case UI.BTN_TAB_DAILY:
                SetDeliveryList(dailyDeliveryInfo);
                break;

            case UI.BTN_TAB_WEEKLY:
                SetDeliveryList(weeklyDeliveryInfo);
                break;
            }
        }
        else if (showMode == SHOW_MODE.ORDER)
        {
            if (questItemAry == null && MonoBehaviourSingleton <InventoryManager> .I.questItemInventory.GetCount() > 0)
            {
                List <QuestItemInfo> list = new List <QuestItemInfo>();
                MonoBehaviourSingleton <InventoryManager> .I.ForAllQuestInvetory(delegate(QuestItemInfo item)
                {
                    if (item.infoData.questData.num > 0)
                    {
                        list.Add(item);
                    }
                });

                questItemAry = list.ToArray();
                GetCtrl(UI.GRD_ORDER_QUEST).DestroyChildren();
            }
            if (questItemAry == null || questItemAry.Length == 0)
            {
                SetActive((Enum)UI.BTN_SORT, false);
                SetActive((Enum)UI.GRD_ORDER_QUEST, false);
                SetActive((Enum)UI.STR_ORDER_NON_LIST, true);
            }
            else
            {
                questSortData = sortSettings.CreateSortAry <QuestItemInfo, QuestSortData>(questItemAry);
                SetActive((Enum)UI.GRD_ORDER_QUEST, true);
                SetActive((Enum)UI.STR_ORDER_NON_LIST, false);
                SetActive((Enum)UI.BTN_SORT, true);
                SetLabelText((Enum)UI.LBL_SORT, sortSettings.GetSortLabel());
                SetToggle((Enum)UI.TGL_ICON_ASC, sortSettings.orderTypeAsc);
                SetDynamicList((Enum)UI.GRD_ORDER_QUEST, "QuestListOrderItem", questSortData.Length, false, (Func <int, bool>) null, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle)
                {
                    QuestSpecialSelect questSpecialSelect2 = this;
                    SetActive(t, true);
                    SetEvent(t, "SELECT_ORDER", i);
                    QuestInfoData info2 = this.questSortData[i].itemData.infoData;
                    int num9            = (int)(info2.questData.tableData.difficulty + 1);
                    int l = 0;
                    for (int num10 = difficult.Length; l < num10; l++)
                    {
                        SetActive(t, difficult[l], l < num9);
                    }
                    if (!is_recycle)
                    {
                        ResetTween(t, UI.TWN_DIFFICULT_STAR, 0);
                        PlayTween(t, UI.TWN_DIFFICULT_STAR, true, null, false, 0);
                    }
                    EnemyTable.EnemyData enemyData2 = Singleton <EnemyTable> .I.GetEnemyData((uint)info2.questData.tableData.GetMainEnemyID());
                    QuestSortData questSortData     = this.questSortData[i];
                    ItemIcon itemIcon2 = ItemIcon.Create(questSortData.GetIconType(), questSortData.GetIconID(), questSortData.GetRarity(), FindCtrl(t, UI.OBJ_ENEMY), questSortData.GetIconElement(), null, -1, null, 0, false, -1, false, null, false, 0, 0, false, GET_TYPE.PAY);
                    itemIcon2.SetEnableCollider(false);
                    SetActive(t, UI.SPR_ELEMENT_ROOT, enemyData2.element != ELEMENT_TYPE.MAX);
                    SetElementSprite(t, UI.SPR_ELEMENT, (int)enemyData2.element);
                    SetElementSprite(t, UI.SPR_WEAK_ELEMENT, (int)enemyData2.weakElement);
                    SetActive(t, UI.STR_NON_WEAK_ELEMENT, enemyData2.weakElement == ELEMENT_TYPE.MAX);
                    SetLabelText(t, UI.LBL_QUEST_NAME, info2.questData.tableData.questText);
                    int num11 = 1;
                    ClearStatusQuest clearStatusQuest2 = MonoBehaviourSingleton <QuestManager> .I.clearStatusQuest.Find((ClearStatusQuest data) => info2.questData.tableData.questID == data.questId);
                    if (clearStatusQuest2 != null)
                    {
                        num11 = clearStatusQuest2.questStatus;
                    }
                    int value2 = i + 100;
                    SetToggleGroup(t, UI.OBJ_ICON_NEW, value2);
                    SetToggleGroup(t, UI.OBJ_ICON_CLEARED, value2);
                    SetToggleGroup(t, UI.OBJ_ICON_COMPLETE, value2);
                    switch (num11)
                    {
                    default:
                        SetToggle(t, UI.OBJ_ICON_NEW, false);
                        SetToggle(t, UI.OBJ_ICON_CLEARED, false);
                        SetToggle(t, UI.OBJ_ICON_COMPLETE, false);
                        break;

                    case 1:
                        SetToggle(t, UI.OBJ_ICON_NEW, true);
                        SetVisibleWidgetEffect(UI.SCR_ORDER_QUEST, t, UI.SPR_ICON_NEW, "ef_ui_questselect_new");
                        break;

                    case 3:
                        SetToggle(t, UI.OBJ_ICON_CLEARED, true);
                        break;

                    case 4:
                        SetToggle(t, UI.OBJ_ICON_COMPLETE, true);
                        SetVisibleWidgetEffect(UI.SCR_ORDER_QUEST, t, UI.SPR_ICON_COMPLETE, "ef_ui_questselect_complete");
                        break;
                    }
                    SetLabelText(t, UI.LBL_ORDER_NUM, info2.questData.num.ToString());
                    SetActive(t, UI.LBL_REMAIN, false);
                });
            }
        }
        else if (showMode == SHOW_MODE.QUEST)
        {
            if (questInfo == null || questInfo.Length == 0)
            {
                SetActive((Enum)UI.GRD_QUEST, false);
                SetActive((Enum)UI.STR_QUEST_NON_LIST, true);
            }
            else
            {
                SetActive((Enum)UI.STR_QUEST_NON_LIST, false);
                SetActive((Enum)UI.GRD_QUEST, true);
                SetDynamicList((Enum)UI.GRD_QUEST, "QuestListItem", questInfo.Length, false, (Func <int, bool>) null, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle)
                {
                    QuestSpecialSelect questSpecialSelect = this;
                    SetEvent(t, "SELECT_QUEST", i);
                    QuestInfoData info = questInfo[i];
                    int num5           = (int)(info.questData.tableData.difficulty + 1);
                    int j = 0;
                    for (int num6 = difficult.Length; j < num6; j++)
                    {
                        SetActive(t, difficult[j], j < num5);
                    }
                    if (!is_recycle)
                    {
                        ResetTween(t, UI.TWN_DIFFICULT_STAR, 0);
                        PlayTween(t, UI.TWN_DIFFICULT_STAR, true, null, false, 0);
                    }
                    EnemyTable.EnemyData enemyData = Singleton <EnemyTable> .I.GetEnemyData((uint)info.questData.tableData.GetMainEnemyID());
                    if (enemyData != null)
                    {
                        SetActive(t, UI.OBJ_ENEMY, true);
                        int iconId         = enemyData.iconId;
                        RARITY_TYPE?rarity = (info.questData.tableData.questType != QUEST_TYPE.ORDER) ? null : new RARITY_TYPE?(info.questData.tableData.rarity);
                        ItemIcon itemIcon  = ItemIcon.Create(ITEM_ICON_TYPE.QUEST_ITEM, iconId, rarity, FindCtrl(t, UI.OBJ_ENEMY), enemyData.element, null, -1, null, 0, false, -1, false, null, false, 0, 0, false, GET_TYPE.PAY);
                        itemIcon.SetEnableCollider(false);
                        SetActive(t, UI.SPR_ELEMENT_ROOT, enemyData.element != ELEMENT_TYPE.MAX);
                        SetElementSprite(t, UI.SPR_ELEMENT, (int)enemyData.element);
                        SetElementSprite(t, UI.SPR_WEAK_ELEMENT, (int)enemyData.weakElement);
                        SetActive(t, UI.STR_NON_WEAK_ELEMENT, enemyData.weakElement == ELEMENT_TYPE.MAX);
                    }
                    else
                    {
                        SetActive(t, UI.OBJ_ENEMY, false);
                        SetElementSprite(t, UI.SPR_WEAK_ELEMENT, 6);
                        SetActive(t, UI.STR_NON_WEAK_ELEMENT, true);
                    }
                    SetLabelText(t, UI.LBL_QUEST_NUM, string.Empty);
                    SetLabelText(t, UI.LBL_QUEST_NAME, info.questData.tableData.questText);
                    if (!info.isExistMission)
                    {
                        SetActive(t, UI.OBJ_MISSION_INFO_ROOT, false);
                    }
                    else
                    {
                        SetActive(t, UI.OBJ_MISSION_INFO_ROOT, true);
                        int k = 0;
                        for (int num7 = info.missionData.Length; k < num7; k++)
                        {
                            SetActive(t, ui_top_crown[k], info.missionData[k] != null);
                            if (info.missionData[k] != null)
                            {
                                SetActive(t, ui_crown[k], info.missionData[k].state >= CLEAR_STATUS.CLEAR);
                            }
                        }
                    }
                    int num8 = 1;
                    ClearStatusQuest clearStatusQuest = MonoBehaviourSingleton <QuestManager> .I.clearStatusQuest.Find((ClearStatusQuest data) => info.questData.tableData.questID == data.questId);
                    if (clearStatusQuest != null)
                    {
                        num8 = clearStatusQuest.questStatus;
                    }
                    int value = i + 100;
                    SetToggleGroup(t, UI.OBJ_ICON_NEW, value);
                    SetToggleGroup(t, UI.OBJ_ICON_CLEARED, value);
                    SetToggleGroup(t, UI.OBJ_ICON_COMPLETE, value);
                    switch (num8)
                    {
                    default:
                        SetToggle(t, UI.OBJ_ICON_NEW, false);
                        SetToggle(t, UI.OBJ_ICON_CLEARED, false);
                        SetToggle(t, UI.OBJ_ICON_COMPLETE, false);
                        break;

                    case 1:
                        SetToggle(t, UI.OBJ_ICON_NEW, true);
                        SetVisibleWidgetEffect(UI.SCR_NORMAL_QUEST, t, UI.SPR_ICON_NEW, "ef_ui_questselect_new");
                        break;

                    case 3:
                        SetToggle(t, UI.OBJ_ICON_CLEARED, true);
                        break;

                    case 4:
                        SetToggle(t, UI.OBJ_ICON_COMPLETE, true);
                        SetVisibleWidgetEffect(UI.SCR_NORMAL_QUEST, t, UI.SPR_ICON_COMPLETE, "ef_ui_questselect_complete");
                        break;
                    }
                });
            }
        }
    }