summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMegaMech <MegaMech@users.noreply.github.com>2025-02-08 13:38:59 -0700
committerGitHub <noreply@github.com>2025-02-08 13:38:59 -0700
commita6ecc276e947fbd4f720fe2714ce23e9216070e7 (patch)
treef82bfa9cf94190493d1b87f13ae7f64dd414ea65
parent6eb0ee294b905ef7391a22965a617b1b44e7691a (diff)
Impl Reset button and fix some naming (#190)
* Compile works now * Update menus * Update CMakeLists.txt
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/port/ui/Menu.cpp12
-rw-r--r--src/port/ui/Menu.h15
-rw-r--r--src/port/ui/PortMenu.cpp2
4 files changed, 18 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ea87f7ffe..eb8f88ebf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -671,4 +671,4 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
endif()
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_SOURCE_DIR}/cmake/configure-packaging.cmake)
-include(cmake/packaging.cmake) \ No newline at end of file
+include(cmake/packaging.cmake)
diff --git a/src/port/ui/Menu.cpp b/src/port/ui/Menu.cpp
index 0832fb2fd..670e304fc 100644
--- a/src/port/ui/Menu.cpp
+++ b/src/port/ui/Menu.cpp
@@ -646,15 +646,7 @@ void Menu::DrawElement() {
UIWidgets::ButtonOptions options2 = {};
options2.color = UIWidgets::Colors::Red;
options2.size = UIWidgets::Sizes::Inline;
- options2.tooltip = "Reset"
-#ifdef __APPLE__
- " (Command-R)"
-#elif !defined(__SWITCH__) && !defined(__WIIU__)
- " (Ctrl+R)"
-#else
- ""
-#endif
- ;
+ options2.tooltip = "Reset";
if (UIWidgets::Button(ICON_FA_UNDO, options2)) {
ProcessReset();
}
@@ -662,7 +654,7 @@ void Menu::DrawElement() {
UIWidgets::ButtonOptions options3 = {};
options3.color = UIWidgets::Colors::Red;
options3.size = UIWidgets::Sizes::Inline;
- options3.tooltip = "Quit 2S2H";
+ options3.tooltip = "Quit";
if (UIWidgets::Button(ICON_FA_POWER_OFF, options3)) {
if (!popped) {
ToggleVisibility();
diff --git a/src/port/ui/Menu.h b/src/port/ui/Menu.h
index e4aa3ac00..fc2a77556 100644
--- a/src/port/ui/Menu.h
+++ b/src/port/ui/Menu.h
@@ -6,6 +6,12 @@
#include "graphic/Fast3D/gfx_rendering_api.h"
#include "MenuTypes.h"
+extern "C" {
+#include "defines.h"
+#include "main.h"
+#include "menus.h"
+}
+
namespace Ship {
uint32_t GetVectorIndexOf(std::vector<std::string>& vector, std::string value);
class Menu : public GuiWindow {
@@ -51,7 +57,14 @@ class Menu : public GuiWindow {
.options = std::make_shared<UIWidgets::WidgetOptions>(UIWidgets::WidgetOptions{}.Tooltip(
"Searches all menus for the given text, including tooltips.")) } } }
};
- virtual void ProcessReset() {}
+ virtual void ProcessReset() {
+ gGamestateNext = MAIN_MENU_FROM_QUIT;
+ if (CVarGetInteger("gEnableDebugMode", 0) == true) {
+ gMenuSelection = START_MENU;
+ } else {
+ gMenuSelection = LOGO_INTRO_MENU;
+ }
+ }
private:
bool allowPopout = true; // PortNote: should be set to false on small screen ports
diff --git a/src/port/ui/PortMenu.cpp b/src/port/ui/PortMenu.cpp
index b1e9cfde2..825ed8527 100644
--- a/src/port/ui/PortMenu.cpp
+++ b/src/port/ui/PortMenu.cpp
@@ -390,7 +390,7 @@ void PortMenu::AddDevTools() {
.CVar("gGameInfoEnabled")
.Options(ButtonOptions().Tooltip(
"Shows the game info window, contains player and actor information"))
- .WindowName("GfxDebuggerWindow");
+ .WindowName("GameInfo");
path = { "Developer", "Stats", SECTION_COLUMN_1 };
AddSidebarEntry("Developer", "Stats", 1);