Exemple #1
0
 // Token: 0x060036F9 RID: 14073 RVA: 0x0017CD26 File Offset: 0x0017B126
 private static void onClickedLevel(SleekLevel level, byte index)
 {
     if ((int)index < MenuPlaySingleplayerUI.levels.Length && MenuPlaySingleplayerUI.levels[(int)index] != null)
     {
         PlaySettings.singleplayerMap = MenuPlaySingleplayerUI.levels[(int)index].name;
         MenuPlaySingleplayerUI.updateSelection();
     }
 }
Exemple #2
0
        // Token: 0x06003703 RID: 14083 RVA: 0x0017CF58 File Offset: 0x0017B358
        private static void refreshLevels()
        {
            MenuPlaySingleplayerUI.levelScrollBox.remove();
            MenuPlaySingleplayerUI.levels = Level.getLevels(PlaySettings.singleplayerCategory);
            bool flag = false;

            MenuPlaySingleplayerUI.levelButtons = new SleekLevel[MenuPlaySingleplayerUI.levels.Length];
            for (int i = 0; i < MenuPlaySingleplayerUI.levels.Length; i++)
            {
                if (MenuPlaySingleplayerUI.levels[i] != null)
                {
                    SleekLevel sleekLevel = new SleekLevel(MenuPlaySingleplayerUI.levels[i], false);
                    sleekLevel.positionOffset_Y = i * 110;
                    SleekLevel sleekLevel2 = sleekLevel;
                    if (MenuPlaySingleplayerUI.< > f__mg$cache0 == null)
                    {
                        MenuPlaySingleplayerUI.< > f__mg$cache0 = new ClickedLevel(MenuPlaySingleplayerUI.onClickedLevel);
                    }
                    sleekLevel2.onClickedLevel = MenuPlaySingleplayerUI.< > f__mg$cache0;
                    MenuPlaySingleplayerUI.levelScrollBox.add(sleekLevel);
                    MenuPlaySingleplayerUI.levelButtons[i] = sleekLevel;
                    if (!flag && MenuPlaySingleplayerUI.levels[i].name == PlaySettings.singleplayerMap)
                    {
                        flag = true;
                    }
                }
            }
            if (MenuPlaySingleplayerUI.levels.Length == 0)
            {
                PlaySettings.singleplayerMap = string.Empty;
            }
            else if (!flag || PlaySettings.singleplayerMap == null || PlaySettings.singleplayerMap.Length == 0)
            {
                PlaySettings.singleplayerMap = MenuPlaySingleplayerUI.levels[0].name;
            }
            MenuPlaySingleplayerUI.updateSelection();
            MenuPlaySingleplayerUI.levelScrollBox.area = new Rect(0f, 0f, 5f, (float)(MenuPlaySingleplayerUI.levels.Length * 110 - 10));
        }