Skip to content

Commit

Permalink
Finish settings, add enhancements windows
Browse files Browse the repository at this point in the history
  • Loading branch information
aMannus committed Jan 31, 2025
1 parent de97f88 commit 82a7875
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 40 deletions.
45 changes: 30 additions & 15 deletions soh/soh/SohGui/SohMenuEnhancements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,52 @@ void SohMenu::AddMenuEnhancements() {

// Cosmetics Editor
path.sidebarName = "Cosmetics Editor";
AddSidebarEntry("Enhancements", path.sidebarName, 3);

AddWidget(path, "Cosmetics filler", WIDGET_TEXT);
AddSidebarEntry("Enhancements", path.sidebarName, 1);
AddWidget(path, "Cosmetics Editor", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Popout Cosmetics Editor Window", WIDGET_WINDOW_BUTTON)
.CVar("gWindows.CosmeticsEditor")
.WindowName("Cosmetics Editor")
.Options(ButtonOptions().Tooltip("Enables the separate Cosmetics Editor Window.").Size(Sizes::Inline));


// Audio Editor
path.sidebarName = "Audio Editor";
AddSidebarEntry("Enhancements", path.sidebarName, 3);

AddWidget(path, "Audio filler", WIDGET_TEXT);
AddSidebarEntry("Enhancements", path.sidebarName, 1);
AddWidget(path, "Audio Editor", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Popout Audio Editor Window", WIDGET_WINDOW_BUTTON)
.CVar("gWindows.AudioEditor")
.WindowName("Audio Editor")
.Options(ButtonOptions().Tooltip("Enables the separate Audio Editor Window.").Size(Sizes::Inline));


// Gameplay Stats
path.sidebarName = "Gameplay Stats";
AddSidebarEntry("Enhancements", path.sidebarName, 3);

AddWidget(path, "Gameplay Stats filler", WIDGET_TEXT);
AddSidebarEntry("Enhancements", path.sidebarName, 2);
AddWidget(path, "Gameplay Stats", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Popout Gameplay Stats Window", WIDGET_WINDOW_BUTTON)
.CVar("gWindows.GameplayStats")
.WindowName("Gameplay Stats")
.Options(ButtonOptions().Tooltip("Enables the separate Gameplay Stats Window.").Size(Sizes::Inline));


// Time Splits
path.sidebarName = "Time Splits";
AddSidebarEntry("Enhancements", path.sidebarName, 3);

AddWidget(path, "Time Splits filler", WIDGET_TEXT);
AddSidebarEntry("Enhancements", path.sidebarName, 1);
AddWidget(path, "Time Splits", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Popout Time Splits Window", WIDGET_WINDOW_BUTTON)
.CVar("gWindows.TimeSplits")
.WindowName("Time Splits")
.Options(ButtonOptions().Tooltip("Enables the separate Time Splits Window.").Size(Sizes::Inline));


// Timers
path.sidebarName = "Timers";
AddSidebarEntry("Enhancements", path.sidebarName, 3);

AddWidget(path, "Timers filler", WIDGET_TEXT);
AddSidebarEntry("Enhancements", path.sidebarName, 1);
AddWidget(path, "Timers", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Popout Timers Window", WIDGET_WINDOW_BUTTON)
.CVar("gWindows.AdditionalTimers")
.WindowName("Additional Timers")
.Options(ButtonOptions().Tooltip("Enables the separate Additional Timers Window.").Size(Sizes::Inline));
}

} // namespace SohGui
39 changes: 14 additions & 25 deletions soh/soh/SohGui/SohMenuSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void SohMenu::AddMenuSettings() {
.Options(IntSliderOptions()
.Min(0)
.Max(100)
.DefaultValue(100)
.DefaultValue(50)
.ShowButtons(true)
.Format(""));
AddWidget(path, "Main Music Volume: %d %%", WIDGET_CVAR_SLIDER_INT)
Expand Down Expand Up @@ -140,7 +140,7 @@ void SohMenu::AddMenuSettings() {
path.sidebarName = "Graphics";
AddSidebarEntry("Settings", "Graphics", 3);
AddWidget(path, "Toggle Fullscreen", WIDGET_CVAR_CHECKBOX)
.CVar("gSettings.Fullscreen")
.CVar(CVAR_SETTING("Fullscreen"))
.Callback([](WidgetInfo& info) { Ship::Context::GetInstance()->GetWindow()->ToggleFullscreen(); })
.Options(CheckboxOptions().Tooltip("Toggles Fullscreen On/Off."));
#ifndef __APPLE__
Expand Down Expand Up @@ -186,7 +186,7 @@ void SohMenu::AddMenuSettings() {
#endif

AddWidget(path, "Current FPS: %d", WIDGET_CVAR_SLIDER_INT)
.CVar("gInterpolationFPS")
.CVar(CVAR_SETTING("InterpolationFPS"))
.Callback([](WidgetInfo& info) {
int32_t defaultValue = std::static_pointer_cast<IntSliderOptions>(info.options)->defaultValue;
if (CVarGetInteger(info.cVar, defaultValue) == defaultValue) {
Expand All @@ -204,7 +204,7 @@ void SohMenu::AddMenuSettings() {
.Callback([](WidgetInfo& info) {
int hz = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
if (hz >= 20 && hz <= 360) {
CVarSetInteger("gInterpolationFPS", hz);
CVarSetInteger(CVAR_SETTING("InterpolationFPS"), hz);
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
})
Expand Down Expand Up @@ -246,38 +246,27 @@ void SohMenu::AddMenuSettings() {
.CVar(CVAR_TEXTURE_FILTER)
.Options(ComboboxOptions().Tooltip("Sets the applied Texture Filtering.").ComboMap(textureFilteringMap));


// Controls
path.sidebarName = "Controls";
AddSidebarEntry("Settings", "Controls", 1);
AddWidget(path,
"This interface can be a little daunting. Please bear with us as we work to improve the experience "
"and address some known issues.\n"
"\n"
"At first glance, you may notice several input devices displayed below the 'Clear All' button. "
"Some of these might be other controllers connected to your computer, while others may be "
"duplicated controllers (a known issue). We recommend clicking on the box with the " ICON_FA_EYE
" icon and the name of any disconnected or unused controllers to hide their inputs. Make sure the "
"target controller remains visible.\n"
"\n"
"If you encounter issues connecting your controller or registering inputs, try closing Steam or "
"any other external input software. Alternatively, test a different controller to determine if "
"it's a compatibility issue.\n",
WIDGET_TEXT);
AddWidget(path, "Bindings", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Popout Bindings Window", WIDGET_WINDOW_BUTTON)
.CVar("gWindows.SohInputEditor")
.WindowName("SoH Input Editor")
.CVar("gWindows.InputEditor")
.WindowName("Input Editor")
.Options(ButtonOptions().Tooltip("Enables the separate Bindings Window.").Size(Sizes::Inline));

// Notifications
path.sidebarName = "Notifications";
AddSidebarEntry("Settings", "Notifications", 3);
AddWidget(path, "Position", WIDGET_CVAR_COMBOBOX)
.CVar("gNotifications.Position")
.CVar(CVAR_SETTING("gNotifications.Position"))
.Options(ComboboxOptions()
.Tooltip("Which corner of the screen notifications appear in.")
.ComboMap(notificationPosition)
.DefaultIndex(3));
AddWidget(path, "Duration: %.0f seconds", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gNotifications.Duration")
.CVar(CVAR_SETTING("gNotifications.Duration"))
.Options(FloatSliderOptions()
.Tooltip("How long notifications are displayed for.")
.Format("%.1f")
Expand All @@ -286,13 +275,13 @@ void SohMenu::AddMenuSettings() {
.Max(30.0f)
.DefaultValue(10.0f));
AddWidget(path, "Background Opacity: %.0f%%", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gNotifications.BgOpacity")
.CVar(CVAR_SETTING("gNotifications.BgOpacity"))
.Options(FloatSliderOptions()
.Tooltip("How opaque the background of notifications is.")
.DefaultValue(0.5f)
.IsPercentage());
AddWidget(path, "Size %.1f", WIDGET_CVAR_SLIDER_FLOAT)
.CVar("gNotifications.Size")
.CVar(CVAR_SETTING("gNotifications.Size"))
.Options(FloatSliderOptions()
.Tooltip("How large notifications are.")
.Format("%.1f")
Expand All @@ -303,7 +292,7 @@ void SohMenu::AddMenuSettings() {
AddWidget(path, "Test Notification", WIDGET_BUTTON)
.Callback([](WidgetInfo& info) {
Notification::Emit({
.itemIcon = "__OTR__icon_item_24_static_yar/gQuestIconGoldSkulltulaTex",
.itemIcon = "__OTR__textures/icon_item_24_static/gQuestIconGoldSkulltulaTex",
.prefix = "This",
.message = "is a",
.suffix = "test.",
Expand Down

0 comments on commit 82a7875

Please sign in to comment.