mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-04-28 13:17:58 +03:00

* Fix issue where random and clear seed buttons overlap text input. * Fix issue where item scale is incorrectly disabled. On fresh json, there was a mismatch on the defaults where SGIA_JUNK was default for the actual combobx but SGIA_DISABLED, was used as the default when the CVar was checked in the scale slider's PreFunc.
151 lines
7.8 KiB
C++
151 lines
7.8 KiB
C++
#include "SohMenu.h"
|
|
#include <macros.h>
|
|
|
|
namespace SohGui {
|
|
|
|
extern std::shared_ptr<SohMenu> mSohMenu;
|
|
using namespace UIWidgets;
|
|
|
|
void SohMenu::AddMenuRandomizer() {
|
|
// Add Randomizer Menu
|
|
AddMenuEntry("Randomizer", CVAR_SETTING("Menu.RandomizerSidebarSection"));
|
|
|
|
// Seed Settings
|
|
WidgetPath path = { "Randomizer", "Seed Settings", SECTION_COLUMN_1 };
|
|
AddSidebarEntry("Randomizer", path.sidebarName, 1);
|
|
AddWidget(path, "Popout Randomizer Settings Window", WIDGET_WINDOW_BUTTON)
|
|
.CVar(CVAR_WINDOW("RandomizerSettings"))
|
|
.WindowName("Randomizer Settings")
|
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Randomizer Settings Window."));
|
|
|
|
// Enhancements
|
|
path.sidebarName = "Enhancements";
|
|
AddSidebarEntry("Randomizer", path.sidebarName, 3);
|
|
AddWidget(path, "Randomizer Enhancements", WIDGET_SEPARATOR_TEXT);
|
|
AddWidget(path, "Rando-Relevant Navi Hints", WIDGET_CVAR_CHECKBOX)
|
|
.CVar(CVAR_RANDOMIZER_ENHANCEMENT("RandoRelevantNavi"))
|
|
.Options(CheckboxOptions().Tooltip(
|
|
"Replace Navi's overworld quest hints with rando-related gameplay hints."
|
|
).DefaultValue(true));
|
|
AddWidget(path, "Random Rupee Names", WIDGET_CVAR_CHECKBOX)
|
|
.CVar(CVAR_RANDOMIZER_ENHANCEMENT("RandomizeRupeeNames"))
|
|
.Options(CheckboxOptions().Tooltip(
|
|
"When obtaining Rupees, randomize what the Rupee is called in the textbox."
|
|
).DefaultValue(true));
|
|
AddWidget(path, "Use Custom Key Models", WIDGET_CVAR_CHECKBOX)
|
|
.CVar(CVAR_RANDOMIZER_ENHANCEMENT("CustomKeyModels"))
|
|
.Options(CheckboxOptions().Tooltip(
|
|
"Use Custom graphics for Dungeon Keys, Big and Small, so that they can be easily told apart."
|
|
).DefaultValue(true));
|
|
AddWidget(path, "Map & Compass Colors Match Dungeon", WIDGET_CVAR_CHECKBOX)
|
|
.CVar(CVAR_RANDOMIZER_ENHANCEMENT("ColoredMapsAndCompasses"))
|
|
.PreFunc([](WidgetInfo& info) {
|
|
info.options->disabled = !(
|
|
OTRGlobals::Instance->gRandoContext->GetOption(RSK_SHUFFLE_MAPANDCOMPASS).IsNot(RO_DUNGEON_ITEM_LOC_STARTWITH) &&
|
|
OTRGlobals::Instance->gRandoContext->GetOption(RSK_SHUFFLE_MAPANDCOMPASS).IsNot(RO_DUNGEON_ITEM_LOC_VANILLA) &&
|
|
OTRGlobals::Instance->gRandoContext->GetOption(RSK_SHUFFLE_MAPANDCOMPASS).IsNot(RO_DUNGEON_ITEM_LOC_OWN_DUNGEON)
|
|
);
|
|
info.options->disabledTooltip = "This setting is disabled because a savefile is loaded without the map & compass.\n"
|
|
"Shuffle settings set to \"Any Dungeon\", \"Overworld\" or \"Anywhere\".";
|
|
})
|
|
.Options(CheckboxOptions().Tooltip(
|
|
"Matches the color of maps & compasses to the dungeon they belong to. "
|
|
"This helps identify maps & compasses from afar and adds a little bit of flair.\n\nThis only "
|
|
"applies to seeds with maps & compasses shuffled to \"Any Dungeon\", \"Overworld\", or \"Anywhere\"."
|
|
).DefaultValue(true));
|
|
AddWidget(path, "Quest Item Fanfares", WIDGET_CVAR_CHECKBOX)
|
|
.CVar(CVAR_RANDOMIZER_ENHANCEMENT("QuestItemFanfares"))
|
|
.Options(CheckboxOptions().Tooltip(
|
|
"Play unique fanfares when obtaining quest items (medallions/stones/songs). Note that these "
|
|
"fanfares can be longer than usual."
|
|
));
|
|
AddWidget(path, "Mysterious Shuffled Items", WIDGET_CVAR_CHECKBOX)
|
|
.CVar(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"))
|
|
.Options(CheckboxOptions().Tooltip(
|
|
"Displays a \"Mystery Item\" model in place of any freestanding/GS/shop items that were shuffled, "
|
|
"and replaces item names for them and scrubs and merchants, regardless of hint settings, "
|
|
"so you never know what you're getting."
|
|
));
|
|
AddWidget(path, "Simpler Boss Soul Models", WIDGET_CVAR_CHECKBOX)
|
|
.CVar(CVAR_RANDOMIZER_ENHANCEMENT("SimplerBossSoulModels"))
|
|
.Options(CheckboxOptions().Tooltip(
|
|
"When shuffling boss souls, they'll appear as a simpler model instead of showing the boss' models."
|
|
"This might make boss souls more distinguishable from a distance, and can help with performance."
|
|
));
|
|
AddWidget(path, "Skip Get Item Animations", WIDGET_CVAR_COMBOBOX)
|
|
.CVar(CVAR_RANDOMIZER_ENHANCEMENT("TimeSavers.SkipGetItemAnimation"))
|
|
.Options(ComboboxOptions().ComboMap(skipGetItemAnimationOptions).DefaultIndex(SGIA_JUNK));
|
|
AddWidget(path, "Item Scale: %.2f", WIDGET_CVAR_SLIDER_FLOAT)
|
|
.CVar(CVAR_RANDOMIZER_ENHANCEMENT("TimeSavers.SkipGetItemAnimationScale"))
|
|
.PreFunc([](WidgetInfo& info) {
|
|
info.options->disabled =
|
|
!CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("TimeSavers.SkipGetItemAnimation"), SGIA_JUNK);
|
|
info.options->disabledTooltip = "This slider only applies when using the \"Skip Get Item Animations\" option.";
|
|
})
|
|
.Options(FloatSliderOptions()
|
|
.Min(5.0f)
|
|
.Max(15.0f)
|
|
.Format("%.2f")
|
|
.DefaultValue(10.0f)
|
|
.Tooltip(
|
|
"The size of the item when it is picked up."
|
|
));
|
|
|
|
// Plandomizer
|
|
path.sidebarName = "Plandomizer";
|
|
AddSidebarEntry("Randomizer", path.sidebarName, 1);
|
|
AddWidget(path, "Popout Plandomizer Window", WIDGET_WINDOW_BUTTON)
|
|
.CVar(CVAR_WINDOW("PlandomizerEditor"))
|
|
.WindowName("Plandomizer Editor")
|
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Randomizer Settings Window."));
|
|
|
|
// Item Tracker
|
|
path.sidebarName = "Item Tracker";
|
|
AddSidebarEntry("Randomizer", path.sidebarName, 1);
|
|
|
|
AddWidget(path, "Item Tracker", WIDGET_SEPARATOR_TEXT);
|
|
AddWidget(path, "Toggle Item Tracker", WIDGET_WINDOW_BUTTON)
|
|
.CVar(CVAR_WINDOW("ItemTracker"))
|
|
.WindowName("Item Tracker")
|
|
.Options(WindowButtonOptions().Tooltip("Toggles the Item Tracker.").EmbedWindow(false));
|
|
|
|
AddWidget(path, "Item Tracker Settings", WIDGET_SEPARATOR_TEXT);
|
|
AddWidget(path, "Popout Item Tracker Settings", WIDGET_WINDOW_BUTTON)
|
|
.CVar(CVAR_WINDOW("ItemTrackerSettings"))
|
|
.WindowName("Item Tracker Settings")
|
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Item Tracker Settings Window."));
|
|
|
|
// Entrance Tracker
|
|
path.sidebarName = "Entrance Tracker";
|
|
AddSidebarEntry("Randomizer", path.sidebarName, 1);
|
|
|
|
AddWidget(path, "Entrance Tracker", WIDGET_SEPARATOR_TEXT);
|
|
AddWidget(path, "Toggle Entrance Tracker", WIDGET_WINDOW_BUTTON)
|
|
.CVar(CVAR_WINDOW("EntranceTracker"))
|
|
.WindowName("Entrance Tracker")
|
|
.Options(WindowButtonOptions().Tooltip("Toggles the Entrance Tracker.").EmbedWindow(false));
|
|
|
|
AddWidget(path, "Entrance Tracker Settings", WIDGET_SEPARATOR_TEXT);
|
|
AddWidget(path, "Popout Entrance Tracker Settings", WIDGET_WINDOW_BUTTON)
|
|
.CVar(CVAR_WINDOW("EntranceTrackerSettings"))
|
|
.WindowName("Entrance Tracker Settings")
|
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Entrance Tracker Settings Window."));
|
|
|
|
// Check Tracker
|
|
path.sidebarName = "Check Tracker";
|
|
AddSidebarEntry("Randomizer", path.sidebarName, 1);
|
|
|
|
AddWidget(path, "Check Tracker", WIDGET_SEPARATOR_TEXT);
|
|
AddWidget(path, "Toggle Check Tracker", WIDGET_WINDOW_BUTTON)
|
|
.CVar(CVAR_WINDOW("CheckTracker"))
|
|
.WindowName("Check Tracker")
|
|
.Options(WindowButtonOptions().Tooltip("Toggles the Check Tracker.").EmbedWindow(false));
|
|
|
|
AddWidget(path, "Check Tracker Settings", WIDGET_SEPARATOR_TEXT);
|
|
AddWidget(path, "Popout Check Tracker Settings", WIDGET_WINDOW_BUTTON)
|
|
.CVar(CVAR_WINDOW("CheckTrackerSettings"))
|
|
.WindowName("Check Tracker Settings")
|
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Check Tracker Settings Window."));
|
|
}
|
|
|
|
} // namespace SohGui
|