Пример #1
0
 private void SetDegreeDetail()
 {
     if (currentSelectData == null)
     {
         SetLabelText((Enum)UI.LBL_SELECTED_DEGREE_NAME, "---");
         SetLabelText((Enum)UI.LBL_SELECTED_DEGREE_REQUIREMENT, "---");
     }
     else
     {
         SetLabelText((Enum)UI.LBL_SELECTED_DEGREE_NAME, (!currentSelectData.IsSecretName(MonoBehaviourSingleton <UserInfoManager> .I.unlockedDegreeIds)) ? currentSelectData.name : "???");
         SetLabelText((Enum)UI.LBL_SELECTED_DEGREE_REQUIREMENT, (!currentSelectData.IsSecretText(MonoBehaviourSingleton <UserInfoManager> .I.unlockedDegreeIds)) ? currentSelectData.requirementText : "???");
     }
 }
    public override void UpdateUI()
    {
        base.UpdateUI();
        List <DegreeTable.DegreeData> currentShow = (!showAll) ? userHaveData : allData;

        maxPage = currentShow.Count / GameDefine.DEGREE_FRAME_CHANGE_LIST_COUNT;
        if (currentShow.Count % GameDefine.DEGREE_FRAME_CHANGE_LIST_COUNT > 0)
        {
            maxPage++;
        }
        int item_num = Mathf.Min(GameDefine.DEGREE_FRAME_CHANGE_LIST_COUNT, currentShow.Count - (currentPage - 1) * GameDefine.DEGREE_FRAME_CHANGE_LIST_COUNT);

        SetGrid(UI.GRD_FRAME, "DegreePlate", item_num, true, delegate(int i, Transform t, bool b)
        {
            //IL_006a: Unknown result type (might be due to invalid IL or missing references)
            int index                         = i + (currentPage - 1) * GameDefine.DEGREE_FRAME_CHANGE_LIST_COUNT;
            DegreePlate component             = t.GetComponent <DegreePlate>();
            DegreeTable.DegreeData degreeData = currentShow[index];
            SetEvent(t, "FRAME_SELECT", degreeData);
            if (degreeData.IsUnlcok(MonoBehaviourSingleton <UserInfoManager> .I.unlockedDegreeIds))
            {
                component.SetFrame((int)degreeData.id);
                component.GetComponent <Collider>().set_enabled(true);
                component.get_gameObject().AddComponent <UIDragScrollView>();
            }
            else if (degreeData.IsSecretName(MonoBehaviourSingleton <UserInfoManager> .I.unlockedDegreeIds))
            {
                component.SetUnknownFrame();
                component.GetComponent <Collider>().set_enabled(false);
            }
            else
            {
                component.SetFrame((int)degreeData.id);
                component.GetComponent <Collider>().set_enabled(false);
            }
        });
        SetLabelText((Enum)UI.LBL_SORT, (!showAll) ? StringTable.Get(STRING_CATEGORY.TEXT_SCRIPT, 21u) : StringTable.Get(STRING_CATEGORY.TEXT_SCRIPT, 20u));
        bool flag = maxPage > 1;

        SetActive((Enum)UI.OBJ_ACTIVE_ARROW_ROOT, flag);
        SetActive((Enum)UI.OBJ_INACTIVE_ARROW_ROOT, !flag);
        SetLabelText((Enum)UI.LBL_ARROW_NOW, currentPage.ToString());
        SetLabelText((Enum)UI.LBL_ARROW_MAX, maxPage.ToString());
    }
Пример #3
0
    public override void UpdateUI()
    {
        base.UpdateUI();
        if (currentTab == WORD_TAB.CONJUNCTION)
        {
            currentShowData = ((!showAll) ? userHaveConData : allConData);
        }
        else
        {
            currentShowData = ((!showAll) ? userHaveNounData : allNounData);
        }
        maxPage = currentShowData.Count / GameDefine.DEGREE_WORD_CHANGE_LIST_COUNT;
        if (currentShowData.Count % GameDefine.DEGREE_FRAME_CHANGE_LIST_COUNT > 0)
        {
            maxPage++;
        }
        DegreeTable.DegreeData data = Singleton <DegreeTable> .I.GetData((uint)currentDegrees[0]);

        if (data.type == DEGREE_TYPE.SPECIAL_FRAME)
        {
            maxPage     = 1;
            currentPage = 1;
            SetLabelText((Enum)UI.LBL_PREFIX, string.Empty);
            SetLabelText((Enum)UI.LBL_CONJUNCTION, string.Empty);
            SetLabelText((Enum)UI.LBL_SUFFIX, string.Empty);
            SetLabelText((Enum)UI.LBL_PAGE_MAX, maxPage.ToString());
            SetLabelText((Enum)UI.LBL_PAGE_NOW, currentPage.ToString());
            SetActive((Enum)UI.OBJ_ARROW_ACTIVE_ROOT, false);
            SetActive((Enum)UI.OBJ_ARROW_INACTIVE_ROOT, true);
            SetActive((Enum)UI.LBL_NO_SELECTABLE_FRAME, true);
            currentPlate.Initialize(currentDegrees, false, delegate
            {
            });
            SetGrid(UI.GRD_WORD_LIST, "DegreeWordList", 0, false, delegate
            {
            });
        }
        else
        {
            SetLabelText((Enum)UI.LBL_PREFIX, Singleton <DegreeTable> .I.GetData((uint)currentDegrees[1]).name);
            SetLabelText((Enum)UI.LBL_CONJUNCTION, Singleton <DegreeTable> .I.GetData((uint)currentDegrees[2]).name);
            SetLabelText((Enum)UI.LBL_SUFFIX, Singleton <DegreeTable> .I.GetData((uint)currentDegrees[3]).name);
            SetLabelText((Enum)UI.LBL_SORT, (!showAll) ? StringTable.Get(STRING_CATEGORY.TEXT_SCRIPT, 21u) : StringTable.Get(STRING_CATEGORY.TEXT_SCRIPT, 20u));
            SetLabelText((Enum)UI.LBL_PAGE_MAX, maxPage.ToString());
            SetLabelText((Enum)UI.LBL_PAGE_NOW, currentPage.ToString());
            SetActive((Enum)UI.OBJ_ARROW_ACTIVE_ROOT, maxPage > 1);
            SetActive((Enum)UI.OBJ_ARROW_INACTIVE_ROOT, maxPage == 1);
            SetActive((Enum)UI.LBL_NO_SELECTABLE_FRAME, false);
            currentPlate.Initialize(currentDegrees, false, delegate
            {
            });
            int item_num = Mathf.Min(GameDefine.DEGREE_WORD_CHANGE_LIST_COUNT, currentShowData.Count - (currentPage - 1) * GameDefine.DEGREE_WORD_CHANGE_LIST_COUNT);
            SetGrid(UI.GRD_WORD_LIST, "DegreeWordList", item_num, false, delegate(int i, Transform t, bool b)
            {
                //IL_0001: Unknown result type (might be due to invalid IL or missing references)
                t.get_gameObject().AddComponent <UIDragScrollView>();
                int index = i + (currentPage - 1) * GameDefine.DEGREE_WORD_CHANGE_LIST_COUNT;
                DegreeTable.DegreeData degreeData = currentShowData[index];
                SetEvent(t, "SELECT", degreeData);
                if (degreeData.IsUnlcok(MonoBehaviourSingleton <UserInfoManager> .I.unlockedDegreeIds))
                {
                    SetButtonSprite(t, (currentDegrees[(int)currentTab] != degreeData.id) ? WORD_LIST_SPRITE_NAME[0] : WORD_LIST_SPRITE_NAME[1], false);
                }
                else
                {
                    SetButtonSprite(t, WORD_LIST_SPRITE_NAME[2], false);
                }
                if (!degreeData.IsSecretName(MonoBehaviourSingleton <UserInfoManager> .I.unlockedDegreeIds))
                {
                    SetLabelText(t, UI.LBL_WORD_NORMAL, degreeData.name);
                    SetLabelText(t, UI.LBL_WORD_SELECTED, degreeData.name);
                    SetActive(t, UI.LBL_WORD_NORMAL, currentDegrees[(int)currentTab] != (int)degreeData.id);
                    SetActive(t, UI.LBL_WORD_SELECTED, currentDegrees[(int)currentTab] == (int)degreeData.id);
                    SetActive(t, UI.LBL_WORD_UNKNOWN, false);
                }
                else
                {
                    SetActive(t, UI.LBL_WORD_NORMAL, false);
                    SetActive(t, UI.LBL_WORD_SELECTED, false);
                    SetActive(t, UI.LBL_WORD_UNKNOWN, true);
                }
                SetActive(t, UI.SPR_WORD_SELECTED, degreeData == currentSelectData);
            });
        }
        SetTab(currentTab, data.type);
        SetDegreeDetail();
    }