Fixed compilation

This commit is contained in:
KiritoDv
2025-03-07 17:39:58 -06:00
committed by Lywx
parent 629125110d
commit 5f8550790a
6 changed files with 97 additions and 25 deletions
+25
View File
@@ -10,6 +10,10 @@
#include <tuple>
#include "ResolutionEditor.h"
#ifdef __SWITCH__
#include <port/switch/SwitchImpl.h>
#endif
extern "C" {
extern s32 gGamestateNext;
extern s32 gMenuSelection;
@@ -362,10 +366,31 @@ void PortMenu::AddEnhancements() {
.Tooltip("When Disable Wall Collision are enable what is the minimal height you can get."));
}
#ifdef __SWITCH__
static const std::unordered_map<int32_t, const char*> switchCPUProfiles = {
{ Ship::SwitchProfiles::MAXIMUM, "Maximum Performance" },
{ Ship::SwitchProfiles::HIGH, "High Performance" },
{ Ship::SwitchProfiles::BOOST, "Boost Performance" },
{ Ship::SwitchProfiles::STOCK, "Stock Performance" },
{ Ship::SwitchProfiles::POWERSAVINGM1, "Powersaving Mode 1" },
{ Ship::SwitchProfiles::POWERSAVINGM2, "Powersaving Mode 2" },
{ Ship::SwitchProfiles::POWERSAVINGM3, "Powersaving Mode 3" }
};
#endif
void PortMenu::AddDevTools() {
AddMenuEntry("Developer", "gSettings.Menu.DevToolsSidebarSection");
AddSidebarEntry("Developer", "General", 3);
WidgetPath path = { "Developer", "General", SECTION_COLUMN_1 };
#ifdef __SWITCH__
AddWidget(path, "Switch CPU Profile", WIDGET_CVAR_COMBOBOX)
.CVar("gSwitchPerfMode")
.Options(ComboboxOptions()
.Tooltip("Switches the CPU profile to a different one")
.ComboMap(switchCPUProfiles)
.DefaultIndex(Ship::SwitchProfiles::STOCK))
.Callback([](WidgetInfo& info) { Ship::Switch::ApplyOverclock(); });
#endif
AddWidget(path, "Popout Menu", WIDGET_CVAR_CHECKBOX)
.CVar("gSettings.Menu.Popout")
.Options(CheckboxOptions().Tooltip("Changes the menu display from overlay to windowed."));