summaryrefslogtreecommitdiff
path: root/src/port/ui/PortMenu.cpp
diff options
context:
space:
mode:
authorKiritoDv <36680385+KiritoDv@users.noreply.github.com>2025-05-16 02:44:40 +0000
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2025-05-16 02:44:40 +0000
commitb53a5dbcfa24ef2aa4860b6d9512709976686de8 (patch)
tree441f2bb9c0bc8f955eb9289d19b13beab5c239c5 /src/port/ui/PortMenu.cpp
parentbdf5ca8d603ae56ac275bebf9fde58ae72484d76 (diff)
clang formatclang-format
Diffstat (limited to 'src/port/ui/PortMenu.cpp')
-rw-r--r--src/port/ui/PortMenu.cpp104
1 files changed, 55 insertions, 49 deletions
diff --git a/src/port/ui/PortMenu.cpp b/src/port/ui/PortMenu.cpp
index b21ddc1fa..d8411e24b 100644
--- a/src/port/ui/PortMenu.cpp
+++ b/src/port/ui/PortMenu.cpp
@@ -15,10 +15,10 @@
#endif
extern "C" {
- extern s32 gGamestateNext;
- extern s32 gMenuSelection;
- #include "audio/external.h"
- #include "defines.h"
+extern s32 gGamestateNext;
+extern s32 gMenuSelection;
+#include "audio/external.h"
+#include "defines.h"
}
namespace GameUI {
@@ -158,9 +158,8 @@ void PortMenu::AddSettings() {
.IsPercentage());
AddWidget(path, "Main Music Volume: %.0f%%", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gMainMusicVolume")
- .Callback([](WidgetInfo& info) {
- audio_set_player_volume(SEQ_PLAYER_LEVEL, CVarGetFloat("gMainMusicVolume", 1.0f));
- })
+ .Callback(
+ [](WidgetInfo& info) { audio_set_player_volume(SEQ_PLAYER_LEVEL, CVarGetFloat("gMainMusicVolume", 1.0f)); })
.Options(FloatSliderOptions()
.Tooltip("Adjust the background music volume.")
.ShowButtons(false)
@@ -168,16 +167,17 @@ void PortMenu::AddSettings() {
.IsPercentage());
AddWidget(path, "Sound Effects Volume: %.0f%%", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gSFXMusicVolume")
- .Callback([](WidgetInfo& info) {
- audio_set_player_volume(SEQ_PLAYER_SFX, CVarGetFloat("gSFXMusicVolume", 1.0f));
- })
- .Options(
- FloatSliderOptions().Tooltip("Adjust the sound effects volume.").ShowButtons(false).Format("").IsPercentage());
+ .Callback(
+ [](WidgetInfo& info) { audio_set_player_volume(SEQ_PLAYER_SFX, CVarGetFloat("gSFXMusicVolume", 1.0f)); })
+ .Options(FloatSliderOptions()
+ .Tooltip("Adjust the sound effects volume.")
+ .ShowButtons(false)
+ .Format("")
+ .IsPercentage());
AddWidget(path, "Sound Effects Volume: %.0f%%", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gEnvironmentVolume")
- .Callback([](WidgetInfo& info) {
- audio_set_player_volume(SEQ_PLAYER_ENV, CVarGetFloat("gEnvironmentVolume", 1.0f));
- })
+ .Callback(
+ [](WidgetInfo& info) { audio_set_player_volume(SEQ_PLAYER_ENV, CVarGetFloat("gEnvironmentVolume", 1.0f)); })
.Options(FloatSliderOptions()
.Tooltip("Adjust the environment volume.")
.ShowButtons(false)
@@ -332,31 +332,36 @@ void PortMenu::AddEnhancements() {
AddMenuEntry("Enhancements", "gSettings.Menu.EnhancementsSidebarSection");
WidgetPath path = { "Enhancements", "General", SECTION_COLUMN_1 };
AddSidebarEntry("Enhancements", "General", 3);
- //UIWidgets::WindowButton("Multiplayer", "gMultiplayerWindowEnabled", GameUI::mMultiplayerWindow,
- // { .tooltip = "Shows the multiplayer window" });
- // UIWidgets::WindowButton("Freecam", "gFreecam", GameUI::mFreecamWindow,
- // { .tooltip = "Allows you to fly around the course" });
+ // UIWidgets::WindowButton("Multiplayer", "gMultiplayerWindowEnabled", GameUI::mMultiplayerWindow,
+ // { .tooltip = "Shows the multiplayer window" });
+ // UIWidgets::WindowButton("Freecam", "gFreecam", GameUI::mFreecamWindow,
+ // { .tooltip = "Allows you to fly around the course" });
AddWidget(path, "No multiplayer feature cuts", WIDGET_CVAR_CHECKBOX)
.CVar("gMultiplayerNoFeatureCuts")
.Options(CheckboxOptions().Tooltip("Allows full train and jumbotron in multiplayer, etc."));
AddWidget(path, "General Improvements", WIDGET_CVAR_CHECKBOX)
- .CVar("gImprovements").Options(CheckboxOptions().Tooltip("General improvements to the game experience."));
+ .CVar("gImprovements")
+ .Options(CheckboxOptions().Tooltip("General improvements to the game experience."));
AddWidget(path, "No Level of Detail (LOD)", WIDGET_CVAR_CHECKBOX)
.CVar("gDisableLod")
- .Options(CheckboxOptions().Tooltip("Disable Level of Detail (LOD) to avoid models using lower poly versions at a distance"));
+ .Options(CheckboxOptions().Tooltip(
+ "Disable Level of Detail (LOD) to avoid models using lower poly versions at a distance"));
AddWidget(path, "Disable Culling", WIDGET_CVAR_CHECKBOX)
- .CVar("gNoCulling").Options(CheckboxOptions().Tooltip("Disable original culling of mk64"));
+ .CVar("gNoCulling")
+ .Options(CheckboxOptions().Tooltip("Disable original culling of mk64"));
AddWidget(path, "Far Frustrum", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gFarFrustrum")
- .Options(FloatSliderOptions().Min(0.0f).Max(10000.0f).DefaultValue(10000.0f)
- .Tooltip("Say how Far the Frustrum are when 'Disable Culling' are enable").Step(10.0f));
+ .Options(FloatSliderOptions()
+ .Min(0.0f)
+ .Max(10000.0f)
+ .DefaultValue(10000.0f)
+ .Tooltip("Say how Far the Frustrum are when 'Disable Culling' are enable")
+ .Step(10.0f));
path = { "Enhancements", "Cheats", SECTION_COLUMN_1 };
AddSidebarEntry("Enhancements", "Cheats", 3);
- AddWidget(path, "Moon Jump", WIDGET_CVAR_CHECKBOX)
- .CVar("gEnableMoonJump");
- AddWidget(path, "Enable Custom CC", WIDGET_CVAR_CHECKBOX)
- .CVar("gEnableCustomCC");
+ AddWidget(path, "Moon Jump", WIDGET_CVAR_CHECKBOX).CVar("gEnableMoonJump");
+ AddWidget(path, "Enable Custom CC", WIDGET_CVAR_CHECKBOX).CVar("gEnableCustomCC");
AddWidget(path, "Custom CC", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gCustomCC")
.Options(FloatSliderOptions().Min(0.0f).Max(1000.0f).DefaultValue(150.0f).Step(10.0f));
@@ -365,21 +370,21 @@ void PortMenu::AddEnhancements() {
.Options(CheckboxOptions().Tooltip("Disable wall collision."));
AddWidget(path, "Min Height", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gMinHeight")
- .Options(FloatSliderOptions().Min(-50.0f).Max(50.0f).DefaultValue(0.0f)
- .Tooltip("When Disable Wall Collision are enable what is the minimal height you can get."));
+ .Options(FloatSliderOptions().Min(-50.0f).Max(50.0f).DefaultValue(0.0f).Tooltip(
+ "When Disable Wall Collision are enable what is the minimal height you can get."));
path = { "Enhancements", "HM64 Lab", SECTION_COLUMN_1 };
AddSidebarEntry("Enhancements", "HM64 Lab", 4);
AddWidget(path, "Enable HM64 Labs", WIDGET_CVAR_CHECKBOX)
- .CVar("gEditorEnabled")
- .Callback([](WidgetInfo& info) {
- Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Tools")->ToggleVisibility();
- Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Scene Explorer")->ToggleVisibility();
- Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Content Browser")->ToggleVisibility();
- Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Track Properties")->ToggleVisibility();
- Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Properties")->ToggleVisibility();
- })
- .Options(UIWidgets::CheckboxOptions({{ .tooltip = "Edit the universe!"}}));
+ .CVar("gEditorEnabled")
+ .Callback([](WidgetInfo& info) {
+ Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Tools")->ToggleVisibility();
+ Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Scene Explorer")->ToggleVisibility();
+ Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Content Browser")->ToggleVisibility();
+ Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Track Properties")->ToggleVisibility();
+ Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Properties")->ToggleVisibility();
+ })
+ .Options(UIWidgets::CheckboxOptions({ { .tooltip = "Edit the universe!" } }));
}
#ifdef __SWITCH__
@@ -400,11 +405,11 @@ void PortMenu::AddDevTools() {
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))
+ .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)
@@ -429,7 +434,8 @@ void PortMenu::AddDevTools() {
AddSidebarEntry("Developer", "Stats", 1);
AddWidget(path, "Popout Stats", WIDGET_WINDOW_BUTTON)
.CVar("gStatsEnabled")
- .Options(ButtonOptions().Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on"))
+ .Options(ButtonOptions().Tooltip(
+ "Shows the stats window, with your FPS and frametimes, and the OS you're playing on"))
.WindowName("Stats");
path = { "Developer", "Console", SECTION_COLUMN_1 };
@@ -445,9 +451,9 @@ PortMenu::PortMenu(const std::string& consoleVariable, const std::string& name)
: Menu(consoleVariable, name, 0, UIWidgets::Colors::LightBlue) {
}
-//bool CheckNetworkConnected(disabledInfo& info) {
-// return gNetwork.isConnected;
-//}
+// bool CheckNetworkConnected(disabledInfo& info) {
+// return gNetwork.isConnected;
+// }
void PortMenu::InitElement() {
Ship::Menu::InitElement();
@@ -531,4 +537,4 @@ void PortMenu::Draw() {
void PortMenu::DrawElement() {
Ship::Menu::DrawElement();
}
-} // namespace BenGui
+} // namespace GameUI