and make it build

This commit is contained in:
briaguya 2022-09-03 04:23:25 -04:00
parent 975a854054
commit 3a6d7fcfd0
7 changed files with 165 additions and 205 deletions

View File

@ -1,32 +0,0 @@
#include "ImGuiHelpers.h"
#include "../../../../libultraship/libultraship/ImGuiImpl.h"
// Adds a text tooltip for the previous ImGui item
void SetLastItemHoverText(const std::string& text) {
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text(SohImGui::BreakTooltip(text, 60).c_str());
ImGui::EndTooltip();
}
}
// Adds a "?" next to the previous ImGui item with a custom tooltip
void InsertHelpHoverText(const std::string& text) {
ImGui::SameLine();
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "?");
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text(SohImGui::BreakTooltip(text, 60).c_str());
ImGui::EndTooltip();
}
}
void PaddedSeparator(bool padTop, bool padBottom, float extraVerticalPadding) {
if (padTop) {
ImGui::Dummy(ImVec2(0.0f, extraVerticalPadding));
}
ImGui::Separator();
if (padBottom) {
ImGui::Dummy(ImVec2(0.0f, extraVerticalPadding));
}
}

View File

@ -1,10 +0,0 @@
#pragma once
#include "../libultraship/Lib/ImGui/imgui.h"
#include <string>
void SetLastItemHoverText(const std::string& text);
void InsertHelpHoverText(const std::string& text);
void PaddedSeparator(bool padTop = true, bool padBottom = true, float extraVerticalPadding = 0);

View File

@ -1,5 +1,6 @@
#include "debugSaveEditor.h" #include "debugSaveEditor.h"
#include "../../util.h" #include "../../util.h"
#include "../../OTRGlobals.h"
#include <libultraship/ImGuiImpl.h> #include <libultraship/ImGuiImpl.h>
#include "../../UIWidgets.hpp" #include "../../UIWidgets.hpp"
@ -623,7 +624,7 @@ void DrawInventoryTab() {
gSaveContext.inventory.items[selectedIndex] = slotEntry.id; gSaveContext.inventory.items[selectedIndex] = slotEntry.id;
// Set adult trade item flag if you're playing adult trade shuffle in rando // Set adult trade item flag if you're playing adult trade shuffle in rando
if (gSaveContext.n64ddFlag && if (gSaveContext.n64ddFlag &&
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_ADULT_TRADE); OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_ADULT_TRADE) &&
selectedIndex == SLOT_TRADE_ADULT && selectedIndex == SLOT_TRADE_ADULT &&
slotEntry.id >= ITEM_POCKET_EGG && slotEntry.id <= ITEM_CLAIM_CHECK) { slotEntry.id >= ITEM_POCKET_EGG && slotEntry.id <= ITEM_CLAIM_CHECK) {
gSaveContext.adultTradeItems |= ADULT_TRADE_FLAG(slotEntry.id); gSaveContext.adultTradeItems |= ADULT_TRADE_FLAG(slotEntry.id);

View File

@ -3567,7 +3567,7 @@ void DrawRandoEditor(bool& open) {
bool disableEditingRandoSettings = CVar_GetS32("gRandoGenerating", 0) || CVar_GetS32("gOnFileSelectNameEntry", 0); bool disableEditingRandoSettings = CVar_GetS32("gRandoGenerating", 0) || CVar_GetS32("gOnFileSelectNameEntry", 0);
ImGui::PushItemFlag(ImGuiItemFlags_Disabled, disableEditingRandoSettings); ImGui::PushItemFlag(ImGuiItemFlags_Disabled, disableEditingRandoSettings);
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * (disableEditingRandoSettings ? 0.5f : 1.0f)); ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * (disableEditingRandoSettings ? 0.5f : 1.0f));
SohImGui::EnhancementCheckbox("Enable Randomizer", "gRandomizer"); UIWidgets::EnhancementCheckbox("Enable Randomizer", "gRandomizer");
if (CVar_GetS32("gRandomizer", 0)) { if (CVar_GetS32("gRandomizer", 0)) {
ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f));
@ -3585,7 +3585,7 @@ void DrawRandoEditor(bool& open) {
// ImGui::Text("Settings File: %s", presetfilepath.c_str()); // ImGui::Text("Settings File: %s", presetfilepath.c_str());
} }
PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGuiWindow* window = ImGui::GetCurrentWindow(); ImGuiWindow* window = ImGui::GetCurrentWindow();
static ImVec2 cellPadding(8.0f, 8.0f); static ImVec2 cellPadding(8.0f, 8.0f);
@ -3611,7 +3611,7 @@ void DrawRandoEditor(bool& open) {
// Forest // Forest
ImGui::Text(Settings::OpenForest.GetName().c_str()); ImGui::Text(Settings::OpenForest.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Closed - Kokiri sword & shield are required to access " "Closed - Kokiri sword & shield are required to access "
"the Deku Tree, and completing the Deku Tree is required to " "the Deku Tree, and completing the Deku Tree is required to "
"access the Hyrule Field exit.\n" "access the Hyrule Field exit.\n"
@ -3623,26 +3623,26 @@ void DrawRandoEditor(bool& open) {
"Open - Mido no longer blocks the path to the Deku Tree. Kokiri " "Open - Mido no longer blocks the path to the Deku Tree. Kokiri "
"boy no longer blocks the path out of the forest." "boy no longer blocks the path out of the forest."
); );
SohImGui::EnhancementCombobox("gRandomizeForest", randoForest, 3, 0); UIWidgets::EnhancementCombobox("gRandomizeForest", randoForest, 3, 0);
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Kakariko Gate // Kakariko Gate
ImGui::Text(Settings::OpenKakariko.GetName().c_str()); ImGui::Text(Settings::OpenKakariko.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Closed - The gate will remain closed until Zelda's letter " "Closed - The gate will remain closed until Zelda's letter "
"is shown to the guard.\n" "is shown to the guard.\n"
"\n" "\n"
"Open - The gate is always open. The happy mask shop " "Open - The gate is always open. The happy mask shop "
"will open immediately after obtaining Zelda's letter." "will open immediately after obtaining Zelda's letter."
); );
SohImGui::EnhancementCombobox("gRandomizeKakarikoGate", randoKakarikoGate, 2, 0); UIWidgets::EnhancementCombobox("gRandomizeKakarikoGate", randoKakarikoGate, 2, 0);
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Door of Time // Door of Time
ImGui::Text(Settings::OpenDoorOfTime.GetName().c_str()); ImGui::Text(Settings::OpenDoorOfTime.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Closed - The Ocarina of Time, the Song of Time and all " "Closed - The Ocarina of Time, the Song of Time and all "
"three spiritual stones are required to open the Door of Time.\n" "three spiritual stones are required to open the Door of Time.\n"
"\n" "\n"
@ -3651,13 +3651,13 @@ void DrawRandoEditor(bool& open) {
"\n" "\n"
"Open - The Door of Time is permanently open with no requirements." "Open - The Door of Time is permanently open with no requirements."
); );
SohImGui::EnhancementCombobox("gRandomizeDoorOfTime", randoDoorOfTime, 3, 0); UIWidgets::EnhancementCombobox("gRandomizeDoorOfTime", randoDoorOfTime, 3, 0);
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Zora's Fountain // Zora's Fountain
ImGui::Text(Settings::ZorasFountain.GetName().c_str()); ImGui::Text(Settings::ZorasFountain.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Closed - King Zora obstructs the way to Zora's Fountain. " "Closed - King Zora obstructs the way to Zora's Fountain. "
"Ruto's letter must be shown as child Link in order to move " "Ruto's letter must be shown as child Link in order to move "
"him in both time periods.\n" "him in both time periods.\n"
@ -3668,9 +3668,9 @@ void DrawRandoEditor(bool& open) {
"Open - King Zora has already mweeped out of the way in both " "Open - King Zora has already mweeped out of the way in both "
"time periods. Ruto's Letter is removed from the item pool." "time periods. Ruto's Letter is removed from the item pool."
); );
SohImGui::EnhancementCombobox("gRandomizeZorasFountain", randoZorasFountain, 3, 0); UIWidgets::EnhancementCombobox("gRandomizeZorasFountain", randoZorasFountain, 3, 0);
PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGui::EndChild(); ImGui::EndChild();
@ -3682,7 +3682,7 @@ void DrawRandoEditor(bool& open) {
// Gerudo Fortress // Gerudo Fortress
ImGui::Text("Gerudo Fortress Carpenters"); ImGui::Text("Gerudo Fortress Carpenters");
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Sets the amount of carpenters required to repair the bridge " "Sets the amount of carpenters required to repair the bridge "
"in Gerudo Valley.\n" "in Gerudo Valley.\n"
"\n" "\n"
@ -3692,13 +3692,13 @@ void DrawRandoEditor(bool& open) {
"\n" "\n"
"Open - The bridge is repaired from the start." "Open - The bridge is repaired from the start."
); );
SohImGui::EnhancementCombobox("gRandomizeGerudoFortress", randoGerudoFortress, 3, 0); UIWidgets::EnhancementCombobox("gRandomizeGerudoFortress", randoGerudoFortress, 3, 0);
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Rainbow Bridge // Rainbow Bridge
ImGui::Text("Rainbow Bridge Requirements"); ImGui::Text("Rainbow Bridge Requirements");
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Alters the requirements to open the bridge to Ganon's Castle.\n" "Alters the requirements to open the bridge to Ganon's Castle.\n"
"\n" "\n"
"Vanilla - Obtain the Shadow Medallion, Spirit Medallion and Light Arrows.\n" "Vanilla - Obtain the Shadow Medallion, Spirit Medallion and Light Arrows.\n"
@ -3719,7 +3719,7 @@ void DrawRandoEditor(bool& open) {
"Tokens - Obtain the specified amount of Skulltula tokens." "Tokens - Obtain the specified amount of Skulltula tokens."
); );
SohImGui::EnhancementCombobox("gRandomizeRainbowBridge", randoRainbowBridge, 7, 0); UIWidgets::EnhancementCombobox("gRandomizeRainbowBridge", randoRainbowBridge, 7, 0);
ImGui::PopItemWidth(); ImGui::PopItemWidth();
switch (CVar_GetS32("gRandomizeRainbowBridge", 0)) { switch (CVar_GetS32("gRandomizeRainbowBridge", 0)) {
case 0: case 0:
@ -3728,37 +3728,37 @@ void DrawRandoEditor(bool& open) {
break; break;
case 2: case 2:
ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f));
SohImGui::EnhancementSliderInt("Stone Count: %d", "##RandoStoneCount", UIWidgets::EnhancementSliderInt("Stone Count: %d", "##RandoStoneCount",
"gRandomizeStoneCount", 1, 3, "", 3, true); "gRandomizeStoneCount", 1, 3, "", 3, true);
break; break;
case 3: case 3:
ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f));
SohImGui::EnhancementSliderInt("Medallion Count: %d", "##RandoMedallionCount", UIWidgets::EnhancementSliderInt("Medallion Count: %d", "##RandoMedallionCount",
"gRandomizeMedallionCount", 1, 6, "", 6, true); "gRandomizeMedallionCount", 1, 6, "", 6, true);
break; break;
case 4: case 4:
ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f));
SohImGui::EnhancementSliderInt("Reward Count: %d", "##RandoRewardCount", UIWidgets::EnhancementSliderInt("Reward Count: %d", "##RandoRewardCount",
"gRandomizeRewardCount", 1, 9, "", 9, true); "gRandomizeRewardCount", 1, 9, "", 9, true);
break; break;
case 5: case 5:
ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f));
SohImGui::EnhancementSliderInt("Dungeon Count: %d", "##RandoDungeonCount", UIWidgets::EnhancementSliderInt("Dungeon Count: %d", "##RandoDungeonCount",
"gRandomizeDungeonCount", 1, 8, "", 8, true); "gRandomizeDungeonCount", 1, 8, "", 8, true);
break; break;
case 6: case 6:
ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f));
SohImGui::EnhancementSliderInt("Token Count: %d", "##RandoTokenCount", UIWidgets::EnhancementSliderInt("Token Count: %d", "##RandoTokenCount",
"gRandomizeTokenCount", 1, 100, "", 100, true); "gRandomizeTokenCount", 1, 100, "", 100, true);
break; break;
} }
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Ganon's Trials // Ganon's Trials
ImGui::PushItemWidth(-FLT_MIN); ImGui::PushItemWidth(-FLT_MIN);
ImGui::Text("Ganon's Trials"); ImGui::Text("Ganon's Trials");
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Sets the number of Ganon's Trials required to dispel the barrier.\n" "Sets the number of Ganon's Trials required to dispel the barrier.\n"
"\n" "\n"
"Skip - No Trials are required and the barrier is already dispelled.\n" "Skip - No Trials are required and the barrier is already dispelled.\n"
@ -3768,16 +3768,16 @@ void DrawRandoEditor(bool& open) {
"\n" "\n"
"Random Number - A Random number and set of trials will be required." "Random Number - A Random number and set of trials will be required."
); );
SohImGui::EnhancementCombobox("gRandomizeGanonTrial", randoGanonsTrial, 3, 0); UIWidgets::EnhancementCombobox("gRandomizeGanonTrial", randoGanonsTrial, 3, 0);
ImGui::PopItemWidth(); ImGui::PopItemWidth();
if (CVar_GetS32("gRandomizeGanonTrial", 0) == 1) { if (CVar_GetS32("gRandomizeGanonTrial", 0) == 1) {
ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f));
SohImGui::EnhancementSliderInt("Ganon's Trial Count: %d", "##RandoTrialCount", UIWidgets::EnhancementSliderInt("Ganon's Trial Count: %d", "##RandoTrialCount",
"gRandomizeGanonTrialCount", 1, 6, "", 6, true); "gRandomizeGanonTrialCount", 1, 6, "", 6, true);
InsertHelpHoverText("Set the number of trials required to enter Ganon's Tower."); UIWidgets::InsertHelpHoverText("Set the number of trials required to enter Ganon's Tower.");
} }
PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGui::EndChild(); ImGui::EndChild();
@ -3789,7 +3789,7 @@ void DrawRandoEditor(bool& open) {
ImGui::Text("Coming soon"); ImGui::Text("Coming soon");
PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGui::PopItemWidth(); ImGui::PopItemWidth();
ImGui::EndChild(); ImGui::EndChild();
@ -3819,7 +3819,7 @@ void DrawRandoEditor(bool& open) {
// Shuffle Songs // Shuffle Songs
ImGui::Text(Settings::ShuffleSongs.GetName().c_str()); ImGui::Text(Settings::ShuffleSongs.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Song locations - Songs will only appear at locations that normally teach songs.\n" "Song locations - Songs will only appear at locations that normally teach songs.\n"
"\n" "\n"
"Dungeon rewards - Songs appear after beating a major dungeon boss.\n" "Dungeon rewards - Songs appear after beating a major dungeon boss.\n"
@ -3831,13 +3831,13 @@ void DrawRandoEditor(bool& open) {
"\n" "\n"
"Anywhere - Songs can appear at any location." "Anywhere - Songs can appear at any location."
); );
SohImGui::EnhancementCombobox("gRandomizeShuffleSongs", randoShuffleSongs, 3, 0); UIWidgets::EnhancementCombobox("gRandomizeShuffleSongs", randoShuffleSongs, 3, 0);
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Shuffle Tokens // Shuffle Tokens
ImGui::Text(Settings::Tokensanity.GetName().c_str()); ImGui::Text(Settings::Tokensanity.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Shuffles Golden Skulltula Tokens into the item pool. This means " "Shuffles Golden Skulltula Tokens into the item pool. This means "
"Golden Skulltulas can contain other items as well.\n" "Golden Skulltulas can contain other items as well.\n"
"\n" "\n"
@ -3849,53 +3849,53 @@ void DrawRandoEditor(bool& open) {
"\n" "\n"
"All Tokens - Shuffle all 100 GS tokens." "All Tokens - Shuffle all 100 GS tokens."
); );
SohImGui::EnhancementCombobox("gRandomizeShuffleTokens", randoTokensanity, 4, 0); UIWidgets::EnhancementCombobox("gRandomizeShuffleTokens", randoTokensanity, 4, 0);
ImGui::Dummy(ImVec2(0,0)); ImGui::Dummy(ImVec2(0,0));
SohImGui::EnhancementCheckbox("Nighttime GS expect Sun's Song", "gRandomizeGsExpectSunsSong"); UIWidgets::EnhancementCheckbox("Nighttime GS expect Sun's Song", "gRandomizeGsExpectSunsSong");
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"All Golden Skulltulas that require nighttime to appear will only be " "All Golden Skulltulas that require nighttime to appear will only be "
"expected to be collected after getting Sun's Song." "expected to be collected after getting Sun's Song."
); );
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Shuffle Kokiri Sword // Shuffle Kokiri Sword
// Disabled when Start with Kokiri Sword is active // Disabled when Start with Kokiri Sword is active
bool disableShuffleKokiriSword = CVar_GetS32("gRandomizeStartingKokiriSword", 0); bool disableShuffleKokiriSword = CVar_GetS32("gRandomizeStartingKokiriSword", 0);
const char* disableShuffleKokiriSwordText = "This option is disabled because \"Start with Kokiri Sword\" is enabled."; const char* disableShuffleKokiriSwordText = "This option is disabled because \"Start with Kokiri Sword\" is enabled.";
SohImGui::EnhancementCheckbox(Settings::ShuffleKokiriSword.GetName().c_str(), "gRandomizeShuffleKokiriSword", UIWidgets::EnhancementCheckbox(Settings::ShuffleKokiriSword.GetName().c_str(), "gRandomizeShuffleKokiriSword",
disableShuffleKokiriSword, disableShuffleKokiriSwordText); disableShuffleKokiriSword, disableShuffleKokiriSwordText);
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Shuffles the Kokiri Sword into the item pool.\n" "Shuffles the Kokiri Sword into the item pool.\n"
"\n" "\n"
"This will require the use of sticks until the Kokiri Sword is found." "This will require the use of sticks until the Kokiri Sword is found."
); );
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Shuffle Ocarinas // Shuffle Ocarinas
// Disabled when Start with Ocarina is active // Disabled when Start with Ocarina is active
bool disableShuffleOcarinas = CVar_GetS32("gRandomizeStartingOcarina", 0); bool disableShuffleOcarinas = CVar_GetS32("gRandomizeStartingOcarina", 0);
const char* disableShuffleOcarinasText = "This option is disabled because \"Start with Fairy Ocarina\" is enabled."; const char* disableShuffleOcarinasText = "This option is disabled because \"Start with Fairy Ocarina\" is enabled.";
SohImGui::EnhancementCheckbox(Settings::ShuffleOcarinas.GetName().c_str(), "gRandomizeShuffleOcarinas", UIWidgets::EnhancementCheckbox(Settings::ShuffleOcarinas.GetName().c_str(), "gRandomizeShuffleOcarinas",
disableShuffleOcarinas, disableShuffleOcarinasText); disableShuffleOcarinas, disableShuffleOcarinasText);
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Enabling this shuffles the Fairy Ocarina and the Ocarina of Time into the item pool.\n" "Enabling this shuffles the Fairy Ocarina and the Ocarina of Time into the item pool.\n"
"\n" "\n"
"This will require finding an Ocarina before being able to play songs." "This will require finding an Ocarina before being able to play songs."
); );
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Shuffle Weird Egg // Shuffle Weird Egg
// Disabled when Skip Child Zelda is active // Disabled when Skip Child Zelda is active
bool disableShuffleWeirdEgg = CVar_GetS32("gRandomizeSkipChildZelda", 0); bool disableShuffleWeirdEgg = CVar_GetS32("gRandomizeSkipChildZelda", 0);
const char* disableShuffleWeirdEggText = "This option is disabled because \"Skip Child Zelda\" is enabled."; const char* disableShuffleWeirdEggText = "This option is disabled because \"Skip Child Zelda\" is enabled.";
SohImGui::EnhancementCheckbox(Settings::ShuffleWeirdEgg.GetName().c_str(), "gRandomizeShuffleWeirdEgg", UIWidgets::EnhancementCheckbox(Settings::ShuffleWeirdEgg.GetName().c_str(), "gRandomizeShuffleWeirdEgg",
disableShuffleWeirdEgg, disableShuffleWeirdEggText); disableShuffleWeirdEgg, disableShuffleWeirdEggText);
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Shuffles the Weird Egg from Malon in to the item pool. Enabling " "Shuffles the Weird Egg from Malon in to the item pool. Enabling "
"\"Skip Child Zelda\" disables this feature.\n" "\"Skip Child Zelda\" disables this feature.\n"
"\n" "\n"
@ -3907,19 +3907,19 @@ void DrawRandoEditor(bool& open) {
" - Happy Mask Shop sidequest\n" " - Happy Mask Shop sidequest\n"
); );
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Shuffle Gerudo Membership Card // Shuffle Gerudo Membership Card
SohImGui::EnhancementCheckbox(Settings::ShuffleGerudoToken.GetName().c_str(), UIWidgets::EnhancementCheckbox(Settings::ShuffleGerudoToken.GetName().c_str(),
"gRandomizeShuffleGerudoToken"); "gRandomizeShuffleGerudoToken");
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Shuffles the Gerudo Membership Card into the item pool.\n" "Shuffles the Gerudo Membership Card into the item pool.\n"
"\n" "\n"
"The Gerudo Card is required to enter the Gerudo Training Grounds, opening " "The Gerudo Card is required to enter the Gerudo Training Grounds, opening "
"the gate to Haunted Wasteland and the Horseback Archery minigame." "the gate to Haunted Wasteland and the Horseback Archery minigame."
); );
PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGui::PopItemWidth(); ImGui::PopItemWidth();
ImGui::EndChild(); ImGui::EndChild();
@ -3932,7 +3932,7 @@ void DrawRandoEditor(bool& open) {
// Shuffle Scrubs // Shuffle Scrubs
ImGui::Text(Settings::Scrubsanity.GetName().c_str()); ImGui::Text(Settings::Scrubsanity.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Off - Scrubs will not be shuffled. The 3 Scrubs that give one-time items in the vanilla game " "Off - Scrubs will not be shuffled. The 3 Scrubs that give one-time items in the vanilla game "
"(PoH, Deku Nut capacity, and Deku Stick capacity) will have random items.\n" "(PoH, Deku Nut capacity, and Deku Stick capacity) will have random items.\n"
"\n" "\n"
@ -3941,27 +3941,27 @@ void DrawRandoEditor(bool& open) {
"Expensive - Scrubs will be shuffled and their item will cost the vanilla price.\n" "Expensive - Scrubs will be shuffled and their item will cost the vanilla price.\n"
"\n" "\n"
"Random - Scrubs will be shuffled and their item will cost will be between 0-95 rupees.\n"); "Random - Scrubs will be shuffled and their item will cost will be between 0-95 rupees.\n");
SohImGui::EnhancementCombobox("gRandomizeShuffleScrubs", randoShuffleScrubs, 4, 0); UIWidgets::EnhancementCombobox("gRandomizeShuffleScrubs", randoShuffleScrubs, 4, 0);
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Shuffle Cows // Shuffle Cows
SohImGui::EnhancementCheckbox(Settings::ShuffleCows.GetName().c_str(), "gRandomizeShuffleCows"); UIWidgets::EnhancementCheckbox(Settings::ShuffleCows.GetName().c_str(), "gRandomizeShuffleCows");
InsertHelpHoverText("Cows give a randomized item from the pool upon performing Epona's Song in front of them."); UIWidgets::InsertHelpHoverText("Cows give a randomized item from the pool upon performing Epona's Song in front of them.");
PaddedSeparator(); UIWidgets::PaddedSeparator();
SohImGui::EnhancementCheckbox(Settings::ShuffleMagicBeans.GetName().c_str(), "gRandomizeShuffleBeans"); UIWidgets::EnhancementCheckbox(Settings::ShuffleMagicBeans.GetName().c_str(), "gRandomizeShuffleBeans");
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Enabling this adds a pack of 10 beans to the item pool and changes the Magic Bean " "Enabling this adds a pack of 10 beans to the item pool and changes the Magic Bean "
"Salesman to sell a random item at a price of 60 rupees." "Salesman to sell a random item at a price of 60 rupees."
); );
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Shuffle Frog Song Rupees // Shuffle Frog Song Rupees
SohImGui::EnhancementCheckbox(Settings::ShuffleFrogSongRupees.GetName().c_str(), "gRandomizeShuffleFrogSongRupees"); UIWidgets::EnhancementCheckbox(Settings::ShuffleFrogSongRupees.GetName().c_str(), "gRandomizeShuffleFrogSongRupees");
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Shuffles 5 Purple Rupees into to the item pool, and allows\n" "Shuffles 5 Purple Rupees into to the item pool, and allows\n"
"you to earn items by playing songs at the Frog Choir.\n" "you to earn items by playing songs at the Frog Choir.\n"
"\n" "\n"
@ -3969,12 +3969,12 @@ void DrawRandoEditor(bool& open) {
"the Song of Storms and the frog song minigame." "the Song of Storms and the frog song minigame."
); );
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Shuffle Adult Trade Quest // Shuffle Adult Trade Quest
SohImGui::EnhancementCheckbox(Settings::ShuffleAdultTradeQuest.GetName().c_str(), UIWidgets::EnhancementCheckbox(Settings::ShuffleAdultTradeQuest.GetName().c_str(),
"gRandomizeShuffleAdultTrade"); "gRandomizeShuffleAdultTrade");
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Adds all of the adult trade quest items into the pool, each of which " "Adds all of the adult trade quest items into the pool, each of which "
"can be traded for a unique reward.\n" "can be traded for a unique reward.\n"
"\n" "\n"
@ -3985,7 +3985,7 @@ void DrawRandoEditor(bool& open) {
"If disabled, only the Claim Check will be found in the pool." "If disabled, only the Claim Check will be found in the pool."
); );
PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGui::PopItemWidth(); ImGui::PopItemWidth();
ImGui::EndChild(); ImGui::EndChild();
@ -3998,7 +3998,7 @@ void DrawRandoEditor(bool& open) {
// Shuffle Dungeon Rewards // Shuffle Dungeon Rewards
ImGui::Text(Settings::ShuffleRewards.GetName().c_str()); ImGui::Text(Settings::ShuffleRewards.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Shuffles the location of spiritual stones and medallions.\n" "Shuffles the location of spiritual stones and medallions.\n"
"\n" "\n"
"End of dungeons - Spiritual stones and medallions will be given as rewards " "End of dungeons - Spiritual stones and medallions will be given as rewards "
@ -4010,13 +4010,13 @@ void DrawRandoEditor(bool& open) {
"\n" "\n"
"Anywhere - Spiritual stones and medallions can appear anywhere." "Anywhere - Spiritual stones and medallions can appear anywhere."
); );
SohImGui::EnhancementCombobox("gRandomizeShuffleDungeonReward", randoShuffleDungeonRewards, 4, 0); UIWidgets::EnhancementCombobox("gRandomizeShuffleDungeonReward", randoShuffleDungeonRewards, 4, 0);
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Maps & Compasses // Maps & Compasses
ImGui::Text(Settings::MapsAndCompasses.GetName().c_str()); ImGui::Text(Settings::MapsAndCompasses.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Start with - You will start with Maps & Compasses from all dungeons.\n" "Start with - You will start with Maps & Compasses from all dungeons.\n"
"\n" "\n"
"Vanilla - Maps & Compasses will appear in their vanilla locations.\n" "Vanilla - Maps & Compasses will appear in their vanilla locations.\n"
@ -4029,13 +4029,13 @@ void DrawRandoEditor(bool& open) {
"\n" "\n"
"Anywhere - Maps & Compasses can appear anywhere in the world." "Anywhere - Maps & Compasses can appear anywhere in the world."
); );
SohImGui::EnhancementCombobox("gRandomizeStartingMapsCompasses", randoShuffleMapsAndCompasses, 6, 2); UIWidgets::EnhancementCombobox("gRandomizeStartingMapsCompasses", randoShuffleMapsAndCompasses, 6, 2);
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Keysanity // Keysanity
ImGui::Text(Settings::Keysanity.GetName().c_str()); ImGui::Text(Settings::Keysanity.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Start with - You will start with all Small Keys from all dungeons.\n" "Start with - You will start with all Small Keys from all dungeons.\n"
"\n" "\n"
"Vanilla - Small Keys will appear in their vanilla locations.\n" "Vanilla - Small Keys will appear in their vanilla locations.\n"
@ -4048,13 +4048,13 @@ void DrawRandoEditor(bool& open) {
"\n" "\n"
"Anywhere - Small Keys can appear anywhere in the world." "Anywhere - Small Keys can appear anywhere in the world."
); );
SohImGui::EnhancementCombobox("gRandomizeKeysanity", randoShuffleSmallKeys, 6, 2); UIWidgets::EnhancementCombobox("gRandomizeKeysanity", randoShuffleSmallKeys, 6, 2);
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Gerudo Keys // Gerudo Keys
ImGui::Text(Settings::GerudoKeys.GetName().c_str()); ImGui::Text(Settings::GerudoKeys.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Vanilla - Thieve's Hideout Keys will appear in their vanilla locations.\n" "Vanilla - Thieve's Hideout Keys will appear in their vanilla locations.\n"
"\n" "\n"
"Any dungeon - Thieve's Hideout Keys can only appear inside of any dungon.\n" "Any dungeon - Thieve's Hideout Keys can only appear inside of any dungon.\n"
@ -4063,13 +4063,13 @@ void DrawRandoEditor(bool& open) {
"\n" "\n"
"Anywhere - Thieve's Hideout Keys can appear anywhere in the world." "Anywhere - Thieve's Hideout Keys can appear anywhere in the world."
); );
SohImGui::EnhancementCombobox("gRandomizeGerudoKeys", randoShuffleGerudoFortressKeys, 4, 0); UIWidgets::EnhancementCombobox("gRandomizeGerudoKeys", randoShuffleGerudoFortressKeys, 4, 0);
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Boss Keysanity // Boss Keysanity
ImGui::Text(Settings::BossKeysanity.GetName().c_str()); ImGui::Text(Settings::BossKeysanity.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Start with - You will start with Boss keys from all dungeons.\n" "Start with - You will start with Boss keys from all dungeons.\n"
"\n" "\n"
"Vanilla - Boss Keys will appear in their vanilla locations.\n" "Vanilla - Boss Keys will appear in their vanilla locations.\n"
@ -4082,13 +4082,13 @@ void DrawRandoEditor(bool& open) {
"\n" "\n"
"Anywhere - Boss Keys can appear anywhere in the world." "Anywhere - Boss Keys can appear anywhere in the world."
); );
SohImGui::EnhancementCombobox("gRandomizeBossKeysanity", randoShuffleBossKeys, 6, 2); UIWidgets::EnhancementCombobox("gRandomizeBossKeysanity", randoShuffleBossKeys, 6, 2);
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Ganon's Boss Key // Ganon's Boss Key
ImGui::Text(Settings::GanonsBossKey.GetName().c_str()); ImGui::Text(Settings::GanonsBossKey.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Vanilla - Ganon's Boss Key will appear in the vanilla location.\n" "Vanilla - Ganon's Boss Key will appear in the vanilla location.\n"
"\n" "\n"
"Own dungeon - Ganon's Boss Key can appear anywhere inside Ganon's Castle.\n" "Own dungeon - Ganon's Boss Key can appear anywhere inside Ganon's Castle.\n"
@ -4101,9 +4101,9 @@ void DrawRandoEditor(bool& open) {
"\n" "\n"
"Anywhere - Ganon's Boss Key Key can appear anywhere in the world." "Anywhere - Ganon's Boss Key Key can appear anywhere in the world."
); );
SohImGui::EnhancementCombobox("gRandomizeShuffleGanonBossKey", randoShuffleGanonsBossKey, 6, 1); UIWidgets::EnhancementCombobox("gRandomizeShuffleGanonBossKey", randoShuffleGanonsBossKey, 6, 1);
PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGui::PopItemWidth(); ImGui::PopItemWidth();
ImGui::EndChild(); ImGui::EndChild();
@ -4130,53 +4130,53 @@ void DrawRandoEditor(bool& open) {
ImGui::BeginChild("ChildTimeSavers", ImVec2(0, -8)); ImGui::BeginChild("ChildTimeSavers", ImVec2(0, -8));
// Cuccos to return // Cuccos to return
SohImGui::EnhancementSliderInt("Cuccos to return: %d", "##RandoCuccosToReturn", UIWidgets::EnhancementSliderInt("Cuccos to return: %d", "##RandoCuccosToReturn",
"gRandomizeCuccosToReturn", 0, 7, "", 7, true); "gRandomizeCuccosToReturn", 0, 7, "", 7, true);
InsertHelpHoverText("The amount of cuccos needed to claim the reward from Anju the cucco lady"); UIWidgets::InsertHelpHoverText("The amount of cuccos needed to claim the reward from Anju the cucco lady");
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Big Poe Target Count // Big Poe Target Count
SohImGui::EnhancementSliderInt("Big Poe Target Count: %d", "##RandoBigPoeTargetCount", UIWidgets::EnhancementSliderInt("Big Poe Target Count: %d", "##RandoBigPoeTargetCount",
"gRandomizeBigPoeTargetCount", 1, 10, "", 10, true); "gRandomizeBigPoeTargetCount", 1, 10, "", 10, true);
InsertHelpHoverText("The Poe collector will give a reward for turning in this many Big Poes."); UIWidgets::InsertHelpHoverText("The Poe collector will give a reward for turning in this many Big Poes.");
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Skip child stealth // Skip child stealth
// Disabled when Skip Child Zelda is active // Disabled when Skip Child Zelda is active
bool disableChildStealth = CVar_GetS32("gRandomizeSkipChildZelda", 0); bool disableChildStealth = CVar_GetS32("gRandomizeSkipChildZelda", 0);
const char* disableChildStealthText = "This option is disabled because \"Skip Child Zelda\" is enabled"; const char* disableChildStealthText = "This option is disabled because \"Skip Child Zelda\" is enabled";
SohImGui::EnhancementCheckbox(Settings::SkipChildStealth.GetName().c_str(), "gRandomizeSkipChildStealth", disableChildStealth, disableChildStealthText); UIWidgets::EnhancementCheckbox(Settings::SkipChildStealth.GetName().c_str(), "gRandomizeSkipChildStealth", disableChildStealth, disableChildStealthText);
InsertHelpHoverText("The crawlspace into Hyrule Castle goes straight to Zelda, skipping the guards."); UIWidgets::InsertHelpHoverText("The crawlspace into Hyrule Castle goes straight to Zelda, skipping the guards.");
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Skip child zelda // Skip child zelda
SohImGui::EnhancementCheckbox("Skip Child Zelda", "gRandomizeSkipChildZelda"); UIWidgets::EnhancementCheckbox("Skip Child Zelda", "gRandomizeSkipChildZelda");
InsertHelpHoverText("Start with Zelda's Letter and the item Impa would normally give you and skip the sequence up " UIWidgets::InsertHelpHoverText("Start with Zelda's Letter and the item Impa would normally give you and skip the sequence up "
"until after meeting Zelda. Disables the ability to shuffle Weird Egg."); "until after meeting Zelda. Disables the ability to shuffle Weird Egg.");
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Skip Epona race // Skip Epona race
SohImGui::EnhancementCheckbox(Settings::SkipEponaRace.GetName().c_str(), "gRandomizeSkipEponaRace"); UIWidgets::EnhancementCheckbox(Settings::SkipEponaRace.GetName().c_str(), "gRandomizeSkipEponaRace");
InsertHelpHoverText("Epona can be summoned with Epona's Song without needing to race Ingo."); UIWidgets::InsertHelpHoverText("Epona can be summoned with Epona's Song without needing to race Ingo.");
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Skip tower escape // Skip tower escape
SohImGui::EnhancementCheckbox(Settings::SkipTowerEscape.GetName().c_str(), "gRandomizeSkipTowerEscape"); UIWidgets::EnhancementCheckbox(Settings::SkipTowerEscape.GetName().c_str(), "gRandomizeSkipTowerEscape");
InsertHelpHoverText("The tower escape sequence between Ganondorf and Ganon will be skipped."); UIWidgets::InsertHelpHoverText("The tower escape sequence between Ganondorf and Ganon will be skipped.");
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Complete mask quest // Complete mask quest
SohImGui::EnhancementCheckbox(Settings::CompleteMaskQuest.GetName().c_str(), UIWidgets::EnhancementCheckbox(Settings::CompleteMaskQuest.GetName().c_str(),
"gRandomizeCompleteMaskQuest"); "gRandomizeCompleteMaskQuest");
InsertHelpHoverText("Once the happy mask shop is opened, all masks will be available to be borrowed."); UIWidgets::InsertHelpHoverText("Once the happy mask shop is opened, all masks will be available to be borrowed.");
PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGui::EndChild(); ImGui::EndChild();
@ -4188,7 +4188,7 @@ void DrawRandoEditor(bool& open) {
// Item Pool Settings // Item Pool Settings
ImGui::Text(Settings::ItemPoolValue.GetName().c_str()); ImGui::Text(Settings::ItemPoolValue.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Sets how many major items appear in the item pool.\n" "Sets how many major items appear in the item pool.\n"
"\n" "\n"
"Plentiful - Extra major items are added to the pool.\n" "Plentiful - Extra major items are added to the pool.\n"
@ -4199,12 +4199,12 @@ void DrawRandoEditor(bool& open) {
"\n" "\n"
"Minimal - Most excess items are removed." "Minimal - Most excess items are removed."
); );
SohImGui::EnhancementCombobox("gRandomizeItemPool", randoItemPool, 4, 1); UIWidgets::EnhancementCombobox("gRandomizeItemPool", randoItemPool, 4, 1);
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Ice Traps // Ice Traps
ImGui::Text(Settings::IceTrapValue.GetName().c_str()); ImGui::Text(Settings::IceTrapValue.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Sets how many items are replaced by ice traps.\n" "Sets how many items are replaced by ice traps.\n"
"\n" "\n"
"Off - No ice traps.\n" "Off - No ice traps.\n"
@ -4218,13 +4218,13 @@ void DrawRandoEditor(bool& open) {
"Onslaught - All junk items will be replaced by Ice Traps, even those " "Onslaught - All junk items will be replaced by Ice Traps, even those "
"in the base pool." "in the base pool."
); );
SohImGui::EnhancementCombobox("gRandomizeIceTraps", randoIceTraps, 5, 1); UIWidgets::EnhancementCombobox("gRandomizeIceTraps", randoIceTraps, 5, 1);
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Gossip Stone Hints // Gossip Stone Hints
ImGui::Text(Settings::GossipStoneHints.GetName().c_str()); ImGui::Text(Settings::GossipStoneHints.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Allows Gossip Stones to provide hints on item locations. Hints mentioning " "Allows Gossip Stones to provide hints on item locations. Hints mentioning "
"\"Way of the Hero\" indicate a location that holds an item required to beat " "\"Way of the Hero\" indicate a location that holds an item required to beat "
"the seed.\n" "the seed.\n"
@ -4236,13 +4236,13 @@ void DrawRandoEditor(bool& open) {
"Need Stone of Agony - Hints are only available after obtaining the Stone of Agony.\n" "Need Stone of Agony - Hints are only available after obtaining the Stone of Agony.\n"
"\n" "\n"
"Need Mask of Truth - Hints are only available whilst wearing the Mask of Truth.\n"); "Need Mask of Truth - Hints are only available whilst wearing the Mask of Truth.\n");
SohImGui::EnhancementCombobox("gRandomizeGossipStoneHints", randoGossipStoneHints, 4, 1); UIWidgets::EnhancementCombobox("gRandomizeGossipStoneHints", randoGossipStoneHints, 4, 1);
if (CVar_GetS32("gRandomizeGossipStoneHints", 1) != 0) { if (CVar_GetS32("gRandomizeGossipStoneHints", 1) != 0) {
// Hint Clarity // Hint Clarity
ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f));
ImGui::Indent(); ImGui::Indent();
ImGui::Text(Settings::ClearerHints.GetName().c_str()); ImGui::Text(Settings::ClearerHints.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Sets the difficulty of hints.\n" "Sets the difficulty of hints.\n"
"\n" "\n"
"Obscure - Hints are unique for each item, but the writing may be cryptic.\n" "Obscure - Hints are unique for each item, but the writing may be cryptic.\n"
@ -4254,12 +4254,12 @@ void DrawRandoEditor(bool& open) {
"Clear - Hints are clearly written and are unique for each item.\n" "Clear - Hints are clearly written and are unique for each item.\n"
"Ex: Kokiri Sword > the Kokiri Sword" "Ex: Kokiri Sword > the Kokiri Sword"
); );
SohImGui::EnhancementCombobox("gRandomizeHintClarity", randoHintClarity, 3, 2); UIWidgets::EnhancementCombobox("gRandomizeHintClarity", randoHintClarity, 3, 2);
// Hint Distribution // Hint Distribution
ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f));
ImGui::Text(Settings::HintDistribution.GetName().c_str()); ImGui::Text(Settings::HintDistribution.GetName().c_str());
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Sets how many hints will be useful.\n" "Sets how many hints will be useful.\n"
"\n" "\n"
"Useless - Only junk hints.\n" "Useless - Only junk hints.\n"
@ -4270,11 +4270,11 @@ void DrawRandoEditor(bool& open) {
"\n" "\n"
"Very Strong - Many powerful hints." "Very Strong - Many powerful hints."
); );
SohImGui::EnhancementCombobox("gRandomizeHintDistribution", randoHintDistribution, 4, 1); UIWidgets::EnhancementCombobox("gRandomizeHintDistribution", randoHintDistribution, 4, 1);
ImGui::Unindent(); ImGui::Unindent();
} }
PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGui::PopItemWidth(); ImGui::PopItemWidth();
ImGui::EndChild(); ImGui::EndChild();
@ -4285,14 +4285,14 @@ void DrawRandoEditor(bool& open) {
ImGui::BeginChild("ChildAdditionalFeatures", ImVec2(0, -8)); ImGui::BeginChild("ChildAdditionalFeatures", ImVec2(0, -8));
ImGui::PushItemWidth(-FLT_MIN); ImGui::PushItemWidth(-FLT_MIN);
SohImGui::EnhancementCheckbox("Full Wallets", "gRandomizeFullWallets"); UIWidgets::EnhancementCheckbox("Full Wallets", "gRandomizeFullWallets");
InsertHelpHoverText("Start with a full wallet. All wallet upgrades come filled with rupees."); UIWidgets::InsertHelpHoverText("Start with a full wallet. All wallet upgrades come filled with rupees.");
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Bombchus in Logic // Bombchus in Logic
SohImGui::EnhancementCheckbox(Settings::BombchusInLogic.GetName().c_str(), "gRandomizeBombchusInLogic"); UIWidgets::EnhancementCheckbox(Settings::BombchusInLogic.GetName().c_str(), "gRandomizeBombchusInLogic");
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Bombchus are properly considered in logic.\n" "Bombchus are properly considered in logic.\n"
"\n" "\n"
"The first Bombchu pack will always be 20, and subsequent packs will be " "The first Bombchu pack will always be 20, and subsequent packs will be "
@ -4302,23 +4302,23 @@ void DrawRandoEditor(bool& open) {
"Bombchu Bowling is opened by obtaining Bombchus." "Bombchu Bowling is opened by obtaining Bombchus."
); );
PaddedSeparator(); UIWidgets::PaddedSeparator();
SohImGui::EnhancementCheckbox("WIP - Blue Fire Arrows", "gRandomizeBlueIceArrows", true, "In development"); UIWidgets::EnhancementCheckbox("WIP - Blue Fire Arrows", "gRandomizeBlueIceArrows", true, "In development");
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Ice Arrows act like Blue Fire, making them able to melt red ice. " "Ice Arrows act like Blue Fire, making them able to melt red ice. "
"Item placement logic will respect this option, so it might be required to use this to progress." "Item placement logic will respect this option, so it might be required to use this to progress."
); );
PaddedSeparator(); UIWidgets::PaddedSeparator();
SohImGui::EnhancementCheckbox("WIP - Sunlight Arrows", "gRandomizeSunlightArrows", true, "In development"); UIWidgets::EnhancementCheckbox("WIP - Sunlight Arrows", "gRandomizeSunlightArrows", true, "In development");
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Light Arrows can be used to light up the sun switches instead of using the Mirror Shield. " "Light Arrows can be used to light up the sun switches instead of using the Mirror Shield. "
"Item placement logic will respect this option, so it might be required to use this to progress." "Item placement logic will respect this option, so it might be required to use this to progress."
); );
PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGui::PopItemWidth(); ImGui::PopItemWidth();
ImGui::EndChild(); ImGui::EndChild();
@ -4386,7 +4386,7 @@ void DrawRandoEditor(bool& open) {
excludedLocationString += ","; excludedLocationString += ",";
} }
CVar_SetString("gRandomizeExcludedLocations", excludedLocationString.c_str()); CVar_SetString("gRandomizeExcludedLocations", excludedLocationString.c_str());
SohImGui::needs_save = true; SohImGui::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text(locationIt.rcShortName.c_str()); ImGui::Text(locationIt.rcShortName.c_str());
@ -4427,7 +4427,7 @@ void DrawRandoEditor(bool& open) {
excludedLocationString += ","; excludedLocationString += ",";
} }
CVar_SetString("gRandomizeExcludedLocations", excludedLocationString.c_str()); CVar_SetString("gRandomizeExcludedLocations", excludedLocationString.c_str());
SohImGui::needs_save = true; SohImGui::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text(locationIt.rcShortName.c_str()); ImGui::Text(locationIt.rcShortName.c_str());
@ -4455,19 +4455,19 @@ void DrawRandoEditor(bool& open) {
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::PushItemWidth(170.0); ImGui::PushItemWidth(170.0);
ImGui::Text("Logic Rules"); ImGui::Text("Logic Rules");
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"Glitchless - No glitches are required, but may require some minor tricks.\n" "Glitchless - No glitches are required, but may require some minor tricks.\n"
"\n" "\n"
"No logic - Item placement is completely random. MAY BE IMPOSSIBLE TO BEAT." "No logic - Item placement is completely random. MAY BE IMPOSSIBLE TO BEAT."
); );
SohImGui::EnhancementCombobox("gRandomizeLogicRules", randoLogicRules, 2, 0); UIWidgets::EnhancementCombobox("gRandomizeLogicRules", randoLogicRules, 2, 0);
PaddedSeparator(); UIWidgets::PaddedSeparator();
// Enable Glitch-Useful Cutscenes // Enable Glitch-Useful Cutscenes
SohImGui::EnhancementCheckbox(Settings::EnableGlitchCutscenes.GetName().c_str(), UIWidgets::EnhancementCheckbox(Settings::EnableGlitchCutscenes.GetName().c_str(),
"gRandomizeEnableGlitchCutscenes"); "gRandomizeEnableGlitchCutscenes");
InsertHelpHoverText( UIWidgets::InsertHelpHoverText(
"The cutscenes of the Poes in Forest Temple and Darunia in Fire Temple will not be skipped. " "The cutscenes of the Poes in Forest Temple and Darunia in Fire Temple will not be skipped. "
"These cutscenes are only useful for glitched gameplay and can be safely skipped otherwise."); "These cutscenes are only useful for glitched gameplay and can be safely skipped otherwise.");
@ -4525,17 +4525,17 @@ void DrawRandoEditor(bool& open) {
// TODO: Show this but disabled when we have options for disabled Comboboxes. // TODO: Show this but disabled when we have options for disabled Comboboxes.
if (CVar_GetS32("gRandomizeShuffleDungeonReward", 0) != 0) { if (CVar_GetS32("gRandomizeShuffleDungeonReward", 0) != 0) {
ImGui::Text(Settings::LinksPocketItem.GetName().c_str()); ImGui::Text(Settings::LinksPocketItem.GetName().c_str());
SohImGui::EnhancementCombobox("gRandomizeLinksPocket", randoLinksPocket, 4, 0); UIWidgets::EnhancementCombobox("gRandomizeLinksPocket", randoLinksPocket, 4, 0);
PaddedSeparator(); UIWidgets::PaddedSeparator();
} }
SohImGui::EnhancementCheckbox(Settings::StartingKokiriSword.GetName().c_str(), UIWidgets::EnhancementCheckbox(Settings::StartingKokiriSword.GetName().c_str(),
"gRandomizeStartingKokiriSword"); "gRandomizeStartingKokiriSword");
PaddedSeparator(); UIWidgets::PaddedSeparator();
SohImGui::EnhancementCheckbox(Settings::StartingDekuShield.GetName().c_str(), UIWidgets::EnhancementCheckbox(Settings::StartingDekuShield.GetName().c_str(),
"gRandomizeStartingDekuShield"); "gRandomizeStartingDekuShield");
PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGui::EndChild(); ImGui::EndChild();
@ -4544,11 +4544,11 @@ void DrawRandoEditor(bool& open) {
window->DC.CurrLineTextBaseOffset = 0.0f; window->DC.CurrLineTextBaseOffset = 0.0f;
ImGui::BeginChild("ChildStartingItems", ImVec2(0, -8)); ImGui::BeginChild("ChildStartingItems", ImVec2(0, -8));
SohImGui::EnhancementCheckbox(Settings::StartingOcarina.GetName().c_str(), "gRandomizeStartingOcarina"); UIWidgets::EnhancementCheckbox(Settings::StartingOcarina.GetName().c_str(), "gRandomizeStartingOcarina");
PaddedSeparator(); UIWidgets::PaddedSeparator();
SohImGui::EnhancementCheckbox(Settings::StartingConsumables.GetName().c_str(), UIWidgets::EnhancementCheckbox(Settings::StartingConsumables.GetName().c_str(),
"gRandomizeStartingConsumables"); "gRandomizeStartingConsumables");
PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGui::EndChild(); ImGui::EndChild();
@ -4559,7 +4559,7 @@ void DrawRandoEditor(bool& open) {
ImGui::Text("Coming soon"); ImGui::Text("Coming soon");
PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGui::EndChild(); ImGui::EndChild();
ImGui::EndTable(); ImGui::EndTable();

View File

@ -2,7 +2,7 @@
#include <map> #include <map>
#include <string> #include <string>
#include <vector> #include <vector>
#include <Cvar.h> #include <libultraship/Cvar.h>
/* /*
typedef struct { typedef struct {

View File

@ -7,6 +7,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <libultraship/Cvar.h> #include <libultraship/Cvar.h>
#include <libultraship/Hooks.h>
extern "C" { extern "C" {
#include <z64.h> #include <z64.h>
@ -349,7 +350,7 @@ void DrawEquip(ItemTrackerItem item) {
ImGui::Image(SohImGui::GetTextureByName(hasEquip && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(SohImGui::GetTextureByName(hasEquip && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
SetLastItemHoverText(SohUtils::GetItemName(item.id)); UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id));
} }
void DrawQuest(ItemTrackerItem item) { void DrawQuest(ItemTrackerItem item) {
@ -365,7 +366,7 @@ void DrawQuest(ItemTrackerItem item) {
ImGui::EndGroup(); ImGui::EndGroup();
SetLastItemHoverText(SohUtils::GetQuestItemName(item.id)); UIWidgets::SetLastItemHoverText(SohUtils::GetQuestItemName(item.id));
}; };
void DrawItem(ItemTrackerItem item) { void DrawItem(ItemTrackerItem item) {
@ -416,7 +417,7 @@ void DrawItem(ItemTrackerItem item) {
DrawItemCount(item); DrawItemCount(item);
ImGui::EndGroup(); ImGui::EndGroup();
SetLastItemHoverText(SohUtils::GetItemName(item.id)); UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id));
} }
void DrawBottle(ItemTrackerItem item) { void DrawBottle(ItemTrackerItem item) {
@ -431,7 +432,7 @@ void DrawBottle(ItemTrackerItem item) {
ImGui::Image(SohImGui::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(SohImGui::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
SetLastItemHoverText(SohUtils::GetItemName(item.id)); UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id));
}; };
void DrawDungeonItem(ItemTrackerItem item) { void DrawDungeonItem(ItemTrackerItem item) {
@ -469,7 +470,7 @@ void DrawDungeonItem(ItemTrackerItem item) {
} }
ImGui::EndGroup(); ImGui::EndGroup();
SetLastItemHoverText(SohUtils::GetItemName(item.id)); UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id));
} }
void DrawSong(ItemTrackerItem item) { void DrawSong(ItemTrackerItem item) {
@ -480,7 +481,7 @@ void DrawSong(ItemTrackerItem item) {
ImGui::SetCursorScreenPos(ImVec2(p.x + 6, p.y)); ImGui::SetCursorScreenPos(ImVec2(p.x + 6, p.y));
ImGui::Image(SohImGui::GetTextureByName(hasSong && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(SohImGui::GetTextureByName(hasSong && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize / 1.5, iconSize), ImVec2(0, 0), ImVec2(1, 1)); ImVec2(iconSize / 1.5, iconSize), ImVec2(0, 0), ImVec2(1, 1));
SetLastItemHoverText(SohUtils::GetQuestItemName(item.id)); UIWidgets::SetLastItemHoverText(SohUtils::GetQuestItemName(item.id));
} }
void DrawNotes(bool resizeable = false) { void DrawNotes(bool resizeable = false) {
@ -645,7 +646,7 @@ void LabeledComboBoxRightAligned(const char* label, const char* cvar, std::vecto
for (int i = 0; i < options.size(); i++) { for (int i = 0; i < options.size(); i++) {
if (ImGui::Selectable(options[i].c_str())) { if (ImGui::Selectable(options[i].c_str())) {
CVar_SetS32(cvar, i); CVar_SetS32(cvar, i);
SohImGui::needs_save = true; SohImGui::RequestCvarSaveOnNextTick();
shouldUpdateVectors = true; shouldUpdateVectors = true;
} }
} }
@ -662,7 +663,7 @@ void PaddedEnhancementCheckbox(const char* text, const char* cvarName, s32 defau
bool val = (bool)CVar_GetS32(cvarName, defaultValue); bool val = (bool)CVar_GetS32(cvarName, defaultValue);
if (ImGui::Checkbox(text, &val)) { if (ImGui::Checkbox(text, &val)) {
CVar_SetS32(cvarName, val); CVar_SetS32(cvarName, val);
SohImGui::needs_save = true; SohImGui::RequestCvarSaveOnNextTick();
shouldUpdateVectors = true; shouldUpdateVectors = true;
} }
if (padBottom) { if (padBottom) {
@ -856,7 +857,7 @@ void DrawItemTrackerOptions(bool& open) {
CVar_SetFloat("gItemTrackerBgColorG", ChromaKeyBackground.y); CVar_SetFloat("gItemTrackerBgColorG", ChromaKeyBackground.y);
CVar_SetFloat("gItemTrackerBgColorB", ChromaKeyBackground.z); CVar_SetFloat("gItemTrackerBgColorB", ChromaKeyBackground.z);
CVar_SetFloat("gItemTrackerBgColorA", ChromaKeyBackground.w); CVar_SetFloat("gItemTrackerBgColorA", ChromaKeyBackground.w);
SohImGui::needs_save = true; SohImGui::RequestCvarSaveOnNextTick();
} }
ImGui::PopItemWidth(); ImGui::PopItemWidth();
@ -871,9 +872,9 @@ void DrawItemTrackerOptions(bool& open) {
LabeledComboBoxRightAligned("Combo Button 2", "gItemTrackerComboButton2", { "A", "B", "C-Up", "C-Down", "C-Left", "C-Right", "L", "Z", "R", "Start", "D-Up", "D-Down", "D-Left", "D-Right" }, 8); LabeledComboBoxRightAligned("Combo Button 2", "gItemTrackerComboButton2", { "A", "B", "C-Up", "C-Down", "C-Left", "C-Right", "L", "Z", "R", "Start", "D-Up", "D-Down", "D-Left", "D-Right" }, 8);
} }
} }
PaddedSeparator(); UIWidgets::PaddedSeparator();
SohImGui::EnhancementSliderInt("Icon size : %dpx", "##ITEMTRACKERICONSIZE", "gItemTrackerIconSize", 25, 128, "", 36, true); UIWidgets::EnhancementSliderInt("Icon size : %dpx", "##ITEMTRACKERICONSIZE", "gItemTrackerIconSize", 25, 128, "", 36, true);
SohImGui::EnhancementSliderInt("Icon margins : %dpx", "##ITEMTRACKERSPACING", "gItemTrackerIconSpacing", -5, 50, "", 12, true); UIWidgets::EnhancementSliderInt("Icon margins : %dpx", "##ITEMTRACKERSPACING", "gItemTrackerIconSpacing", -5, 50, "", 12, true);
PaddedEnhancementCheckbox("Display \"Current/Max\" values", "gItemTrackerDisplayCurrentMax", 0); PaddedEnhancementCheckbox("Display \"Current/Max\" values", "gItemTrackerDisplayCurrentMax", 0);
if (CVar_GetS32("gItemTrackerDisplayCurrentMax", 0) == 0) { if (CVar_GetS32("gItemTrackerDisplayCurrentMax", 0) == 0) {
PaddedEnhancementCheckbox("Align count to left side", "gItemTrackerCurrentOnLeft", 0); PaddedEnhancementCheckbox("Align count to left side", "gItemTrackerCurrentOnLeft", 0);

View File

@ -519,7 +519,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
if (!gSaveContext.n64ddFlag) { if (!gSaveContext.n64ddFlag) {
func_8002F554(&this->actor, globalCtx, getItemId); func_8002F554(&this->actor, globalCtx, getItemId);
} else { } else {
getItem = Randomizer_GetRandomizedItem(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum); getItem = Randomizer_GetItemFromActor(this->actor.id, globalCtx->sceneNum, this->ogParams, getItemId);
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, getItem); GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, getItem);
} }
} }