コード例 #1
0
 private static void onClickedLevel(SleekLevel level, byte index)
 {
     if ((int)index < MenuWorkshopEditorUI.levels.Length && MenuWorkshopEditorUI.levels[(int)index] != null && MenuWorkshopEditorUI.levels[(int)index].isEditable)
     {
         PlaySettings.editorMap = MenuWorkshopEditorUI.levels[(int)index].name;
         MenuWorkshopEditorUI.updateSelection();
     }
 }
コード例 #2
0
        private static void onLevelsRefreshed()
        {
            MenuWorkshopEditorUI.levelScrollBox.remove();
            MenuWorkshopEditorUI.levels = Level.getLevels(ESingleplayerMapCategory.EDITABLE);
            bool flag = false;

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