Search Exclusion and Search Widgets (#5656)
* Implement widget search exclusion. Exclude all external windows from the search. * Add second column to search results for non-widget results. * Implement extra search index. Add various controls, audio editor, and tracker options to the extra search index. Fix capitalization on a few options. Add click-to-view functionality to extra search column. * Add extraSearchWidgets for searching through non-menu widgets. Convert Controls extraSearches to widgets. Used to display in-window, as well as provide reference to extraSearchWidgets. * Swap Audio search to menu widget search system. * Fix missing static on a ShipInit instance. * Implement SearchWidgets in popout windows. Remove remaining vestiges of custom search. * Add SearchWidget for randomizing audio on seed gen. * Remove comments on color picker entries in WidgetType. * Put all search results in middle column for width management. Change combobox alignment and label position in search results to unify them all to left and above for better organization. Add "Search Results" text to header of results page for clarification. * clang
This commit is contained in:
@@ -437,7 +437,9 @@ void PresetsCustomWidget(WidgetInfo& info) {
|
|||||||
void RegisterPresetsWidgets() {
|
void RegisterPresetsWidgets() {
|
||||||
SohGui::mSohMenu->AddSidebarEntry("Settings", "Presets", 1);
|
SohGui::mSohMenu->AddSidebarEntry("Settings", "Presets", 1);
|
||||||
WidgetPath path = { "Settings", "Presets", SECTION_COLUMN_1 };
|
WidgetPath path = { "Settings", "Presets", SECTION_COLUMN_1 };
|
||||||
SohGui::mSohMenu->AddWidget(path, "PresetsWidget", WIDGET_CUSTOM).CustomFunction(PresetsCustomWidget);
|
SohGui::mSohMenu->AddWidget(path, "PresetsWidget", WIDGET_CUSTOM)
|
||||||
|
.CustomFunction(PresetsCustomWidget)
|
||||||
|
.HideInSearch(true);
|
||||||
presetFolder = Ship::Context::GetInstance()->GetPathRelativeToAppDirectory("presets");
|
presetFolder = Ship::Context::GetInstance()->GetPathRelativeToAppDirectory("presets");
|
||||||
std::fill_n(saveSection, PRESET_SECTION_MAX, true);
|
std::fill_n(saveSection, PRESET_SECTION_MAX, true);
|
||||||
LoadPresets();
|
LoadPresets();
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include "soh/OTRGlobals.h"
|
#include "soh/OTRGlobals.h"
|
||||||
#include "soh/cvar_prefixes.h"
|
#include "soh/cvar_prefixes.h"
|
||||||
#include <utils/StringHelper.h>
|
#include <utils/StringHelper.h>
|
||||||
#include "soh/SohGui/UIWidgets.hpp"
|
#include "soh/SohGui/SohMenu.h"
|
||||||
#include "soh/SohGui/SohGui.hpp"
|
#include "soh/SohGui/SohGui.hpp"
|
||||||
#include "AudioCollection.h"
|
#include "AudioCollection.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
@@ -25,6 +25,23 @@ Vec3f pos = { 0.0f, 0.0f, 0.0f };
|
|||||||
f32 freqScale = 1.0f;
|
f32 freqScale = 1.0f;
|
||||||
s8 reverbAdd = 0;
|
s8 reverbAdd = 0;
|
||||||
|
|
||||||
|
using namespace UIWidgets;
|
||||||
|
|
||||||
|
static WidgetInfo lowHpAlarm;
|
||||||
|
static WidgetInfo naviCall;
|
||||||
|
static WidgetInfo enemyProx;
|
||||||
|
static WidgetInfo leadingMusic;
|
||||||
|
static WidgetInfo displaySeqName;
|
||||||
|
static WidgetInfo ovlDuration;
|
||||||
|
static WidgetInfo voicePitch;
|
||||||
|
static WidgetInfo randoMusicOnSceneChange;
|
||||||
|
static WidgetInfo randomAudioOnSeedGen;
|
||||||
|
static WidgetInfo lowerOctaves;
|
||||||
|
|
||||||
|
namespace SohGui {
|
||||||
|
extern std::shared_ptr<SohMenu> mSohMenu;
|
||||||
|
}
|
||||||
|
|
||||||
// Authentic sequence counts
|
// Authentic sequence counts
|
||||||
// used to ensure we have enough to shuffle
|
// used to ensure we have enough to shuffle
|
||||||
#define SEQ_COUNT_BGM_WORLD 30
|
#define SEQ_COUNT_BGM_WORLD 30
|
||||||
@@ -527,75 +544,22 @@ void AudioEditor::DrawElement() {
|
|||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
if (ImGui::BeginChild("SfxOptions", ImVec2(0, -8))) {
|
if (ImGui::BeginChild("SfxOptions", ImVec2(0, -8))) {
|
||||||
UIWidgets::CVarCheckbox(
|
SohGui::mSohMenu->MenuDrawItem(lowHpAlarm, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
"Mute Low HP Alarm", CVAR_AUDIO("LowHpAlarm"),
|
SohGui::mSohMenu->MenuDrawItem(naviCall, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
UIWidgets::CheckboxOptions().Color(THEME_COLOR).Tooltip("Disable the low HP beeping sound."));
|
SohGui::mSohMenu->MenuDrawItem(enemyProx, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
UIWidgets::CVarCheckbox("Disable Navi Call Audio", CVAR_AUDIO("DisableNaviCallAudio"),
|
SohGui::mSohMenu->MenuDrawItem(leadingMusic, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
UIWidgets::CheckboxOptions()
|
SohGui::mSohMenu->MenuDrawItem(displaySeqName, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
.Color(THEME_COLOR)
|
SohGui::mSohMenu->MenuDrawItem(ovlDuration, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
.Tooltip("Disables the voice audio when Navi calls you."));
|
SohGui::mSohMenu->MenuDrawItem(voicePitch, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
UIWidgets::CVarCheckbox(
|
|
||||||
"Disable Enemy Proximity Music", CVAR_AUDIO("EnemyBGMDisable"),
|
|
||||||
UIWidgets::CheckboxOptions()
|
|
||||||
.Color(THEME_COLOR)
|
|
||||||
.Tooltip("Disables the music change when getting close to enemies. Useful for hearing "
|
|
||||||
"your custom music for each scene more often."));
|
|
||||||
UIWidgets::CVarCheckbox(
|
|
||||||
"Disable Leading Music in Lost Woods", CVAR_AUDIO("LostWoodsConsistentVolume"),
|
|
||||||
UIWidgets::CheckboxOptions()
|
|
||||||
.Color(THEME_COLOR)
|
|
||||||
.Tooltip("Disables the volume shifting in the Lost Woods. Useful for hearing "
|
|
||||||
"your custom music in the Lost Woods if you don't need the navigation assitance "
|
|
||||||
"the volume changing provides. If toggling this while in the Lost Woods, reload "
|
|
||||||
"the area for the effect to kick in."));
|
|
||||||
UIWidgets::CVarCheckbox(
|
|
||||||
"Display Sequence Name on Overlay", CVAR_AUDIO("SeqNameOverlay"),
|
|
||||||
UIWidgets::CheckboxOptions()
|
|
||||||
.Color(THEME_COLOR)
|
|
||||||
.Tooltip("Displays the name of the current sequence in the corner of the screen whenever a new "
|
|
||||||
"sequence "
|
|
||||||
"is loaded to the main sequence player (does not apply to fanfares or enemy BGM)."));
|
|
||||||
UIWidgets::CVarSliderInt("Overlay Duration: %d seconds", CVAR_AUDIO("SeqNameOverlayDuration"),
|
|
||||||
UIWidgets::IntSliderOptions()
|
|
||||||
.Min(1)
|
|
||||||
.Max(10)
|
|
||||||
.DefaultValue(5)
|
|
||||||
.Size(ImVec2(300.0f, 0.0f))
|
|
||||||
.Color(THEME_COLOR));
|
|
||||||
UIWidgets::CVarSliderFloat("Link's voice pitch multiplier", CVAR_AUDIO("LinkVoiceFreqMultiplier"),
|
|
||||||
UIWidgets::FloatSliderOptions()
|
|
||||||
.IsPercentage()
|
|
||||||
.Min(0.4f)
|
|
||||||
.Max(2.5f)
|
|
||||||
.DefaultValue(1.0f)
|
|
||||||
.Size(ImVec2(300.0f, 0.0f))
|
|
||||||
.Color(THEME_COLOR));
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::SetCursorPosY(ImGui::GetCursorPos().y + 40.f);
|
ImGui::SetCursorPosY(ImGui::GetCursorPos().y + 40.f);
|
||||||
if (UIWidgets::Button("Reset##linkVoiceFreqMultiplier",
|
if (UIWidgets::Button("Reset##linkVoiceFreqMultiplier",
|
||||||
UIWidgets::ButtonOptions().Size(ImVec2(80, 36)).Padding(ImVec2(5.0f, 0.0f)))) {
|
UIWidgets::ButtonOptions().Size(ImVec2(80, 36)).Padding(ImVec2(5.0f, 0.0f)))) {
|
||||||
CVarSetFloat(CVAR_AUDIO("LinkVoiceFreqMultiplier"), 1.0f);
|
CVarSetFloat(CVAR_AUDIO("LinkVoiceFreqMultiplier"), 1.0f);
|
||||||
}
|
}
|
||||||
UIWidgets::CVarCheckbox(
|
SohGui::mSohMenu->MenuDrawItem(randoMusicOnSceneChange, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
"Randomize All Music and Sound Effects on New Scene", CVAR_AUDIO("RandomizeAllOnNewScene"),
|
SohGui::mSohMenu->MenuDrawItem(randomAudioOnSeedGen, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
UIWidgets::CheckboxOptions()
|
SohGui::mSohMenu->MenuDrawItem(lowerOctaves, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
.Color(THEME_COLOR)
|
|
||||||
.Tooltip(
|
|
||||||
"Enables randomizing all unlocked music and sound effects when you enter a new scene."));
|
|
||||||
UIWidgets::CVarCheckbox("Randomize All Music and Sound Effects on Randomizer Generation",
|
|
||||||
CVAR_AUDIO("RandomizeAllOnRandoGen"),
|
|
||||||
UIWidgets::CheckboxOptions()
|
|
||||||
.Color(THEME_COLOR)
|
|
||||||
.Tooltip("Enables randomizing all unlocked music and sound effects when "
|
|
||||||
"you generate a new randomizer."));
|
|
||||||
UIWidgets::CVarCheckbox(
|
|
||||||
"Lower Octaves of Unplayable High Notes", CVAR_AUDIO("ExperimentalOctaveDrop"),
|
|
||||||
UIWidgets::CheckboxOptions()
|
|
||||||
.Color(THEME_COLOR)
|
|
||||||
.Tooltip("Some custom sequences may have notes that are too high for the game's audio "
|
|
||||||
"engine to play. Enabling this checkbox will cause these notes to drop a "
|
|
||||||
"couple of octaves so they can still harmonize with the other notes of the "
|
|
||||||
"sequence."));
|
|
||||||
}
|
}
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
@@ -849,3 +813,86 @@ void AudioEditor_UnlockAll() {
|
|||||||
|
|
||||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RegisterAudioWidgets() {
|
||||||
|
lowHpAlarm = { .name = "Mute Low HP Alarm", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
lowHpAlarm.CVar(CVAR_AUDIO("LowHpAlarm"))
|
||||||
|
.Options(CheckboxOptions().Color(THEME_COLOR).Tooltip("Disable the low HP beeping sound."));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ lowHpAlarm, "Enhancements", "Audio Editor", "Audio Options" });
|
||||||
|
|
||||||
|
naviCall = { .name = "Disable Navi Call Audio", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
naviCall.CVar(CVAR_AUDIO("DisableNaviCallAudio"))
|
||||||
|
.Options(CheckboxOptions().Color(THEME_COLOR).Tooltip("Disables the voice audio when Navi calls you."));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ naviCall, "Enhancements", "Audio Editor", "Audio Options" });
|
||||||
|
|
||||||
|
enemyProx = { .name = "Disable Enemy Proximity Music", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
enemyProx.CVar(CVAR_AUDIO("EnemyBGMDisable"))
|
||||||
|
.Options(CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("Disables the music change when getting close to enemies. Useful for hearing "
|
||||||
|
"your custom music for each scene more often."));
|
||||||
|
|
||||||
|
leadingMusic = { .name = "Disable Leading Music in Lost Woods", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
leadingMusic.CVar(CVAR_AUDIO("LostWoodsConsistentVolume"))
|
||||||
|
.Options(CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("Disables the volume shifting in the Lost Woods. Useful for hearing "
|
||||||
|
"your custom music in the Lost Woods if you don't need the navigation assitance "
|
||||||
|
"the volume changing provides. If toggling this while in the Lost Woods, reload "
|
||||||
|
"the area for the effect to kick in."));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ leadingMusic, "Enhancements", "Audio Editor", "Audio Options" });
|
||||||
|
|
||||||
|
displaySeqName = { .name = "Display Sequence Name on Overlay", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
displaySeqName.CVar(CVAR_AUDIO("SeqNameOverlay"))
|
||||||
|
.Options(CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("Displays the name of the current sequence in the corner of the screen whenever a new "
|
||||||
|
"sequence "
|
||||||
|
"is loaded to the main sequence player (does not apply to fanfares or enemy BGM)."));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ displaySeqName, "Enhancements", "Audio Editor", "Audio Options" });
|
||||||
|
|
||||||
|
ovlDuration = { .name = "Overlay Duration: %d seconds", .type = WidgetType::WIDGET_CVAR_SLIDER_INT };
|
||||||
|
ovlDuration.CVar(CVAR_AUDIO("SeqNameOverlayDuration"))
|
||||||
|
.Options(IntSliderOptions().Color(THEME_COLOR).Min(1).Max(10).DefaultValue(5).Size(ImVec2(300.0f, 0.0f)));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ ovlDuration, "Enhancements", "Audio Editor", "Audio Options" });
|
||||||
|
|
||||||
|
voicePitch = { .name = "Link's Voice Pitch Multiplier", .type = WidgetType::WIDGET_CVAR_SLIDER_FLOAT };
|
||||||
|
voicePitch.CVar(CVAR_AUDIO("LinkVoiceFreqMultiplier"))
|
||||||
|
.Options(FloatSliderOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.IsPercentage()
|
||||||
|
.Min(0.4f)
|
||||||
|
.Max(2.5f)
|
||||||
|
.DefaultValue(1.0f)
|
||||||
|
.Size(ImVec2(300.0f, 0.0f)));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ voicePitch, "Enhancements", "Audio Editor", "Audio Options" });
|
||||||
|
|
||||||
|
randoMusicOnSceneChange = { .name = "Randomize All Music and Sound Effects on New Scene",
|
||||||
|
.type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
randoMusicOnSceneChange.CVar(CVAR_AUDIO("RandomizeAllOnNewScene"))
|
||||||
|
.Options(CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("Enables randomizing all unlocked music and sound effects when you enter a new scene."));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ randoMusicOnSceneChange, "Enhancements", "Audio Editor", "Audio Options" });
|
||||||
|
|
||||||
|
randomAudioOnSeedGen = { .name = "Randomize All Music and Sound Effects on Randomizer Generation",
|
||||||
|
.type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
randomAudioOnSeedGen.CVar(CVAR_AUDIO("RandomizeAllOnRandoGen"))
|
||||||
|
.Options(CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("Enables randomizing all unlocked music and sound effects when you generate a new "
|
||||||
|
"randomizer. Respects locks already in place."));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ randomAudioOnSeedGen, "Enhancements", "Audio Editor", "Audio Options" });
|
||||||
|
|
||||||
|
lowerOctaves = { .name = "Lower Octaves of Unplayable High Notes", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
lowerOctaves.CVar(CVAR_AUDIO("ExperimentalOctaveDrop"))
|
||||||
|
.Options(CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("Some custom sequences may have notes that are too high for the game's audio "
|
||||||
|
"engine to play. Enabling this checkbox will cause these notes to drop a "
|
||||||
|
"couple of octaves so they can still harmonize with the other notes of the "
|
||||||
|
"sequence."));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ lowerOctaves, "Enhancements", "Audio Editor", "Audio Options" });
|
||||||
|
}
|
||||||
|
|
||||||
|
static RegisterMenuInitFunc initAudioWidgets(RegisterAudioWidgets);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "SohInputEditorWindow.h"
|
#include "SohInputEditorWindow.h"
|
||||||
#include <utils/StringHelper.h>
|
#include <utils/StringHelper.h>
|
||||||
#include "soh/OTRGlobals.h"
|
#include "soh/OTRGlobals.h"
|
||||||
#include "soh/SohGui/UIWidgets.hpp"
|
#include "soh/SohGui/SohMenu.h"
|
||||||
#include "soh/SohGui/SohGui.hpp"
|
#include "soh/SohGui/SohGui.hpp"
|
||||||
#include "z64.h"
|
#include "z64.h"
|
||||||
#include "soh/cvar_prefixes.h"
|
#include "soh/cvar_prefixes.h"
|
||||||
@@ -13,6 +13,17 @@
|
|||||||
|
|
||||||
using namespace UIWidgets;
|
using namespace UIWidgets;
|
||||||
|
|
||||||
|
static WidgetInfo freeLook;
|
||||||
|
static WidgetInfo mouseControl;
|
||||||
|
static WidgetInfo rightStickOcarina;
|
||||||
|
static WidgetInfo dpadOcarina;
|
||||||
|
static WidgetInfo dpadPause;
|
||||||
|
static WidgetInfo dpadText;
|
||||||
|
|
||||||
|
namespace SohGui {
|
||||||
|
extern std::shared_ptr<SohMenu> mSohMenu;
|
||||||
|
}
|
||||||
|
|
||||||
SohInputEditorWindow::~SohInputEditorWindow() {
|
SohInputEditorWindow::~SohInputEditorWindow() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1321,8 +1332,8 @@ void SohInputEditorWindow::DrawOcarinaControlPanel() {
|
|||||||
ImGui::SetCursorPos(ImVec2(cursor.x, cursor.y + 5));
|
ImGui::SetCursorPos(ImVec2(cursor.x, cursor.y + 5));
|
||||||
|
|
||||||
CheckboxOptions checkOpt = CheckboxOptions().Color(THEME_COLOR);
|
CheckboxOptions checkOpt = CheckboxOptions().Color(THEME_COLOR);
|
||||||
CVarCheckbox("Dpad Ocarina Playback", CVAR_SETTING("CustomOcarina.Dpad"), checkOpt);
|
SohGui::mSohMenu->MenuDrawItem(dpadOcarina, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
CVarCheckbox("Right Stick Ocarina Playback", CVAR_SETTING("CustomOcarina.RightStick"), checkOpt);
|
SohGui::mSohMenu->MenuDrawItem(rightStickOcarina, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
CVarCheckbox("Customize Ocarina Controls", CVAR_SETTING("CustomOcarina.Enabled"), checkOpt);
|
CVarCheckbox("Customize Ocarina Controls", CVAR_SETTING("CustomOcarina.Enabled"), checkOpt);
|
||||||
|
|
||||||
if (!CVarGetInteger(CVAR_SETTING("CustomOcarina.Enabled"), 0)) {
|
if (!CVarGetInteger(CVAR_SETTING("CustomOcarina.Enabled"), 0)) {
|
||||||
@@ -1354,12 +1365,8 @@ void SohInputEditorWindow::DrawOcarinaControlPanel() {
|
|||||||
void SohInputEditorWindow::DrawCameraControlPanel() {
|
void SohInputEditorWindow::DrawCameraControlPanel() {
|
||||||
ImVec2 cursor = ImGui::GetCursorPos();
|
ImVec2 cursor = ImGui::GetCursorPos();
|
||||||
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
|
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
|
||||||
CVarCheckbox(
|
SohGui::mSohMenu->MenuDrawItem(mouseControl, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
"Enable Mouse Controls", CVAR_SETTING("EnableMouse"),
|
|
||||||
CheckboxOptions()
|
|
||||||
.Color(THEME_COLOR)
|
|
||||||
.Tooltip("Allows for using the mouse to control the camera (must enable Free Look), "
|
|
||||||
"aim with the shield, and perform quickspin attacks (quickly rotate the mouse then press B)"));
|
|
||||||
Ship::GuiWindow::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail());
|
Ship::GuiWindow::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail());
|
||||||
CVarCheckbox("Right Stick Aiming", CVAR_SETTING("Controls.RightStickAim"),
|
CVarCheckbox("Right Stick Aiming", CVAR_SETTING("Controls.RightStickAim"),
|
||||||
CheckboxOptions()
|
CheckboxOptions()
|
||||||
@@ -1427,14 +1434,7 @@ void SohInputEditorWindow::DrawCameraControlPanel() {
|
|||||||
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
|
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
|
||||||
Ship::GuiWindow::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail());
|
Ship::GuiWindow::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail());
|
||||||
|
|
||||||
CVarCheckbox(
|
SohGui::mSohMenu->MenuDrawItem(freeLook, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
"Free Look", CVAR_SETTING("FreeLook.Enabled"),
|
|
||||||
CheckboxOptions()
|
|
||||||
.Color(THEME_COLOR)
|
|
||||||
.Tooltip("Enables free look camera control\nNote: You must remap C buttons off of the right stick in the "
|
|
||||||
"controller config menu, and map the camera stick to the right stick.\n"
|
|
||||||
"Doesn't work in areas were the game locks the camera.\n"
|
|
||||||
"Scene reload may be necessary to enable."));
|
|
||||||
CVarCheckbox("Invert Camera X Axis", CVAR_SETTING("FreeLook.InvertXAxis"),
|
CVarCheckbox("Invert Camera X Axis", CVAR_SETTING("FreeLook.InvertXAxis"),
|
||||||
CheckboxOptions().Color(THEME_COLOR).Tooltip("Inverts the Camera X Axis in:\n-Free look"));
|
CheckboxOptions().Color(THEME_COLOR).Tooltip("Inverts the Camera X Axis in:\n-Free look"));
|
||||||
CVarCheckbox(
|
CVarCheckbox(
|
||||||
@@ -1467,16 +1467,8 @@ void SohInputEditorWindow::DrawDpadControlPanel() {
|
|||||||
ImVec2 cursor = ImGui::GetCursorPos();
|
ImVec2 cursor = ImGui::GetCursorPos();
|
||||||
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
|
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
|
||||||
Ship::GuiWindow::BeginGroupPanel("D-Pad Options", ImGui::GetContentRegionAvail());
|
Ship::GuiWindow::BeginGroupPanel("D-Pad Options", ImGui::GetContentRegionAvail());
|
||||||
CVarCheckbox("D-pad Support on Pause Screen", CVAR_SETTING("DPadOnPause"),
|
SohGui::mSohMenu->MenuDrawItem(dpadPause, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
CheckboxOptions()
|
SohGui::mSohMenu->MenuDrawItem(dpadText, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
.Color(THEME_COLOR)
|
|
||||||
.Tooltip("Navigate Pause with the D-pad\nIf used with \"D-pad as Equip Items\", you must hold "
|
|
||||||
"C-Up to equip instead of navigate"));
|
|
||||||
CVarCheckbox("D-pad Support in Text Boxes", CVAR_SETTING("DpadInText"),
|
|
||||||
CheckboxOptions()
|
|
||||||
.Color(THEME_COLOR)
|
|
||||||
.Tooltip("Navigate choices in text boxes, shop item selection, and the file select / name entry "
|
|
||||||
"screens with the D-pad"));
|
|
||||||
|
|
||||||
if (!CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0) && !CVarGetInteger(CVAR_SETTING("DpadInText"), 0)) {
|
if (!CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0) && !CVarGetInteger(CVAR_SETTING("DpadInText"), 0)) {
|
||||||
ImGui::BeginDisabled();
|
ImGui::BeginDisabled();
|
||||||
@@ -1902,3 +1894,52 @@ void SohInputEditorWindow::DrawElement() {
|
|||||||
ImGui::PopStyleColor(3);
|
ImGui::PopStyleColor(3);
|
||||||
ImGui::PopFont();
|
ImGui::PopFont();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RegisterInputEditorWidgets() {
|
||||||
|
dpadOcarina = { .name = "Dpad Ocarina Playback", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
dpadOcarina.CVar(CVAR_SETTING("CustomOcarina.Dpad")).Options(CheckboxOptions().Color(THEME_COLOR));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ dpadOcarina, "Settings", "Controls", "Ocarina Controls", "" });
|
||||||
|
|
||||||
|
freeLook = { .name = "Free Look", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
freeLook.CVar(CVAR_SETTING("FreeLook.Enabled"))
|
||||||
|
.Options(
|
||||||
|
CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip(
|
||||||
|
"Enables free look camera control\nNote: You must remap C buttons off of the right stick in the "
|
||||||
|
"controller config menu, and map the camera stick to the right stick.\n"
|
||||||
|
"Doesn't work in areas were the game locks the camera.\n"
|
||||||
|
"Scene reload may be necessary to enable."));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ freeLook, "Settings", "Controls", "Camera Controls" });
|
||||||
|
|
||||||
|
mouseControl = { .name = "Enable Mouse Controls", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
mouseControl.CVar(CVAR_SETTING("EnableMouse"))
|
||||||
|
.Options(
|
||||||
|
CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("Allows for using the mouse to control the camera (must enable Free Look), "
|
||||||
|
"aim with the shield, and perform quickspin attacks (quickly rotate the mouse then press B)"));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ mouseControl, "Settings", "Controls", "Camera Controls" });
|
||||||
|
|
||||||
|
rightStickOcarina = { .name = "Right Stick Ocarina Playback", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
rightStickOcarina.CVar(CVAR_SETTING("CustomOcarina.RightStick")).Options(CheckboxOptions().Color(THEME_COLOR));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ rightStickOcarina, "Settings", "Controls", "Ocarina Controls" });
|
||||||
|
|
||||||
|
dpadPause = { .name = "D-pad Support on Pause Screen", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
dpadPause.CVar(CVAR_SETTING("DPadOnPause"))
|
||||||
|
.Options(CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("Navigate Pause with the D-pad\nIf used with \"D-pad as Equip Items\", you must hold "
|
||||||
|
"C-Up to equip instead of navigate"));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ dpadPause, "Settings", "Controls", "Dpad Controls" });
|
||||||
|
|
||||||
|
dpadText = { .name = "D-pad Support in Text Boxes", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
dpadText.CVar(CVAR_SETTING("DpadInText"))
|
||||||
|
.Options(CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("Navigate choices in text boxes, shop item selection, and the file select / name entry "
|
||||||
|
"screens with the D-pad"));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ dpadText, "Settings", "Controls", "Dpad Controls" });
|
||||||
|
}
|
||||||
|
|
||||||
|
static RegisterMenuInitFunc initInputWidgets(RegisterInputEditorWidgets);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "soh/ResourceManagerHelpers.h"
|
#include "soh/ResourceManagerHelpers.h"
|
||||||
#include "soh/SohGui/UIWidgets.hpp"
|
#include "soh/SohGui/UIWidgets.hpp"
|
||||||
#include "soh/SohGui/SohGui.hpp"
|
#include "soh/SohGui/SohGui.hpp"
|
||||||
|
#include "soh/SohGui/SohMenu.h"
|
||||||
#include "dungeon.h"
|
#include "dungeon.h"
|
||||||
#include "entrance.h"
|
#include "entrance.h"
|
||||||
#include "location_access.h"
|
#include "location_access.h"
|
||||||
@@ -39,9 +40,21 @@ extern std::vector<ItemTrackerItem> dungeonRewardMedallions;
|
|||||||
extern std::vector<ItemTrackerItem> songItems;
|
extern std::vector<ItemTrackerItem> songItems;
|
||||||
extern std::vector<ItemTrackerItem> equipmentItems;
|
extern std::vector<ItemTrackerItem> equipmentItems;
|
||||||
|
|
||||||
|
namespace SohGui {
|
||||||
|
extern std::shared_ptr<SohMenu> mSohMenu;
|
||||||
|
}
|
||||||
|
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
|
using namespace UIWidgets;
|
||||||
|
|
||||||
namespace CheckTracker {
|
namespace CheckTracker {
|
||||||
|
static WidgetInfo backgroundColorWidget;
|
||||||
|
static WidgetInfo windowTypeWidget;
|
||||||
|
static WidgetInfo dungeonSpoilerWidget;
|
||||||
|
static WidgetInfo hideUnshuffledShopWidget;
|
||||||
|
static WidgetInfo showGSWidget;
|
||||||
|
static WidgetInfo showLogicWidget;
|
||||||
|
static WidgetInfo checkAvailabilityWidget;
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
bool showShops;
|
bool showShops;
|
||||||
@@ -936,43 +949,6 @@ void SetAreaSpoiled(RandomizerCheckArea rcArea) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CheckTrackerWindow::DrawElement() {
|
void CheckTrackerWindow::DrawElement() {
|
||||||
Color_Background = CVarGetColor(CVAR_TRACKER_CHECK("BgColor.Value"), Color_Bg_Default);
|
|
||||||
Color_Area_Incomplete_Main = CVarGetColor(CVAR_TRACKER_CHECK("AreaIncomplete.MainColor.Value"), Color_Main_Default);
|
|
||||||
Color_Area_Incomplete_Extra =
|
|
||||||
CVarGetColor(CVAR_TRACKER_CHECK("AreaIncomplete.ExtraColor.Value"), Color_Area_Incomplete_Extra_Default);
|
|
||||||
Color_Area_Complete_Main = CVarGetColor(CVAR_TRACKER_CHECK("AreaComplete.MainColor.Value"), Color_Main_Default);
|
|
||||||
Color_Area_Complete_Extra =
|
|
||||||
CVarGetColor(CVAR_TRACKER_CHECK("AreaComplete.ExtraColor.Value"), Color_Area_Complete_Extra_Default);
|
|
||||||
Color_Unchecked_Main = CVarGetColor(CVAR_TRACKER_CHECK("Unchecked.MainColor.Value"), Color_Main_Default);
|
|
||||||
Color_Unchecked_Extra =
|
|
||||||
CVarGetColor(CVAR_TRACKER_CHECK("Unchecked.ExtraColor.Value"), Color_Unchecked_Extra_Default);
|
|
||||||
Color_Skipped_Main = CVarGetColor(CVAR_TRACKER_CHECK("Skipped.MainColor.Value"), Color_Main_Default);
|
|
||||||
Color_Skipped_Extra = CVarGetColor(CVAR_TRACKER_CHECK("Skipped.ExtraColor.Value"), Color_Skipped_Extra_Default);
|
|
||||||
Color_Seen_Main = CVarGetColor(CVAR_TRACKER_CHECK("Seen.MainColor.Value"), Color_Main_Default);
|
|
||||||
Color_Seen_Extra = CVarGetColor(CVAR_TRACKER_CHECK("Seen.ExtraColor.Value"), Color_Seen_Extra_Default);
|
|
||||||
Color_Hinted_Main = CVarGetColor(CVAR_TRACKER_CHECK("Hinted.MainColor.Value"), Color_Main_Default);
|
|
||||||
Color_Hinted_Extra = CVarGetColor(CVAR_TRACKER_CHECK("Hinted.ExtraColor.Value"), Color_Hinted_Extra_Default);
|
|
||||||
Color_Collected_Main = CVarGetColor(CVAR_TRACKER_CHECK("Collected.MainColor.Value"), Color_Main_Default);
|
|
||||||
Color_Collected_Extra =
|
|
||||||
CVarGetColor(CVAR_TRACKER_CHECK("Collected.ExtraColor.Value"), Color_Collected_Extra_Default);
|
|
||||||
Color_Scummed_Main = CVarGetColor(CVAR_TRACKER_CHECK("Scummed.MainColor.Value"), Color_Main_Default);
|
|
||||||
Color_Scummed_Extra = CVarGetColor(CVAR_TRACKER_CHECK("Scummed.ExtraColor.Value"), Color_Scummed_Extra_Default);
|
|
||||||
Color_Saved_Main = CVarGetColor(CVAR_TRACKER_CHECK("Saved.MainColor.Value"), Color_Main_Default);
|
|
||||||
Color_Saved_Extra = CVarGetColor(CVAR_TRACKER_CHECK("Saved.ExtraColor.Value"), Color_Saved_Extra_Default);
|
|
||||||
hideUnchecked = CVarGetInteger(CVAR_TRACKER_CHECK("Unchecked.Hide"), 0);
|
|
||||||
hideScummed = CVarGetInteger(CVAR_TRACKER_CHECK("Scummed.Hide"), 0);
|
|
||||||
hideSeen = CVarGetInteger(CVAR_TRACKER_CHECK("Seen.Hide"), 0);
|
|
||||||
hideSkipped = CVarGetInteger(CVAR_TRACKER_CHECK("Skipped.Hide"), 0);
|
|
||||||
hideSaved = CVarGetInteger(CVAR_TRACKER_CHECK("Saved.Hide"), 0);
|
|
||||||
hideCollected = CVarGetInteger(CVAR_TRACKER_CHECK("Collected.Hide"), 0);
|
|
||||||
showHidden = CVarGetInteger(CVAR_TRACKER_CHECK("ShowHidden"), 0);
|
|
||||||
mystery = CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0);
|
|
||||||
showLogicTooltip = CVarGetInteger(CVAR_TRACKER_CHECK("ShowLogic"), 0);
|
|
||||||
enableAvailableChecks = CVarGetInteger(CVAR_TRACKER_CHECK("EnableAvailableChecks"), 0);
|
|
||||||
onlyShowAvailable = CVarGetInteger(CVAR_TRACKER_CHECK("OnlyShowAvailable"), 0);
|
|
||||||
|
|
||||||
hideShopUnshuffledChecks = CVarGetInteger(CVAR_TRACKER_CHECK("HideUnshuffledShopChecks"), 0);
|
|
||||||
alwaysShowGS = CVarGetInteger(CVAR_TRACKER_CHECK("AlwaysShowGSLocs"), 0);
|
|
||||||
if (CVarGetInteger(CVAR_TRACKER_CHECK("WindowType"), TRACKER_WINDOW_WINDOW) == TRACKER_WINDOW_FLOATING) {
|
if (CVarGetInteger(CVAR_TRACKER_CHECK("WindowType"), TRACKER_WINDOW_WINDOW) == TRACKER_WINDOW_FLOATING) {
|
||||||
if (CVarGetInteger(CVAR_TRACKER_CHECK("ShowOnlyPaused"), 0) &&
|
if (CVarGetInteger(CVAR_TRACKER_CHECK("ShowOnlyPaused"), 0) &&
|
||||||
(gPlayState == nullptr || gPlayState->pauseCtx.state == 0)) {
|
(gPlayState == nullptr || gPlayState->pauseCtx.state == 0)) {
|
||||||
@@ -2089,22 +2065,14 @@ void CheckTrackerSettingsWindow::DrawElement() {
|
|||||||
ImGui::TableHeadersRow();
|
ImGui::TableHeadersRow();
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
|
SohGui::mSohMenu->MenuDrawItem(backgroundColorWidget, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
UIWidgets::CVarColorPicker("BG Color", CVAR_TRACKER_CHECK("BgColor"), Color_Bg_Default, true,
|
|
||||||
UIWidgets::ColorPickerResetButton | UIWidgets::ColorPickerRandomButton, THEME_COLOR);
|
|
||||||
ImGui::PopItemWidth();
|
|
||||||
|
|
||||||
UIWidgets::CVarCombobox("Window Type", CVAR_TRACKER_CHECK("WindowType"), windowType,
|
SohGui::mSohMenu->MenuDrawItem(windowTypeWidget, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
UIWidgets::ComboboxOptions()
|
|
||||||
.LabelPosition(UIWidgets::LabelPositions::Far)
|
|
||||||
.ComponentAlignment(UIWidgets::ComponentAlignments::Right)
|
|
||||||
.Color(THEME_COLOR)
|
|
||||||
.DefaultIndex(TRACKER_WINDOW_WINDOW));
|
|
||||||
|
|
||||||
if (CVarGetInteger(CVAR_TRACKER_CHECK("WindowType"), TRACKER_WINDOW_WINDOW) == TRACKER_WINDOW_FLOATING) {
|
if (CVarGetInteger(CVAR_TRACKER_CHECK("WindowType"), TRACKER_WINDOW_WINDOW) == TRACKER_WINDOW_FLOATING) {
|
||||||
UIWidgets::CVarCheckbox("Enable Dragging", CVAR_TRACKER_CHECK("Draggable"),
|
UIWidgets::CVarCheckbox("Enable Dragging", CVAR_TRACKER_CHECK("Draggable"),
|
||||||
UIWidgets::CheckboxOptions().Color(THEME_COLOR));
|
UIWidgets::CheckboxOptions().Color(THEME_COLOR));
|
||||||
UIWidgets::CVarCheckbox("Only enable while paused", CVAR_TRACKER_CHECK("ShowOnlyPaused"),
|
UIWidgets::CVarCheckbox("Only Enable While Paused", CVAR_TRACKER_CHECK("ShowOnlyPaused"),
|
||||||
UIWidgets::CheckboxOptions().Color(THEME_COLOR));
|
UIWidgets::CheckboxOptions().Color(THEME_COLOR));
|
||||||
UIWidgets::CVarCombobox("Display Mode", CVAR_TRACKER_CHECK("DisplayType"), displayType,
|
UIWidgets::CVarCombobox("Display Mode", CVAR_TRACKER_CHECK("DisplayType"), displayType,
|
||||||
UIWidgets::ComboboxOptions()
|
UIWidgets::ComboboxOptions()
|
||||||
@@ -2129,41 +2097,17 @@ void CheckTrackerSettingsWindow::DrawElement() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
|
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
|
||||||
UIWidgets::CVarCheckbox("Vanilla/MQ Dungeon Spoilers", CVAR_TRACKER_CHECK("MQSpoilers"),
|
SohGui::mSohMenu->MenuDrawItem(dungeonSpoilerWidget, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
UIWidgets::CheckboxOptions()
|
|
||||||
.Tooltip("If enabled, Vanilla/MQ dungeons will show on the tracker immediately. "
|
|
||||||
"Otherwise, Vanilla/MQ dungeon locations must be unlocked.")
|
|
||||||
.Color(THEME_COLOR));
|
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
if (UIWidgets::CVarCheckbox(
|
|
||||||
"Hide unshuffled shop item checks", CVAR_TRACKER_CHECK("HideUnshuffledShopChecks"),
|
SohGui::mSohMenu->MenuDrawItem(hideUnshuffledShopWidget, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
UIWidgets::CheckboxOptions()
|
|
||||||
.Tooltip("If enabled, will prevent the tracker from displaying slots with non-shop-item shuffles.")
|
SohGui::mSohMenu->MenuDrawItem(showGSWidget, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
.Color(THEME_COLOR))) {
|
|
||||||
hideShopUnshuffledChecks = CVarGetInteger(CVAR_TRACKER_CHECK("HideUnshuffledShopChecks"), 0);
|
SohGui::mSohMenu->MenuDrawItem(showLogicWidget, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
UpdateFilters();
|
|
||||||
}
|
|
||||||
if (UIWidgets::CVarCheckbox(
|
|
||||||
"Always show gold skulltulas", CVAR_TRACKER_CHECK("AlwaysShowGSLocs"),
|
|
||||||
UIWidgets::CheckboxOptions()
|
|
||||||
.Tooltip("If enabled, will show GS locations in the tracker regardless of tokensanity settings.")
|
|
||||||
.Color(THEME_COLOR))) {
|
|
||||||
alwaysShowGS = !alwaysShowGS;
|
|
||||||
UpdateFilters();
|
|
||||||
}
|
|
||||||
UIWidgets::CVarCheckbox("Show Logic", CVAR_TRACKER_CHECK("ShowLogic"),
|
|
||||||
UIWidgets::CheckboxOptions()
|
|
||||||
.Tooltip("If enabled, will show a check's logic when hovering over it.")
|
|
||||||
.Color(THEME_COLOR));
|
|
||||||
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
|
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
|
||||||
if (UIWidgets::CVarCheckbox("Enable Available Checks", CVAR_TRACKER_CHECK("EnableAvailableChecks"),
|
SohGui::mSohMenu->MenuDrawItem(checkAvailabilityWidget, ImGui::GetContentRegionAvail().x, THEME_COLOR);
|
||||||
UIWidgets::CheckboxOptions()
|
|
||||||
.Tooltip("If enabled, will show the checks that are available to be collected "
|
|
||||||
"with your current progress.")
|
|
||||||
.Color(THEME_COLOR))) {
|
|
||||||
enableAvailableChecks = CVarGetInteger(CVAR_TRACKER_CHECK("EnableAvailableChecks"), 0);
|
|
||||||
RecalculateAvailableChecks();
|
|
||||||
}
|
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
|
|
||||||
// Filtering settings
|
// Filtering settings
|
||||||
@@ -2240,4 +2184,74 @@ void CheckTrackerWindow::InitElement() {
|
|||||||
|
|
||||||
void CheckTrackerWindow::UpdateElement() {
|
void CheckTrackerWindow::UpdateElement() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RegisterCheckTrackerWidgets() {
|
||||||
|
backgroundColorWidget = { .name = "Background Color##CheckTrackerBgColor",
|
||||||
|
.type = WidgetType::WIDGET_CVAR_COLOR_PICKER };
|
||||||
|
backgroundColorWidget.CVar(CVAR_TRACKER_ITEM("BgColor"))
|
||||||
|
.Options(
|
||||||
|
ColorPickerOptions().Color(THEME_COLOR).DefaultValue(Color_Bg_Default).UseAlpha().ShowReset().ShowRandom());
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ backgroundColorWidget, "Randomizer", "Check Tracker", "General Settings" });
|
||||||
|
|
||||||
|
windowTypeWidget = { .name = "Window Type", .type = WidgetType::WIDGET_CVAR_COMBOBOX };
|
||||||
|
windowTypeWidget.CVar(CVAR_TRACKER_ITEM("WindowType"))
|
||||||
|
.Options(ComboboxOptions()
|
||||||
|
.DefaultIndex(TRACKER_WINDOW_WINDOW)
|
||||||
|
.ComponentAlignment(ComponentAlignments::Right)
|
||||||
|
.LabelPosition(LabelPositions::Far)
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.ComboMap(windowType));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ windowTypeWidget, "Randomizer", "Check Tracker", "General Settings" });
|
||||||
|
|
||||||
|
dungeonSpoilerWidget = { .name = "Vanilla/MQ Dungeon Spoilers", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
dungeonSpoilerWidget.CVar(CVAR_TRACKER_CHECK("MQSpoilers"))
|
||||||
|
.Options(CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("If enabled, Vanilla/MQ dungeons will show on the tracker immediately. "
|
||||||
|
"Otherwise, Vanilla/MQ dungeon locations must be unlocked."));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ dungeonSpoilerWidget, "Randomizer", "Check Tracker", "General Settings" });
|
||||||
|
|
||||||
|
hideUnshuffledShopWidget = { .name = "Hide Unshuffled Shop Item Checks", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
hideUnshuffledShopWidget.CVar(CVAR_TRACKER_CHECK("HideUnshuffledShopChecks"))
|
||||||
|
.Options(
|
||||||
|
CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("If enabled, will prevent the tracker from displaying slots with non-shop-item shuffles."))
|
||||||
|
.Callback([&](WidgetInfo& info) {
|
||||||
|
hideShopUnshuffledChecks = CVarGetInteger(CVAR_TRACKER_CHECK("HideUnshuffledShopChecks"), 0);
|
||||||
|
UpdateFilters();
|
||||||
|
});
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ hideUnshuffledShopWidget, "Randomizer", "Check Tracker", "General Settings" });
|
||||||
|
|
||||||
|
showGSWidget = { .name = "Always Show Gold Skulltulas", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
showGSWidget.CVar(CVAR_TRACKER_CHECK("AlwaysShowGSLocs"))
|
||||||
|
.Options(CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("If enabled, will show GS locations in the tracker regardless of tokensanity settings."))
|
||||||
|
.Callback([&](WidgetInfo& info) {
|
||||||
|
alwaysShowGS = !alwaysShowGS;
|
||||||
|
UpdateFilters();
|
||||||
|
});
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ showGSWidget, "Randomizer", "Check Tracker", "General Settings" });
|
||||||
|
|
||||||
|
showLogicWidget = { .name = "Show Logic", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
showLogicWidget.CVar(CVAR_TRACKER_CHECK("ShowLogic"))
|
||||||
|
.Options(CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("If enabled, will show a check's logic when hovering over it."));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ showLogicWidget, "Randomizer", "Check Tracker", "General Settings" });
|
||||||
|
|
||||||
|
checkAvailabilityWidget = { .name = "Enable Available Checks", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
checkAvailabilityWidget.CVar(CVAR_TRACKER_CHECK("EnableAvailableChecks"))
|
||||||
|
.Options(CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("If enabled, will show the checks that are available to be collected "
|
||||||
|
"with your current progress."))
|
||||||
|
.Callback([&](WidgetInfo& info) {
|
||||||
|
enableAvailableChecks = CVarGetInteger(CVAR_TRACKER_CHECK("EnableAvailableChecks"), 0);
|
||||||
|
RecalculateAvailableChecks();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static RegisterMenuInitFunc initCheckTrackerWidgets(RegisterCheckTrackerWidgets);
|
||||||
} // namespace CheckTracker
|
} // namespace CheckTracker
|
||||||
|
|||||||
@@ -1,20 +1,22 @@
|
|||||||
#include "randomizer_item_tracker.h"
|
#include <algorithm>
|
||||||
#include "soh/util.h"
|
|
||||||
#include "soh/OTRGlobals.h"
|
|
||||||
#include "soh/cvar_prefixes.h"
|
|
||||||
#include "soh/SaveManager.h"
|
|
||||||
#include "soh/ResourceManagerHelpers.h"
|
|
||||||
#include "soh/SohGui/UIWidgets.hpp"
|
|
||||||
#include "soh/SohGui/SohGui.hpp"
|
|
||||||
#include "randomizerTypes.h"
|
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <libultraship/libultraship.h>
|
#include <libultraship/libultraship.h>
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
|
||||||
#include "randomizer_check_tracker.h"
|
#include "randomizer_check_tracker.h"
|
||||||
#include <algorithm>
|
#include "randomizer_item_tracker.h"
|
||||||
|
#include "randomizerTypes.h"
|
||||||
|
#include "soh/cvar_prefixes.h"
|
||||||
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
|
#include "soh/OTRGlobals.h"
|
||||||
|
#include "soh/ResourceManagerHelpers.h"
|
||||||
|
#include "soh/SaveManager.h"
|
||||||
|
#include "soh/SohGui/SohGui.hpp"
|
||||||
|
#include "soh/SohGui/SohMenu.h"
|
||||||
|
#include "soh/SohGui/UIWidgets.hpp"
|
||||||
|
#include "soh/util.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <z64.h>
|
#include <z64.h>
|
||||||
@@ -42,6 +44,27 @@ bool shouldUpdateVectors = true;
|
|||||||
|
|
||||||
std::vector<ItemTrackerItem> mainWindowItems = {};
|
std::vector<ItemTrackerItem> mainWindowItems = {};
|
||||||
|
|
||||||
|
static WidgetInfo backgroundColor;
|
||||||
|
static WidgetInfo windowTypeWidget;
|
||||||
|
static WidgetInfo enableDraggingWidget;
|
||||||
|
static WidgetInfo onlyPausedWidget;
|
||||||
|
static WidgetInfo ammoTracking;
|
||||||
|
static WidgetInfo keyTracking;
|
||||||
|
static WidgetInfo triforcePieceCount;
|
||||||
|
static WidgetInfo dungeonItemTracking;
|
||||||
|
static WidgetInfo gregTracking;
|
||||||
|
static WidgetInfo triforcePieceTracking;
|
||||||
|
static WidgetInfo bossSoulsTracking;
|
||||||
|
static WidgetInfo ocarinaButtonTracking;
|
||||||
|
static WidgetInfo overworldKeysTracking;
|
||||||
|
static WidgetInfo fishingPoleTracking;
|
||||||
|
static WidgetInfo personalNotesWiget;
|
||||||
|
static WidgetInfo hookshotIdentWidget;
|
||||||
|
|
||||||
|
namespace SohGui {
|
||||||
|
extern std::shared_ptr<SohMenu> mSohMenu;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<ItemTrackerItem> inventoryItems = {
|
std::vector<ItemTrackerItem> inventoryItems = {
|
||||||
ITEM_TRACKER_ITEM(ITEM_STICK, 0, DrawItem), ITEM_TRACKER_ITEM(ITEM_NUT, 0, DrawItem),
|
ITEM_TRACKER_ITEM(ITEM_STICK, 0, DrawItem), ITEM_TRACKER_ITEM(ITEM_NUT, 0, DrawItem),
|
||||||
ITEM_TRACKER_ITEM(ITEM_BOMB, 0, DrawItem), ITEM_TRACKER_ITEM(ITEM_BOW, 0, DrawItem),
|
ITEM_TRACKER_ITEM(ITEM_BOMB, 0, DrawItem), ITEM_TRACKER_ITEM(ITEM_BOW, 0, DrawItem),
|
||||||
@@ -1764,24 +1787,15 @@ void ItemTrackerSettingsWindow::DrawElement() {
|
|||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
|
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
|
||||||
CVarColorPicker("Background Color##gItemTrackerBgColor", CVAR_TRACKER_ITEM("BgColor"), { 0, 0, 0, 0 }, true,
|
SohGui::mSohMenu->MenuDrawItem(backgroundColor, 250, THEME_COLOR);
|
||||||
ColorPickerRandomButton | ColorPickerResetButton, THEME_COLOR);
|
|
||||||
|
|
||||||
ImGui::PopItemWidth();
|
ImGui::PopItemWidth();
|
||||||
if (CVarCombobox("Window Type", CVAR_TRACKER_ITEM("WindowType"), windowTypes,
|
SohGui::mSohMenu->MenuDrawItem(windowTypeWidget, 250, THEME_COLOR);
|
||||||
ComboboxOptions()
|
|
||||||
.DefaultIndex(TRACKER_WINDOW_FLOATING)
|
|
||||||
.ComponentAlignment(ComponentAlignments::Right)
|
|
||||||
.LabelPosition(LabelPositions::Far)
|
|
||||||
.Color(THEME_COLOR))) {
|
|
||||||
shouldUpdateVectors = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CVarGetInteger(CVAR_TRACKER_ITEM("WindowType"), TRACKER_WINDOW_FLOATING) == TRACKER_WINDOW_FLOATING) {
|
if (CVarGetInteger(CVAR_TRACKER_ITEM("WindowType"), TRACKER_WINDOW_FLOATING) == TRACKER_WINDOW_FLOATING) {
|
||||||
if (CVarCheckbox("Enable Dragging", CVAR_TRACKER_ITEM("Draggable"), CheckboxOptions().Color(THEME_COLOR))) {
|
if (CVarCheckbox("Enable Dragging", CVAR_TRACKER_ITEM("Draggable"), CheckboxOptions().Color(THEME_COLOR))) {
|
||||||
shouldUpdateVectors = true;
|
shouldUpdateVectors = true;
|
||||||
}
|
}
|
||||||
if (CVarCheckbox("Only enable while paused", CVAR_TRACKER_ITEM("ShowOnlyPaused"),
|
if (CVarCheckbox("Only Enable While Paused", CVAR_TRACKER_ITEM("ShowOnlyPaused"),
|
||||||
CheckboxOptions().Color(THEME_COLOR))) {
|
CheckboxOptions().Color(THEME_COLOR))) {
|
||||||
shouldUpdateVectors = true;
|
shouldUpdateVectors = true;
|
||||||
}
|
}
|
||||||
@@ -1822,14 +1836,7 @@ void ItemTrackerSettingsWindow::DrawElement() {
|
|||||||
IntSliderOptions().Min(1).Max(30).DefaultValue(13).Color(THEME_COLOR));
|
IntSliderOptions().Min(1).Max(30).DefaultValue(13).Color(THEME_COLOR));
|
||||||
|
|
||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
CVarCombobox("Ammo/Capacity Tracking", CVAR_TRACKER_ITEM("ItemCountType"), itemTrackerCapacityTrackOptions,
|
SohGui::mSohMenu->MenuDrawItem(ammoTracking, 250, THEME_COLOR);
|
||||||
ComboboxOptions()
|
|
||||||
.DefaultIndex(ITEM_TRACKER_NUMBER_CURRENT_CAPACITY_ONLY)
|
|
||||||
.ComponentAlignment(ComponentAlignments::Left)
|
|
||||||
.LabelPosition(LabelPositions::Above)
|
|
||||||
.Color(THEME_COLOR)
|
|
||||||
.Tooltip("Customize what the numbers under each item are tracking."
|
|
||||||
"\n\nNote: items without capacity upgrades will track ammo even in capacity mode"));
|
|
||||||
if (CVarGetInteger(CVAR_TRACKER_ITEM("ItemCountType"), ITEM_TRACKER_NUMBER_CURRENT_CAPACITY_ONLY) ==
|
if (CVarGetInteger(CVAR_TRACKER_ITEM("ItemCountType"), ITEM_TRACKER_NUMBER_CURRENT_CAPACITY_ONLY) ==
|
||||||
ITEM_TRACKER_NUMBER_CURRENT_CAPACITY_ONLY ||
|
ITEM_TRACKER_NUMBER_CURRENT_CAPACITY_ONLY ||
|
||||||
CVarGetInteger(CVAR_TRACKER_ITEM("ItemCountType"), ITEM_TRACKER_NUMBER_CURRENT_CAPACITY_ONLY) ==
|
CVarGetInteger(CVAR_TRACKER_ITEM("ItemCountType"), ITEM_TRACKER_NUMBER_CURRENT_CAPACITY_ONLY) ==
|
||||||
@@ -1840,22 +1847,8 @@ void ItemTrackerSettingsWindow::DrawElement() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CVarCombobox("Key Count Tracking", CVAR_TRACKER_ITEM("KeyCounts"), itemTrackerKeyTrackOptions,
|
SohGui::mSohMenu->MenuDrawItem(keyTracking, 250, THEME_COLOR);
|
||||||
ComboboxOptions()
|
SohGui::mSohMenu->MenuDrawItem(triforcePieceCount, 250, THEME_COLOR);
|
||||||
.DefaultIndex(KEYS_COLLECTED_MAX)
|
|
||||||
.ComponentAlignment(ComponentAlignments::Left)
|
|
||||||
.LabelPosition(LabelPositions::Above)
|
|
||||||
.Color(THEME_COLOR)
|
|
||||||
.Tooltip("Customize what numbers are shown for key tracking."));
|
|
||||||
|
|
||||||
CVarCombobox("Triforce Piece Count Tracking", CVAR_TRACKER_ITEM("TriforcePieceCounts"),
|
|
||||||
itemTrackerTriforcePieceTrackOptions,
|
|
||||||
ComboboxOptions()
|
|
||||||
.DefaultIndex(TRIFORCE_PIECE_COLLECTED_REQUIRED_MAX)
|
|
||||||
.ComponentAlignment(ComponentAlignments::Left)
|
|
||||||
.LabelPosition(LabelPositions::Above)
|
|
||||||
.Color(THEME_COLOR)
|
|
||||||
.Tooltip("Customize what numbers are shown for triforce piece tracking."));
|
|
||||||
|
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
|
|
||||||
@@ -1906,14 +1899,7 @@ void ItemTrackerSettingsWindow::DrawElement() {
|
|||||||
.Color(THEME_COLOR))) {
|
.Color(THEME_COLOR))) {
|
||||||
shouldUpdateVectors = true;
|
shouldUpdateVectors = true;
|
||||||
}
|
}
|
||||||
if (CVarCombobox("Dungeon Items", CVAR_TRACKER_ITEM("DisplayType.DungeonItems"), displayTypes,
|
SohGui::mSohMenu->MenuDrawItem(dungeonItemTracking, 250, THEME_COLOR);
|
||||||
ComboboxOptions()
|
|
||||||
.DefaultIndex(SECTION_DISPLAY_HIDDEN)
|
|
||||||
.ComponentAlignment(ComponentAlignments::Right)
|
|
||||||
.LabelPosition(LabelPositions::Far)
|
|
||||||
.Color(THEME_COLOR))) {
|
|
||||||
shouldUpdateVectors = true;
|
|
||||||
}
|
|
||||||
if (CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.DungeonItems"), SECTION_DISPLAY_HIDDEN) !=
|
if (CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.DungeonItems"), SECTION_DISPLAY_HIDDEN) !=
|
||||||
SECTION_DISPLAY_HIDDEN) {
|
SECTION_DISPLAY_HIDDEN) {
|
||||||
if (CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.DungeonItems"), SECTION_DISPLAY_HIDDEN) ==
|
if (CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.DungeonItems"), SECTION_DISPLAY_HIDDEN) ==
|
||||||
@@ -1928,61 +1914,14 @@ void ItemTrackerSettingsWindow::DrawElement() {
|
|||||||
shouldUpdateVectors = true;
|
shouldUpdateVectors = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CVarCombobox("Greg", CVAR_TRACKER_ITEM("DisplayType.Greg"), extendedDisplayTypes,
|
SohGui::mSohMenu->MenuDrawItem(gregTracking, 250, THEME_COLOR);
|
||||||
ComboboxOptions()
|
SohGui::mSohMenu->MenuDrawItem(triforcePieceTracking, 250, THEME_COLOR);
|
||||||
.DefaultIndex(SECTION_DISPLAY_EXTENDED_HIDDEN)
|
SohGui::mSohMenu->MenuDrawItem(bossSoulsTracking, 250, THEME_COLOR);
|
||||||
.ComponentAlignment(ComponentAlignments::Right)
|
SohGui::mSohMenu->MenuDrawItem(ocarinaButtonTracking, 250, THEME_COLOR);
|
||||||
.LabelPosition(LabelPositions::Far)
|
SohGui::mSohMenu->MenuDrawItem(overworldKeysTracking, 250, THEME_COLOR);
|
||||||
.Color(THEME_COLOR))) {
|
SohGui::mSohMenu->MenuDrawItem(fishingPoleTracking, 250, THEME_COLOR);
|
||||||
shouldUpdateVectors = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CVarCombobox("Triforce Pieces", CVAR_TRACKER_ITEM("DisplayType.TriforcePieces"), displayTypes,
|
if (CVarCombobox("Total Checks", CVAR_TRACKER_ITEM("TotalChecks.DisplayType"), minimalDisplayTypes,
|
||||||
ComboboxOptions()
|
|
||||||
.DefaultIndex(SECTION_DISPLAY_HIDDEN)
|
|
||||||
.ComponentAlignment(ComponentAlignments::Right)
|
|
||||||
.LabelPosition(LabelPositions::Far)
|
|
||||||
.Color(THEME_COLOR))) {
|
|
||||||
shouldUpdateVectors = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CVarCombobox("Boss Souls", CVAR_TRACKER_ITEM("DisplayType.BossSouls"), displayTypes,
|
|
||||||
ComboboxOptions()
|
|
||||||
.DefaultIndex(SECTION_DISPLAY_HIDDEN)
|
|
||||||
.ComponentAlignment(ComponentAlignments::Right)
|
|
||||||
.LabelPosition(LabelPositions::Far)
|
|
||||||
.Color(THEME_COLOR))) {
|
|
||||||
shouldUpdateVectors = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CVarCombobox("Ocarina Buttons", CVAR_TRACKER_ITEM("DisplayType.OcarinaButtons"), displayTypes,
|
|
||||||
ComboboxOptions()
|
|
||||||
.DefaultIndex(SECTION_DISPLAY_HIDDEN)
|
|
||||||
.ComponentAlignment(ComponentAlignments::Right)
|
|
||||||
.LabelPosition(LabelPositions::Far)
|
|
||||||
.Color(THEME_COLOR))) {
|
|
||||||
shouldUpdateVectors = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CVarCombobox("Overworld Keys", CVAR_TRACKER_ITEM("DisplayType.OverworldKeys"), displayTypes,
|
|
||||||
ComboboxOptions()
|
|
||||||
.DefaultIndex(SECTION_DISPLAY_HIDDEN)
|
|
||||||
.ComponentAlignment(ComponentAlignments::Right)
|
|
||||||
.LabelPosition(LabelPositions::Far)
|
|
||||||
.Color(THEME_COLOR))) {
|
|
||||||
shouldUpdateVectors = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CVarCombobox("Fishing Pole", CVAR_TRACKER_ITEM("DisplayType.FishingPole"), extendedDisplayTypes,
|
|
||||||
ComboboxOptions()
|
|
||||||
.DefaultIndex(SECTION_DISPLAY_EXTENDED_HIDDEN)
|
|
||||||
.ComponentAlignment(ComponentAlignments::Right)
|
|
||||||
.LabelPosition(LabelPositions::Far)
|
|
||||||
.Color(THEME_COLOR))) {
|
|
||||||
shouldUpdateVectors = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CVarCombobox("Total Checks", "gTrackers.ItemTracker.TotalChecks.DisplayType", minimalDisplayTypes,
|
|
||||||
ComboboxOptions()
|
ComboboxOptions()
|
||||||
.DefaultIndex(SECTION_DISPLAY_MINIMAL_HIDDEN)
|
.DefaultIndex(SECTION_DISPLAY_MINIMAL_HIDDEN)
|
||||||
.ComponentAlignment(ComponentAlignments::Right)
|
.ComponentAlignment(ComponentAlignments::Right)
|
||||||
@@ -1991,23 +1930,8 @@ void ItemTrackerSettingsWindow::DrawElement() {
|
|||||||
shouldUpdateVectors = true;
|
shouldUpdateVectors = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CVarGetInteger(CVAR_TRACKER_ITEM("WindowType"), TRACKER_WINDOW_FLOATING) == TRACKER_WINDOW_WINDOW ||
|
SohGui::mSohMenu->MenuDrawItem(personalNotesWiget, 250, THEME_COLOR);
|
||||||
(CVarGetInteger(CVAR_TRACKER_ITEM("WindowType"), TRACKER_WINDOW_FLOATING) == TRACKER_WINDOW_FLOATING &&
|
SohGui::mSohMenu->MenuDrawItem(hookshotIdentWidget, 250, THEME_COLOR);
|
||||||
CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Main"), TRACKER_DISPLAY_ALWAYS) !=
|
|
||||||
TRACKER_DISPLAY_COMBO_BUTTON)) {
|
|
||||||
if (CVarCombobox("Personal notes", CVAR_TRACKER_ITEM("DisplayType.Notes"), displayTypes,
|
|
||||||
ComboboxOptions()
|
|
||||||
.DefaultIndex(SECTION_DISPLAY_HIDDEN)
|
|
||||||
.ComponentAlignment(ComponentAlignments::Right)
|
|
||||||
.LabelPosition(LabelPositions::Far)
|
|
||||||
.Color(THEME_COLOR))) {
|
|
||||||
shouldUpdateVectors = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CVarCheckbox("Show Hookshot Identifiers", CVAR_TRACKER_ITEM("HookshotIdentifier"),
|
|
||||||
CheckboxOptions()
|
|
||||||
.Tooltip("Shows an 'H' or an 'L' to more easiely distinguish between Hookshot and Longshot.")
|
|
||||||
.Color(THEME_COLOR));
|
|
||||||
|
|
||||||
ImGui::PopStyleVar(1);
|
ImGui::PopStyleVar(1);
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
@@ -2026,3 +1950,178 @@ void ItemTrackerWindow::InitElement() {
|
|||||||
|
|
||||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>(ItemTrackerOnFrame);
|
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>(ItemTrackerOnFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RegisterItemTrackerWidgets() {
|
||||||
|
backgroundColor = { .name = "Background Color##gItemTrackerBgColor", .type = WidgetType::WIDGET_CVAR_COLOR_PICKER };
|
||||||
|
backgroundColor.CVar(CVAR_TRACKER_ITEM("BgColor"))
|
||||||
|
.Options(
|
||||||
|
ColorPickerOptions().Color(THEME_COLOR).DefaultValue({ 0, 0, 0, 0 }).UseAlpha().ShowReset().ShowRandom());
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ backgroundColor, "Randomizer", "Item Tracker", "General Settings" });
|
||||||
|
|
||||||
|
windowTypeWidget = { .name = "Window Type", .type = WidgetType::WIDGET_CVAR_COMBOBOX };
|
||||||
|
windowTypeWidget.CVar(CVAR_TRACKER_ITEM("WindowType"))
|
||||||
|
.Options(ComboboxOptions()
|
||||||
|
.DefaultIndex(TRACKER_WINDOW_FLOATING)
|
||||||
|
.ComponentAlignment(ComponentAlignments::Right)
|
||||||
|
.LabelPosition(LabelPositions::Far)
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.ComboMap(windowTypes))
|
||||||
|
.Callback([](WidgetInfo& info) { shouldUpdateVectors = true; });
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ windowTypeWidget, "Randomizer", "Item Tracker", "General Settings" });
|
||||||
|
enableDraggingWidget;
|
||||||
|
onlyPausedWidget;
|
||||||
|
|
||||||
|
ammoTracking = { .name = "Ammo/Capacity Tracking", .type = WidgetType::WIDGET_CVAR_COMBOBOX };
|
||||||
|
ammoTracking.CVar(CVAR_TRACKER_ITEM("ItemCountType"))
|
||||||
|
.Options(ComboboxOptions()
|
||||||
|
.DefaultIndex(ITEM_TRACKER_NUMBER_CURRENT_CAPACITY_ONLY)
|
||||||
|
.ComponentAlignment(ComponentAlignments::Right)
|
||||||
|
.LabelPosition(LabelPositions::Far)
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.ComboMap(itemTrackerCapacityTrackOptions)
|
||||||
|
.Tooltip("Customize what the numbers under each item are tracking."
|
||||||
|
"\n\nNote: items without capacity upgrades will track ammo even in capacity mode"));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ ammoTracking, "Randomizer", "Item Tracker", "General Settings" });
|
||||||
|
|
||||||
|
keyTracking = { .name = "Key Count Tracking", .type = WidgetType::WIDGET_CVAR_COMBOBOX };
|
||||||
|
keyTracking.CVar(CVAR_TRACKER_ITEM("KeyCounts"))
|
||||||
|
.Options(ComboboxOptions()
|
||||||
|
.DefaultIndex(KEYS_COLLECTED_MAX)
|
||||||
|
.ComponentAlignment(ComponentAlignments::Right)
|
||||||
|
.LabelPosition(LabelPositions::Far)
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.ComboMap(itemTrackerKeyTrackOptions)
|
||||||
|
.Tooltip("Customize what numbers are shown for key tracking."));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ keyTracking, "Randomizer", "Item Tracker", "General Settings" });
|
||||||
|
|
||||||
|
triforcePieceTracking = { .name = "Triforce Pieces", .type = WidgetType::WIDGET_CVAR_COMBOBOX };
|
||||||
|
triforcePieceTracking.CVar(CVAR_TRACKER_ITEM("DisplayType.TriforcePieces"))
|
||||||
|
.Options(ComboboxOptions()
|
||||||
|
.DefaultIndex(SECTION_DISPLAY_HIDDEN)
|
||||||
|
.ComponentAlignment(ComponentAlignments::Right)
|
||||||
|
.LabelPosition(LabelPositions::Far)
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.ComboMap(displayTypes))
|
||||||
|
.Callback([](WidgetInfo& info) { shouldUpdateVectors = true; });
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ triforcePieceTracking, "Randomizer", "Item Tracker", "General Settings" });
|
||||||
|
|
||||||
|
dungeonItemTracking = { .name = "Dungeon Items", .type = WidgetType::WIDGET_CVAR_COMBOBOX };
|
||||||
|
dungeonItemTracking.CVar(CVAR_TRACKER_ITEM("DisplayType.DungeonItems"))
|
||||||
|
.Options(ComboboxOptions()
|
||||||
|
.DefaultIndex(SECTION_DISPLAY_HIDDEN)
|
||||||
|
.ComponentAlignment(ComponentAlignments::Right)
|
||||||
|
.LabelPosition(LabelPositions::Far)
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.ComboMap(displayTypes))
|
||||||
|
.Callback([](WidgetInfo& info) { shouldUpdateVectors = true; });
|
||||||
|
;
|
||||||
|
SohGui::mSohMenu->AddSearchWidget(
|
||||||
|
{ dungeonItemTracking, "Randomizer", "Item Tracker", "General Settings", "keys maps compasses icon" });
|
||||||
|
|
||||||
|
gregTracking = { .name = "Greg", .type = WidgetType::WIDGET_CVAR_COMBOBOX };
|
||||||
|
gregTracking.CVar(CVAR_TRACKER_ITEM("DisplayType.Greg"))
|
||||||
|
.Options(ComboboxOptions()
|
||||||
|
.DefaultIndex(SECTION_DISPLAY_EXTENDED_HIDDEN)
|
||||||
|
.ComponentAlignment(ComponentAlignments::Right)
|
||||||
|
.LabelPosition(LabelPositions::Far)
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.ComboMap(extendedDisplayTypes))
|
||||||
|
.Callback([](WidgetInfo& info) { shouldUpdateVectors = true; });
|
||||||
|
;
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ gregTracking, "Randomizer", "Item Tracker", "General Settings", "icon" });
|
||||||
|
|
||||||
|
bossSoulsTracking = { .name = "Boss Souls", .type = WidgetType::WIDGET_CVAR_COMBOBOX };
|
||||||
|
bossSoulsTracking.CVar(CVAR_TRACKER_ITEM("DisplayType.Greg"))
|
||||||
|
.Options(ComboboxOptions()
|
||||||
|
.DefaultIndex(SECTION_DISPLAY_HIDDEN)
|
||||||
|
.ComponentAlignment(ComponentAlignments::Right)
|
||||||
|
.LabelPosition(LabelPositions::Far)
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.ComboMap(displayTypes))
|
||||||
|
.Callback([](WidgetInfo& info) { shouldUpdateVectors = true; });
|
||||||
|
;
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ bossSoulsTracking, "Randomizer", "Item Tracker", "General Settings", "icon" });
|
||||||
|
|
||||||
|
triforcePieceCount = { .name = "Triforce Piece Count Tracking", .type = WidgetType::WIDGET_CVAR_COMBOBOX };
|
||||||
|
triforcePieceCount.CVar(CVAR_TRACKER_ITEM("TriforcePieceCounts"))
|
||||||
|
.Options(ComboboxOptions()
|
||||||
|
.DefaultIndex(TRIFORCE_PIECE_COLLECTED_REQUIRED_MAX)
|
||||||
|
.ComponentAlignment(ComponentAlignments::Right)
|
||||||
|
.LabelPosition(LabelPositions::Far)
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.ComboMap(itemTrackerTriforcePieceTrackOptions)
|
||||||
|
.Tooltip("Customize what numbers are shown for triforce piece tracking."));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ triforcePieceCount, "Randomizer", "Item Tracker", "General Settings" });
|
||||||
|
|
||||||
|
ocarinaButtonTracking = { .name = "Ocarina Buttons", .type = WidgetType::WIDGET_CVAR_COMBOBOX };
|
||||||
|
ocarinaButtonTracking.CVar(CVAR_TRACKER_ITEM("DisplayType.OcarinaButtons"))
|
||||||
|
.Options(ComboboxOptions()
|
||||||
|
.DefaultIndex(SECTION_DISPLAY_HIDDEN)
|
||||||
|
.ComponentAlignment(ComponentAlignments::Right)
|
||||||
|
.LabelPosition(LabelPositions::Far)
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.ComboMap(displayTypes))
|
||||||
|
.Callback([](WidgetInfo& info) { shouldUpdateVectors = true; });
|
||||||
|
;
|
||||||
|
SohGui::mSohMenu->AddSearchWidget(
|
||||||
|
{ ocarinaButtonTracking, "Randomizer", "Item Tracker", "General Settings", "icon" });
|
||||||
|
|
||||||
|
overworldKeysTracking = { .name = "Overworld Keys", .type = WidgetType::WIDGET_CVAR_COMBOBOX };
|
||||||
|
overworldKeysTracking.CVar(CVAR_TRACKER_ITEM("DisplayType.OverworldKeys"))
|
||||||
|
.Options(ComboboxOptions()
|
||||||
|
.DefaultIndex(SECTION_DISPLAY_HIDDEN)
|
||||||
|
.ComponentAlignment(ComponentAlignments::Right)
|
||||||
|
.LabelPosition(LabelPositions::Far)
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.ComboMap(displayTypes))
|
||||||
|
.Callback([](WidgetInfo& info) { shouldUpdateVectors = true; });
|
||||||
|
;
|
||||||
|
SohGui::mSohMenu->AddSearchWidget(
|
||||||
|
{ overworldKeysTracking, "Randomizer", "Item Tracker", "General Settings", "icon" });
|
||||||
|
|
||||||
|
fishingPoleTracking = { .name = "Fishing Pole", .type = WidgetType::WIDGET_CVAR_COMBOBOX };
|
||||||
|
fishingPoleTracking.CVar(CVAR_TRACKER_ITEM("DisplayType.FishingPole"))
|
||||||
|
.Options(ComboboxOptions()
|
||||||
|
.DefaultIndex(SECTION_DISPLAY_EXTENDED_HIDDEN)
|
||||||
|
.ComponentAlignment(ComponentAlignments::Right)
|
||||||
|
.LabelPosition(LabelPositions::Far)
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.ComboMap(extendedDisplayTypes))
|
||||||
|
.Callback([](WidgetInfo& info) { shouldUpdateVectors = true; });
|
||||||
|
;
|
||||||
|
SohGui::mSohMenu->AddSearchWidget(
|
||||||
|
{ fishingPoleTracking, "Randomizer", "Item Tracker", "General Settings", "icon" });
|
||||||
|
|
||||||
|
personalNotesWiget = { .name = "Personal notes", .type = WidgetType::WIDGET_CVAR_COMBOBOX };
|
||||||
|
static const char* notesDisabledTooltip =
|
||||||
|
"Disabled because tracker is set to floating and display combo is enabled.";
|
||||||
|
personalNotesWiget.CVar(CVAR_TRACKER_ITEM("DisplayType.Notes"))
|
||||||
|
.Options(ComboboxOptions()
|
||||||
|
.DefaultIndex(SECTION_DISPLAY_HIDDEN)
|
||||||
|
.ComponentAlignment(ComponentAlignments::Right)
|
||||||
|
.LabelPosition(LabelPositions::Far)
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.ComboMap(displayTypes))
|
||||||
|
.PreFunc([&](WidgetInfo& info) {
|
||||||
|
if (CVarGetInteger(CVAR_TRACKER_ITEM("WindowType"), TRACKER_WINDOW_FLOATING) == TRACKER_WINDOW_WINDOW ||
|
||||||
|
(CVarGetInteger(CVAR_TRACKER_ITEM("WindowType"), TRACKER_WINDOW_FLOATING) == TRACKER_WINDOW_FLOATING &&
|
||||||
|
CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Main"), TRACKER_DISPLAY_ALWAYS) !=
|
||||||
|
TRACKER_DISPLAY_COMBO_BUTTON)) {
|
||||||
|
info.options.get()->disabled = true;
|
||||||
|
info.options.get()->disabledTooltip = notesDisabledTooltip;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.Callback([](WidgetInfo& info) { shouldUpdateVectors = true; });
|
||||||
|
;
|
||||||
|
SohGui::mSohMenu->AddSearchWidget({ personalNotesWiget, "Randomizer", "Item Tracker", "General Settings" });
|
||||||
|
|
||||||
|
hookshotIdentWidget = { .name = "Show Hookshot Identifiers", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||||
|
hookshotIdentWidget.CVar(CVAR_SETTING("FreeLook.Enabled"))
|
||||||
|
.Options(CheckboxOptions()
|
||||||
|
.Color(THEME_COLOR)
|
||||||
|
.Tooltip("Shows an 'H' or an 'L' to more easiely distinguish between Hookshot and Longshot."));
|
||||||
|
SohGui::mSohMenu->AddSearchWidget(
|
||||||
|
{ hookshotIdentWidget, "Settings", "Controls", "Camera Controls", "longshot icon" });
|
||||||
|
}
|
||||||
|
|
||||||
|
static RegisterMenuInitFunc initItemTrackerWidgets(RegisterItemTrackerWidgets);
|
||||||
|
|||||||
@@ -26,4 +26,4 @@ static void ActorMaximumHealth_Register() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
RegisterShipInitFunc actorMaximumHealthInit(ActorMaximumHealth_Register);
|
static RegisterShipInitFunc actorMaximumHealthInit(ActorMaximumHealth_Register);
|
||||||
|
|||||||
@@ -23,12 +23,19 @@ extern void Warp();
|
|||||||
namespace SohGui {
|
namespace SohGui {
|
||||||
extern std::shared_ptr<SohModalWindow> mModalWindow;
|
extern std::shared_ptr<SohModalWindow> mModalWindow;
|
||||||
}
|
}
|
||||||
|
std::vector<SearchWidget> extraSearchWidgets = {};
|
||||||
|
|
||||||
namespace Ship {
|
namespace Ship {
|
||||||
std::string disabledTempTooltip;
|
std::string disabledTempTooltip;
|
||||||
const char* disabledTooltip;
|
const char* disabledTooltip;
|
||||||
bool disabledValue = false;
|
bool disabledValue = false;
|
||||||
|
|
||||||
|
bool navigateToWidget = false;
|
||||||
|
const char* navigateMainEntry = "";
|
||||||
|
const char* navigateSidebar = "";
|
||||||
|
std::string navigateWidgetName = "";
|
||||||
|
bool highlightWidget = false;
|
||||||
|
|
||||||
bool operator==(Color_RGB8 const& l, Color_RGB8 const& r) noexcept {
|
bool operator==(Color_RGB8 const& l, Color_RGB8 const& r) noexcept {
|
||||||
return l.r == r.r && l.g == r.g && l.b == r.b;
|
return l.r == r.r && l.g == r.g && l.b == r.b;
|
||||||
}
|
}
|
||||||
@@ -128,6 +135,7 @@ void Menu::InitElement() {
|
|||||||
poppedSize.y = CVarGetInteger(CVAR_SETTING("Menu.PoppedHeight"), 800);
|
poppedSize.y = CVarGetInteger(CVAR_SETTING("Menu.PoppedHeight"), 800);
|
||||||
poppedPos.x = CVarGetInteger(CVAR_SETTING("Menu.PoppedPos.x"), 0);
|
poppedPos.x = CVarGetInteger(CVAR_SETTING("Menu.PoppedPos.x"), 0);
|
||||||
poppedPos.y = CVarGetInteger(CVAR_SETTING("Menu.PoppedPos.y"), 0);
|
poppedPos.y = CVarGetInteger(CVAR_SETTING("Menu.PoppedPos.y"), 0);
|
||||||
|
menuThemeIndex = static_cast<UIWidgets::Colors>(CVarGetInteger(CVAR_SETTING("Menu.Theme"), defaultThemeIndex));
|
||||||
|
|
||||||
UpdateWindowBackendObjects();
|
UpdateWindowBackendObjects();
|
||||||
}
|
}
|
||||||
@@ -186,7 +194,12 @@ bool ModernMenuHeaderEntry(std::string label) {
|
|||||||
|
|
||||||
uint32_t Menu::DrawSearchResults(std::string& menuSearchText) {
|
uint32_t Menu::DrawSearchResults(std::string& menuSearchText) {
|
||||||
int searchCount = 0;
|
int searchCount = 0;
|
||||||
if (ImGui::BeginChild("Search Results")) {
|
std::transform(menuSearchText.begin(), menuSearchText.end(), menuSearchText.begin(), ::tolower);
|
||||||
|
menuSearchText.erase(std::remove(menuSearchText.begin(), menuSearchText.end(), ' '), menuSearchText.end());
|
||||||
|
ImGui::SetNextWindowSizeConstraints({ ImGui::GetContentRegionAvail().x / 2, 0 },
|
||||||
|
{ ImGui::GetContentRegionAvail().x / 2, ImGui::GetContentRegionAvail().y });
|
||||||
|
if (ImGui::BeginChild("Search Results Col 1", { ImGui::GetContentRegionAvail().x / 2, 0 },
|
||||||
|
ImGuiChildFlags_AutoResizeY, ImGuiWindowFlags_NoTitleBar)) {
|
||||||
for (auto& menuLabel : menuOrder) {
|
for (auto& menuLabel : menuOrder) {
|
||||||
auto& menuEntry = menuEntries.at(menuLabel);
|
auto& menuEntry = menuEntries.at(menuLabel);
|
||||||
for (auto& sidebarLabel : menuEntry.sidebarOrder) {
|
for (auto& sidebarLabel : menuEntry.sidebarOrder) {
|
||||||
@@ -195,30 +208,64 @@ uint32_t Menu::DrawSearchResults(std::string& menuSearchText) {
|
|||||||
auto& column = sidebar.columnWidgets.at(i);
|
auto& column = sidebar.columnWidgets.at(i);
|
||||||
for (auto& info : column) {
|
for (auto& info : column) {
|
||||||
if (info.type == WIDGET_SEARCH || info.type == WIDGET_SEPARATOR ||
|
if (info.type == WIDGET_SEARCH || info.type == WIDGET_SEPARATOR ||
|
||||||
info.type == WIDGET_SEPARATOR_TEXT || info.isHidden) {
|
info.type == WIDGET_SEPARATOR_TEXT || info.isHidden || info.hideInSearch) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const char* tooltip = info.options->tooltip;
|
const char* tooltip = info.options->tooltip;
|
||||||
std::string widgetStr = std::string(info.name) + std::string(tooltip != NULL ? tooltip : "");
|
std::string widgetStr = std::string(info.name) + std::string(tooltip != NULL ? tooltip : "");
|
||||||
std::transform(menuSearchText.begin(), menuSearchText.end(), menuSearchText.begin(), ::tolower);
|
|
||||||
menuSearchText.erase(std::remove(menuSearchText.begin(), menuSearchText.end(), ' '),
|
|
||||||
menuSearchText.end());
|
|
||||||
std::transform(widgetStr.begin(), widgetStr.end(), widgetStr.begin(), ::tolower);
|
std::transform(widgetStr.begin(), widgetStr.end(), widgetStr.begin(), ::tolower);
|
||||||
widgetStr.erase(std::remove(widgetStr.begin(), widgetStr.end(), ' '), widgetStr.end());
|
widgetStr.erase(std::remove(widgetStr.begin(), widgetStr.end(), ' '), widgetStr.end());
|
||||||
if (widgetStr.find(menuSearchText) != std::string::npos) {
|
if (widgetStr.find(menuSearchText) != std::string::npos) {
|
||||||
MenuDrawItem(info, 90 / sidebar.columnCount, menuThemeIndex);
|
UIWidgets::ComponentAlignments backupAlignment;
|
||||||
|
UIWidgets::LabelPositions backupLabelPos;
|
||||||
|
if (info.type == WIDGET_COMBOBOX || info.type == WIDGET_CVAR_COMBOBOX) {
|
||||||
|
backupAlignment =
|
||||||
|
std::static_pointer_cast<UIWidgets::ComboboxOptions>(info.options)->alignment;
|
||||||
|
backupLabelPos =
|
||||||
|
std::static_pointer_cast<UIWidgets::ComboboxOptions>(info.options)->labelPosition;
|
||||||
|
std::static_pointer_cast<UIWidgets::ComboboxOptions>(info.options)->alignment =
|
||||||
|
UIWidgets::ComponentAlignments::Left;
|
||||||
|
std::static_pointer_cast<UIWidgets::ComboboxOptions>(info.options)->labelPosition =
|
||||||
|
UIWidgets::LabelPositions::Above;
|
||||||
|
}
|
||||||
|
MenuDrawItem(info, 400, menuThemeIndex);
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, UIWidgets::ColorValues.at(UIWidgets::Colors::Gray));
|
ImGui::PushStyleColor(ImGuiCol_Text, UIWidgets::ColorValues.at(UIWidgets::Colors::Gray));
|
||||||
std::string origin =
|
std::string origin =
|
||||||
fmt::format(" ({} -> {}, Col {})", menuEntry.label, sidebarLabel, i + 1);
|
fmt::format(" ({} -> {}, Col {})", menuEntry.label, sidebarLabel, i + 1);
|
||||||
ImGui::Text("%s", origin.c_str());
|
ImGui::Text("%s", origin.c_str());
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
searchCount++;
|
searchCount++;
|
||||||
|
if (info.type == WIDGET_COMBOBOX || info.type == WIDGET_CVAR_COMBOBOX) {
|
||||||
|
std::static_pointer_cast<UIWidgets::ComboboxOptions>(info.options)->alignment =
|
||||||
|
backupAlignment;
|
||||||
|
std::static_pointer_cast<UIWidgets::ComboboxOptions>(info.options)->labelPosition =
|
||||||
|
backupLabelPos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (auto& entry : extraSearchWidgets) {
|
||||||
|
if (entry.info.type == WIDGET_SEARCH || entry.info.type == WIDGET_SEPARATOR ||
|
||||||
|
entry.info.type == WIDGET_SEPARATOR_TEXT || entry.info.isHidden || entry.info.hideInSearch) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
std::string widgetStr =
|
||||||
|
entry.info.name + entry.info.options->tooltip + entry.extraTerms + entry.sidebarName;
|
||||||
|
std::transform(widgetStr.begin(), widgetStr.end(), widgetStr.begin(), ::tolower);
|
||||||
|
widgetStr.erase(std::remove(widgetStr.begin(), widgetStr.end(), ' '), widgetStr.end());
|
||||||
|
if (widgetStr.find(menuSearchText) != std::string::npos) {
|
||||||
|
MenuDrawItem(entry.info, 400, menuThemeIndex);
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text, UIWidgets::ColorValues.at(UIWidgets::Colors::Gray));
|
||||||
|
std::string origin = fmt::format(" ({} -> {}, {})", entry.menuName, entry.sidebarName, entry.location);
|
||||||
|
ImGui::Text("%s", origin.c_str());
|
||||||
|
ImGui::PopStyleColor();
|
||||||
|
searchCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::EndChild();
|
||||||
|
}
|
||||||
return searchCount;
|
return searchCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,6 +274,10 @@ void Menu::AddMenuEntry(std::string entryName, const char* entryCvar) {
|
|||||||
menuOrder.push_back(entryName);
|
menuOrder.push_back(entryName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Menu::AddSearchWidget(SearchWidget widget) {
|
||||||
|
extraSearchWidgets.push_back(widget);
|
||||||
|
}
|
||||||
|
|
||||||
std::unordered_map<uint32_t, disabledInfo>& Menu::GetDisabledMap() {
|
std::unordered_map<uint32_t, disabledInfo>& Menu::GetDisabledMap() {
|
||||||
return disabledMap;
|
return disabledMap;
|
||||||
}
|
}
|
||||||
@@ -449,6 +500,20 @@ void Menu::MenuDrawItem(WidgetInfo& widget, uint32_t width, UIWidgets::Colors me
|
|||||||
window->DrawElement();
|
window->DrawElement();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
case WIDGET_CVAR_COLOR_PICKER: {
|
||||||
|
auto options = std::static_pointer_cast<UIWidgets::ColorPickerOptions>(widget.options);
|
||||||
|
uint32_t modifiers = 0;
|
||||||
|
if (options->showLock)
|
||||||
|
modifiers |= UIWidgets::ColorPickerLockCheck;
|
||||||
|
if (options->showRandom)
|
||||||
|
modifiers |= UIWidgets::ColorPickerRandomButton;
|
||||||
|
if (options->showReset)
|
||||||
|
modifiers |= UIWidgets::ColorPickerResetButton;
|
||||||
|
if (options->showRainbow)
|
||||||
|
modifiers |= UIWidgets::ColorPickerRainbowCheck;
|
||||||
|
UIWidgets::CVarColorPicker(widget.name.c_str(), widget.cVar, options->defaultValue, options->useAlpha,
|
||||||
|
modifiers, options->color);
|
||||||
|
} break;
|
||||||
case WIDGET_SEARCH: {
|
case WIDGET_SEARCH: {
|
||||||
UIWidgets::PushStyleButton(menuThemeIndex);
|
UIWidgets::PushStyleButton(menuThemeIndex);
|
||||||
if (ImGui::Button("Clear")) {
|
if (ImGui::Button("Clear")) {
|
||||||
@@ -473,7 +538,6 @@ void Menu::MenuDrawItem(WidgetInfo& widget, uint32_t width, UIWidgets::Colors me
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DrawSearchResults(menuSearchText);
|
DrawSearchResults(menuSearchText);
|
||||||
ImGui::EndChild();
|
|
||||||
} break;
|
} break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -501,6 +565,19 @@ void Menu::DrawElement() {
|
|||||||
for (auto& [reason, info] : disabledMap) {
|
for (auto& [reason, info] : disabledMap) {
|
||||||
info.active = info.evaluation(info);
|
info.active = info.evaluation(info);
|
||||||
}
|
}
|
||||||
|
const char* headerCvar = CVAR_SETTING("Menu.ActiveHeader");
|
||||||
|
|
||||||
|
if (navigateToWidget) {
|
||||||
|
if (menuEntries.contains(navigateMainEntry) &&
|
||||||
|
menuEntries.at(navigateMainEntry).sidebars.contains(navigateSidebar)) {
|
||||||
|
menuSearch.Clear();
|
||||||
|
CVarSetString(headerCvar, navigateMainEntry);
|
||||||
|
const char* sidebarCvar = menuEntries.at(navigateMainEntry).sidebarCvar;
|
||||||
|
CVarSetString(sidebarCvar, navigateSidebar);
|
||||||
|
highlightWidget = true;
|
||||||
|
}
|
||||||
|
navigateToWidget = false;
|
||||||
|
}
|
||||||
|
|
||||||
raceDisableActive = CVarGetInteger(CVAR_SETTING("DisableChanges"), 0);
|
raceDisableActive = CVarGetInteger(CVAR_SETTING("DisableChanges"), 0);
|
||||||
|
|
||||||
@@ -569,7 +646,6 @@ void Menu::DrawElement() {
|
|||||||
|
|
||||||
ImGui::PushFont(OTRGlobals::Instance->fontStandardLargest);
|
ImGui::PushFont(OTRGlobals::Instance->fontStandardLargest);
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10.0f, 8.0f));
|
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10.0f, 8.0f));
|
||||||
const char* headerCvar = CVAR_SETTING("Menu.ActiveHeader");
|
|
||||||
std::string headerIndex = CVarGetString(headerCvar, "Settings");
|
std::string headerIndex = CVarGetString(headerCvar, "Settings");
|
||||||
ImVec2 pos = window->DC.CursorPos;
|
ImVec2 pos = window->DC.CursorPos;
|
||||||
float centerX = pos.x + windowWidth / 2 - (style.ItemSpacing.x * (menuEntries.size() + 1));
|
float centerX = pos.x + windowWidth / 2 - (style.ItemSpacing.x * (menuEntries.size() + 1));
|
||||||
@@ -800,21 +876,26 @@ void Menu::DrawElement() {
|
|||||||
ImGuiWindowFlags_NoTitleBar);
|
ImGuiWindowFlags_NoTitleBar);
|
||||||
}
|
}
|
||||||
if (headerSearch && menuSearchText.length() > 0) {
|
if (headerSearch && menuSearchText.length() > 0) {
|
||||||
|
ImGui::AlignTextToFramePadding();
|
||||||
|
ImGui::PushFont(OTRGlobals::Instance->fontMonoLargest);
|
||||||
|
ImGui::Text("Search Results");
|
||||||
|
ImGui::PopFont();
|
||||||
|
ImGui::SameLine();
|
||||||
|
UIWidgets::ButtonOptions clearBtnOpts = {};
|
||||||
|
clearBtnOpts.size = UIWidgets::Sizes::Inline;
|
||||||
|
if (UIWidgets::Button("Clear Search", clearBtnOpts)) {
|
||||||
|
menuSearch.Clear();
|
||||||
|
}
|
||||||
|
ImGui::BeginChild("searchSeparator", ImVec2(ImGui::GetContentRegionAvail().x / 2, 20),
|
||||||
|
ImGuiChildFlags_AlwaysAutoResize | ImGuiChildFlags_AutoResizeY);
|
||||||
|
UIWidgets::Separator(true, true, 0, 10);
|
||||||
|
ImGui::EndChild();
|
||||||
uint32_t searchCount = DrawSearchResults(menuSearchText);
|
uint32_t searchCount = DrawSearchResults(menuSearchText);
|
||||||
if (searchCount == 0) {
|
if (searchCount == 0) {
|
||||||
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - ImGui::CalcTextSize("No results found").x) / 2);
|
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - ImGui::CalcTextSize("No results found").x) / 2);
|
||||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.0f);
|
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.0f);
|
||||||
ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 0.4f), "No results found");
|
ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 0.4f), "No results found");
|
||||||
}
|
}
|
||||||
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - ImGui::CalcTextSize("Clear Search").x) / 2 - 10.0f);
|
|
||||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.0f);
|
|
||||||
UIWidgets::ButtonOptions clearBtnOpts = {};
|
|
||||||
clearBtnOpts.size = UIWidgets::Sizes::Inline;
|
|
||||||
if (UIWidgets::Button("Clear Search", clearBtnOpts)) {
|
|
||||||
menuSearch.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::EndChild();
|
|
||||||
} else {
|
} else {
|
||||||
std::string menuLabel = menuEntries.at(headerIndex).label;
|
std::string menuLabel = menuEntries.at(headerIndex).label;
|
||||||
if (MenuInit::GetUpdateFuncs().contains(menuLabel)) {
|
if (MenuInit::GetUpdateFuncs().contains(menuLabel)) {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ class Menu : public GuiWindow {
|
|||||||
|
|
||||||
void MenuDrawItem(WidgetInfo& widget, uint32_t width, UIWidgets::Colors menuThemeIndex);
|
void MenuDrawItem(WidgetInfo& widget, uint32_t width, UIWidgets::Colors menuThemeIndex);
|
||||||
void AddMenuEntry(std::string entryName, const char* entryCvar);
|
void AddMenuEntry(std::string entryName, const char* entryCvar);
|
||||||
|
void AddSearchWidget(SearchWidget widget);
|
||||||
std::unordered_map<uint32_t, disabledInfo>& GetDisabledMap();
|
std::unordered_map<uint32_t, disabledInfo>& GetDisabledMap();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ typedef enum {
|
|||||||
|
|
||||||
struct WidgetInfo;
|
struct WidgetInfo;
|
||||||
struct disabledInfo;
|
struct disabledInfo;
|
||||||
using VoidFunc = void (*)();
|
using VoidFunc = std::function<void()>;
|
||||||
using DisableInfoFunc = bool (*)(disabledInfo&);
|
using DisableInfoFunc = std::function<bool(disabledInfo&)>;
|
||||||
using DisableVec = std::vector<DisableOption>;
|
using DisableVec = std::vector<DisableOption>;
|
||||||
using WidgetFunc = void (*)(WidgetInfo&);
|
using WidgetFunc = std::function<void(WidgetInfo&)>;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
WIDGET_CHECKBOX,
|
WIDGET_CHECKBOX,
|
||||||
@@ -41,8 +41,8 @@ typedef enum {
|
|||||||
WIDGET_BUTTON,
|
WIDGET_BUTTON,
|
||||||
WIDGET_INPUT,
|
WIDGET_INPUT,
|
||||||
WIDGET_CVAR_INPUT,
|
WIDGET_CVAR_INPUT,
|
||||||
WIDGET_COLOR_24, // color picker without alpha
|
WIDGET_CVAR_COLOR_PICKER,
|
||||||
WIDGET_COLOR_32, // color picker with alpha
|
WIDGET_COLOR_PICKER,
|
||||||
WIDGET_SEARCH,
|
WIDGET_SEARCH,
|
||||||
WIDGET_SEPARATOR,
|
WIDGET_SEPARATOR,
|
||||||
WIDGET_SEPARATOR_TEXT,
|
WIDGET_SEPARATOR_TEXT,
|
||||||
@@ -72,9 +72,10 @@ typedef enum {
|
|||||||
// holds the widget values for a widget, contains all CVar types available from LUS. int32_t is used for boolean
|
// holds the widget values for a widget, contains all CVar types available from LUS. int32_t is used for boolean
|
||||||
// evaluation
|
// evaluation
|
||||||
using CVarVariant = std::variant<int32_t, const char*, float, Color_RGBA8, Color_RGB8>;
|
using CVarVariant = std::variant<int32_t, const char*, float, Color_RGBA8, Color_RGB8>;
|
||||||
using OptionsVariant = std::variant<UIWidgets::ButtonOptions, UIWidgets::CheckboxOptions, UIWidgets::ComboboxOptions,
|
using OptionsVariant =
|
||||||
|
std::variant<UIWidgets::ButtonOptions, UIWidgets::CheckboxOptions, UIWidgets::ComboboxOptions,
|
||||||
UIWidgets::FloatSliderOptions, UIWidgets::IntSliderOptions, UIWidgets::TextOptions,
|
UIWidgets::FloatSliderOptions, UIWidgets::IntSliderOptions, UIWidgets::TextOptions,
|
||||||
UIWidgets::WidgetOptions, UIWidgets::WindowButtonOptions>;
|
UIWidgets::WidgetOptions, UIWidgets::WindowButtonOptions, UIWidgets::ColorPickerOptions>;
|
||||||
|
|
||||||
// All the info needed for display and search of all widgets in the menu.
|
// All the info needed for display and search of all widgets in the menu.
|
||||||
// `name` is the label displayed,
|
// `name` is the label displayed,
|
||||||
@@ -111,11 +112,13 @@ struct WidgetInfo {
|
|||||||
bool isHidden = false;
|
bool isHidden = false;
|
||||||
bool sameLine = false;
|
bool sameLine = false;
|
||||||
bool raceDisable = true;
|
bool raceDisable = true;
|
||||||
|
bool hideInSearch = false;
|
||||||
|
|
||||||
WidgetInfo& CVar(const char* cVar_) {
|
WidgetInfo& CVar(const char* cVar_) {
|
||||||
cVar = cVar_;
|
cVar = cVar_;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
WidgetInfo& Options(OptionsVariant options_) {
|
WidgetInfo& Options(OptionsVariant options_) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case WIDGET_AUDIO_BACKEND:
|
case WIDGET_AUDIO_BACKEND:
|
||||||
@@ -138,6 +141,11 @@ struct WidgetInfo {
|
|||||||
options =
|
options =
|
||||||
std::make_shared<UIWidgets::IntSliderOptions>(std::get<UIWidgets::IntSliderOptions>(options_));
|
std::make_shared<UIWidgets::IntSliderOptions>(std::get<UIWidgets::IntSliderOptions>(options_));
|
||||||
break;
|
break;
|
||||||
|
case WIDGET_COLOR_PICKER:
|
||||||
|
case WIDGET_CVAR_COLOR_PICKER:
|
||||||
|
options =
|
||||||
|
std::make_shared<UIWidgets::ColorPickerOptions>(std::get<UIWidgets::ColorPickerOptions>(options_));
|
||||||
|
break;
|
||||||
case WIDGET_BUTTON:
|
case WIDGET_BUTTON:
|
||||||
options = std::make_shared<UIWidgets::ButtonOptions>(std::get<UIWidgets::ButtonOptions>(options_));
|
options = std::make_shared<UIWidgets::ButtonOptions>(std::get<UIWidgets::ButtonOptions>(options_));
|
||||||
break;
|
break;
|
||||||
@@ -155,48 +163,63 @@ struct WidgetInfo {
|
|||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WidgetInfo& Options(std::shared_ptr<UIWidgets::WidgetOptions> options_) {
|
||||||
|
options = options_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
WidgetInfo& Callback(WidgetFunc callback_) {
|
||||||
|
callback = callback_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
WidgetInfo& PreFunc(WidgetFunc preFunc_) {
|
||||||
|
preFunc = preFunc_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
WidgetInfo& PostFunc(WidgetFunc postFunc_) {
|
||||||
|
postFunc = postFunc_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
WidgetInfo& WindowName(const char* windowName_) {
|
||||||
|
windowName = windowName_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
WidgetInfo& ValuePointer(std::variant<bool*, int32_t*, float*> valuePointer_) {
|
||||||
|
valuePointer = valuePointer_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
WidgetInfo& SameLine(bool sameLine_) {
|
||||||
|
sameLine = sameLine_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
WidgetInfo& CustomFunction(WidgetFunc customFunction_) {
|
||||||
|
customFunction = customFunction_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
WidgetInfo& RaceDisable(bool disable) {
|
||||||
|
raceDisable = disable;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
WidgetInfo& HideInSearch(bool hide) {
|
||||||
|
hideInSearch = hide;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
void ResetDisables() {
|
void ResetDisables() {
|
||||||
isHidden = false;
|
isHidden = false;
|
||||||
options->disabled = false;
|
options->disabled = false;
|
||||||
options->disabledTooltip = "";
|
options->disabledTooltip = "";
|
||||||
activeDisables.clear();
|
activeDisables.clear();
|
||||||
}
|
}
|
||||||
WidgetInfo& Options(std::shared_ptr<UIWidgets::WidgetOptions> options_) {
|
|
||||||
options = options_;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
WidgetInfo& Callback(WidgetFunc callback_) {
|
|
||||||
callback = callback_;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
WidgetInfo& PreFunc(WidgetFunc preFunc_) {
|
|
||||||
preFunc = preFunc_;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
WidgetInfo& PostFunc(WidgetFunc postFunc_) {
|
|
||||||
postFunc = postFunc_;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
WidgetInfo& WindowName(const char* windowName_) {
|
|
||||||
windowName = windowName_;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
WidgetInfo& ValuePointer(std::variant<bool*, int32_t*, float*> valuePointer_) {
|
|
||||||
valuePointer = valuePointer_;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
WidgetInfo& SameLine(bool sameLine_) {
|
|
||||||
sameLine = sameLine_;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
WidgetInfo& CustomFunction(WidgetFunc customFunction_) {
|
|
||||||
customFunction = customFunction_;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
WidgetInfo& RaceDisable(bool disable) {
|
|
||||||
raceDisable = disable;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct WidgetPath {
|
struct WidgetPath {
|
||||||
@@ -269,6 +292,24 @@ struct MenuInit {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct SearchEntry {
|
||||||
|
// First four required
|
||||||
|
std::string widgetName;
|
||||||
|
std::string menuName;
|
||||||
|
std::string sidebarName;
|
||||||
|
std::string location;
|
||||||
|
std::string extraTerms = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SearchWidget {
|
||||||
|
// First four required
|
||||||
|
WidgetInfo& info;
|
||||||
|
std::string menuName;
|
||||||
|
std::string sidebarName;
|
||||||
|
std::string location;
|
||||||
|
std::string extraTerms = "";
|
||||||
|
};
|
||||||
|
|
||||||
struct RegisterMenuInitFunc {
|
struct RegisterMenuInitFunc {
|
||||||
RegisterMenuInitFunc(std::function<void()> initFunc) {
|
RegisterMenuInitFunc(std::function<void()> initFunc) {
|
||||||
auto& menuInitFuncs = MenuInit::GetInitFuncs();
|
auto& menuInitFuncs = MenuInit::GetInitFuncs();
|
||||||
|
|||||||
@@ -61,8 +61,9 @@ WidgetInfo& SohMenu::AddWidget(WidgetPath& pathInfo, std::string widgetName, Wid
|
|||||||
case WIDGET_WINDOW_BUTTON:
|
case WIDGET_WINDOW_BUTTON:
|
||||||
widget.options = std::make_shared<WindowButtonOptions>();
|
widget.options = std::make_shared<WindowButtonOptions>();
|
||||||
break;
|
break;
|
||||||
case WIDGET_COLOR_24:
|
case WIDGET_CVAR_COLOR_PICKER:
|
||||||
case WIDGET_COLOR_32:
|
case WIDGET_COLOR_PICKER:
|
||||||
|
widget.options = std::make_shared<ColorPickerOptions>();
|
||||||
break;
|
break;
|
||||||
case WIDGET_SEPARATOR_TEXT:
|
case WIDGET_SEPARATOR_TEXT:
|
||||||
case WIDGET_TEXT:
|
case WIDGET_TEXT:
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ void SohMenu::AddMenuDevTools() {
|
|||||||
.CVar(CVAR_WINDOW("SohStats"))
|
.CVar(CVAR_WINDOW("SohStats"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Stats##Soh")
|
.WindowName("Stats##Soh")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Stats Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Stats Window."));
|
||||||
|
|
||||||
// Console
|
// Console
|
||||||
@@ -132,6 +133,7 @@ void SohMenu::AddMenuDevTools() {
|
|||||||
AddWidget(path, "Popout Console", WIDGET_WINDOW_BUTTON)
|
AddWidget(path, "Popout Console", WIDGET_WINDOW_BUTTON)
|
||||||
.CVar(CVAR_WINDOW("SohConsole"))
|
.CVar(CVAR_WINDOW("SohConsole"))
|
||||||
.WindowName("Console##SoH")
|
.WindowName("Console##SoH")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Console Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Console Window."));
|
||||||
|
|
||||||
// Save Editor
|
// Save Editor
|
||||||
@@ -140,6 +142,7 @@ void SohMenu::AddMenuDevTools() {
|
|||||||
AddWidget(path, "Popout Save Editor", WIDGET_WINDOW_BUTTON)
|
AddWidget(path, "Popout Save Editor", WIDGET_WINDOW_BUTTON)
|
||||||
.CVar(CVAR_WINDOW("SaveEditor"))
|
.CVar(CVAR_WINDOW("SaveEditor"))
|
||||||
.WindowName("Save Editor")
|
.WindowName("Save Editor")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Save Editor Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Save Editor Window."));
|
||||||
|
|
||||||
// Hook Debugger
|
// Hook Debugger
|
||||||
@@ -148,6 +151,7 @@ void SohMenu::AddMenuDevTools() {
|
|||||||
AddWidget(path, "Popout Hook Debugger", WIDGET_WINDOW_BUTTON)
|
AddWidget(path, "Popout Hook Debugger", WIDGET_WINDOW_BUTTON)
|
||||||
.CVar(CVAR_WINDOW("HookDebugger"))
|
.CVar(CVAR_WINDOW("HookDebugger"))
|
||||||
.WindowName("Hook Debugger")
|
.WindowName("Hook Debugger")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Hook Debugger Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Hook Debugger Window."));
|
||||||
|
|
||||||
// Collision Viewer
|
// Collision Viewer
|
||||||
@@ -156,6 +160,7 @@ void SohMenu::AddMenuDevTools() {
|
|||||||
AddWidget(path, "Popout Collision Viewer", WIDGET_WINDOW_BUTTON)
|
AddWidget(path, "Popout Collision Viewer", WIDGET_WINDOW_BUTTON)
|
||||||
.CVar(CVAR_WINDOW("CollisionViewer"))
|
.CVar(CVAR_WINDOW("CollisionViewer"))
|
||||||
.WindowName("Collision Viewer")
|
.WindowName("Collision Viewer")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Collision Viewer Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Collision Viewer Window."));
|
||||||
|
|
||||||
// Actor Viewer
|
// Actor Viewer
|
||||||
@@ -164,6 +169,7 @@ void SohMenu::AddMenuDevTools() {
|
|||||||
AddWidget(path, "Popout Actor Viewer", WIDGET_WINDOW_BUTTON)
|
AddWidget(path, "Popout Actor Viewer", WIDGET_WINDOW_BUTTON)
|
||||||
.CVar(CVAR_WINDOW("ActorViewer"))
|
.CVar(CVAR_WINDOW("ActorViewer"))
|
||||||
.WindowName("Actor Viewer")
|
.WindowName("Actor Viewer")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Actor Viewer Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Actor Viewer Window."));
|
||||||
|
|
||||||
// Display List Viewer
|
// Display List Viewer
|
||||||
@@ -172,6 +178,7 @@ void SohMenu::AddMenuDevTools() {
|
|||||||
AddWidget(path, "Popout Display List Viewer", WIDGET_WINDOW_BUTTON)
|
AddWidget(path, "Popout Display List Viewer", WIDGET_WINDOW_BUTTON)
|
||||||
.CVar(CVAR_WINDOW("DisplayListViewer"))
|
.CVar(CVAR_WINDOW("DisplayListViewer"))
|
||||||
.WindowName("Display List Viewer")
|
.WindowName("Display List Viewer")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Display List Viewer Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Display List Viewer Window."));
|
||||||
|
|
||||||
// Value Viewer
|
// Value Viewer
|
||||||
@@ -180,6 +187,7 @@ void SohMenu::AddMenuDevTools() {
|
|||||||
AddWidget(path, "Popout Value Viewer", WIDGET_WINDOW_BUTTON)
|
AddWidget(path, "Popout Value Viewer", WIDGET_WINDOW_BUTTON)
|
||||||
.CVar(CVAR_WINDOW("ValueViewer"))
|
.CVar(CVAR_WINDOW("ValueViewer"))
|
||||||
.WindowName("Value Viewer")
|
.WindowName("Value Viewer")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Value Viewer Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Value Viewer Window."));
|
||||||
|
|
||||||
// Message Viewer
|
// Message Viewer
|
||||||
@@ -188,6 +196,7 @@ void SohMenu::AddMenuDevTools() {
|
|||||||
AddWidget(path, "Popout Message Viewer", WIDGET_WINDOW_BUTTON)
|
AddWidget(path, "Popout Message Viewer", WIDGET_WINDOW_BUTTON)
|
||||||
.CVar(CVAR_WINDOW("MessageViewer"))
|
.CVar(CVAR_WINDOW("MessageViewer"))
|
||||||
.WindowName("Message Viewer")
|
.WindowName("Message Viewer")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Message Viewer Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Message Viewer Window."));
|
||||||
|
|
||||||
// Gfx Debugger
|
// Gfx Debugger
|
||||||
@@ -196,6 +205,7 @@ void SohMenu::AddMenuDevTools() {
|
|||||||
AddWidget(path, "Popout Gfx Debugger", WIDGET_WINDOW_BUTTON)
|
AddWidget(path, "Popout Gfx Debugger", WIDGET_WINDOW_BUTTON)
|
||||||
.CVar(CVAR_WINDOW("SohGfxDebugger"))
|
.CVar(CVAR_WINDOW("SohGfxDebugger"))
|
||||||
.WindowName("GfxDebugger##SoH")
|
.WindowName("GfxDebugger##SoH")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Gfx Debugger Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Gfx Debugger Window."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1844,6 +1844,7 @@ void SohMenu::AddMenuEnhancements() {
|
|||||||
.CVar(CVAR_WINDOW("CosmeticsEditor"))
|
.CVar(CVAR_WINDOW("CosmeticsEditor"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Cosmetics Editor")
|
.WindowName("Cosmetics Editor")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Cosmetics Editor Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Cosmetics Editor Window."));
|
||||||
|
|
||||||
// Audio Editor
|
// Audio Editor
|
||||||
@@ -1853,6 +1854,7 @@ void SohMenu::AddMenuEnhancements() {
|
|||||||
.CVar(CVAR_WINDOW("AudioEditor"))
|
.CVar(CVAR_WINDOW("AudioEditor"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Audio Editor")
|
.WindowName("Audio Editor")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Audio Editor Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Audio Editor Window."));
|
||||||
|
|
||||||
// Gameplay Stats
|
// Gameplay Stats
|
||||||
@@ -1862,6 +1864,7 @@ void SohMenu::AddMenuEnhancements() {
|
|||||||
.CVar(CVAR_WINDOW("GameplayStats"))
|
.CVar(CVAR_WINDOW("GameplayStats"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Gameplay Stats")
|
.WindowName("Gameplay Stats")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Gameplay Stats Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Gameplay Stats Window."));
|
||||||
|
|
||||||
// Time Splits
|
// Time Splits
|
||||||
@@ -1871,6 +1874,7 @@ void SohMenu::AddMenuEnhancements() {
|
|||||||
.CVar(CVAR_WINDOW("TimeSplits"))
|
.CVar(CVAR_WINDOW("TimeSplits"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Time Splits")
|
.WindowName("Time Splits")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Time Splits Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Time Splits Window."));
|
||||||
|
|
||||||
// Timers
|
// Timers
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ void SohMenu::AddMenuRandomizer() {
|
|||||||
AddWidget(path, "Popout Randomizer Settings Window", WIDGET_WINDOW_BUTTON)
|
AddWidget(path, "Popout Randomizer Settings Window", WIDGET_WINDOW_BUTTON)
|
||||||
.CVar(CVAR_WINDOW("RandomizerSettings"))
|
.CVar(CVAR_WINDOW("RandomizerSettings"))
|
||||||
.WindowName("Randomizer Settings")
|
.WindowName("Randomizer Settings")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Randomizer Settings Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Randomizer Settings Window."));
|
||||||
|
|
||||||
// Enhancements
|
// Enhancements
|
||||||
@@ -104,6 +105,7 @@ void SohMenu::AddMenuRandomizer() {
|
|||||||
.CVar(CVAR_WINDOW("PlandomizerEditor"))
|
.CVar(CVAR_WINDOW("PlandomizerEditor"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Plandomizer Editor")
|
.WindowName("Plandomizer Editor")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Randomizer Settings Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Randomizer Settings Window."));
|
||||||
|
|
||||||
// Item Tracker
|
// Item Tracker
|
||||||
@@ -115,6 +117,7 @@ void SohMenu::AddMenuRandomizer() {
|
|||||||
.CVar(CVAR_WINDOW("ItemTracker"))
|
.CVar(CVAR_WINDOW("ItemTracker"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Item Tracker")
|
.WindowName("Item Tracker")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Toggles the Item Tracker.").EmbedWindow(false));
|
.Options(WindowButtonOptions().Tooltip("Toggles the Item Tracker.").EmbedWindow(false));
|
||||||
|
|
||||||
AddWidget(path, "Item Tracker Settings", WIDGET_SEPARATOR_TEXT);
|
AddWidget(path, "Item Tracker Settings", WIDGET_SEPARATOR_TEXT);
|
||||||
@@ -122,6 +125,7 @@ void SohMenu::AddMenuRandomizer() {
|
|||||||
.CVar(CVAR_WINDOW("ItemTrackerSettings"))
|
.CVar(CVAR_WINDOW("ItemTrackerSettings"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Item Tracker Settings")
|
.WindowName("Item Tracker Settings")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Item Tracker Settings Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Item Tracker Settings Window."));
|
||||||
|
|
||||||
// Entrance Tracker
|
// Entrance Tracker
|
||||||
@@ -133,6 +137,7 @@ void SohMenu::AddMenuRandomizer() {
|
|||||||
.CVar(CVAR_WINDOW("EntranceTracker"))
|
.CVar(CVAR_WINDOW("EntranceTracker"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Entrance Tracker")
|
.WindowName("Entrance Tracker")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Toggles the Entrance Tracker.").EmbedWindow(false));
|
.Options(WindowButtonOptions().Tooltip("Toggles the Entrance Tracker.").EmbedWindow(false));
|
||||||
|
|
||||||
AddWidget(path, "Entrance Tracker Settings", WIDGET_SEPARATOR_TEXT);
|
AddWidget(path, "Entrance Tracker Settings", WIDGET_SEPARATOR_TEXT);
|
||||||
@@ -140,6 +145,7 @@ void SohMenu::AddMenuRandomizer() {
|
|||||||
.CVar(CVAR_WINDOW("EntranceTrackerSettings"))
|
.CVar(CVAR_WINDOW("EntranceTrackerSettings"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Entrance Tracker Settings")
|
.WindowName("Entrance Tracker Settings")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Entrance Tracker Settings Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Entrance Tracker Settings Window."));
|
||||||
|
|
||||||
// Check Tracker
|
// Check Tracker
|
||||||
@@ -151,6 +157,7 @@ void SohMenu::AddMenuRandomizer() {
|
|||||||
.CVar(CVAR_WINDOW("CheckTracker"))
|
.CVar(CVAR_WINDOW("CheckTracker"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Check Tracker")
|
.WindowName("Check Tracker")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Toggles the Check Tracker.").EmbedWindow(false));
|
.Options(WindowButtonOptions().Tooltip("Toggles the Check Tracker.").EmbedWindow(false));
|
||||||
|
|
||||||
AddWidget(path, "Check Tracker Settings", WIDGET_SEPARATOR_TEXT);
|
AddWidget(path, "Check Tracker Settings", WIDGET_SEPARATOR_TEXT);
|
||||||
@@ -158,6 +165,7 @@ void SohMenu::AddMenuRandomizer() {
|
|||||||
.CVar(CVAR_WINDOW("CheckTrackerSettings"))
|
.CVar(CVAR_WINDOW("CheckTrackerSettings"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Check Tracker Settings")
|
.WindowName("Check Tracker Settings")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Check Tracker Settings Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Check Tracker Settings Window."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -433,6 +433,7 @@ void SohMenu::AddMenuSettings() {
|
|||||||
.CVar(CVAR_WINDOW("ControllerConfiguration"))
|
.CVar(CVAR_WINDOW("ControllerConfiguration"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Configure Controller")
|
.WindowName("Configure Controller")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Bindings Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Bindings Window."));
|
||||||
|
|
||||||
// Input Viewer
|
// Input Viewer
|
||||||
@@ -443,6 +444,7 @@ void SohMenu::AddMenuSettings() {
|
|||||||
.CVar(CVAR_WINDOW("InputViewer"))
|
.CVar(CVAR_WINDOW("InputViewer"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Input Viewer")
|
.WindowName("Input Viewer")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Toggles the Input Viewer.").EmbedWindow(false));
|
.Options(WindowButtonOptions().Tooltip("Toggles the Input Viewer.").EmbedWindow(false));
|
||||||
|
|
||||||
AddWidget(path, "Input Viewer Settings", WIDGET_SEPARATOR_TEXT);
|
AddWidget(path, "Input Viewer Settings", WIDGET_SEPARATOR_TEXT);
|
||||||
@@ -450,6 +452,7 @@ void SohMenu::AddMenuSettings() {
|
|||||||
.CVar(CVAR_WINDOW("InputViewerSettings"))
|
.CVar(CVAR_WINDOW("InputViewerSettings"))
|
||||||
.RaceDisable(false)
|
.RaceDisable(false)
|
||||||
.WindowName("Input Viewer Settings")
|
.WindowName("Input Viewer Settings")
|
||||||
|
.HideInSearch(true)
|
||||||
.Options(WindowButtonOptions().Tooltip("Enables the separate Input Viewer Settings Window."));
|
.Options(WindowButtonOptions().Tooltip("Enables the separate Input Viewer Settings Window."));
|
||||||
|
|
||||||
// Notifications
|
// Notifications
|
||||||
|
|||||||
@@ -162,6 +162,64 @@ struct ButtonOptions : WidgetOptions {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ColorPickerOptions : WidgetOptions {
|
||||||
|
ImVec2 size = Sizes::Fill;
|
||||||
|
ImVec2 padding = ImVec2(10.0f, 8.0f);
|
||||||
|
Colors color = Colors::Gray;
|
||||||
|
Color_RGBA8 defaultValue = { 255, 255, 255, 255 };
|
||||||
|
bool useAlpha, showReset, showRandom, showRainbow, showLock;
|
||||||
|
|
||||||
|
ColorPickerOptions& Size(ImVec2 size_) {
|
||||||
|
size = size_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
ColorPickerOptions& Padding(ImVec2 padding_) {
|
||||||
|
padding = padding_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
ColorPickerOptions& Tooltip(const char* tooltip_) {
|
||||||
|
WidgetOptions::tooltip = tooltip_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
ColorPickerOptions& ShowReset(bool showReset_ = true) {
|
||||||
|
showReset = showReset_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
ColorPickerOptions& ShowRandom(bool showRandom_ = true) {
|
||||||
|
showRandom = showRandom_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
ColorPickerOptions& ShowRainbow(bool showRainbow_ = true) {
|
||||||
|
showRainbow = showRainbow_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
ColorPickerOptions& ShowLock(bool showLock_ = true) {
|
||||||
|
showLock = showLock_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
ColorPickerOptions& UseAlpha(bool useAlpha_ = true) {
|
||||||
|
useAlpha = useAlpha_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
ColorPickerOptions& Color(Colors color_) {
|
||||||
|
color = color_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
ColorPickerOptions& DefaultValue(Color_RGBA8 defaultValue_) {
|
||||||
|
defaultValue = defaultValue_;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
struct WindowButtonOptions : WidgetOptions {
|
struct WindowButtonOptions : WidgetOptions {
|
||||||
ImVec2 size = Sizes::Inline;
|
ImVec2 size = Sizes::Inline;
|
||||||
ImVec2 padding = ImVec2(10.0f, 8.0f);
|
ImVec2 padding = ImVec2(10.0f, 8.0f);
|
||||||
|
|||||||
Reference in New Issue
Block a user