Skip to content

Commit a6ecc27

Browse files
authored
Impl Reset button and fix some naming (#190)
* Compile works now * Update menus * Update CMakeLists.txt
1 parent 6eb0ee2 commit a6ecc27

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,4 +671,4 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
671671
endif()
672672

673673
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_SOURCE_DIR}/cmake/configure-packaging.cmake)
674-
include(cmake/packaging.cmake)
674+
include(cmake/packaging.cmake)

src/port/ui/Menu.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -646,23 +646,15 @@ void Menu::DrawElement() {
646646
UIWidgets::ButtonOptions options2 = {};
647647
options2.color = UIWidgets::Colors::Red;
648648
options2.size = UIWidgets::Sizes::Inline;
649-
options2.tooltip = "Reset"
650-
#ifdef __APPLE__
651-
" (Command-R)"
652-
#elif !defined(__SWITCH__) && !defined(__WIIU__)
653-
" (Ctrl+R)"
654-
#else
655-
""
656-
#endif
657-
;
649+
options2.tooltip = "Reset";
658650
if (UIWidgets::Button(ICON_FA_UNDO, options2)) {
659651
ProcessReset();
660652
}
661653
ImGui::SameLine();
662654
UIWidgets::ButtonOptions options3 = {};
663655
options3.color = UIWidgets::Colors::Red;
664656
options3.size = UIWidgets::Sizes::Inline;
665-
options3.tooltip = "Quit 2S2H";
657+
options3.tooltip = "Quit";
666658
if (UIWidgets::Button(ICON_FA_POWER_OFF, options3)) {
667659
if (!popped) {
668660
ToggleVisibility();

src/port/ui/Menu.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
#include "graphic/Fast3D/gfx_rendering_api.h"
77
#include "MenuTypes.h"
88

9+
extern "C" {
10+
#include "defines.h"
11+
#include "main.h"
12+
#include "menus.h"
13+
}
14+
915
namespace Ship {
1016
uint32_t GetVectorIndexOf(std::vector<std::string>& vector, std::string value);
1117
class Menu : public GuiWindow {
@@ -51,7 +57,14 @@ class Menu : public GuiWindow {
5157
.options = std::make_shared<UIWidgets::WidgetOptions>(UIWidgets::WidgetOptions{}.Tooltip(
5258
"Searches all menus for the given text, including tooltips.")) } } }
5359
};
54-
virtual void ProcessReset() {}
60+
virtual void ProcessReset() {
61+
gGamestateNext = MAIN_MENU_FROM_QUIT;
62+
if (CVarGetInteger("gEnableDebugMode", 0) == true) {
63+
gMenuSelection = START_MENU;
64+
} else {
65+
gMenuSelection = LOGO_INTRO_MENU;
66+
}
67+
}
5568

5669
private:
5770
bool allowPopout = true; // PortNote: should be set to false on small screen ports

src/port/ui/PortMenu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ void PortMenu::AddDevTools() {
390390
.CVar("gGameInfoEnabled")
391391
.Options(ButtonOptions().Tooltip(
392392
"Shows the game info window, contains player and actor information"))
393-
.WindowName("GfxDebuggerWindow");
393+
.WindowName("GameInfo");
394394

395395
path = { "Developer", "Stats", SECTION_COLUMN_1 };
396396
AddSidebarEntry("Developer", "Stats", 1);

0 commit comments

Comments
 (0)