Add s6 and hellmode presets for rando (#1904)

* Refactor how presets are created and used, and add presets for rando

* Add new enhancements to clear

* Tweaks and feedback
This commit is contained in:
Garrett Cox 2022-11-22 11:30:18 -06:00 committed by GitHub
parent 156f713e19
commit 8461ea4abd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 756 additions and 451 deletions

View File

@ -157,6 +157,7 @@ set(Header_Files__soh__Enhancements
#"soh/Enhancements/cvar.h"
"soh/Enhancements/debugconsole.h"
"soh/Enhancements/gameconsole.h"
"soh/Enhancements/presets.h"
"soh/Enhancements/savestates.h"
"soh/Enhancements/savestates_extern.inc"
)
@ -287,6 +288,7 @@ set(Source_Files__soh__Enhancements
"soh/Enhancements/bootcommands.c"
"soh/Enhancements/debugconsole.cpp"
"soh/Enhancements/gameconsole.c"
"soh/Enhancements/presets.cpp"
"soh/Enhancements/savestates.cpp"
)
source_group("Source Files\\soh\\Enhancements" FILES ${Source_Files__soh__Enhancements})

View File

@ -0,0 +1,66 @@
#include "presets.h"
#include <variant>
#include <string>
#include <cstdint>
#include <ImGuiImpl.h>
#include <Cvar.h>
#include "soh/UIWidgets.hpp"
void clearCvars(std::vector<const char*> cvarsToClear) {
for(const char* cvar : cvarsToClear) {
CVar_Clear(cvar);
}
}
void applyPreset(std::vector<PresetEntry> entries) {
for(auto& [cvar, type, value] : entries) {
switch (type) {
case PRESET_ENTRY_TYPE_S32:
CVar_SetS32(cvar, std::get<int32_t>(value));
break;
case PRESET_ENTRY_TYPE_FLOAT:
CVar_SetFloat(cvar, std::get<float>(value));
break;
case PRESET_ENTRY_TYPE_STRING:
CVar_SetString(cvar, std::get<const char*>(value));
break;
}
}
}
void DrawPresetSelector(PresetType presetTypeId) {
const std::string presetTypeCvar = "gPreset" + std::to_string(presetTypeId);
const PresetTypeDefinition presetTypeDef = presetTypes.at(presetTypeId);
const uint16_t selectedPresetId = CVar_GetS32(presetTypeCvar.c_str(), 0);
const PresetDefinition selectedPresetDef = presetTypeDef.presets.at(selectedPresetId);
std::string comboboxTooltip = "";
for ( auto iter = presetTypeDef.presets.begin(); iter != presetTypeDef.presets.end(); ++iter ) {
if (iter->first != 0) comboboxTooltip += "\n\n";
comboboxTooltip += std::string(iter->second.label) + " - " + std::string(iter->second.description);
}
UIWidgets::PaddedText("Presets", false, true);
if (ImGui::BeginCombo("##PresetsComboBox", selectedPresetDef.label)) {
for ( auto iter = presetTypeDef.presets.begin(); iter != presetTypeDef.presets.end(); ++iter ) {
if (ImGui::Selectable(iter->second.label, iter->first == selectedPresetId)) {
CVar_SetS32(presetTypeCvar.c_str(), iter->first);
}
}
ImGui::EndCombo();
}
UIWidgets::Tooltip(comboboxTooltip.c_str());
UIWidgets::Spacer(0);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(6.0f, 4.0f));
if (ImGui::Button(("Apply Preset##" + presetTypeCvar).c_str())) {
if (selectedPresetId == 0) {
clearCvars(presetTypeDef.cvarsToClear);
} else {
applyPreset(selectedPresetDef.entries);
}
SohImGui::RequestCvarSaveOnNextTick();
}
ImGui::PopStyleVar(1);
}

View File

@ -0,0 +1,683 @@
#pragma once
#include <map>
#include <vector>
#include <variant>
#include <cstdint>
enum PresetEntryType {
PRESET_ENTRY_TYPE_S32,
PRESET_ENTRY_TYPE_FLOAT,
PRESET_ENTRY_TYPE_STRING,
};
enum PresetType {
PRESET_TYPE_ENHANCEMENTS,
PRESET_TYPE_RANDOMIZER,
};
enum EnhancementPreset {
ENHANCEMENT_PRESET_DEFAULT,
ENHANCEMENT_PRESET_VANILLA_PLUS,
ENHANCEMENT_PRESET_ENHANCED,
ENHANCEMENT_PRESET_RANDOMIZER,
};
enum RandomizerPreset {
RANDOMIZER_PRESET_DEFAULT,
RANDOMIZER_PRESET_S6,
RANDOMIZER_PRESET_HELL_MODE,
};
typedef struct PresetEntry {
const char* cvar;
PresetEntryType type;
std::variant<int32_t, float, const char*> value;
} PresetEntry;
#define PRESET_ENTRY_S32(cvar, value) \
{ cvar, PRESET_ENTRY_TYPE_S32, value }
#define PRESET_ENTRY_FLOAT(cvar, value) \
{ cvar, PRESET_ENTRY_TYPE_FLOAT, value }
#define PRESET_ENTRY_STRING(cvar, value) \
{ cvar, PRESET_ENTRY_TYPE_STRING, value }
void DrawPresetSelector(PresetType presetType);
// TODO: Ideally everything below this point will come from one/many JSON files
const std::vector<const char*> enhancementsCvars = {
"gDpadPause",
"gDpadText",
"gDpadOcarina",
"gRStickOcarina",
"gDpadEquips",
"gPauseAnyCursor",
"gDpadNoDropOcarinaInput",
"gNaviOnL",
"gInvertXAxis",
"gInvertYAxis",
"gRightStickAiming",
"gDisableAutoCenterView",
"gTextSpeed",
"gMweepSpeed",
"gForgeTime",
"gClimbSpeed",
"gFasterBlockPush",
"gFasterHeavyBlockLift",
"gNoForcedNavi",
"gSkulltulaFreeze",
"gMMBunnyHood",
"gFastChests",
"gChestSizeAndTextureMatchesContents",
"gFastDrops",
"gBetterOwl",
"gFastOcarinaPlayback",
"gInstantPutaway",
"gFastBoomerang",
"gAskToEquip",
"gMaskSelect",
"gRememberSaveLocation",
"gDamageMul",
"gFallDamageMul",
"gVoidDamageMul",
"gNoRandomDrops",
"gNoHeartDrops",
"gBombchuDrops",
"gGoronPot",
"gDampeWin",
"gRedPotionEffect",
"gRedPotionHealth",
"gRedPercentRestore",
"gGreenPotionEffect",
"gGreenPotionMana",
"gGreenPercentRestore",
"gBluePotionEffects",
"gBluePotionHealth",
"gBlueHealthPercentRestore",
"gBluePotionMana",
"gBlueManaPercentRestore",
"gMilkEffect",
"gMilkHealth",
"gMilkPercentRestore",
"gSeparateHalfMilkEffect",
"gHalfMilkHealth",
"gHalfMilkPercentRestore",
"gFairyEffect",
"gFairyHealth",
"gFairyPercentRestore",
"gFairyReviveEffect",
"gFairyReviveHealth",
"gFairyRevivePercentRestore",
"gInstantFishing",
"gGuaranteeFishingBite",
"gFishNeverEscape",
"gChildMinimumWeightFish",
"gAdultMinimumWeightFish",
"gLowHpAlarm",
"gMinimalUI",
"gDisableNaviCallAudio",
"gVisualAgony",
"gAssignableTunicsAndBoots",
"gEquipmentCanBeRemoved",
"gCowOfTime",
"gGuardVision",
"gTimeFlowFileSelect",
"gInjectItemCounts",
"gDayGravePull",
"gSkipScarecrow",
"gBlueFireArrows",
"gSunlightArrows",
"gPauseLiveLinkRotation",
"gPauseLiveLink",
"gMinFrameCount",
"gN64Mode",
"gNewDrops",
"gDisableBlackBars",
"gDynamicWalletIcon",
"gAlwaysShowDungeonMinimapIcon",
"gUniformLR",
"gNGCKaleidoSwitcher",
"gFixDungeonMinimapIcon",
"gTwoHandedIdle",
"gGravediggingTourFix",
"gDekuNutUpgradeFix",
"gNaviTextFix",
"gAnubisFix",
"gCrouchStabHammerFix",
"gCrouchStabFix",
"gGerudoWarriorClothingFix",
"gRedGanonBlood",
"gHoverFishing",
"gN64WeirdFrames",
"gBombchusOOB",
"gGsCutscene",
"gSkipSaveConfirmation",
"gAutosave",
"gDisableCritWiggle",
"gChestSizeDependsStoneOfAgony",
"gSkipArrowAnimation",
"gSeparateArrows",
"gCustomizeShootingGallery",
"gInstantShootingGalleryWin",
"gConstantAdultGallery",
"gChildShootingGalleryAmmunition",
"gAdultShootingGalleryAmmunition",
"gCreditsFix",
};
const std::vector<const char*> randomizerCvars = {
"gChestSizeAndTextureMatchesContents",
"gFastChests",
"gMMBunnyHood",
"gRandomizeBigPoeTargetCount",
"gRandomizeBlueFireArrows",
"gRandomizeBossKeysanity",
"gRandomizeCompleteMaskQuest",
"gRandomizeCuccosToReturn",
"gRandomizeDoorOfTime",
"gRandomizeEnableBombchuDrops",
"gRandomizeEnableGlitchCutscenes",
"gRandomizeExcludedLocations",
"gRandomizeForest",
"gRandomizeGanonTrial",
"gRandomizeGanonTrialCount",
"gRandomizeGerudoFortress",
"gRandomizeGerudoKeys",
"gRandomizeGsExpectSunsSong",
"gRandomizeIceTraps",
"gRandomizeItemPool",
"gRandomizeKakarikoGate",
"gRandomizeKeysanity",
"gRandomizeLinksPocket",
"gRandomizeMedallionCount",
"gRandomizeMqDungeons",
"gRandomizeRainbowBridge",
"gRandomizeShopsanity",
"gRandomizeShuffleAdultTrade",
"gRandomizeShuffleBeans",
"gRandomizeShuffleCows",
"gRandomizeShuffleDungeonReward",
"gRandomizeShuffleFrogSongRupees",
"gRandomizeShuffleGanonBossKey",
"gRandomizeShuffleGerudoToken",
"gRandomizeShuffleKeyRings",
"gRandomizeShuffleKokiriSword",
"gRandomizeShuffleOcarinas",
"gRandomizeShuffleScrubs",
"gRandomizeShuffleSongs",
"gRandomizeShuffleTokens",
"gRandomizeShuffleWeirdEgg",
"gRandomizeSkipChildStealth",
"gRandomizeSkipChildZelda",
"gRandomizeSkipEponaRace",
"gRandomizeSkipScarecrowsSong",
"gRandomizeSkipTowerEscape",
"gRandomizeStartingAge",
"gRandomizeStartingConsumables",
"gRandomizeStartingDekuShield",
"gRandomizeStartingOcarina",
"gRandomizeStartingMapsCompasses",
"gRandomizeSunlightArrows",
"gRandomizeZorasFountain",
};
const std::vector<PresetEntry> vanillaPlusPresetEntries = {
// D-pad Support in text and file select
PRESET_ENTRY_S32("gDpadText", 1),
// Play Ocarina with D-pad
PRESET_ENTRY_S32("gDpadOcarina", 1),
// Play Ocarina with Right Stick
PRESET_ENTRY_S32("gRStickOcarina", 1),
// D-pad as Equip Items
PRESET_ENTRY_S32("gDpadEquips", 1),
// Prevent Dropped Ocarina Inputs
PRESET_ENTRY_S32("gDpadNoDropOcarinaInput", 1),
// Right Stick Aiming
PRESET_ENTRY_S32("gRightStickAiming", 1),
// Text Speed (1 to 5)
PRESET_ENTRY_S32("gTextSpeed", 5),
// King Zora Speed (1 to 5)
PRESET_ENTRY_S32("gMweepSpeed", 2),
// Faster Block Push (+0 to +5)
PRESET_ENTRY_S32("gFasterBlockPush", 5),
// Better Owl
PRESET_ENTRY_S32("gBetterOwl", 1),
// Assignable Tunics and Boots
PRESET_ENTRY_S32("gAssignableTunicsAndBoots", 1),
// Enable passage of time on file select
PRESET_ENTRY_S32("gTimeFlowFileSelect", 1),
// Inject Item Counts in messages
PRESET_ENTRY_S32("gInjectItemCounts", 1),
// Pause link animation (0 to 16)
PRESET_ENTRY_S32("gPauseLiveLink", 1),
// Dynamic Wallet Icon
PRESET_ENTRY_S32("gDynamicWalletIcon", 1),
// Always show dungeon entrances
PRESET_ENTRY_S32("gAlwaysShowDungeonMinimapIcon", 1),
// Fix L&R Pause menu
PRESET_ENTRY_S32("gUniformLR", 1),
// Fix Dungeon entrances
PRESET_ENTRY_S32("gFixDungeonMinimapIcon", 1),
// Fix Two Handed idle animations
PRESET_ENTRY_S32("gTwoHandedIdle", 1),
// Fix the Gravedigging Tour Glitch
PRESET_ENTRY_S32("gGravediggingTourFix", 1),
// Fix Deku Nut upgrade
PRESET_ENTRY_S32("gDekuNutUpgradeFix", 1),
// Fix Navi text HUD position
PRESET_ENTRY_S32("gNaviTextFix", 1),
// Red Ganon blood
PRESET_ENTRY_S32("gRedGanonBlood", 1),
// Fish while hovering
PRESET_ENTRY_S32("gHoverFishing", 1),
// N64 Weird Frames
PRESET_ENTRY_S32("gN64WeirdFrames", 1),
// Bombchus out of bounds
PRESET_ENTRY_S32("gBombchusOOB", 1),
// Skip save confirmation
PRESET_ENTRY_S32("gSkipSaveConfirmation", 1),
};
const std::vector<PresetEntry> enhancedPresetEntries = {
// D-pad Support in text and file select
PRESET_ENTRY_S32("gDpadText", 1),
// Play Ocarina with D-pad
PRESET_ENTRY_S32("gDpadOcarina", 1),
// Play Ocarina with Right Stick
PRESET_ENTRY_S32("gRStickOcarina", 1),
// D-pad as Equip Items
PRESET_ENTRY_S32("gDpadEquips", 1),
// Prevent Dropped Ocarina Inputs
PRESET_ENTRY_S32("gDpadNoDropOcarinaInput", 1),
// Right Stick Aiming
PRESET_ENTRY_S32("gRightStickAiming", 1),
// Text Speed (1 to 5)
PRESET_ENTRY_S32("gTextSpeed", 5),
// King Zora Speed (1 to 5)
PRESET_ENTRY_S32("gMweepSpeed", 2),
// Faster Block Push (+0 to +5)
PRESET_ENTRY_S32("gFasterBlockPush", 5),
// Better Owl
PRESET_ENTRY_S32("gBetterOwl", 1),
// Assignable Tunics and Boots
PRESET_ENTRY_S32("gAssignableTunicsAndBoots", 1),
// Enable passage of time on file select
PRESET_ENTRY_S32("gTimeFlowFileSelect", 1),
// Inject Item Counts in messages
PRESET_ENTRY_S32("gInjectItemCounts", 1),
// Pause link animation (0 to 16)
PRESET_ENTRY_S32("gPauseLiveLink", 1),
// Dynamic Wallet Icon
PRESET_ENTRY_S32("gDynamicWalletIcon", 1),
// Always show dungeon entrances
PRESET_ENTRY_S32("gAlwaysShowDungeonMinimapIcon", 1),
// Fix L&R Pause menu
PRESET_ENTRY_S32("gUniformLR", 1),
// Fix Dungeon entrances
PRESET_ENTRY_S32("gFixDungeonMinimapIcon", 1),
// Fix Two Handed idle animations
PRESET_ENTRY_S32("gTwoHandedIdle", 1),
// Fix the Gravedigging Tour Glitch
PRESET_ENTRY_S32("gGravediggingTourFix", 1),
// Fix Deku Nut upgrade
PRESET_ENTRY_S32("gDekuNutUpgradeFix", 1),
// Fix Navi text HUD position
PRESET_ENTRY_S32("gNaviTextFix", 1),
// Red Ganon blood
PRESET_ENTRY_S32("gRedGanonBlood", 1),
// Fish while hovering
PRESET_ENTRY_S32("gHoverFishing", 1),
// N64 Weird Frames
PRESET_ENTRY_S32("gN64WeirdFrames", 1),
// Bombchus out of bounds
PRESET_ENTRY_S32("gBombchusOOB", 1),
// Skip save confirmation
PRESET_ENTRY_S32("gSkipSaveConfirmation", 1),
// King Zora Speed (1 to 5)
PRESET_ENTRY_S32("gMweepSpeed", 5),
// Biggoron Forge Time (0 to 3)
PRESET_ENTRY_S32("gForgeTime", 0),
// Vine/Ladder Climb speed (+0 to +12)
PRESET_ENTRY_S32("gClimbSpeed", 3),
// Faster Heavy Block Lift
PRESET_ENTRY_S32("gFasterHeavyBlockLift", 1),
// No Forced Navi
PRESET_ENTRY_S32("gNoForcedNavi", 1),
// No Skulltula Freeze
PRESET_ENTRY_S32("gSkulltulaFreeze", 1),
// MM Bunny Hood
PRESET_ENTRY_S32("gMMBunnyHood", 1),
// Fast Chests
PRESET_ENTRY_S32("gFastChests", 1),
// Fast Drops
PRESET_ENTRY_S32("gFastDrops", 1),
// Fast Ocarina Playback
PRESET_ENTRY_S32("gFastOcarinaPlayback", 1),
// Instant Putaway
PRESET_ENTRY_S32("gInstantPutaway", 1),
// Instant Boomerang Recall
PRESET_ENTRY_S32("gFastBoomerang", 1),
// Ask to Equip New Items
PRESET_ENTRY_S32("gAskToEquip", 1),
// Mask Select in Inventory
PRESET_ENTRY_S32("gMaskSelect", 1),
// Always Win Goron Pot
PRESET_ENTRY_S32("gGoronPot", 1),
// Always Win Dampe Digging
PRESET_ENTRY_S32("gDampeWin", 1),
// Skip Magic Arrow Equip Animation
PRESET_ENTRY_S32("gSkipArrowAnimation", 1),
// Equip arrows on multiple slots
PRESET_ENTRY_S32("gSeparateArrows", 1),
// Disable Navi Call Audio
PRESET_ENTRY_S32("gDisableNaviCallAudio", 1),
// Equipment Toggle
PRESET_ENTRY_S32("gEquipmentCanBeRemoved", 1),
// Link's Cow in Both Time Periods
PRESET_ENTRY_S32("gCowOfTime", 1),
// Enable 3D Dropped items/projectiles
PRESET_ENTRY_S32("gNewDrops", 1),
// Fix Anubis fireballs
PRESET_ENTRY_S32("gAnubisFix", 1),
// Autosave
PRESET_ENTRY_S32("gAutosave", 1),
};
const std::vector<PresetEntry> randomizerPresetEntries = {
// D-pad Support in text and file select
PRESET_ENTRY_S32("gDpadText", 1),
// Play Ocarina with D-pad
PRESET_ENTRY_S32("gDpadOcarina", 1),
// Play Ocarina with Right Stick
PRESET_ENTRY_S32("gRStickOcarina", 1),
// D-pad as Equip Items
PRESET_ENTRY_S32("gDpadEquips", 1),
// Prevent Dropped Ocarina Inputs
PRESET_ENTRY_S32("gDpadNoDropOcarinaInput", 1),
// Right Stick Aiming
PRESET_ENTRY_S32("gRightStickAiming", 1),
// Text Speed (1 to 5)
PRESET_ENTRY_S32("gTextSpeed", 5),
// King Zora Speed (1 to 5)
PRESET_ENTRY_S32("gMweepSpeed", 2),
// Faster Block Push (+0 to +5)
PRESET_ENTRY_S32("gFasterBlockPush", 5),
// Better Owl
PRESET_ENTRY_S32("gBetterOwl", 1),
// Assignable Tunics and Boots
PRESET_ENTRY_S32("gAssignableTunicsAndBoots", 1),
// Enable passage of time on file select
PRESET_ENTRY_S32("gTimeFlowFileSelect", 1),
// Inject Item Counts in messages
PRESET_ENTRY_S32("gInjectItemCounts", 1),
// Pause link animation (0 to 16)
PRESET_ENTRY_S32("gPauseLiveLink", 1),
// Dynamic Wallet Icon
PRESET_ENTRY_S32("gDynamicWalletIcon", 1),
// Always show dungeon entrances
PRESET_ENTRY_S32("gAlwaysShowDungeonMinimapIcon", 1),
// Fix L&R Pause menu
PRESET_ENTRY_S32("gUniformLR", 1),
// Fix Dungeon entrances
PRESET_ENTRY_S32("gFixDungeonMinimapIcon", 1),
// Fix Two Handed idle animations
PRESET_ENTRY_S32("gTwoHandedIdle", 1),
// Fix the Gravedigging Tour Glitch
PRESET_ENTRY_S32("gGravediggingTourFix", 1),
// Fix Deku Nut upgrade
PRESET_ENTRY_S32("gDekuNutUpgradeFix", 1),
// Fix Navi text HUD position
PRESET_ENTRY_S32("gNaviTextFix", 1),
// Red Ganon blood
PRESET_ENTRY_S32("gRedGanonBlood", 1),
// Fish while hovering
PRESET_ENTRY_S32("gHoverFishing", 1),
// N64 Weird Frames
PRESET_ENTRY_S32("gN64WeirdFrames", 1),
// Bombchus out of bounds
PRESET_ENTRY_S32("gBombchusOOB", 1),
// Skip save confirmation
PRESET_ENTRY_S32("gSkipSaveConfirmation", 1),
// King Zora Speed (1 to 5)
PRESET_ENTRY_S32("gMweepSpeed", 5),
// Biggoron Forge Time (0 to 3)
PRESET_ENTRY_S32("gForgeTime", 0),
// Vine/Ladder Climb speed (+0 to +12)
PRESET_ENTRY_S32("gClimbSpeed", 3),
// Faster Heavy Block Lift
PRESET_ENTRY_S32("gFasterHeavyBlockLift", 1),
// No Forced Navi
PRESET_ENTRY_S32("gNoForcedNavi", 1),
// No Skulltula Freeze
PRESET_ENTRY_S32("gSkulltulaFreeze", 1),
// MM Bunny Hood
PRESET_ENTRY_S32("gMMBunnyHood", 1),
// Fast Chests
PRESET_ENTRY_S32("gFastChests", 1),
// Fast Drops
PRESET_ENTRY_S32("gFastDrops", 1),
// Fast Ocarina Playback
PRESET_ENTRY_S32("gFastOcarinaPlayback", 1),
// Instant Putaway
PRESET_ENTRY_S32("gInstantPutaway", 1),
// Instant Boomerang Recall
PRESET_ENTRY_S32("gFastBoomerang", 1),
// Ask to Equip New Items
PRESET_ENTRY_S32("gAskToEquip", 1),
// Mask Select in Inventory
PRESET_ENTRY_S32("gMaskSelect", 1),
// Always Win Goron Pot
PRESET_ENTRY_S32("gGoronPot", 1),
// Always Win Dampe Digging
PRESET_ENTRY_S32("gDampeWin", 1),
// Skip Magic Arrow Equip Animation
PRESET_ENTRY_S32("gSkipArrowAnimation", 1),
// Equip arrows on multiple slots
PRESET_ENTRY_S32("gSeparateArrows", 1),
// Disable Navi Call Audio
PRESET_ENTRY_S32("gDisableNaviCallAudio", 1),
// Equipment Toggle
PRESET_ENTRY_S32("gEquipmentCanBeRemoved", 1),
// Link's Cow in Both Time Periods
PRESET_ENTRY_S32("gCowOfTime", 1),
// Enable 3D Dropped items/projectiles
PRESET_ENTRY_S32("gNewDrops", 1),
// Fix Anubis fireballs
PRESET_ENTRY_S32("gAnubisFix", 1),
// Autosave
PRESET_ENTRY_S32("gAutosave", 1),
// Allow the cursor to be on any slot
PRESET_ENTRY_S32("gPauseAnyCursor", 1),
// Guarantee Bite
PRESET_ENTRY_S32("gGuaranteeFishingBite", 1),
// Fish Never Escape
PRESET_ENTRY_S32("gFishNeverEscape", 1),
// Child Minimum Weight (6 to 10)
PRESET_ENTRY_S32("gChildMinimumWeightFish", 3),
// Adult Minimum Weight (8 to 13)
PRESET_ENTRY_S32("gAdultMinimumWeightFish", 6),
// Visual Stone of Agony
PRESET_ENTRY_S32("gVisualAgony", 1),
// Pull grave during the day
PRESET_ENTRY_S32("gDayGravePull", 1),
// Pull out Ocarina to Summon Scarecrow
PRESET_ENTRY_S32("gSkipScarecrow", 1),
// Chest size & texture matches contents
PRESET_ENTRY_S32("gChestSizeAndTextureMatchesContents", 1),
// Pause link animation (0 to 16)
PRESET_ENTRY_S32("gPauseLiveLink", 16),
// Frames to wait
PRESET_ENTRY_S32("gMinFrameCount", 200),
};
const std::vector<PresetEntry> s6PresetEntries = {
PRESET_ENTRY_S32("gChestSizeAndTextureMatchesContents", 1),
PRESET_ENTRY_S32("gFastChests", 1),
PRESET_ENTRY_S32("gMMBunnyHood", 2),
PRESET_ENTRY_S32("gRandomizeBigPoeTargetCount", 1),
PRESET_ENTRY_S32("gRandomizeCuccosToReturn", 4),
PRESET_ENTRY_S32("gRandomizeDoorOfTime", 2),
PRESET_ENTRY_STRING("gRandomizeExcludedLocations", "48,"),
PRESET_ENTRY_S32("gRandomizeForest", 1),
PRESET_ENTRY_S32("gRandomizeGanonTrial", 0),
PRESET_ENTRY_S32("gRandomizeGerudoFortress", 1),
PRESET_ENTRY_S32("gRandomizeIceTraps", 0),
PRESET_ENTRY_S32("gRandomizeKakarikoGate", 1),
PRESET_ENTRY_S32("gRandomizeMedallionCount", 6),
PRESET_ENTRY_S32("gRandomizeMqDungeons", 0),
PRESET_ENTRY_S32("gRandomizeRainbowBridge", 3),
PRESET_ENTRY_S32("gRandomizeShuffleAdultTrade", 1),
PRESET_ENTRY_S32("gRandomizeShuffleDungeonReward", 0),
PRESET_ENTRY_S32("gRandomizeShuffleGanonBossKey", 2),
PRESET_ENTRY_S32("gRandomizeShuffleKokiriSword", 1),
PRESET_ENTRY_S32("gRandomizeSkipChildStealth", 1),
PRESET_ENTRY_S32("gRandomizeSkipChildZelda", 1),
PRESET_ENTRY_S32("gRandomizeSkipEponaRace", 1),
PRESET_ENTRY_S32("gRandomizeSkipTowerEscape", 1),
PRESET_ENTRY_S32("gRandomizeStartingAge", 2),
PRESET_ENTRY_S32("gRandomizeStartingConsumables", 1),
PRESET_ENTRY_S32("gRandomizeStartingDekuShield", 1),
PRESET_ENTRY_S32("gRandomizeStartingMapsCompasses", 0),
PRESET_ENTRY_S32("gRandomizeStartingOcarina", 1),
PRESET_ENTRY_S32("gRandomizeZorasFountain", 0),
};
const std::vector<PresetEntry> hellModePresetEntries = {
PRESET_ENTRY_S32("gChestSizeAndTextureMatchesContents", 1),
PRESET_ENTRY_S32("gFastChests", 1),
PRESET_ENTRY_S32("gMMBunnyHood", 2),
PRESET_ENTRY_S32("gRandomizeBigPoeTargetCount", 1),
PRESET_ENTRY_S32("gRandomizeBlueFireArrows", 1),
PRESET_ENTRY_S32("gRandomizeBossKeysanity", 5),
PRESET_ENTRY_S32("gRandomizeCompleteMaskQuest", 1),
PRESET_ENTRY_S32("gRandomizeCuccosToReturn", 1),
PRESET_ENTRY_S32("gRandomizeDoorOfTime", 2),
PRESET_ENTRY_S32("gRandomizeEnableBombchuDrops", 1),
PRESET_ENTRY_S32("gRandomizeEnableGlitchCutscenes", 1),
PRESET_ENTRY_S32("gRandomizeForest", 2),
PRESET_ENTRY_S32("gRandomizeGanonTrial", 2),
PRESET_ENTRY_S32("gRandomizeGanonTrialCount", 6),
PRESET_ENTRY_S32("gRandomizeGerudoKeys", 3),
PRESET_ENTRY_S32("gRandomizeGsExpectSunsSong", 1),
PRESET_ENTRY_S32("gRandomizeIceTraps", 4),
PRESET_ENTRY_S32("gRandomizeItemPool", 1),
PRESET_ENTRY_S32("gRandomizeKakarikoGate", 1),
PRESET_ENTRY_S32("gRandomizeKeysanity", 5),
PRESET_ENTRY_S32("gRandomizeLinksPocket", 3),
PRESET_ENTRY_S32("gRandomizeMqDungeons", 2),
PRESET_ENTRY_S32("gRandomizeRainbowBridge", 4),
PRESET_ENTRY_S32("gRandomizeShopsanity", 5),
PRESET_ENTRY_S32("gRandomizeShuffleAdultTrade", 1),
PRESET_ENTRY_S32("gRandomizeShuffleBeans", 1),
PRESET_ENTRY_S32("gRandomizeShuffleCows", 1),
PRESET_ENTRY_S32("gRandomizeShuffleDungeonReward", 3),
PRESET_ENTRY_S32("gRandomizeShuffleFrogSongRupees", 1),
PRESET_ENTRY_S32("gRandomizeShuffleGanonBossKey", 10),
PRESET_ENTRY_S32("gRandomizeShuffleGerudoToken", 1),
PRESET_ENTRY_S32("gRandomizeShuffleKeyRings", 1),
PRESET_ENTRY_S32("gRandomizeShuffleKokiriSword", 1),
PRESET_ENTRY_S32("gRandomizeShuffleOcarinas", 1),
PRESET_ENTRY_S32("gRandomizeShuffleScrubs", 3),
PRESET_ENTRY_S32("gRandomizeShuffleSongs", 2),
PRESET_ENTRY_S32("gRandomizeShuffleTokens", 3),
PRESET_ENTRY_S32("gRandomizeShuffleWeirdEgg", 1),
PRESET_ENTRY_S32("gRandomizeSkipChildStealth", 1),
PRESET_ENTRY_S32("gRandomizeSkipEponaRace", 1),
PRESET_ENTRY_S32("gRandomizeSkipScarecrowsSong", 1),
PRESET_ENTRY_S32("gRandomizeSkipTowerEscape", 1),
PRESET_ENTRY_S32("gRandomizeStartingAge", 2),
PRESET_ENTRY_S32("gRandomizeStartingMapsCompasses", 5),
PRESET_ENTRY_S32("gRandomizeSunlightArrows", 1),
PRESET_ENTRY_S32("gRandomizeZorasFountain", 2),
};
typedef struct PresetDefinition {
const char* label;
const char* description;
std::vector<PresetEntry> entries;
} PresetDefinition;
typedef struct PresetTypeDefinition {
std::vector<const char*> cvarsToClear;
std::map<uint16_t, PresetDefinition> presets;
} PresetTypeDefinition;
const std::map<PresetType, PresetTypeDefinition> presetTypes = {
{ PRESET_TYPE_ENHANCEMENTS, { enhancementsCvars, {
{ ENHANCEMENT_PRESET_DEFAULT, {
"Default",
"Reset all options to their default values.",
{},
} },
{ ENHANCEMENT_PRESET_VANILLA_PLUS, {
"Vanilla Plus",
"Adds Quality of Life features that enhance your experience, but don't alter gameplay. Recommended for a first playthrough of OoT.",
vanillaPlusPresetEntries,
} },
{ ENHANCEMENT_PRESET_ENHANCED, {
"Enhanced",
"The \"Vanilla Plus\" preset, but with more quality of life enhancements that might alter gameplay slightly. Recommended for returning players.",
enhancedPresetEntries
} },
{ ENHANCEMENT_PRESET_RANDOMIZER, {
"Randomizer",
"The \"Enhanced\" preset, plus any other enhancements that are recommended for playing Randomizer.",
randomizerPresetEntries
} },
} } },
{ PRESET_TYPE_RANDOMIZER, { randomizerCvars, {
{ RANDOMIZER_PRESET_DEFAULT, {
"Default",
"Reset all options to their default values.",
{},
} },
{ RANDOMIZER_PRESET_S6, {
"S6 Tournament (Adapted)",
"Matches OOTR S6 tournament settings as close as we can get with the options available in SoH. The following differences are notable:\n" \
"- Child overworld spawn not randomized\n" \
"- Dungeon rewards are shuffled at the end of dungeons, rather than at the end of their own dungeon\n" \
"- Full adult trade sequence is shuffled instead of the selected 4\n" \
"- Hint distribution no \"tournament\" mode, falling back to balanced",
s6PresetEntries,
} },
{ RANDOMIZER_PRESET_HELL_MODE, {
"Hell Mode",
"All settings maxed but still using glitchless logic. Expect pain.",
hellModePresetEntries
} },
} } }
};

View File

@ -17,6 +17,7 @@
#include <ImGui/imgui_internal.h>
#include "../custom-message/CustomMessageTypes.h"
#include "../item-tables/ItemTableManager.h"
#include "../presets.h"
#include "../../../src/overlays/actors/ovl_En_GirlA/z_en_girla.h"
#include <stdexcept>
#include "randomizer_check_objects.h"
@ -2748,6 +2749,8 @@ void DrawRandoEditor(bool& open) {
return;
}
DrawPresetSelector(PRESET_TYPE_RANDOMIZER);
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));

View File

@ -27,6 +27,7 @@
#include "include/z64audio.h"
#include "soh/SaveManager.h"
#include "OTRGlobals.h"
#include "soh/Enhancements/presets.h"
#ifdef ENABLE_CROWD_CONTROL
#include "Enhancements/crowd-control/CrowdControl.h"
@ -99,435 +100,6 @@ namespace GameMenuBar {
Audio_SetGameVolume(SEQ_SFX, CVar_GetFloat("gFanfareVolume", 1));
}
void applyEnhancementPresetDefault(void) {
// D-pad Support on Pause
CVar_SetS32("gDpadPause", 0);
// D-pad Support in text and file select
CVar_SetS32("gDpadText", 0);
// Play Ocarina with D-pad
CVar_SetS32("gDpadOcarina", 0);
// Play Ocarina with Right Stick
CVar_SetS32("gRStickOcarina", 0);
// D-pad as Equip Items
CVar_SetS32("gDpadEquips", 0);
// Allow the cursor to be on any slot
CVar_SetS32("gPauseAnyCursor", 0);
// Prevent Dropped Ocarina Inputs
CVar_SetS32("gDpadNoDropOcarinaInput", 0);
// Answer Navi Prompt with L Button
CVar_SetS32("gNaviOnL", 0);
// Invert Camera X Axis
CVar_SetS32("gInvertXAxis", 0);
// Invert Camera Y Axis
CVar_SetS32("gInvertYAxis", 1);
// Right Stick Aiming
CVar_SetS32("gRightStickAiming", 0);
// Disable Auto-Center First Person View
CVar_SetS32("gDisableAutoCenterView", 0);
// Text Speed (1 to 5)
CVar_SetS32("gTextSpeed", 1);
// King Zora Speed (1 to 5)
CVar_SetS32("gMweepSpeed", 1);
// Biggoron Forge Time (0 to 3)
CVar_SetS32("gForgeTime", 3);
// Vine/Ladder Climb speed (+0 to +12)
CVar_SetS32("gClimbSpeed", 0);
// Faster Block Push (+0 to +5)
CVar_SetS32("gFasterBlockPush", 0);
// Faster Heavy Block Lift
CVar_SetS32("gFasterHeavyBlockLift", 0);
// No Forced Navi
CVar_SetS32("gNoForcedNavi", 0);
// No Skulltula Freeze
CVar_SetS32("gSkulltulaFreeze", 0);
// MM Bunny Hood
CVar_SetS32("gMMBunnyHood", 0);
// Fast Chests
CVar_SetS32("gFastChests", 0);
// Chest size & texture matches contents
CVar_SetS32("gChestSizeAndTextureMatchesContents", 0);
// Chest size & texture matches contents only with agony
CVar_SetS32("gChestSizeDependsStoneOfAgony", 0);
// Fast Drops
CVar_SetS32("gFastDrops", 0);
// Better Owl
CVar_SetS32("gBetterOwl", 0);
// Fast Ocarina Playback
CVar_SetS32("gFastOcarinaPlayback", 0);
// Instant Putaway
CVar_SetS32("gInstantPutaway", 0);
// Instant Boomerang Recall
CVar_SetS32("gFastBoomerang", 0);
// Ask to Equip New Items
CVar_SetS32("gAskToEquip", 0);
// Mask Select in Inventory
CVar_SetS32("gMaskSelect", 0);
// Remember Save Location
CVar_SetS32("gRememberSaveLocation", 0);
// Skip Magic Arrow Equip Animation
CVar_SetS32("gSkipArrowAnimation", 0);
// Equip arrows on multiple slots
CVar_SetS32("gSeparateArrows", 0);
// Damage Multiplier (0 to 8)
CVar_SetS32("gDamageMul", 0);
// Fall Damage Multiplier (0 to 7)
CVar_SetS32("gFallDamageMul", 0);
// Void Damage Multiplier (0 to 6)
CVar_SetS32("gVoidDamageMul", 0);
// No Random Drops
CVar_SetS32("gNoRandomDrops", 0);
// No Heart Drops
CVar_SetS32("gNoHeartDrops", 0);
// Enable Bombchu Drops
CVar_SetS32("gBombchuDrops", 0);
// Always Win Goron Pot
CVar_SetS32("gGoronPot", 0);
// Always Win Dampe Digging First Try
CVar_SetS32("gDampeWin", 0);
// Change Red Potion Effect
CVar_SetS32("gRedPotionEffect", 0);
// Red Potion Health (1 to 100)
CVar_SetS32("gRedPotionHealth", 1);
// Red Potion Percent Restore
CVar_SetS32("gRedPercentRestore", 0);
// Change Green Potion Effect
CVar_SetS32("gGreenPotionEffect", 0);
// Green Potion Mana (1 to 100)
CVar_SetS32("gGreenPotionMana", 1);
// Green Potion Percent Restore
CVar_SetS32("gGreenPercentRestore", 0);
// Change Blue Potion Effects
CVar_SetS32("gBluePotionEffects", 0);
// Blue Potion Health (1 to 100)
CVar_SetS32("gBluePotionHealth", 1);
// Blue Potion Health Percent Restore
CVar_SetS32("gBlueHealthPercentRestore", 0);
// Blue Potion Mana (1 to 100)
CVar_SetS32("gBluePotionMana", 1);
// Blue Potion Mana Percent Restore
CVar_SetS32("gBlueManaPercentRestore", 0);
// Change Milk Effect
CVar_SetS32("gMilkEffect", 0);
// Milk Health (1 to 100)
CVar_SetS32("gMilkHealth", 1);
// Milk Percent Restore
CVar_SetS32("gMilkPercentRestore", 0);
// Separate Half Milk Effect
CVar_SetS32("gSeparateHalfMilkEffect", 0);
// Half Milk Health (1 to 100)
CVar_SetS32("gHalfMilkHealth", 0);
// Half Milk Percent Restore
CVar_SetS32("gHalfMilkPercentRestore", 0);
// Change Fairy Effect
CVar_SetS32("gFairyEffect", 0);
// Fairy (1 to 100)
CVar_SetS32("gFairyHealth", 1);
// Fairy Percent Restore
CVar_SetS32("gFairyPercentRestore", 0);
// Change Fairy Revive Effect
CVar_SetS32("gFairyReviveEffect", 0);
// Fairy Revival (1 to 100)
CVar_SetS32("gFairyReviveHealth", 1);
// Fairy Revive Percent Restore
CVar_SetS32("gFairyRevivePercentRestore", 0);
// Customize Shooting Gallery
CVar_SetS32("gCustomizeShootingGallery", 0);
// Shooting Gallery Instant Win
CVar_SetS32("gInstantShootingGalleryWin", 0);
// Constant Adult Shooting Gallery
CVar_SetS32("gConstantAdultGallery", 0);
// Child Starting Ammunition (10 to 30)
CVar_SetS32("gChildShootingGalleryAmmunition", 15);
// Adult Starting Ammunition (10 to 30)
CVar_SetS32("gAdultShootingGalleryAmmunition", 15);
// Instant Fishing
CVar_SetS32("gInstantFishing", 0);
// Guarantee Bite
CVar_SetS32("gGuaranteeFishingBite", 0);
// Fish Never Escape
CVar_SetS32("gFishNeverEscape", 0);
// Child Minimum Weight (6 to 10)
CVar_SetS32("gChildMinimumWeightFish", 10);
// Adult Minimum Weight (8 to 13)
CVar_SetS32("gAdultMinimumWeightFish", 13);
// Mute Low HP Alarm
CVar_SetS32("gLowHpAlarm", 0);
// Minimal UI
CVar_SetS32("gMinimalUI", 0);
// Disable Navi Call Audio
CVar_SetS32("gDisableNaviCallAudio", 0);
// Visual Stone of Agony
CVar_SetS32("gVisualAgony", 0);
// Assignable Tunics and Boots
CVar_SetS32("gAssignableTunicsAndBoots", 0);
// Equipment Toggle
CVar_SetS32("gEquipmentCanBeRemoved", 0);
// Link's Cow in Both Time Periods
CVar_SetS32("gCowOfTime", 0);
// Enable visible guard vision
CVar_SetS32("gGuardVision", 0);
// Enable passage of time on file select
CVar_SetS32("gTimeFlowFileSelect", 0);
// Inject Item Counts in messages
CVar_SetS32("gInjectItemCounts", 0);
// Pull grave during the day
CVar_SetS32("gDayGravePull", 0);
// Pull out Ocarina to Summon Scarecrow
CVar_SetS32("gSkipScarecrow", 0);
// Blue Fire Arrows
CVar_SetS32("gBlueFireArrows", 0);
// Sunlight Arrows
CVar_SetS32("gSunlightArrows", 0);
// Rotate link (0 to 2)
CVar_SetS32("gPauseLiveLinkRotation", 0);
// Pause link animation (0 to 16)
CVar_SetS32("gPauseLiveLink", 0);
// Frames to wait
CVar_SetS32("gMinFrameCount", 1);
// N64 Mode
CVar_SetS32("gN64Mode", 0);
// Enable 3D Dropped items/projectiles
CVar_SetS32("gNewDrops", 0);
// Disable Black Bar Letterboxes
CVar_SetS32("gDisableBlackBars", 0);
// Dynamic Wallet Icon
CVar_SetS32("gDynamicWalletIcon", 0);
// Always show dungeon entrances
CVar_SetS32("gAlwaysShowDungeonMinimapIcon", 0);
// Fix L&R Pause menu
CVar_SetS32("gUniformLR", 0);
// Fix L&Z Page switch in Pause menu
CVar_SetS32("gNGCKaleidoSwitcher", 0);
// Fix Dungeon entrances
CVar_SetS32("gFixDungeonMinimapIcon", 0);
// Fix Two Handed idle animations
CVar_SetS32("gTwoHandedIdle", 0);
// Fix the Gravedigging Tour Glitch
CVar_SetS32("gGravediggingTourFix", 0);
// Fix Deku Nut upgrade
CVar_SetS32("gDekuNutUpgradeFix", 0);
// Fix Navi text HUD position
CVar_SetS32("gNaviTextFix", 0);
// Fix Anubis fireballs
CVar_SetS32("gAnubisFix", 0);
// Fix Megaton Hammer crouch stab
CVar_SetS32("gCrouchStabHammerFix", 0);
// Fix all crouch stab
CVar_SetS32("gCrouchStabFix", 0);
// Fix credits timing
CVar_SetS32("gCreditsFix", 1);
// Fix Gerudo Warrior's clothing colors
CVar_SetS32("gGerudoWarriorClothingFix", 0);
// Red Ganon blood
CVar_SetS32("gRedGanonBlood", 0);
// Fish while hovering
CVar_SetS32("gHoverFishing", 0);
// N64 Weird Frames
CVar_SetS32("gN64WeirdFrames", 0);
// Bombchus out of bounds
CVar_SetS32("gBombchusOOB", 0);
// Restore old Gold Skulltula cutscene
CVar_SetS32("gGsCutscene", 0);
// Skip save confirmation
CVar_SetS32("gSkipSaveConfirmation", 0);
// Autosave
CVar_SetS32("gAutosave", 0);
//Crit wiggle disable
CVar_SetS32("gDisableCritWiggle", 0);
}
void applyEnhancementPresetVanillaPlus(void) {
// D-pad Support in text and file select
CVar_SetS32("gDpadText", 1);
// Play Ocarina with D-pad
CVar_SetS32("gDpadOcarina", 1);
// Play Ocarina with Right Stick
CVar_SetS32("gRStickOcarina", 1);
// D-pad as Equip Items
CVar_SetS32("gDpadEquips", 1);
// Prevent Dropped Ocarina Inputs
CVar_SetS32("gDpadNoDropOcarinaInput", 1);
// Right Stick Aiming
CVar_SetS32("gRightStickAiming", 1);
// Text Speed (1 to 5)
CVar_SetS32("gTextSpeed", 5);
// King Zora Speed (1 to 5)
CVar_SetS32("gMweepSpeed", 2);
// Faster Block Push (+0 to +5)
CVar_SetS32("gFasterBlockPush", 5);
// Better Owl
CVar_SetS32("gBetterOwl", 1);
// Assignable Tunics and Boots
CVar_SetS32("gAssignableTunicsAndBoots", 1);
// Enable passage of time on file select
CVar_SetS32("gTimeFlowFileSelect", 1);
// Inject Item Counts in messages
CVar_SetS32("gInjectItemCounts", 1);
// Pause link animation (0 to 16)
CVar_SetS32("gPauseLiveLink", 1);
// Dynamic Wallet Icon
CVar_SetS32("gDynamicWalletIcon", 1);
// Always show dungeon entrances
CVar_SetS32("gAlwaysShowDungeonMinimapIcon", 1);
// Fix L&R Pause menu
CVar_SetS32("gUniformLR", 1);
// Fix Dungeon entrances
CVar_SetS32("gFixDungeonMinimapIcon", 1);
// Fix Two Handed idle animations
CVar_SetS32("gTwoHandedIdle", 1);
// Fix the Gravedigging Tour Glitch
CVar_SetS32("gGravediggingTourFix", 1);
// Fix Deku Nut upgrade
CVar_SetS32("gDekuNutUpgradeFix", 1);
// Fix Navi text HUD position
CVar_SetS32("gNaviTextFix", 1);
// Red Ganon blood
CVar_SetS32("gRedGanonBlood", 1);
// Fish while hovering
CVar_SetS32("gHoverFishing", 1);
// N64 Weird Frames
CVar_SetS32("gN64WeirdFrames", 1);
// Bombchus out of bounds
CVar_SetS32("gBombchusOOB", 1);
// Skip save confirmation
CVar_SetS32("gSkipSaveConfirmation", 1);
}
void applyEnhancementPresetEnhanced(void) {
// King Zora Speed (1 to 5)
CVar_SetS32("gMweepSpeed", 5);
// Biggoron Forge Time (0 to 3)
CVar_SetS32("gForgeTime", 0);
// Vine/Ladder Climb speed (+0 to +12)
CVar_SetS32("gClimbSpeed", 3);
// Faster Heavy Block Lift
CVar_SetS32("gFasterHeavyBlockLift", 1);
// No Forced Navi
CVar_SetS32("gNoForcedNavi", 1);
// No Skulltula Freeze
CVar_SetS32("gSkulltulaFreeze", 1);
// MM Bunny Hood
CVar_SetS32("gMMBunnyHood", 1);
// Fast Chests
CVar_SetS32("gFastChests", 1);
// Fast Drops
CVar_SetS32("gFastDrops", 1);
// Fast Ocarina Playback
CVar_SetS32("gFastOcarinaPlayback", 1);
// Instant Putaway
CVar_SetS32("gInstantPutaway", 1);
// Instant Boomerang Recall
CVar_SetS32("gFastBoomerang", 1);
// Ask to Equip New Items
CVar_SetS32("gAskToEquip", 1);
// Mask Select in Inventory
CVar_SetS32("gMaskSelect", 1);
// Always Win Goron Pot
CVar_SetS32("gGoronPot", 1);
// Always Win Dampe Digging
CVar_SetS32("gDampeWin", 1);
// Skip Magic Arrow Equip Animation
CVar_SetS32("gSkipArrowAnimation", 1);
// Equip arrows on multiple slots
CVar_SetS32("gSeparateArrows", 1);
// Disable Navi Call Audio
CVar_SetS32("gDisableNaviCallAudio", 1);
// Equipment Toggle
CVar_SetS32("gEquipmentCanBeRemoved", 1);
// Link's Cow in Both Time Periods
CVar_SetS32("gCowOfTime", 1);
// Enable 3D Dropped items/projectiles
CVar_SetS32("gNewDrops", 1);
// Fix Anubis fireballs
CVar_SetS32("gAnubisFix", 1);
// Autosave
CVar_SetS32("gAutosave", 1);
}
void applyEnhancementPresetRandomizer(void) {
// Allow the cursor to be on any slot
CVar_SetS32("gPauseAnyCursor", 1);
// Guarantee Bite
CVar_SetS32("gGuaranteeFishingBite", 1);
// Fish Never Escape
CVar_SetS32("gFishNeverEscape", 1);
// Child Minimum Weight (6 to 10)
CVar_SetS32("gChildMinimumWeightFish", 3);
// Adult Minimum Weight (8 to 13)
CVar_SetS32("gAdultMinimumWeightFish", 6);
// Visual Stone of Agony
CVar_SetS32("gVisualAgony", 1);
// Pull grave during the day
CVar_SetS32("gDayGravePull", 1);
// Pull out Ocarina to Summon Scarecrow
CVar_SetS32("gSkipScarecrow", 1);
// Chest size & texture matches contents
CVar_SetS32("gChestSizeAndTextureMatchesContents", 1);
// Pause link animation (0 to 16)
CVar_SetS32("gPauseLiveLink", 16);
// Frames to wait
CVar_SetS32("gMinFrameCount", 200);
}
void applyEnhancementPresets(void) {
switch (CVar_GetS32("gSelectEnhancementPresets", 0)) {
// Default
case 0:
applyEnhancementPresetDefault();
break;
// Vanilla Plus
case 1:
applyEnhancementPresetDefault();
applyEnhancementPresetVanillaPlus();
break;
// Enhanced
case 2:
applyEnhancementPresetDefault();
applyEnhancementPresetVanillaPlus();
applyEnhancementPresetEnhanced();
break;
// Randomizer
case 3:
applyEnhancementPresetDefault();
applyEnhancementPresetVanillaPlus();
applyEnhancementPresetEnhanced();
applyEnhancementPresetRandomizer();
break;
}
}
// MARK: - Delegates
void SetupHooks() {
@ -731,28 +303,7 @@ namespace GameMenuBar {
if (ImGui::BeginMenu("Enhancements"))
{
const char* enhancementPresets[4] = { "Default", "Vanilla Plus", "Enhanced", "Randomizer"};
UIWidgets::PaddedText("Enhancement Presets", false, true);
UIWidgets::EnhancementCombobox("gSelectEnhancementPresets", enhancementPresets, 4, 0);
UIWidgets::Tooltip(
"Default - Set all enhancements to their default values. The true vanilla SoH experience.\n"
"\n"
"Vanilla Plus - Adds Quality of Life features that enhance your experience, but don't alter gameplay. Recommended for a first playthrough of OoT.\n"
"\n"
"Enhanced - The \"Vanilla Plus\" preset, but with more quality of life enhancements that might alter gameplay slightly. Recommended for returning players.\n"
"\n"
"Randomizer - The \"Enhanced\" preset, plus any other enhancements that are recommended for playing Randomizer."
);
UIWidgets::Spacer(0);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(6.0f, 4.0f));
if (ImGui::Button("Apply Preset")) {
applyEnhancementPresets();
SohImGui::RequestCvarSaveOnNextTick();
}
ImGui::PopStyleVar(1);
DrawPresetSelector(PRESET_TYPE_ENHANCEMENTS);
UIWidgets::Spacer(0);