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 "../../util.h"
#include "../../OTRGlobals.h"
#include <libultraship/ImGuiImpl.h>
#include "../../UIWidgets.hpp"
@ -623,7 +624,7 @@ void DrawInventoryTab() {
gSaveContext.inventory.items[selectedIndex] = slotEntry.id;
// Set adult trade item flag if you're playing adult trade shuffle in rando
if (gSaveContext.n64ddFlag &&
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_ADULT_TRADE);
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_ADULT_TRADE) &&
selectedIndex == SLOT_TRADE_ADULT &&
slotEntry.id >= ITEM_POCKET_EGG && slotEntry.id <= ITEM_CLAIM_CHECK) {
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);
ImGui::PushItemFlag(ImGuiItemFlags_Disabled, disableEditingRandoSettings);
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)) {
ImGui::Dummy(ImVec2(0.0f, 0.0f));
@ -3585,7 +3585,7 @@ void DrawRandoEditor(bool& open) {
// ImGui::Text("Settings File: %s", presetfilepath.c_str());
}
PaddedSeparator();
UIWidgets::PaddedSeparator();
ImGuiWindow* window = ImGui::GetCurrentWindow();
static ImVec2 cellPadding(8.0f, 8.0f);
@ -3611,7 +3611,7 @@ void DrawRandoEditor(bool& open) {
// Forest
ImGui::Text(Settings::OpenForest.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Closed - Kokiri sword & shield are required to access "
"the Deku Tree, and completing the Deku Tree is required to "
"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 "
"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
ImGui::Text(Settings::OpenKakariko.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Closed - The gate will remain closed until Zelda's letter "
"is shown to the guard.\n"
"\n"
"Open - The gate is always open. The happy mask shop "
"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
ImGui::Text(Settings::OpenDoorOfTime.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Closed - The Ocarina of Time, the Song of Time and all "
"three spiritual stones are required to open the Door of Time.\n"
"\n"
@ -3651,13 +3651,13 @@ void DrawRandoEditor(bool& open) {
"\n"
"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
ImGui::Text(Settings::ZorasFountain.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Closed - King Zora obstructs the way to Zora's Fountain. "
"Ruto's letter must be shown as child Link in order to move "
"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 "
"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();
@ -3682,7 +3682,7 @@ void DrawRandoEditor(bool& open) {
// Gerudo Fortress
ImGui::Text("Gerudo Fortress Carpenters");
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Sets the amount of carpenters required to repair the bridge "
"in Gerudo Valley.\n"
"\n"
@ -3692,13 +3692,13 @@ void DrawRandoEditor(bool& open) {
"\n"
"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
ImGui::Text("Rainbow Bridge Requirements");
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Alters the requirements to open the bridge to Ganon's Castle.\n"
"\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."
);
SohImGui::EnhancementCombobox("gRandomizeRainbowBridge", randoRainbowBridge, 7, 0);
UIWidgets::EnhancementCombobox("gRandomizeRainbowBridge", randoRainbowBridge, 7, 0);
ImGui::PopItemWidth();
switch (CVar_GetS32("gRandomizeRainbowBridge", 0)) {
case 0:
@ -3728,37 +3728,37 @@ void DrawRandoEditor(bool& open) {
break;
case 2:
ImGui::Dummy(ImVec2(0.0f, 0.0f));
SohImGui::EnhancementSliderInt("Stone Count: %d", "##RandoStoneCount",
UIWidgets::EnhancementSliderInt("Stone Count: %d", "##RandoStoneCount",
"gRandomizeStoneCount", 1, 3, "", 3, true);
break;
case 3:
ImGui::Dummy(ImVec2(0.0f, 0.0f));
SohImGui::EnhancementSliderInt("Medallion Count: %d", "##RandoMedallionCount",
UIWidgets::EnhancementSliderInt("Medallion Count: %d", "##RandoMedallionCount",
"gRandomizeMedallionCount", 1, 6, "", 6, true);
break;
case 4:
ImGui::Dummy(ImVec2(0.0f, 0.0f));
SohImGui::EnhancementSliderInt("Reward Count: %d", "##RandoRewardCount",
UIWidgets::EnhancementSliderInt("Reward Count: %d", "##RandoRewardCount",
"gRandomizeRewardCount", 1, 9, "", 9, true);
break;
case 5:
ImGui::Dummy(ImVec2(0.0f, 0.0f));
SohImGui::EnhancementSliderInt("Dungeon Count: %d", "##RandoDungeonCount",
UIWidgets::EnhancementSliderInt("Dungeon Count: %d", "##RandoDungeonCount",
"gRandomizeDungeonCount", 1, 8, "", 8, true);
break;
case 6:
ImGui::Dummy(ImVec2(0.0f, 0.0f));
SohImGui::EnhancementSliderInt("Token Count: %d", "##RandoTokenCount",
UIWidgets::EnhancementSliderInt("Token Count: %d", "##RandoTokenCount",
"gRandomizeTokenCount", 1, 100, "", 100, true);
break;
}
PaddedSeparator();
UIWidgets::PaddedSeparator();
// Ganon's Trials
ImGui::PushItemWidth(-FLT_MIN);
ImGui::Text("Ganon's Trials");
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Sets the number of Ganon's Trials required to dispel the barrier.\n"
"\n"
"Skip - No Trials are required and the barrier is already dispelled.\n"
@ -3768,16 +3768,16 @@ void DrawRandoEditor(bool& open) {
"\n"
"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();
if (CVar_GetS32("gRandomizeGanonTrial", 0) == 1) {
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);
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();
@ -3789,7 +3789,7 @@ void DrawRandoEditor(bool& open) {
ImGui::Text("Coming soon");
PaddedSeparator();
UIWidgets::PaddedSeparator();
ImGui::PopItemWidth();
ImGui::EndChild();
@ -3819,7 +3819,7 @@ void DrawRandoEditor(bool& open) {
// Shuffle Songs
ImGui::Text(Settings::ShuffleSongs.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Song locations - Songs will only appear at locations that normally teach songs.\n"
"\n"
"Dungeon rewards - Songs appear after beating a major dungeon boss.\n"
@ -3831,13 +3831,13 @@ void DrawRandoEditor(bool& open) {
"\n"
"Anywhere - Songs can appear at any location."
);
SohImGui::EnhancementCombobox("gRandomizeShuffleSongs", randoShuffleSongs, 3, 0);
UIWidgets::EnhancementCombobox("gRandomizeShuffleSongs", randoShuffleSongs, 3, 0);
PaddedSeparator();
UIWidgets::PaddedSeparator();
// Shuffle Tokens
ImGui::Text(Settings::Tokensanity.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Shuffles Golden Skulltula Tokens into the item pool. This means "
"Golden Skulltulas can contain other items as well.\n"
"\n"
@ -3849,53 +3849,53 @@ void DrawRandoEditor(bool& open) {
"\n"
"All Tokens - Shuffle all 100 GS tokens."
);
SohImGui::EnhancementCombobox("gRandomizeShuffleTokens", randoTokensanity, 4, 0);
UIWidgets::EnhancementCombobox("gRandomizeShuffleTokens", randoTokensanity, 4, 0);
ImGui::Dummy(ImVec2(0,0));
SohImGui::EnhancementCheckbox("Nighttime GS expect Sun's Song", "gRandomizeGsExpectSunsSong");
InsertHelpHoverText(
UIWidgets::EnhancementCheckbox("Nighttime GS expect Sun's Song", "gRandomizeGsExpectSunsSong");
UIWidgets::InsertHelpHoverText(
"All Golden Skulltulas that require nighttime to appear will only be "
"expected to be collected after getting Sun's Song."
);
PaddedSeparator();
UIWidgets::PaddedSeparator();
// Shuffle Kokiri Sword
// Disabled when Start with Kokiri Sword is active
bool disableShuffleKokiriSword = CVar_GetS32("gRandomizeStartingKokiriSword", 0);
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);
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Shuffles the Kokiri Sword into the item pool.\n"
"\n"
"This will require the use of sticks until the Kokiri Sword is found."
);
PaddedSeparator();
UIWidgets::PaddedSeparator();
// Shuffle Ocarinas
// Disabled when Start with Ocarina is active
bool disableShuffleOcarinas = CVar_GetS32("gRandomizeStartingOcarina", 0);
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);
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Enabling this shuffles the Fairy Ocarina and the Ocarina of Time into the item pool.\n"
"\n"
"This will require finding an Ocarina before being able to play songs."
);
PaddedSeparator();
UIWidgets::PaddedSeparator();
// Shuffle Weird Egg
// Disabled when Skip Child Zelda is active
bool disableShuffleWeirdEgg = CVar_GetS32("gRandomizeSkipChildZelda", 0);
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);
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Shuffles the Weird Egg from Malon in to the item pool. Enabling "
"\"Skip Child Zelda\" disables this feature.\n"
"\n"
@ -3907,19 +3907,19 @@ void DrawRandoEditor(bool& open) {
" - Happy Mask Shop sidequest\n"
);
PaddedSeparator();
UIWidgets::PaddedSeparator();
// Shuffle Gerudo Membership Card
SohImGui::EnhancementCheckbox(Settings::ShuffleGerudoToken.GetName().c_str(),
UIWidgets::EnhancementCheckbox(Settings::ShuffleGerudoToken.GetName().c_str(),
"gRandomizeShuffleGerudoToken");
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Shuffles the Gerudo Membership Card into the item pool.\n"
"\n"
"The Gerudo Card is required to enter the Gerudo Training Grounds, opening "
"the gate to Haunted Wasteland and the Horseback Archery minigame."
);
PaddedSeparator();
UIWidgets::PaddedSeparator();
ImGui::PopItemWidth();
ImGui::EndChild();
@ -3932,7 +3932,7 @@ void DrawRandoEditor(bool& open) {
// Shuffle Scrubs
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 "
"(PoH, Deku Nut capacity, and Deku Stick capacity) will have random items.\n"
"\n"
@ -3941,27 +3941,27 @@ void DrawRandoEditor(bool& open) {
"Expensive - Scrubs will be shuffled and their item will cost the vanilla price.\n"
"\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
SohImGui::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::EnhancementCheckbox(Settings::ShuffleCows.GetName().c_str(), "gRandomizeShuffleCows");
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");
InsertHelpHoverText(
UIWidgets::EnhancementCheckbox(Settings::ShuffleMagicBeans.GetName().c_str(), "gRandomizeShuffleBeans");
UIWidgets::InsertHelpHoverText(
"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."
);
PaddedSeparator();
UIWidgets::PaddedSeparator();
// Shuffle Frog Song Rupees
SohImGui::EnhancementCheckbox(Settings::ShuffleFrogSongRupees.GetName().c_str(), "gRandomizeShuffleFrogSongRupees");
InsertHelpHoverText(
UIWidgets::EnhancementCheckbox(Settings::ShuffleFrogSongRupees.GetName().c_str(), "gRandomizeShuffleFrogSongRupees");
UIWidgets::InsertHelpHoverText(
"Shuffles 5 Purple Rupees into to the item pool, and allows\n"
"you to earn items by playing songs at the Frog Choir.\n"
"\n"
@ -3969,12 +3969,12 @@ void DrawRandoEditor(bool& open) {
"the Song of Storms and the frog song minigame."
);
PaddedSeparator();
UIWidgets::PaddedSeparator();
// Shuffle Adult Trade Quest
SohImGui::EnhancementCheckbox(Settings::ShuffleAdultTradeQuest.GetName().c_str(),
UIWidgets::EnhancementCheckbox(Settings::ShuffleAdultTradeQuest.GetName().c_str(),
"gRandomizeShuffleAdultTrade");
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Adds all of the adult trade quest items into the pool, each of which "
"can be traded for a unique reward.\n"
"\n"
@ -3985,7 +3985,7 @@ void DrawRandoEditor(bool& open) {
"If disabled, only the Claim Check will be found in the pool."
);
PaddedSeparator();
UIWidgets::PaddedSeparator();
ImGui::PopItemWidth();
ImGui::EndChild();
@ -3998,7 +3998,7 @@ void DrawRandoEditor(bool& open) {
// Shuffle Dungeon Rewards
ImGui::Text(Settings::ShuffleRewards.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Shuffles the location of spiritual stones and medallions.\n"
"\n"
"End of dungeons - Spiritual stones and medallions will be given as rewards "
@ -4010,13 +4010,13 @@ void DrawRandoEditor(bool& open) {
"\n"
"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
ImGui::Text(Settings::MapsAndCompasses.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Start with - You will start with Maps & Compasses from all dungeons.\n"
"\n"
"Vanilla - Maps & Compasses will appear in their vanilla locations.\n"
@ -4029,13 +4029,13 @@ void DrawRandoEditor(bool& open) {
"\n"
"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
ImGui::Text(Settings::Keysanity.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Start with - You will start with all Small Keys from all dungeons.\n"
"\n"
"Vanilla - Small Keys will appear in their vanilla locations.\n"
@ -4048,13 +4048,13 @@ void DrawRandoEditor(bool& open) {
"\n"
"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
ImGui::Text(Settings::GerudoKeys.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Vanilla - Thieve's Hideout Keys will appear in their vanilla locations.\n"
"\n"
"Any dungeon - Thieve's Hideout Keys can only appear inside of any dungon.\n"
@ -4063,13 +4063,13 @@ void DrawRandoEditor(bool& open) {
"\n"
"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
ImGui::Text(Settings::BossKeysanity.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Start with - You will start with Boss keys from all dungeons.\n"
"\n"
"Vanilla - Boss Keys will appear in their vanilla locations.\n"
@ -4082,13 +4082,13 @@ void DrawRandoEditor(bool& open) {
"\n"
"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
ImGui::Text(Settings::GanonsBossKey.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Vanilla - Ganon's Boss Key will appear in the vanilla location.\n"
"\n"
"Own dungeon - Ganon's Boss Key can appear anywhere inside Ganon's Castle.\n"
@ -4101,9 +4101,9 @@ void DrawRandoEditor(bool& open) {
"\n"
"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::EndChild();
@ -4130,53 +4130,53 @@ void DrawRandoEditor(bool& open) {
ImGui::BeginChild("ChildTimeSavers", ImVec2(0, -8));
// Cuccos to return
SohImGui::EnhancementSliderInt("Cuccos to return: %d", "##RandoCuccosToReturn",
UIWidgets::EnhancementSliderInt("Cuccos to return: %d", "##RandoCuccosToReturn",
"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
SohImGui::EnhancementSliderInt("Big Poe Target Count: %d", "##RandoBigPoeTargetCount",
UIWidgets::EnhancementSliderInt("Big Poe Target Count: %d", "##RandoBigPoeTargetCount",
"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
// Disabled when Skip Child Zelda is active
bool disableChildStealth = CVar_GetS32("gRandomizeSkipChildZelda", 0);
const char* disableChildStealthText = "This option is disabled because \"Skip Child Zelda\" is enabled";
SohImGui::EnhancementCheckbox(Settings::SkipChildStealth.GetName().c_str(), "gRandomizeSkipChildStealth", disableChildStealth, disableChildStealthText);
InsertHelpHoverText("The crawlspace into Hyrule Castle goes straight to Zelda, skipping the guards.");
UIWidgets::EnhancementCheckbox(Settings::SkipChildStealth.GetName().c_str(), "gRandomizeSkipChildStealth", disableChildStealth, disableChildStealthText);
UIWidgets::InsertHelpHoverText("The crawlspace into Hyrule Castle goes straight to Zelda, skipping the guards.");
PaddedSeparator();
UIWidgets::PaddedSeparator();
// Skip child zelda
SohImGui::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::EnhancementCheckbox("Skip Child Zelda", "gRandomizeSkipChildZelda");
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.");
PaddedSeparator();
UIWidgets::PaddedSeparator();
// Skip Epona race
SohImGui::EnhancementCheckbox(Settings::SkipEponaRace.GetName().c_str(), "gRandomizeSkipEponaRace");
InsertHelpHoverText("Epona can be summoned with Epona's Song without needing to race Ingo.");
UIWidgets::EnhancementCheckbox(Settings::SkipEponaRace.GetName().c_str(), "gRandomizeSkipEponaRace");
UIWidgets::InsertHelpHoverText("Epona can be summoned with Epona's Song without needing to race Ingo.");
PaddedSeparator();
UIWidgets::PaddedSeparator();
// Skip tower escape
SohImGui::EnhancementCheckbox(Settings::SkipTowerEscape.GetName().c_str(), "gRandomizeSkipTowerEscape");
InsertHelpHoverText("The tower escape sequence between Ganondorf and Ganon will be skipped.");
UIWidgets::EnhancementCheckbox(Settings::SkipTowerEscape.GetName().c_str(), "gRandomizeSkipTowerEscape");
UIWidgets::InsertHelpHoverText("The tower escape sequence between Ganondorf and Ganon will be skipped.");
PaddedSeparator();
UIWidgets::PaddedSeparator();
// Complete mask quest
SohImGui::EnhancementCheckbox(Settings::CompleteMaskQuest.GetName().c_str(),
UIWidgets::EnhancementCheckbox(Settings::CompleteMaskQuest.GetName().c_str(),
"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();
@ -4188,7 +4188,7 @@ void DrawRandoEditor(bool& open) {
// Item Pool Settings
ImGui::Text(Settings::ItemPoolValue.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Sets how many major items appear in the item pool.\n"
"\n"
"Plentiful - Extra major items are added to the pool.\n"
@ -4199,12 +4199,12 @@ void DrawRandoEditor(bool& open) {
"\n"
"Minimal - Most excess items are removed."
);
SohImGui::EnhancementCombobox("gRandomizeItemPool", randoItemPool, 4, 1);
PaddedSeparator();
UIWidgets::EnhancementCombobox("gRandomizeItemPool", randoItemPool, 4, 1);
UIWidgets::PaddedSeparator();
// Ice Traps
ImGui::Text(Settings::IceTrapValue.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Sets how many items are replaced by ice traps.\n"
"\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 "
"in the base pool."
);
SohImGui::EnhancementCombobox("gRandomizeIceTraps", randoIceTraps, 5, 1);
UIWidgets::EnhancementCombobox("gRandomizeIceTraps", randoIceTraps, 5, 1);
PaddedSeparator();
UIWidgets::PaddedSeparator();
// Gossip Stone Hints
ImGui::Text(Settings::GossipStoneHints.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"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 "
"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"
"\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) {
// Hint Clarity
ImGui::Dummy(ImVec2(0.0f, 0.0f));
ImGui::Indent();
ImGui::Text(Settings::ClearerHints.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Sets the difficulty of hints.\n"
"\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"
"Ex: Kokiri Sword > the Kokiri Sword"
);
SohImGui::EnhancementCombobox("gRandomizeHintClarity", randoHintClarity, 3, 2);
UIWidgets::EnhancementCombobox("gRandomizeHintClarity", randoHintClarity, 3, 2);
// Hint Distribution
ImGui::Dummy(ImVec2(0.0f, 0.0f));
ImGui::Text(Settings::HintDistribution.GetName().c_str());
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Sets how many hints will be useful.\n"
"\n"
"Useless - Only junk hints.\n"
@ -4270,11 +4270,11 @@ void DrawRandoEditor(bool& open) {
"\n"
"Very Strong - Many powerful hints."
);
SohImGui::EnhancementCombobox("gRandomizeHintDistribution", randoHintDistribution, 4, 1);
UIWidgets::EnhancementCombobox("gRandomizeHintDistribution", randoHintDistribution, 4, 1);
ImGui::Unindent();
}
PaddedSeparator();
UIWidgets::PaddedSeparator();
ImGui::PopItemWidth();
ImGui::EndChild();
@ -4285,14 +4285,14 @@ void DrawRandoEditor(bool& open) {
ImGui::BeginChild("ChildAdditionalFeatures", ImVec2(0, -8));
ImGui::PushItemWidth(-FLT_MIN);
SohImGui::EnhancementCheckbox("Full Wallets", "gRandomizeFullWallets");
InsertHelpHoverText("Start with a full wallet. All wallet upgrades come filled with rupees.");
UIWidgets::EnhancementCheckbox("Full Wallets", "gRandomizeFullWallets");
UIWidgets::InsertHelpHoverText("Start with a full wallet. All wallet upgrades come filled with rupees.");
PaddedSeparator();
UIWidgets::PaddedSeparator();
// Bombchus in Logic
SohImGui::EnhancementCheckbox(Settings::BombchusInLogic.GetName().c_str(), "gRandomizeBombchusInLogic");
InsertHelpHoverText(
UIWidgets::EnhancementCheckbox(Settings::BombchusInLogic.GetName().c_str(), "gRandomizeBombchusInLogic");
UIWidgets::InsertHelpHoverText(
"Bombchus are properly considered in logic.\n"
"\n"
"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."
);
PaddedSeparator();
UIWidgets::PaddedSeparator();
SohImGui::EnhancementCheckbox("WIP - Blue Fire Arrows", "gRandomizeBlueIceArrows", true, "In development");
InsertHelpHoverText(
UIWidgets::EnhancementCheckbox("WIP - Blue Fire Arrows", "gRandomizeBlueIceArrows", true, "In development");
UIWidgets::InsertHelpHoverText(
"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."
);
PaddedSeparator();
UIWidgets::PaddedSeparator();
SohImGui::EnhancementCheckbox("WIP - Sunlight Arrows", "gRandomizeSunlightArrows", true, "In development");
InsertHelpHoverText(
UIWidgets::EnhancementCheckbox("WIP - Sunlight Arrows", "gRandomizeSunlightArrows", true, "In development");
UIWidgets::InsertHelpHoverText(
"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."
);
PaddedSeparator();
UIWidgets::PaddedSeparator();
ImGui::PopItemWidth();
ImGui::EndChild();
@ -4386,7 +4386,7 @@ void DrawRandoEditor(bool& open) {
excludedLocationString += ",";
}
CVar_SetString("gRandomizeExcludedLocations", excludedLocationString.c_str());
SohImGui::needs_save = true;
SohImGui::RequestCvarSaveOnNextTick();
}
ImGui::SameLine();
ImGui::Text(locationIt.rcShortName.c_str());
@ -4427,7 +4427,7 @@ void DrawRandoEditor(bool& open) {
excludedLocationString += ",";
}
CVar_SetString("gRandomizeExcludedLocations", excludedLocationString.c_str());
SohImGui::needs_save = true;
SohImGui::RequestCvarSaveOnNextTick();
}
ImGui::SameLine();
ImGui::Text(locationIt.rcShortName.c_str());
@ -4455,19 +4455,19 @@ void DrawRandoEditor(bool& open) {
ImGui::TableNextColumn();
ImGui::PushItemWidth(170.0);
ImGui::Text("Logic Rules");
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"Glitchless - No glitches are required, but may require some minor tricks.\n"
"\n"
"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
SohImGui::EnhancementCheckbox(Settings::EnableGlitchCutscenes.GetName().c_str(),
UIWidgets::EnhancementCheckbox(Settings::EnableGlitchCutscenes.GetName().c_str(),
"gRandomizeEnableGlitchCutscenes");
InsertHelpHoverText(
UIWidgets::InsertHelpHoverText(
"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.");
@ -4525,17 +4525,17 @@ void DrawRandoEditor(bool& open) {
// TODO: Show this but disabled when we have options for disabled Comboboxes.
if (CVar_GetS32("gRandomizeShuffleDungeonReward", 0) != 0) {
ImGui::Text(Settings::LinksPocketItem.GetName().c_str());
SohImGui::EnhancementCombobox("gRandomizeLinksPocket", randoLinksPocket, 4, 0);
PaddedSeparator();
UIWidgets::EnhancementCombobox("gRandomizeLinksPocket", randoLinksPocket, 4, 0);
UIWidgets::PaddedSeparator();
}
SohImGui::EnhancementCheckbox(Settings::StartingKokiriSword.GetName().c_str(),
UIWidgets::EnhancementCheckbox(Settings::StartingKokiriSword.GetName().c_str(),
"gRandomizeStartingKokiriSword");
PaddedSeparator();
SohImGui::EnhancementCheckbox(Settings::StartingDekuShield.GetName().c_str(),
UIWidgets::PaddedSeparator();
UIWidgets::EnhancementCheckbox(Settings::StartingDekuShield.GetName().c_str(),
"gRandomizeStartingDekuShield");
PaddedSeparator();
UIWidgets::PaddedSeparator();
ImGui::EndChild();
@ -4544,11 +4544,11 @@ void DrawRandoEditor(bool& open) {
window->DC.CurrLineTextBaseOffset = 0.0f;
ImGui::BeginChild("ChildStartingItems", ImVec2(0, -8));
SohImGui::EnhancementCheckbox(Settings::StartingOcarina.GetName().c_str(), "gRandomizeStartingOcarina");
PaddedSeparator();
SohImGui::EnhancementCheckbox(Settings::StartingConsumables.GetName().c_str(),
UIWidgets::EnhancementCheckbox(Settings::StartingOcarina.GetName().c_str(), "gRandomizeStartingOcarina");
UIWidgets::PaddedSeparator();
UIWidgets::EnhancementCheckbox(Settings::StartingConsumables.GetName().c_str(),
"gRandomizeStartingConsumables");
PaddedSeparator();
UIWidgets::PaddedSeparator();
ImGui::EndChild();
@ -4559,7 +4559,7 @@ void DrawRandoEditor(bool& open) {
ImGui::Text("Coming soon");
PaddedSeparator();
UIWidgets::PaddedSeparator();
ImGui::EndChild();
ImGui::EndTable();

View File

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

View File

@ -7,6 +7,7 @@
#include <string>
#include <vector>
#include <libultraship/Cvar.h>
#include <libultraship/Hooks.h>
extern "C" {
#include <z64.h>
@ -349,7 +350,7 @@ void DrawEquip(ItemTrackerItem item) {
ImGui::Image(SohImGui::GetTextureByName(hasEquip && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
SetLastItemHoverText(SohUtils::GetItemName(item.id));
UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id));
}
void DrawQuest(ItemTrackerItem item) {
@ -365,7 +366,7 @@ void DrawQuest(ItemTrackerItem item) {
ImGui::EndGroup();
SetLastItemHoverText(SohUtils::GetQuestItemName(item.id));
UIWidgets::SetLastItemHoverText(SohUtils::GetQuestItemName(item.id));
};
void DrawItem(ItemTrackerItem item) {
@ -416,7 +417,7 @@ void DrawItem(ItemTrackerItem item) {
DrawItemCount(item);
ImGui::EndGroup();
SetLastItemHoverText(SohUtils::GetItemName(item.id));
UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id));
}
void DrawBottle(ItemTrackerItem item) {
@ -431,7 +432,7 @@ void DrawBottle(ItemTrackerItem item) {
ImGui::Image(SohImGui::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
SetLastItemHoverText(SohUtils::GetItemName(item.id));
UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id));
};
void DrawDungeonItem(ItemTrackerItem item) {
@ -469,7 +470,7 @@ void DrawDungeonItem(ItemTrackerItem item) {
}
ImGui::EndGroup();
SetLastItemHoverText(SohUtils::GetItemName(item.id));
UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id));
}
void DrawSong(ItemTrackerItem item) {
@ -480,7 +481,7 @@ void DrawSong(ItemTrackerItem item) {
ImGui::SetCursorScreenPos(ImVec2(p.x + 6, p.y));
ImGui::Image(SohImGui::GetTextureByName(hasSong && IsValidSaveFile() ? item.name : item.nameFaded),
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) {
@ -645,7 +646,7 @@ void LabeledComboBoxRightAligned(const char* label, const char* cvar, std::vecto
for (int i = 0; i < options.size(); i++) {
if (ImGui::Selectable(options[i].c_str())) {
CVar_SetS32(cvar, i);
SohImGui::needs_save = true;
SohImGui::RequestCvarSaveOnNextTick();
shouldUpdateVectors = true;
}
}
@ -662,7 +663,7 @@ void PaddedEnhancementCheckbox(const char* text, const char* cvarName, s32 defau
bool val = (bool)CVar_GetS32(cvarName, defaultValue);
if (ImGui::Checkbox(text, &val)) {
CVar_SetS32(cvarName, val);
SohImGui::needs_save = true;
SohImGui::RequestCvarSaveOnNextTick();
shouldUpdateVectors = true;
}
if (padBottom) {
@ -856,7 +857,7 @@ void DrawItemTrackerOptions(bool& open) {
CVar_SetFloat("gItemTrackerBgColorG", ChromaKeyBackground.y);
CVar_SetFloat("gItemTrackerBgColorB", ChromaKeyBackground.z);
CVar_SetFloat("gItemTrackerBgColorA", ChromaKeyBackground.w);
SohImGui::needs_save = true;
SohImGui::RequestCvarSaveOnNextTick();
}
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);
}
}
PaddedSeparator();
SohImGui::EnhancementSliderInt("Icon size : %dpx", "##ITEMTRACKERICONSIZE", "gItemTrackerIconSize", 25, 128, "", 36, true);
SohImGui::EnhancementSliderInt("Icon margins : %dpx", "##ITEMTRACKERSPACING", "gItemTrackerIconSpacing", -5, 50, "", 12, true);
UIWidgets::PaddedSeparator();
UIWidgets::EnhancementSliderInt("Icon size : %dpx", "##ITEMTRACKERICONSIZE", "gItemTrackerIconSize", 25, 128, "", 36, true);
UIWidgets::EnhancementSliderInt("Icon margins : %dpx", "##ITEMTRACKERSPACING", "gItemTrackerIconSpacing", -5, 50, "", 12, true);
PaddedEnhancementCheckbox("Display \"Current/Max\" values", "gItemTrackerDisplayCurrentMax", 0);
if (CVar_GetS32("gItemTrackerDisplayCurrentMax", 0) == 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) {
func_8002F554(&this->actor, globalCtx, getItemId);
} 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);
}
}