@@ -637,6 +637,8 @@ void Engine::show_multiplayer_host() {
637637 }
638638}
639639
640+ static void DrawScenarioMenu (Frame &f, Audio &sfx, Assets &ass);
641+
640642void UICache::show_editor_menu () {
641643 ZoneScoped;
642644 ImGuiViewport *vp = ImGui::GetMainViewport ();
@@ -658,6 +660,7 @@ void UICache::show_editor_menu() {
658660 f.str2 (" Scenario Editor" , TextHalign::center);
659661 }
660662
663+ #if 0
661664 FontGuard fg(fnt.copper);
662665
663666 ImGui::SetCursorPosY(272.0f / 768.0f * vp->WorkSize.y);
@@ -678,7 +681,9 @@ void UICache::show_editor_menu() {
678681 if (btn(f, "Cancel", TextHalign::center, e->sfx))
679682 next_menu_state = MenuState::start;
680683
681- ImGui::SetCursorPosX (old_x);
684+ #else
685+ DrawScenarioMenu (f, e->sfx , *e->assets .get ());
686+ #endif
682687}
683688
684689
@@ -1049,9 +1054,32 @@ MenuButton mainMenuButtons[] = {
10491054 {604 , " Exit" },
10501055};
10511056
1057+ MenuButton scenarioMenuButtons[] = {
1058+ {272 , " Create Scenario" },
1059+ {352 , " Edit Scenario" },
1060+ {432 , " Campaign Editor" },
1061+ {512 , " Cancel" },
1062+ };
1063+
10521064static void DrawMainMenu (Frame &f, Audio &sfx, Assets &ass);
1065+ static void DrawScenarioMenu (Frame &f, Audio &sfx, Assets &ass);
10531066
10541067FullscreenMenu mainMenu (MenuState::start, mainMenuButtons, ARRAY_SIZE(mainMenuButtons), DrawMainMenu);
1068+ FullscreenMenu scenarioMenu (MenuState::editor_menu, scenarioMenuButtons, ARRAY_SIZE(scenarioMenuButtons), DrawScenarioMenu);
1069+
1070+ static void DrawScenarioMenu (Frame &f, Audio &sfx, Assets &ass)
1071+ {
1072+ FullscreenMenu &mm = scenarioMenu;
1073+ ImGuiViewport *vp = ImGui::GetMainViewport ();
1074+
1075+ FontGuard fg (fnt.copper );
1076+ mm.reshape (vp);
1077+
1078+ BackgroundColors col = ass.bkg_cols .at (io::DrsId::bkg_editor_menu);
1079+
1080+ for (unsigned i = 0 , n = mm.buttonCount ; i < n; ++i)
1081+ mm.buttons [i].show (f, sfx, col);
1082+ }
10551083
10561084static void DrawMainMenu (Frame &f, Audio &sfx, Assets &ass)
10571085{
@@ -1063,14 +1091,8 @@ static void DrawMainMenu(Frame &f, Audio &sfx, Assets &ass)
10631091
10641092 BackgroundColors col = ass.bkg_cols .at (io::DrsId::bkg_main_menu);
10651093
1066- bool activated = false ;
1067-
1068- for (unsigned i = 0 , n = mm.buttonCount ; i < n; ++i) {
1069- if (mm.buttons [i].show (f, sfx, col) && !activated) {
1070- activated = true ;
1071- MenuButtonActivate (MenuState::start, i);
1072- }
1073- }
1094+ for (unsigned i = 0 , n = mm.buttonCount ; i < n; ++i)
1095+ mm.buttons [i].show (f, sfx, col);
10741096}
10751097
10761098void Engine::show_start () {
0 commit comments