Merge remote-tracking branch 'origin/develop' into actor-accessibility-experiments

This commit is contained in:
Demur Rumed 2025-06-01 01:19:07 +00:00
commit bb8bbe445f
112 changed files with 3655 additions and 4457 deletions

View file

@ -40,7 +40,7 @@ $files = Get-ChildItem -Path $basePath\soh -Recurse -File `
($_.Extension -eq '.c' -or $_.Extension -eq '.cpp' -or ` ($_.Extension -eq '.c' -or $_.Extension -eq '.cpp' -or `
(($_.Extension -eq '.h' -or $_.Extension -eq '.hpp') -and ` (($_.Extension -eq '.h' -or $_.Extension -eq '.hpp') -and `
(-not ($_.FullName -like "*\soh\src\*" -or $_.FullName -like "*\soh\include\*")))) -and ` (-not ($_.FullName -like "*\soh\src\*" -or $_.FullName -like "*\soh\include\*")))) -and `
(-not ($_.FullName -like "*\soh\assets\*")) } (-not ($_.FullName -like "*\soh\assets\*" -or $_.FullName -like "*\soh\build\*")) }
for ($i = 0; $i -lt $files.Length; $i++) { for ($i = 0; $i -lt $files.Length; $i++) {
$file = $files[$i] $file = $files[$i]

View file

@ -0,0 +1,11 @@
{
"blocks": {
"enhancements": {
"gCheats": null,
"gEnhancements": null,
"gRandoEnhancements": null
}
},
"presetName": "Main Default",
"isBuiltIn": true
}

View file

@ -0,0 +1,56 @@
{
"blocks": {
"enhancements": {
"gCheats": null,
"gEnhancements": {
"AssignableTunicsAndBoots": 1,
"Autosave": 1,
"BetterOwl": 1,
"CreditsFix": 1,
"CustomizeFrogsOcarinaGame": 1,
"DekuNutUpgradeFix": 1,
"DisableLOD": 1,
"DpadEquips": 1,
"DpadNoDropOcarinaInput": 1,
"DynamicWalletIcon": 1,
"EnemySpawnsOverWaterboxes": 1,
"FasterRupeeAccumulator": 1,
"FixBrokenGiantsKnife": 1,
"FixDaruniaDanceSpeed": 1,
"FixDungeonMinimapIcon": 1,
"FixEyesOpenWhileSleeping": 1,
"FixFloorSwitches": 1,
"FixHammerHand": 1,
"FixMenuLR": 1,
"FixSawSoftlock": 1,
"FixTexturesOOB": 1,
"FixVineFall": 1,
"FixZoraHintDialogue": 1,
"FrogsModifyFailTime": 2,
"GerudoWarriorClothingFix": 1,
"GravediggingTourFix": 1,
"InjectItemCounts": {
"GoldSkulltula": 1,
"HeartContainer": 1,
"HeartPiece": 1
},
"NaviTextFix": 1,
"PulsateBossIcon": 1,
"RedGanonBlood": 1,
"RememberMapToggleState": 1,
"SceneSpecificDirtPathFix": 1,
"SilverRupeeJingleExtend": 1,
"SkipSaveConfirmation": 1,
"SkipText": 1,
"TextSpeed": 5,
"TimeFlowFileSelect": 1,
"TwoHandedIdle": 1,
"VisualAgony": 1,
"WidescreenActorCulling": 1
},
"gRandoEnhancements": null
}
},
"presetName": "Main Enhanced",
"isBuiltIn": true
}

View file

@ -0,0 +1,135 @@
{
"blocks": {
"enhancements": {
"gCheats": {
"EasyFrameAdvance": 1
},
"gEnhancements": {
"AdultMasks": 1,
"AssignableTunicsAndBoots": 1,
"Autosave": 1,
"BetterAmmoRendering": 1,
"BetterBombchuShopping": 1,
"BetterFarore": 1,
"BetterOwl": 1,
"BombchusOOB": 1,
"ClimbSpeed": 3,
"CrawlSpeed": 2,
"CreditsFix": 1,
"CustomizeFishing": 1,
"CustomizeFrogsOcarinaGame": 1,
"CustomizeOcarinaGame": 1,
"DampeAllNight": 1,
"DampeWin": 1,
"DayGravePull": 1,
"DekuNutUpgradeFix": 1,
"DisableCritWiggle": 1,
"DisableFirstPersonChus": 1,
"DisableLOD": 1,
"DpadEquips": 1,
"DpadNoDropOcarinaInput": 1,
"DynamicWalletIcon": 1,
"EarlyEyeballFrog": 1,
"EnemySpawnsOverWaterboxes": 1,
"EquipmentCanBeRemoved": 1,
"ExtendedCullingExcludeGlitchActors": 1,
"FastBoomerang": 1,
"FastChests": 1,
"FastDrops": 1,
"FastFarores": 1,
"FastOcarinaPlayback": 1,
"FasterBlockPush": 5,
"FasterHeavyBlockLift": 1,
"FasterRupeeAccumulator": 1,
"FileSelectMoreInfo": 1,
"FishNeverEscape": 1,
"FixBrokenGiantsKnife": 1,
"FixDaruniaDanceSpeed": 1,
"FixDungeonMinimapIcon": 1,
"FixFloorSwitches": 1,
"FixHammerHand": 1,
"FixMenuLR": 1,
"FixSawSoftlock": 1,
"FixTexturesOOB": 1,
"FixVineFall": 1,
"FixZoraHintDialogue": 1,
"ForgeTime": 0,
"FrogsModifyFailTime": 2,
"GerudoWarriorClothingFix": 1,
"GoronPot": 1,
"GravediggingTourFix": 1,
"GuaranteeFishingBite": 1,
"HoverFishing": 1,
"IncludeHeldInputsBufferWindow": 1,
"InjectItemCounts": {
"GoldSkulltula": 1,
"HeartContainer": 1,
"HeartPiece": 1
},
"InstantPutaway": 1,
"InstantScarecrow": 1,
"MMBunnyHood": 1,
"MarketSneak": 1,
"MaskSelect": 1,
"MinimumFishWeightAdult": 6,
"MinimumFishWeightChild": 3,
"MweepSpeed": 5.0,
"N64WeirdFrames": 1,
"NaviTextFix": 1,
"NewDrops": 1,
"NoInputForCredits": 1,
"NutsExplodeBombs": 1,
"OcarinaGame": {
"StartingNotes": 5
},
"PauseMenuAnimatedLink": 1,
"PauseWarp": 1,
"PersistentMasks": 1,
"PulsateBossIcon": 1,
"QuickBongoKill": 1,
"QuickPutaway": 1,
"QuitFishingAtDoor": 1,
"RedGanonBlood": 1,
"RememberMapToggleState": 1,
"SceneSpecificDirtPathFix": 1,
"SeparateArrows": 1,
"ShowDoorLocksOnBothSides": 1,
"SilverRupeeJingleExtend": 1,
"SkipArrowAnimation": 1,
"SkipSaveConfirmation": 1,
"SkipSwimDeepEndAnim": 1,
"SkipText": 1,
"SlowTextSpeed": 5,
"SwordToggle": 1,
"TextSpeed": 5,
"TimeFlowFileSelect": 1,
"TimeSavers": {
"DisableTitleCard": 1,
"SkipChildStealth": 1,
"SkipCutscene": {
"BossIntro": 1,
"Entrances": 1,
"Intro": 1,
"LearnSong": 1,
"OnePoint": 1,
"QuickBossDeaths": 1,
"Story": 1
},
"SkipForcedDialog": 3,
"SkipMiscInteractions": 1,
"SkipOwlInteractions": 1,
"SkipTowerEscape": 1,
"SleepingWaterfall": 1
},
"ToTMedallionsColors": 1,
"ToggleStrength": 1,
"TwoHandedIdle": 1,
"VisualAgony": 1,
"WidescreenActorCulling": 1
},
"gRandoEnhancements": null
}
},
"presetName": "Main Randomizer",
"isBuiltIn": true
}

View file

@ -0,0 +1,56 @@
{
"blocks": {
"enhancements": {
"gCheats": null,
"gEnhancements": {
"AssignableTunicsAndBoots": 1,
"Autosave": 1,
"BetterOwl": 1,
"CreditsFix": 1,
"CustomizeFrogsOcarinaGame": 1,
"DekuNutUpgradeFix": 1,
"DisableLOD": 1,
"DpadEquips": 1,
"DpadNoDropOcarinaInput": 1,
"DynamicWalletIcon": 1,
"EnemySpawnsOverWaterboxes": 1,
"FasterRupeeAccumulator": 1,
"FixBrokenGiantsKnife": 1,
"FixDaruniaDanceSpeed": 1,
"FixDungeonMinimapIcon": 1,
"FixEyesOpenWhileSleeping": 1,
"FixFloorSwitches": 1,
"FixHammerHand": 1,
"FixMenuLR": 1,
"FixSawSoftlock": 1,
"FixTexturesOOB": 1,
"FixVineFall": 1,
"FixZoraHintDialogue": 1,
"FrogsModifyFailTime": 2,
"GerudoWarriorClothingFix": 1,
"GravediggingTourFix": 1,
"InjectItemCounts": {
"GoldSkulltula": 1,
"HeartContainer": 1,
"HeartPiece": 1
},
"NaviTextFix": 1,
"PulsateBossIcon": 1,
"RedGanonBlood": 1,
"RememberMapToggleState": 1,
"SceneSpecificDirtPathFix": 1,
"SilverRupeeJingleExtend": 1,
"SkipSaveConfirmation": 1,
"SkipText": 1,
"TextSpeed": 5,
"TimeFlowFileSelect": 1,
"TwoHandedIdle": 1,
"VisualAgony": 1,
"WidescreenActorCulling": 1
},
"gRandoEnhancements": null
}
},
"presetName": "Main Vanilla+",
"isBuiltIn": true
}

View file

@ -0,0 +1,69 @@
{
"blocks": {
"rando": {
"gRandoSettings": {
"40GSHint": 1,
"50GSHint": 1,
"BigPoeTargetCount": 1,
"BlueFireArrows": 1,
"BombchuBag": 1,
"BossKeysanity": 5,
"ClosedForest": 2,
"CompleteMaskQuest": 1,
"CuccosToReturn": 1,
"DampeHint": 1,
"DoorOfTime": 2,
"EnableBombchuDrops": 1,
"FortressCarpenters": 1,
"FrogsHint": 1,
"FullWallets": 1,
"GanonTrial": 0,
"GerudoKeys": 3,
"GregHint": 1,
"HBAHint": 1,
"IncludeTycoonWallet": 1,
"KakarikoGate": 1,
"Keysanity": 5,
"LacsRewardCount": 8,
"MalonHint": 1,
"MerchantText": 1,
"RainbowBridge": 7,
"SariaHint": 1,
"ScrubsFixedPrice": 2,
"ScrubsPrices": 3,
"SheikLAHint": 0,
"Shopsanity": 1,
"ShopsanityCount": 7,
"ShopsanityPrices": 2,
"ShuffleAdultTrade": 1,
"ShuffleBossEntrances": 2,
"ShuffleCows": 1,
"ShuffleDekuNutBag": 1,
"ShuffleDekuStickBag": 1,
"ShuffleDungeonsEntrances": 2,
"ShuffleFrogSongRupees": 1,
"ShuffleGanonBossKey": 9,
"ShuffleGerudoToken": 1,
"ShuffleKeyRings": 2,
"ShuffleKeyRingsRandomCount": 4,
"ShuffleKokiriSword": 1,
"ShuffleMasterSword": 1,
"ShuffleMerchants": 3,
"ShuffleOcarinas": 1,
"ShuffleOverworldSpawns": 1,
"ShuffleScrubs": 2,
"ShuffleSongs": 2,
"ShuffleSwim": 1,
"ShuffleTokens": 3,
"SkipChildZelda": 1,
"SkipEponaRace": 1,
"SkipScarecrowsSong": 1,
"StartingAge": 2,
"StartingMapsCompasses": 0,
"SunlightArrows": 1
}
}
},
"presetName": "Rando Advanced",
"isBuiltIn": true
}

View file

@ -0,0 +1,51 @@
{
"blocks": {
"rando": {
"gRandoSettings": {
"10GSHint": 1,
"20GSHint": 1,
"30GSHint": 1,
"40GSHint": 1,
"50GSHint": 1,
"BigPoeTargetCount": 1,
"BiggoronHint": 1,
"BlueFireArrows": 1,
"BossKeysanity": 2,
"ClosedForest": 2,
"CompleteMaskQuest": 1,
"CuccosToReturn": 1,
"DampeHint": 1,
"DoorOfTime": 2,
"EnableBombchuDrops": 1,
"ExcludedLocations": "147,148,233,323,",
"FortressCarpenters": 1,
"FrogsHint": 1,
"FullWallets": 1,
"GanonTrial": 0,
"GregHint": 1,
"HBAHint": 1,
"IncludeTycoonWallet": 1,
"KakarikoGate": 1,
"Keysanity": 2,
"LacsRewardCount": 6,
"MalonHint": 1,
"MerchantText": 1,
"RainbowBridge": 7,
"SariaHint": 1,
"SheikLAHint": 0,
"ShuffleGanonBossKey": 9,
"ShuffleOcarinas": 1,
"SkipChildZelda": 1,
"SkipEponaRace": 1,
"SkipScarecrowsSong": 1,
"StartingKokiriSword": 1,
"StartingMapsCompasses": 0,
"StartingOcarina": 1,
"SunlightArrows": 1,
"ZorasFountain": 1
}
}
},
"presetName": "Rando Beginner",
"isBuiltIn": true
}

View file

@ -0,0 +1,9 @@
{
"blocks": {
"rando": {
"gRandoSettings": null
}
},
"presetName": "Rando Default",
"isBuiltIn": true
}

View file

@ -0,0 +1,80 @@
{
"blocks": {
"rando": {
"gRandoSettings": {
"BigPoeTargetCount": 1,
"BlueFireArrows": 1,
"BombchuBag": 1,
"BossKeysanity": 5,
"ClosedForest": 2,
"CuccosToReturn": 1,
"DecoupleEntrances": 1,
"DoorOfTime": 2,
"EnableBombchuDrops": 1,
"Fishsanity": 4,
"FishsanityAgeSplit": 1,
"FishsanityPondCount": 17,
"GerudoKeys": 3,
"IncludeTycoonWallet": 1,
"KakarikoGate": 1,
"Keysanity": 5,
"LacsRewardCount": 10,
"LacsRewardOptions": 1,
"LockOverworldDoors": 1,
"MixBosses": 1,
"MixDungeons": 1,
"MixGrottos": 1,
"MixInteriors": 1,
"MixOverworld": 1,
"MixedEntrances": 1,
"RainbowBridge": 7,
"ScrubsPrices": 2,
"Shopsanity": 1,
"ShopsanityCount": 7,
"ShopsanityPrices": 2,
"Shuffle100GSReward": 1,
"ShuffleAdultTrade": 1,
"ShuffleBeehives": 1,
"ShuffleBossEntrances": 2,
"ShuffleBossSouls": 2,
"ShuffleChildWallet": 1,
"ShuffleCows": 1,
"ShuffleCrates": 3,
"ShuffleDekuNutBag": 1,
"ShuffleDekuStickBag": 1,
"ShuffleDungeonsEntrances": 2,
"ShuffleFairies": 1,
"ShuffleFishingPole": 1,
"ShuffleFreestanding": 3,
"ShuffleFrogSongRupees": 1,
"ShuffleGanonBossKey": 9,
"ShuffleGerudoToken": 1,
"ShuffleGrass": 3,
"ShuffleGrottosEntrances": 1,
"ShuffleInteriorsEntrances": 2,
"ShuffleKokiriSword": 1,
"ShuffleMasterSword": 1,
"ShuffleMerchants": 3,
"ShuffleOcarinaButtons": 1,
"ShuffleOcarinas": 1,
"ShuffleOverworldEntrances": 1,
"ShuffleOverworldSpawns": 1,
"ShuffleOwlDrops": 1,
"ShufflePots": 3,
"ShuffleScrubs": 2,
"ShuffleSongs": 2,
"ShuffleSwim": 1,
"ShuffleTokens": 3,
"ShuffleWarpSongs": 1,
"ShuffleWeirdEgg": 1,
"SkipEponaRace": 1,
"StartingAge": 2,
"StartingHearts": 0,
"StartingMapsCompasses": 5,
"SunlightArrows": 1
}
}
},
"presetName": "Rando Hell Mode",
"isBuiltIn": true
}

View file

@ -0,0 +1,63 @@
{
"blocks": {
"rando": {
"gRandoSettings": {
"10GSHint": 1,
"20GSHint": 1,
"30GSHint": 1,
"40GSHint": 1,
"50GSHint": 1,
"BigPoeTargetCount": 1,
"BiggoronHint": 1,
"BlueFireArrows": 1,
"BombchuBag": 1,
"BossKeysanity": 2,
"ClosedForest": 2,
"CompleteMaskQuest": 1,
"CuccosToReturn": 1,
"DampeHint": 1,
"DoorOfTime": 2,
"EnableBombchuDrops": 1,
"FortressCarpenters": 1,
"FrogsHint": 1,
"FullWallets": 1,
"GanonTrial": 0,
"GregHint": 1,
"HBAHint": 1,
"IncludeTycoonWallet": 1,
"KakarikoGate": 1,
"Keysanity": 5,
"LacsRewardCount": 7,
"MalonHint": 1,
"MerchantText": 1,
"RainbowBridge": 7,
"SariaHint": 1,
"ScrubsFixedPrice": 2,
"ScrubsPrices": 3,
"SheikLAHint": 0,
"Shopsanity": 1,
"ShopsanityCount": 4,
"ShopsanityPrices": 2,
"ShuffleGanonBossKey": 9,
"ShuffleGerudoToken": 1,
"ShuffleKeyRings": 2,
"ShuffleKeyRingsRandomCount": 8,
"ShuffleKokiriSword": 1,
"ShuffleMerchants": 1,
"ShuffleOcarinas": 1,
"ShuffleScrubs": 2,
"ShuffleSongs": 2,
"ShuffleTokens": 3,
"SkipChildZelda": 1,
"SkipEponaRace": 1,
"SkipScarecrowsSong": 1,
"StartingMapsCompasses": 0,
"StartingOcarina": 1,
"SunlightArrows": 1,
"ZorasFountain": 1
}
}
},
"presetName": "Rando Standard",
"isBuiltIn": true
}

View file

@ -12,7 +12,6 @@ extern "C"
#include "luslog.h" #include "luslog.h"
#include <soh/Enhancements/item-tables/ItemTableTypes.h> #include <soh/Enhancements/item-tables/ItemTableTypes.h>
#include <soh/Enhancements/randomizer/randomizer_inf.h>
#if defined(INCLUDE_GAME_PRINTF) && defined(_DEBUG) #if defined(INCLUDE_GAME_PRINTF) && defined(_DEBUG)
#define osSyncPrintf(fmt, ...) lusprintf(__FILE__, __LINE__, 0, fmt, ##__VA_ARGS__) #define osSyncPrintf(fmt, ...) lusprintf(__FILE__, __LINE__, 0, fmt, ##__VA_ARGS__)

View file

@ -5,7 +5,6 @@
#include "z64math.h" #include "z64math.h"
#include "z64audio.h" #include "z64audio.h"
#include "soh/Enhancements/randomizer/randomizerTypes.h" #include "soh/Enhancements/randomizer/randomizerTypes.h"
#include "soh/Enhancements/randomizer/randomizer_inf.h"
#include "soh/Enhancements/gameplaystats.h" #include "soh/Enhancements/gameplaystats.h"
#include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h"
#include "soh/Enhancements/boss-rush/BossRushTypes.h" #include "soh/Enhancements/boss-rush/BossRushTypes.h"

View file

@ -0,0 +1,42 @@
#include <libultraship/bridge.h>
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/ShipInit.hpp"
#include "functions.h"
#include "macros.h"
#include "variables.h"
extern "C" PlayState* gPlayState;
static constexpr int32_t CVAR_RUPEE_DASH_DEFAULT = 0;
#define CVAR_RUPEE_DASH_NAME CVAR_ENHANCEMENT("RupeeDash")
#define CVAR_RUPEE_DASH_VALUE CVarGetInteger(CVAR_RUPEE_DASH_NAME, CVAR_RUPEE_DASH_DEFAULT)
static constexpr int32_t CVAR_RUPEE_DASH_INTERVAL_DEFAULT = 5;
#define CVAR_RUPEE_DASH_INTERVAL_NAME CVAR_ENHANCEMENT("RupeeDashInterval")
#define CVAR_RUPEE_DASH_INTERVAL_TIME \
CVarGetInteger(CVAR_RUPEE_DASH_INTERVAL_NAME, CVAR_RUPEE_DASH_INTERVAL_DEFAULT) * 20
void UpdateRupeeDash() {
// Initialize Timer
static uint16_t rupeeDashTimer = 0;
// Did time change by DashInterval?
if (rupeeDashTimer < CVAR_RUPEE_DASH_INTERVAL_TIME) {
rupeeDashTimer++;
return;
}
rupeeDashTimer = 0;
if (gSaveContext.rupees > 0) {
uint16_t walletSize = (CUR_UPG_VALUE(UPG_WALLET) + 1) * -1;
Rupees_ChangeBy(walletSize);
} else {
Health_ChangeBy(gPlayState, -16);
}
}
void RegisterRupeeDash() {
COND_HOOK(OnPlayerUpdate, CVAR_RUPEE_DASH_VALUE, UpdateRupeeDash);
}
static RegisterShipInitFunc initFunc_RupeeDash(RegisterRupeeDash, { CVAR_RUPEE_DASH_NAME });

View file

@ -1,650 +0,0 @@
#include "Presets.h"
#include <map>
#include "soh/cvar_prefixes.h"
#include "soh/Enhancements/enhancementTypes.h"
#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 }
#define PRESET_ENTRY_CPP_STRING(cvar, value) \
{ cvar, PRESET_ENTRY_TYPE_CPP_STRING, value }
// TODO: Ideally everything in this file will come from one/many JSON files
// Enhancement presets
const std::vector<PresetEntry> vanillaPlusPresetEntries = {
// Quality of Life
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("Autosave"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.GoldSkulltula"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartPiece"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartContainer"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterOwl"), 1),
// Skips & Speed-ups
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterRupeeAccumulator"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 1),
// Graphics
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableLOD"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RememberMapToggleState"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("VisualAgony"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DynamicWalletIcon"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("WidescreenActorCulling"), 1),
// Items
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadEquips"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1),
// Fixes
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GravediggingTourFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixFloorSwitches"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixZoraHintDialogue"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixVineFall"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EnemySpawnsOverWaterboxes"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixSawSoftlock"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DekuNutUpgradeFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixBrokenGiantsKnife"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixMenuLR"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TwoHandedIdle"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NaviTextFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GerudoWarriorClothingFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixTexturesOOB"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixEyesOpenWhileSleeping"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixHammerHand"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SceneSpecificDirtPathFix"), ZFIGHT_FIX_CONSISTENT_VANISH),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDaruniaDanceSpeed"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CreditsFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RedGanonBlood"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PulsateBossIcon"), 1),
// Difficulty
// NONE
// Minigames
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFrogsOcarinaGame"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FrogsModifyFailTime"), 2),
// Extra Modes
// NONE
// Cheats
// NONE
};
const std::vector<PresetEntry> enhancedPresetEntries = {
// Quality of Life
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("Autosave"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseWarp"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoInputForCredits"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.GoldSkulltula"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartPiece"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartContainer"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableCritWiggle"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterOwl"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuitFishingAtDoor"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantPutaway"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SleepingWaterfall"), 1),
// Skips & Speed-ups
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SlowTextSpeed"), 5),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSwimDeepEndAnim"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ClimbSpeed"), 3),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CrawlSpeed"), 2),
PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 5.0f), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantScarecrow"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterRupeeAccumulator"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkulltulaFreeze"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 1),
// Graphics
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableLOD"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NewDrops"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseMenuAnimatedLink"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ShowDoorLocksOnBothSides"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ToTMedallionsColors"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RememberMapToggleState"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("VisualAgony"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DynamicWalletIcon"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterAmmoRendering"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("WidescreenActorCulling"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ExtendedCullingExcludeGlitchActors"), 1),
// Items
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadEquips"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PersistentMasks"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NutsExplodeBombs"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableFirstPersonChus"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterBombchuShopping"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SeparateArrows"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipArrowAnimation"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastBoomerang"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterFarore"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastFarores"), 1),
// Fixes
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GravediggingTourFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixFloorSwitches"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixZoraHintDialogue"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixVineFall"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EnemySpawnsOverWaterboxes"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixSawSoftlock"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DekuNutUpgradeFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixBrokenGiantsKnife"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixMenuLR"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TwoHandedIdle"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NaviTextFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GerudoWarriorClothingFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixTexturesOOB"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixEyesOpenWhileSleeping"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixHammerHand"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SceneSpecificDirtPathFix"), ZFIGHT_FIX_CONSISTENT_VANISH),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDaruniaDanceSpeed"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CreditsFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RedGanonBlood"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PulsateBossIcon"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("HoverFishing"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("N64WeirdFrames"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BombchusOOB"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuickPutaway"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuickBongoKill"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EarlyEyeballFrog"), 1),
// Difficulty
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EnableBombchuDrops"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DampeWin"), 1),
// Minigames
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFrogsOcarinaGame"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FrogsModifyFailTime"), 2),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeOcarinaGame"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("OcarinaGame.StartingNotes"), 5),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFishing"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GuaranteeFishingBite"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FishNeverEscape"), 1),
// Extra Modes
// NONE
// Cheats
// NONE
};
const std::vector<PresetEntry> randomizerPresetEntries = {
// Quality of Life
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("Autosave"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DayGravePull"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DampeAllNight"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MarketSneak"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseWarp"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoInputForCredits"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("IncludeHeldInputsBufferWindow"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.GoldSkulltula"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartPiece"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InjectItemCounts.HeartContainer"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableCritWiggle"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterOwl"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuitFishingAtDoor"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantPutaway"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SleepingWaterfall"), 1),
// Skips & Speed-ups
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Intro"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Entrances"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.BossIntro"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.QuickBossDeaths"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.OnePoint"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipOwlInteractions"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.DisableTitleCard"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastDrops"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipForcedDialog"), FORCED_DIALOG_SKIP_ALL),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SlowTextSpeed"), 5),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastChests"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSwimDeepEndAnim"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ClimbSpeed"), 3),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CrawlSpeed"), 2),
PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 5.0f),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipChildStealth"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeSavers.SkipTowerEscape"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("InstantScarecrow"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterRupeeAccumulator"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipSaveConfirmation"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ForgeTime"), 0),
// Graphics
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableLOD"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NewDrops"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseMenuAnimatedLink"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ShowDoorLocksOnBothSides"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ToTMedallionsColors"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RememberMapToggleState"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("VisualAgony"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DynamicWalletIcon"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterAmmoRendering"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TimeFlowFileSelect"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("WidescreenActorCulling"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ExtendedCullingExcludeGlitchActors"), 1),
// Items
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadEquips"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EquipmentCanBeRemoved"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ToggleStrength"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SwordToggle"), SWORD_TOGGLE_CHILD),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DpadNoDropOcarinaInput"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastOcarinaPlayback"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("AdultMasks"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PersistentMasks"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MaskSelect"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NutsExplodeBombs"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DisableFirstPersonChus"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterBombchuShopping"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SeparateArrows"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipArrowAnimation"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastBoomerang"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BetterFarore"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FastFarores"), 1),
// Fixes
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GravediggingTourFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixFloorSwitches"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixZoraHintDialogue"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixVineFall"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EnemySpawnsOverWaterboxes"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixSawSoftlock"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DekuNutUpgradeFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixBrokenGiantsKnife"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixMenuLR"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TwoHandedIdle"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NaviTextFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GerudoWarriorClothingFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixTexturesOOB"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixHammerHand"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SceneSpecificDirtPathFix"), ZFIGHT_FIX_CONSISTENT_VANISH),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SilverRupeeJingleExtend"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FixDaruniaDanceSpeed"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CreditsFix"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("RedGanonBlood"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PulsateBossIcon"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("HoverFishing"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("N64WeirdFrames"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("BombchusOOB"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuickPutaway"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("QuickBongoKill"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("EarlyEyeballFrog"), 1),
// Difficulty
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GoronPot"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("DampeWin"), 1),
// Minigames
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFrogsOcarinaGame"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FrogsModifyFailTime"), 2),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeOcarinaGame"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("OcarinaGame.StartingNotes"), 5),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("CustomizeFishing"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("GuaranteeFishingBite"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FishNeverEscape"), 1),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightChild"), 3),
PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MinimumFishWeightAdult"), 6),
// Extra Modes
// NONE
// Cheats
PRESET_ENTRY_S32(CVAR_CHEAT("EasyFrameAdvance"), 1),
};
// Randomizer presets
const std::vector<PresetEntry> randomizerBeginnerPresetEntries = {
// World tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ClosedForest"), RO_CLOSED_FOREST_OFF),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("KakarikoGate"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), 2),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ZorasFountain"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_GREG),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GanonTrial"), RO_GANONS_TRIALS_SKIP),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FortressCarpenters"), 1),
// Items tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("IncludeTycoonWallet"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinas"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_STARTWITH),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Keysanity"), RO_DUNGEON_ITEM_LOC_OWN_DUNGEON),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BossKeysanity"), RO_DUNGEON_ITEM_LOC_OWN_DUNGEON),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGanonBossKey"), RO_GANON_BOSS_KEY_LACS_REWARDS),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LacsRewardCount"), 6),
// Gamplay tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CuccosToReturn"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BigPoeTargetCount"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildZelda"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CompleteMaskQuest"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipScarecrowsSong"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SheikLAHint"), 0),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DampeHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GregHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SariaHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FrogsHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BiggoronHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MalonHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("HBAHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MerchantText"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("10GSHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("20GSHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("30GSHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("40GSHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("50GSHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FullWallets"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("EnableBombchuDrops"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BlueFireArrows"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SunlightArrows"), 1),
// Locations tab
PRESET_ENTRY_STRING(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), "147,148,233,323,"),
// Tricks/Glitches tab
// NONE
// Starting inventory tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingKokiriSword"), RO_STARTING_OCARINA_FAIRY),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingOcarina"), RO_STARTING_OCARINA_FAIRY),
};
const std::vector<PresetEntry> randomizerStandardPresetEntries = {
// World tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ClosedForest"), RO_CLOSED_FOREST_OFF),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("KakarikoGate"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), 2),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ZorasFountain"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_GREG),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GanonTrial"), RO_GANONS_TRIALS_SKIP),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FortressCarpenters"), 1),
// Items tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleSongs"), RO_SONG_SHUFFLE_ANYWHERE),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleTokens"), RO_TOKENSANITY_ALL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKokiriSword"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("IncludeTycoonWallet"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinas"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGerudoToken"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Shopsanity"), RO_SHOPSANITY_SPECIFIC_COUNT),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityCount"), 4),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityPrices"), RO_PRICE_BALANCED),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleScrubs"), RO_SCRUBS_ALL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubsPrices"), RO_PRICE_FIXED),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubsFixedPrice"), 2),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMerchants"), RO_SHUFFLE_MERCHANTS_BEANS_ONLY),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_STARTWITH),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Keysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BossKeysanity"), RO_DUNGEON_ITEM_LOC_OWN_DUNGEON),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGanonBossKey"), RO_GANON_BOSS_KEY_LACS_REWARDS),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LacsRewardCount"), 7),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKeyRings"), RO_KEYRINGS_COUNT),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKeyRingsRandomCount"), 8),
// Gamplay tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CuccosToReturn"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BigPoeTargetCount"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildZelda"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CompleteMaskQuest"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipScarecrowsSong"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SheikLAHint"), 0),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DampeHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GregHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SariaHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FrogsHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BiggoronHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MalonHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("HBAHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MerchantText"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("10GSHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("20GSHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("30GSHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("40GSHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("50GSHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FullWallets"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BombchuBag"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("EnableBombchuDrops"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BlueFireArrows"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SunlightArrows"), 1),
// Locations tab
// NONE
// Tricks/Glitches tab
// NONE
// Starting inventory tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingOcarina"), RO_STARTING_OCARINA_FAIRY),
};
const std::vector<PresetEntry> randomizerAdvancedPresetEntries = {
// World tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ClosedForest"), RO_CLOSED_FOREST_OFF),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("KakarikoGate"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), 2),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_GREG),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingAge"), RO_AGE_RANDOM),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GanonTrial"), RO_GANONS_TRIALS_SKIP),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FortressCarpenters"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDungeonsEntrances"), RO_DUNGEON_ENTRANCE_SHUFFLE_ON_PLUS_GANON),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleBossEntrances"), RO_BOSS_ROOM_ENTRANCE_SHUFFLE_FULL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOverworldSpawns"), 1),
// Items tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleSongs"), RO_SONG_SHUFFLE_ANYWHERE),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleTokens"), RO_TOKENSANITY_ALL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKokiriSword"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMasterSword"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("IncludeTycoonWallet"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinas"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleSwim"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGerudoToken"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDekuNutBag"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDekuStickBag"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Shopsanity"), RO_SHOPSANITY_SPECIFIC_COUNT),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityCount"), 7),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityPrices"), RO_PRICE_BALANCED),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleScrubs"), RO_SCRUBS_ALL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubsPrices"), RO_PRICE_FIXED),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubsFixedPrice"), 2),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleCows"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMerchants"), RO_SHUFFLE_MERCHANTS_ALL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleFrogSongRupees"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleAdultTrade"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_STARTWITH),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Keysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GerudoKeys"), RO_GERUDO_KEYS_ANYWHERE),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BossKeysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGanonBossKey"), RO_GANON_BOSS_KEY_LACS_REWARDS),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LacsRewardCount"), 8),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKeyRings"), RO_KEYRINGS_COUNT),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKeyRingsRandomCount"), 4),
// Gamplay tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CuccosToReturn"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BigPoeTargetCount"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildZelda"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CompleteMaskQuest"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipScarecrowsSong"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SheikLAHint"), 0),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DampeHint"), 1), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GregHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SariaHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FrogsHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MalonHint"), 1), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("HBAHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MerchantText"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("40GSHint"), 1), PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("50GSHint"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FullWallets"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BombchuBag"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("EnableBombchuDrops"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BlueFireArrows"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SunlightArrows"), 1),
// Locations tab
// NONE
// Tricks/Glitches tab
// NONE
// Starting inventory tab
// NONE
};
const std::vector<PresetEntry> hellModePresetEntries = {
// World tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ClosedForest"), RO_CLOSED_FOREST_OFF),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("KakarikoGate"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), 2),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LockOverworldDoors"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_GREG),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingAge"), RO_AGE_RANDOM),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDungeonsEntrances"), RO_DUNGEON_ENTRANCE_SHUFFLE_ON_PLUS_GANON),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleBossEntrances"), RO_BOSS_ROOM_ENTRANCE_SHUFFLE_FULL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOverworldEntrances"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleInteriorsEntrances"), RO_INTERIOR_ENTRANCE_SHUFFLE_ALL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGrottosEntrances"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOwlDrops"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleWarpSongs"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOverworldSpawns"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MixedEntrances"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MixDungeons"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MixBosses"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MixOverworld"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MixInteriors"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("MixGrottos"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DecoupleEntrances"), 1),
// Items tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleSongs"), RO_SONG_SHUFFLE_ANYWHERE),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleTokens"), RO_TOKENSANITY_ALL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleKokiriSword"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMasterSword"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleChildWallet"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("IncludeTycoonWallet"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinas"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleOcarinaButtons"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleSwim"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleWeirdEgg"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGerudoToken"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleFishingPole"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDekuNutBag"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleDekuStickBag"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleFreestanding"), RO_SHUFFLE_FREESTANDING_ALL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Shopsanity"), RO_SHOPSANITY_SPECIFIC_COUNT),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityCount"), 7),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShopsanityPrices"), RO_PRICE_BALANCED),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Fishsanity"), RO_FISHSANITY_BOTH),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FishsanityPondCount"), 17),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("FishsanityAgeSplit"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleScrubs"), RO_SCRUBS_ALL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ScrubsPrices"), RO_PRICE_BALANCED),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleBeehives"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleCows"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShufflePots"), RO_SHUFFLE_POTS_ALL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleCrates"), RO_SHUFFLE_CRATES_ALL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleMerchants"), RO_SHUFFLE_MERCHANTS_ALL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleFrogSongRupees"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleAdultTrade"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Shuffle100GSReward"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleBossSouls"), 2),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleFairies"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGrass"), RO_SHUFFLE_GRASS_ALL),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_ANYWHERE),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Keysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GerudoKeys"), RO_GERUDO_KEYS_ANYWHERE),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BossKeysanity"), RO_DUNGEON_ITEM_LOC_ANYWHERE),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ShuffleGanonBossKey"), RO_GANON_BOSS_KEY_LACS_REWARDS),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LacsRewardCount"), 10),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LacsRewardOptions"), RO_LACS_GREG_REWARD),
// Gamplay tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("CuccosToReturn"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BigPoeTargetCount"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BombchuBag"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("EnableBombchuDrops"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("BlueFireArrows"), 1),
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SunlightArrows"), 1),
// Locations tab
// NONE
// Tricks/Glitches tab
// NONE
// Starting inventory tab
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingHearts"), 0),
};
const std::map<PresetType, PresetTypeDefinition> presetTypes = {
{ PRESET_TYPE_ENHANCEMENTS,
{ { CVAR_PREFIX_ENHANCEMENT, CVAR_PREFIX_CHEAT },
{
{ ENHANCEMENT_PRESET_DEFAULT,
{
"Default",
"Reset all options to their default values.",
{},
} },
{ ENHANCEMENT_PRESET_VANILLA_PLUS,
{
"Vanilla Plus",
"Adds some quality of life features, but don't alter gameplay and aims to "
"preserve the authentic experience. 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 going through the vanilla game again.",
enhancedPresetEntries } },
{ ENHANCEMENT_PRESET_RANDOMIZER,
{ "Randomizer",
"A baseline set of enhancements for playing randomizer. Includes many quality of life options and "
"options to speed up gameplay.",
randomizerPresetEntries } },
} } },
{ PRESET_TYPE_RANDOMIZER,
{ { CVAR_PREFIX_RANDOMIZER_SETTING, CVAR_PREFIX_RANDOMIZER_ENHANCEMENT },
{
{ RANDOMIZER_PRESET_DEFAULT,
{
"Default",
"Reset all options to their default values.",
{},
} },
{ RANDOMIZER_PRESET_BEGINNER,
{
"Beginner",
"A simpler set of options and shuffled items meant for players new to the randomizer. ",
randomizerBeginnerPresetEntries,
} },
{ RANDOMIZER_PRESET_STANDARD,
{
"Standard",
"A set of options meant as a baseline for both newer and experienced randomizer players.",
randomizerStandardPresetEntries,
} },
{ RANDOMIZER_PRESET_ADVANCED,
{
"Advanced",
"Includes many more shuffled items and introduces some entrance shuffle options. Meant for advanced "
"randomizer players.",
randomizerAdvancedPresetEntries,
} },
{ RANDOMIZER_PRESET_HELL_MODE,
{ "Hell Mode",
"Every location randomized, all entrance settings enabled, but still using glitchless logic. Expect "
"pain.",
hellModePresetEntries } },
} } }
};

View file

@ -1,63 +1,145 @@
#include "Presets.h" #include "Presets.h"
#include <variant> #include <variant>
#include <string> #include <string>
#include <cstdint> #include <fstream>
#include <libultraship/bridge.h> #include <config/Config.h>
#include <libultraship/classes.h>
#include <nlohmann/json.hpp>
#include <libultraship/libultraship.h> #include <libultraship/libultraship.h>
#include <Json.h>
#include "soh/OTRGlobals.h"
#include "soh/SohGui/MenuTypes.h" #include "soh/SohGui/MenuTypes.h"
#include "soh/SohGui/SohMenu.h" #include "soh/SohGui/SohMenu.h"
#include "soh/SohGui/SohGui.hpp" #include "soh/SohGui/SohGui.hpp"
#include "soh/Enhancements/randomizer/randomizer_settings_window.h"
#include "soh/Enhancements/randomizer/randomizer_check_tracker.h"
#include "soh/Enhancements/randomizer/randomizer_entrance_tracker.h"
#include "soh/Enhancements/randomizer/randomizer_item_tracker.h"
std::string FormatLocations(std::vector<RandomizerCheck> locs) { namespace fs = std::filesystem;
std::string locString = "";
for (auto loc : locs) { namespace SohGui {
locString += std::to_string(loc) + ","; extern std::shared_ptr<SohMenu> mSohMenu;
} extern std::shared_ptr<RandomizerSettingsWindow> mRandomizerSettingsWindow;
return locString; } // namespace SohGui
struct PresetInfo {
nlohmann::json presetValues;
std::string fileName;
bool apply[PRESET_SECTION_MAX];
bool isBuiltIn = false;
};
struct BlockInfo {
std::vector<std::string> sections;
const char* icon;
std::string names[2];
};
static std::map<std::string, PresetInfo> presets;
static std::string presetFolder;
void BlankButton() {
ImGui::PushStyleColor(ImGuiCol_Button, { 0, 0, 0, 0 });
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0, 0, 0, 0 });
ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0, 0, 0, 0 });
ImGui::PushStyleColor(ImGuiCol_Border, { 0, 0, 0, 0 });
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(8.0f, 8.0f));
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 5.0f);
} }
void applyPreset(std::vector<PresetEntry> entries) { void PresetCheckboxStyle(const ImVec4& color) {
for (auto& [cvar, type, value] : entries) { ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(color.x, color.y, color.z, 1.0f));
switch (type) { ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(color.x, color.y, color.z, 0.8f));
case PRESET_ENTRY_TYPE_S32: ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(color.x, color.y, color.z, 0.6f));
CVarSetInteger(cvar, std::get<int32_t>(value)); ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.0f, 0.0f, 0.0f, 0.3f));
break; ImGui::PushStyleColor(ImGuiCol_CheckMark, ImVec4(1.0f, 1.0f, 1.0f, 0.7f));
case PRESET_ENTRY_TYPE_FLOAT: ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f);
CVarSetFloat(cvar, std::get<float>(value)); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(6.0f, 6.0f));
break; ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 5.0f);
case PRESET_ENTRY_TYPE_STRING: }
CVarSetString(cvar, std::get<const char*>(value));
break; static BlockInfo blockInfo[PRESET_SECTION_MAX] = {
case PRESET_ENTRY_TYPE_CPP_STRING: { { CVAR_PREFIX_SETTING, CVAR_PREFIX_WINDOW }, ICON_FA_COG, { "Settings", "settings" } },
CVarSetString(cvar, std::get<std::string>(value).c_str()); { { CVAR_PREFIX_ENHANCEMENT, CVAR_PREFIX_RANDOMIZER_ENHANCEMENT, CVAR_PREFIX_CHEAT },
break; ICON_FA_PLUS_CIRCLE,
{ "Enhancements", "enhancements" } },
{ { CVAR_PREFIX_AUDIO }, ICON_FA_MUSIC, { "Audio", "audio" } },
{ { CVAR_PREFIX_COSMETIC }, ICON_FA_PAINT_BRUSH, { "Cosmetics", "cosmetics" } },
{ { CVAR_PREFIX_RANDOMIZER_SETTING }, ICON_FA_RANDOM, { "Rando Settings", "rando" } },
{ { CVAR_PREFIX_TRACKER }, ICON_FA_MAP, { "Trackers", "trackers" } },
{ { CVAR_PREFIX_REMOTE }, ICON_FA_WIFI, { "Network", "network" } },
};
std::string FormatPresetPath(std::string name) {
return fmt::format("{}/{}.json", presetFolder, name);
}
void applyPreset(std::string presetName, std::vector<PresetSection> includeSections) {
auto& info = presets[presetName];
for (int i = PRESET_SECTION_SETTINGS; i < PRESET_SECTION_MAX; i++) {
if (info.apply[i] && info.presetValues["blocks"].contains(blockInfo[i].names[1])) {
if (!includeSections.empty() &&
std::find(includeSections.begin(), includeSections.end(), i) == includeSections.end()) {
continue;
}
if (i == PRESET_SECTION_TRACKERS) {
ItemTracker_LoadFromPreset(info.presetValues["blocks"][blockInfo[i].names[1]]["windows"]);
if (info.presetValues["blocks"][blockInfo[i].names[1]]["windows"].contains("Check Tracker")) {
CheckTracker::CheckTracker_LoadFromPreset(
info.presetValues["blocks"][blockInfo[i].names[1]]["windows"]["Check Tracker"]);
}
if (info.presetValues["blocks"][blockInfo[i].names[1]]["windows"].contains("Entrance Tracker")) {
EntranceTracker_LoadFromPreset(
info.presetValues["blocks"][blockInfo[i].names[1]]["windows"]["Entrance Tracker"]);
}
}
auto section = info.presetValues["blocks"][blockInfo[i].names[1]];
for (auto& item : section.items()) {
if (section[item.key()].is_null()) {
CVarClearBlock(item.key().c_str());
} else {
Ship::Context::GetInstance()->GetConfig()->SetBlock(fmt::format("{}.{}", "CVars", item.key()),
item.value());
Ship::Context::GetInstance()->GetConsoleVariables()->Load();
}
}
if (i == PRESET_SECTION_RANDOMIZER) {
SohGui::mRandomizerSettingsWindow->SetNeedsUpdate();
}
} }
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
} }
ShipInit::Init("*");
} }
void DrawPresetSelector(PresetType presetTypeId) { void DrawPresetSelector(std::vector<PresetSection> includeSections, std::string presetLoc, bool disabled) {
const std::string presetTypeCvar = CVAR_GENERAL("SelectedPresets.") + std::to_string(presetTypeId); std::vector<std::string> includedPresets;
const PresetTypeDefinition presetTypeDef = presetTypes.at(presetTypeId); for (auto& [name, info] : presets) {
uint16_t selectedPresetId = CVarGetInteger(presetTypeCvar.c_str(), 0); for (auto& section : includeSections) {
if (selectedPresetId >= presetTypeDef.presets.size()) { if (info.apply[section]) {
selectedPresetId = 0; includedPresets.push_back(name);
}
}
} }
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);
}
ImGui::Text("Presets"); ImGui::Text("Presets");
if (includedPresets.empty()) {
ImGui::PushStyleColor(ImGuiCol_Text, UIWidgets::ColorValues.at(UIWidgets::Colors::Orange));
ImGui::Text("No presets with rando options. Make some in Settings -> Presets");
ImGui::PopStyleColor();
return;
}
std::string selectorCvar = fmt::format(CVAR_GENERAL("{}SelectedPreset"), presetLoc);
std::string currentIndex = CVarGetString(selectorCvar.c_str(), includedPresets[0].c_str());
if (!presets.contains(currentIndex)) {
currentIndex = *includedPresets.begin();
CVarSetString(selectorCvar.c_str(), currentIndex.c_str());
}
UIWidgets::PushStyleCombobox(THEME_COLOR); UIWidgets::PushStyleCombobox(THEME_COLOR);
if (ImGui::BeginCombo("##PresetsComboBox", selectedPresetDef.label)) { if (ImGui::BeginCombo("##PresetsComboBox", currentIndex.c_str())) {
for (auto iter = presetTypeDef.presets.begin(); iter != presetTypeDef.presets.end(); ++iter) { for (auto iter = includedPresets.begin(); iter != includedPresets.end(); ++iter) {
if (ImGui::Selectable(iter->second.label, iter->first == selectedPresetId)) { if (ImGui::Selectable(iter->c_str(), *iter == currentIndex)) {
CVarSetInteger(presetTypeCvar.c_str(), iter->first); CVarSetString(selectorCvar.c_str(), iter->c_str());
currentIndex = *iter;
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
} }
} }
@ -65,18 +147,299 @@ void DrawPresetSelector(PresetType presetTypeId) {
ImGui::EndCombo(); ImGui::EndCombo();
} }
UIWidgets::PopStyleCombobox(); UIWidgets::PopStyleCombobox();
UIWidgets::Tooltip(comboboxTooltip.c_str()); // UIWidgets::Tooltip(comboboxTooltip.c_str());
UIWidgets::PushStyleButton(THEME_COLOR); UIWidgets::PushStyleButton(THEME_COLOR);
if (ImGui::Button(("Apply Preset##" + presetTypeCvar).c_str())) { if (UIWidgets::Button(
for (const char* block : presetTypeDef.blocksToClear) { ("Apply Preset##" + selectorCvar).c_str(),
CVarClearBlock(block); UIWidgets::ButtonOptions({ { .disabled = disabled } }).Color(THEME_COLOR).Size(UIWidgets::Sizes::Inline))) {
} applyPreset(currentIndex, includeSections);
if (selectedPresetId != 0) {
applyPreset(selectedPresetDef.entries);
}
CVarSetInteger(presetTypeCvar.c_str(), selectedPresetId);
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
} }
UIWidgets::PopStyleButton(); UIWidgets::PopStyleButton();
} }
void DrawSectionCheck(const std::string& name, bool empty, bool* pointer, std::string section) {
ImGui::AlignTextToFramePadding();
if (empty) {
ImGui::PushStyleColor(ImGuiCol_Text, { 1.0f, 0.0f, 0.0f, 0.7f });
BlankButton();
ImGui::BeginDisabled();
ImGui::Button((ICON_FA_TIMES + std::string("##") + name + section).c_str());
ImGui::EndDisabled();
UIWidgets::PopStyleButton();
ImGui::PopStyleColor();
} else {
ImGui::PushFont(OTRGlobals::Instance->fontMono);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (ImGui::GetStyle().FramePadding.y));
UIWidgets::Checkbox(("##" + name + section).c_str(), pointer,
{ .defaultValue = true, .padding = { 6.0f, 6.0f }, .color = THEME_COLOR });
ImGui::PopFont();
}
}
void ParsePreset(nlohmann::json& json, std::string name) {
try {
presets[json["presetName"]].presetValues = json;
presets[json["presetName"]].fileName = name;
if (json.contains("isBuiltIn")) {
presets[json["presetName"]].isBuiltIn = json["isBuiltIn"];
}
for (int i = 0; i < PRESET_SECTION_MAX; i++) {
if (presets[json["presetName"]].presetValues["blocks"].contains(blockInfo[i].names[1])) {
presets[json["presetName"]].apply[i] = true;
}
}
} catch (...) {}
}
void LoadPresets() {
if (!presets.empty()) {
presets.clear();
}
if (fs::exists(presetFolder)) {
for (auto const& preset : fs::directory_iterator(presetFolder)) {
std::ifstream ifs(preset.path());
auto json = nlohmann::json::parse(ifs);
if (!json.contains("presetName")) {
spdlog::error(fmt::format("Attempted to load file {} as a preset, but was not a preset file.",
preset.path().filename().string()));
} else {
ParsePreset(json, preset.path().filename().stem().string());
}
ifs.close();
}
}
auto initData = std::make_shared<Ship::ResourceInitData>();
initData->Format = RESOURCE_FORMAT_BINARY;
initData->Type = static_cast<uint32_t>(Ship::ResourceType::Json);
initData->ResourceVersion = 0;
std::string folder = "presets/*";
auto builtIns = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(folder);
size_t start = std::string(folder).size() - 1;
for (size_t i = 0; i < builtIns->size(); i++) {
std::string filePath = builtIns->at(i);
auto json = std::static_pointer_cast<Ship::Json>(
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(filePath, true, initData));
std::string fileName = filePath.substr(start, filePath.size() - start - 5); // 5 for length of ".json"
ParsePreset(json->Data, fileName);
}
}
void SavePreset(std::string& presetName) {
if (!fs::exists(presetFolder)) {
fs::create_directory(presetFolder);
}
presets[presetName].presetValues["presetName"] = presetName;
std::ofstream file(
fmt::format("{}/{}.json", Ship::Context::GetInstance()->LocateFileAcrossAppDirs("presets"), presetName));
file << presets[presetName].presetValues.dump(4);
file.close();
LoadPresets();
}
static std::string newPresetName;
static bool saveSection[PRESET_SECTION_MAX];
void DrawNewPresetPopup() {
bool nameExists = presets.contains(newPresetName);
UIWidgets::InputString("Preset Name", &newPresetName,
UIWidgets::InputOptions()
.Color(THEME_COLOR)
.Size({ 200, 40 })
.ComponentAlignment(UIWidgets::ComponentAlignments::Right)
.LabelPosition(UIWidgets::LabelPositions::Near)
.ErrorText("Preset name already exists")
.HasError(nameExists));
nameExists = presets.contains(newPresetName);
bool noneSelected = true;
for (int i = PRESET_SECTION_SETTINGS; i < PRESET_SECTION_MAX; i++) {
if (saveSection[i]) {
noneSelected = false;
break;
}
}
const char* disabledTooltip =
(newPresetName.empty() ? "Preset name is empty"
: (noneSelected ? "No sections selected" : "Preset name already exists"));
for (int i = PRESET_SECTION_SETTINGS; i < PRESET_SECTION_MAX; i++) {
UIWidgets::Checkbox(fmt::format("Save {}", blockInfo[i].names[0]).c_str(), &saveSection[i],
UIWidgets::CheckboxOptions().Color(THEME_COLOR).Padding({ 6.0f, 6.0f }));
}
if (UIWidgets::Button(
"Save", UIWidgets::ButtonOptions({ { .disabled = (nameExists || noneSelected || newPresetName.empty()),
.disabledTooltip = disabledTooltip } })
.Padding({ 6.0f, 6.0f })
.Color(THEME_COLOR))) {
presets[newPresetName] = {};
auto config = Ship::Context::GetInstance()->GetConfig()->GetNestedJson();
for (int i = PRESET_SECTION_SETTINGS; i < PRESET_SECTION_MAX; i++) {
if (saveSection[i]) {
for (int j = 0; j < blockInfo[i].sections.size(); j++) {
presets[newPresetName].presetValues["blocks"][blockInfo[i].names[1]][blockInfo[i].sections[j]] =
config["CVars"][blockInfo[i].sections[j]];
}
}
}
if (saveSection[PRESET_SECTION_TRACKERS]) {
for (auto id : itemTrackerWindowIDs) {
auto window = ImGui::FindWindowByName(id);
if (window != nullptr) {
auto size = window->Size;
auto pos = window->Pos;
presets[newPresetName].presetValues["blocks"][blockInfo[PRESET_SECTION_TRACKERS].names[1]]
["windows"][id]["size"]["width"] = size.x;
presets[newPresetName].presetValues["blocks"][blockInfo[PRESET_SECTION_TRACKERS].names[1]]
["windows"][id]["size"]["height"] = size.y;
presets[newPresetName].presetValues["blocks"][blockInfo[PRESET_SECTION_TRACKERS].names[1]]
["windows"][id]["pos"]["x"] = pos.x;
presets[newPresetName].presetValues["blocks"][blockInfo[PRESET_SECTION_TRACKERS].names[1]]
["windows"][id]["pos"]["y"] = pos.y;
}
}
auto window = ImGui::FindWindowByName("Entrance Tracker");
if (window != nullptr) {
auto size = window->Size;
auto pos = window->Pos;
presets[newPresetName].presetValues["blocks"][blockInfo[PRESET_SECTION_TRACKERS].names[1]]["windows"]
["Entrance Tracker"]["size"]["width"] = size.x;
presets[newPresetName].presetValues["blocks"][blockInfo[PRESET_SECTION_TRACKERS].names[1]]["windows"]
["Entrance Tracker"]["size"]["height"] = size.y;
presets[newPresetName].presetValues["blocks"][blockInfo[PRESET_SECTION_TRACKERS].names[1]]["windows"]
["Entrance Tracker"]["pos"]["x"] = pos.x;
presets[newPresetName].presetValues["blocks"][blockInfo[PRESET_SECTION_TRACKERS].names[1]]["windows"]
["Entrance Tracker"]["pos"]["y"] = pos.y;
}
window = ImGui::FindWindowByName("Check Tracker");
if (window != nullptr) {
auto size = window->Size;
auto pos = window->Pos;
presets[newPresetName].presetValues["blocks"][blockInfo[PRESET_SECTION_TRACKERS].names[1]]["windows"]
["Check Tracker"]["size"]["width"] = size.x;
presets[newPresetName].presetValues["blocks"][blockInfo[PRESET_SECTION_TRACKERS].names[1]]["windows"]
["Check Tracker"]["size"]["height"] = size.y;
presets[newPresetName].presetValues["blocks"][blockInfo[PRESET_SECTION_TRACKERS].names[1]]["windows"]
["Check Tracker"]["pos"]["x"] = pos.x;
presets[newPresetName].presetValues["blocks"][blockInfo[PRESET_SECTION_TRACKERS].names[1]]["windows"]
["Check Tracker"]["pos"]["y"] = pos.y;
}
}
presets[newPresetName].fileName = newPresetName;
std::fill_n(presets[newPresetName].apply, PRESET_SECTION_MAX, true);
SavePreset(newPresetName);
newPresetName = "";
ImGui::CloseCurrentPopup();
}
if (UIWidgets::Button("Cancel", UIWidgets::ButtonOptions().Padding({ 6.0f, 6.0f }).Color(THEME_COLOR))) {
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();
}
void PresetsCustomWidget(WidgetInfo& info) {
ImGui::PushFont(OTRGlobals::Instance->fontMonoLargest);
if (UIWidgets::Button("New Preset", UIWidgets::ButtonOptions(
{ { .disabled = (CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) != 0),
.disabledTooltip = "Disabled because of race lockout" } })
.Size(UIWidgets::Sizes::Inline)
.Color(THEME_COLOR))) {
ImGui::OpenPopup("newPreset");
}
if (ImGui::BeginPopup("newPreset", ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize |
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar |
ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoTitleBar)) {
DrawNewPresetPopup();
}
ImGui::SameLine();
UIWidgets::CVarCheckbox("Hide built-in presets", CVAR_GENERAL("HideBuiltInPresets"),
UIWidgets::CheckboxOptions().Color(THEME_COLOR));
bool hideBuiltIn = CVarGetInteger(CVAR_GENERAL("HideBuiltInPresets"), 0);
UIWidgets::PushStyleTabs(THEME_COLOR);
if (ImGui::BeginTable("PresetWidgetTable", PRESET_SECTION_MAX + 3)) {
ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthFixed, 250);
for (int i = PRESET_SECTION_SETTINGS; i < PRESET_SECTION_MAX; i++) {
ImGui::TableSetupColumn(blockInfo[i].names[0].c_str());
}
ImGui::TableSetupColumn("Apply", ImGuiTableColumnFlags_WidthFixed,
ImGui::CalcTextSize("Apply").x + ImGui::GetStyle().FramePadding.x * 2);
ImGui::TableSetupColumn("Delete", ImGuiTableColumnFlags_WidthFixed,
ImGui::CalcTextSize("Delete").x + ImGui::GetStyle().FramePadding.x * 2);
BlankButton();
ImGui::TableNextRow();
ImGui::TableNextColumn();
for (int i = PRESET_SECTION_SETTINGS; i < PRESET_SECTION_MAX; i++) {
ImGui::TableNextColumn();
ImGui::Button(fmt::format("{}##header{}", blockInfo[i].icon, blockInfo[i].names[1]).c_str());
UIWidgets::Tooltip(blockInfo[i].names[0].c_str());
}
UIWidgets::PopStyleButton();
if (presets.empty()) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::AlignTextToFramePadding();
ImGui::Text("No presets found.");
ImGui::EndTable();
UIWidgets::PopStyleTabs();
ImGui::PopFont();
return;
}
for (auto& [name, info] : presets) {
if (hideBuiltIn && info.isBuiltIn) {
continue;
}
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::AlignTextToFramePadding();
ImGui::Text(name.c_str());
for (int i = PRESET_SECTION_SETTINGS; i < PRESET_SECTION_MAX; i++) {
ImGui::TableNextColumn();
DrawSectionCheck(name, !info.presetValues["blocks"].contains(blockInfo[i].names[1]), &info.apply[i],
blockInfo[i].names[1]);
}
ImGui::TableNextColumn();
UIWidgets::PushStyleButton(THEME_COLOR);
if (UIWidgets::Button(
("Apply##" + name).c_str(),
UIWidgets::ButtonOptions({ { .disabled = (CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) != 0),
.disabledTooltip = "Disabled because of race lockout" } })
.Padding({ 6.0f, 6.0f }))) {
applyPreset(name);
}
UIWidgets::PopStyleButton();
ImGui::TableNextColumn();
UIWidgets::PushStyleButton(THEME_COLOR);
if (!info.isBuiltIn) {
if (UIWidgets::Button(("Delete##" + name).c_str(),
UIWidgets::ButtonOptions().Padding({ 6.0f, 6.0f }))) {
auto path = FormatPresetPath(info.fileName);
if (fs::exists(path)) {
fs::remove(path);
}
presets.erase(name);
UIWidgets::PopStyleButton();
break;
}
}
UIWidgets::PopStyleButton();
}
ImGui::EndTable();
}
ImGui::PopFont();
UIWidgets::PopStyleTabs();
}
void RegisterPresetsWidgets() {
SohGui::mSohMenu->AddSidebarEntry("Settings", "Presets", 1);
WidgetPath path = { "Settings", "Presets", SECTION_COLUMN_1 };
SohGui::mSohMenu->AddWidget(path, "PresetsWidget", WIDGET_CUSTOM).CustomFunction(PresetsCustomWidget);
presetFolder = Ship::Context::GetInstance()->GetPathRelativeToAppDirectory("presets");
std::fill_n(saveSection, PRESET_SECTION_MAX, true);
LoadPresets();
}
static RegisterMenuInitFunc initFunc(RegisterPresetsWidgets);

View file

@ -2,57 +2,17 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <variant>
#include "soh/OTRGlobals.h"
enum PresetEntryType { enum PresetSection {
PRESET_ENTRY_TYPE_S32, PRESET_SECTION_SETTINGS,
PRESET_ENTRY_TYPE_FLOAT, PRESET_SECTION_ENHANCEMENTS,
PRESET_ENTRY_TYPE_STRING, PRESET_SECTION_AUDIO,
PRESET_ENTRY_TYPE_CPP_STRING, PRESET_SECTION_COSMETICS,
PRESET_SECTION_RANDOMIZER,
PRESET_SECTION_TRACKERS,
PRESET_SECTION_NETWORK,
PRESET_SECTION_MAX,
}; };
enum PresetType { void DrawPresetSelector(std::vector<PresetSection> includeSections, std::string currentIndex, bool disabled);
PRESET_TYPE_ENHANCEMENTS, void applyPreset(std::string presetName, std::vector<PresetSection> includeSections = {});
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_BEGINNER,
RANDOMIZER_PRESET_STANDARD,
RANDOMIZER_PRESET_ADVANCED,
RANDOMIZER_PRESET_HELL_MODE,
};
typedef struct PresetEntry {
const char* cvar;
PresetEntryType type;
std::variant<int32_t, float, const char*, std::string> value;
} PresetEntry;
std::string FormatLocations(std::vector<RandomizerCheck> locs);
void DrawPresetSelector(PresetType presetType);
void clearCvars(std::vector<const char*> cvarsToClear);
void applyPreset(std::vector<PresetEntry> entries);
typedef struct PresetDefinition {
const char* label;
const char* description;
std::vector<PresetEntry> entries;
} PresetDefinition;
typedef struct PresetTypeDefinition {
std::vector<const char*> blocksToClear;
std::map<uint16_t, PresetDefinition> presets;
} PresetTypeDefinition;
extern const std::map<PresetType, PresetTypeDefinition> presetTypes;

View file

@ -0,0 +1,25 @@
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/ShipInit.hpp"
extern "C" {
#include "src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h"
void EnIceHono_CapturableFlame(EnIceHono* thisx, PlayState* play);
u32 EnIceHono_InBottleRange(EnIceHono* thisx, PlayState* play);
}
extern PlayState* gPlayState;
void OnEnIceHonoUpdate(void* actor) {
EnIceHono* thisx = (EnIceHono*)actor;
if (thisx->actionFunc != EnIceHono_CapturableFlame && EnIceHono_InBottleRange(thisx, gPlayState)) {
// GI_MAX in this case allows the player to catch the actor in a bottle
Actor_OfferGetItem(&thisx->actor, gPlayState, GI_MAX, 60.0f, 100.0f);
}
}
void RegisterRebottleBlueFire() {
COND_ID_HOOK(OnActorUpdate, ACTOR_EN_ICE_HONO, CVarGetInteger(CVAR_ENHANCEMENT("RebottleBlueFire"), 0),
OnEnIceHonoUpdate);
}
static RegisterShipInitFunc initFunc(RegisterRebottleBlueFire, { CVAR_ENHANCEMENT("RebottleBlueFire") });

View file

@ -77,9 +77,9 @@ void CrawlSpeed_Register() {
COND_VB_SHOULD(VB_CRAWL_SPEED_EXIT_CS, shouldRegister, { COND_VB_SHOULD(VB_CRAWL_SPEED_EXIT_CS, shouldRegister, {
Player* player = GET_PLAYER(gPlayState); Player* player = GET_PLAYER(gPlayState);
Camera* csCam = va_arg(args, Camera*); Camera* csCam = va_arg(args, Camera*);
s16 csId = va_arg(args, s16); s16 csId = static_cast<s16>(va_arg(args, int));
s16 actionParameters = va_arg(args, s16); s16 actionParameters = static_cast<s16>(va_arg(args, int));
s16 initTimer = va_arg(args, s16); s16 initTimer = static_cast<s16>(va_arg(args, int));
CutsceneCameraPoint* atPoints = va_arg(args, CutsceneCameraPoint*); CutsceneCameraPoint* atPoints = va_arg(args, CutsceneCameraPoint*);
CutsceneCameraPoint* eyePoints = va_arg(args, CutsceneCameraPoint*); CutsceneCameraPoint* eyePoints = va_arg(args, CutsceneCameraPoint*);
bool excludeWellBackroom = (player->actor.world.pos.x > 950.0f) && (player->actor.world.pos.x < 1025.0f) && bool excludeWellBackroom = (player->actor.world.pos.x > 950.0f) && (player->actor.world.pos.x < 1025.0f) &&

View file

@ -7,6 +7,7 @@
#include "soh/Enhancements/nametag.h" #include "soh/Enhancements/nametag.h"
#include "soh/ShipInit.hpp" #include "soh/ShipInit.hpp"
#include <algorithm>
#include <array> #include <array>
#include <bit> #include <bit>
#include <map> #include <map>
@ -17,6 +18,7 @@
#include <spdlog/fmt/fmt.h> #include <spdlog/fmt/fmt.h>
#include "soh/OTRGlobals.h" #include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h" #include "soh/cvar_prefixes.h"
#include "soh/ObjectExtension/ActorListIndex.h"
extern "C" { extern "C" {
#include <z64.h> #include <z64.h>
@ -44,13 +46,6 @@ typedef struct {
Vec3s rot; Vec3s rot;
} ActorInfo; } ActorInfo;
typedef enum {
LIST,
TARGET,
HELD,
INTERACT,
} RetrievalMethod;
std::array<const char*, 12> acMapping = { std::array<const char*, 12> acMapping = {
"Switch", "Background (Prop type 1)", "Switch", "Background (Prop type 1)",
"Player", "Bomb", "Player", "Bomb",
@ -872,37 +867,14 @@ void ActorViewer_AddTagForAllActors() {
void ActorViewerWindow::DrawElement() { void ActorViewerWindow::DrawElement() {
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0)); ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
static Actor* display;
static Actor empty{};
static Actor* fetch = NULL;
static ActorInfo newActor = { 0, 0, { 0, 0, 0 }, { 0, 0, 0 } }; static ActorInfo newActor = { 0, 0, { 0, 0, 0 }, { 0, 0, 0 } };
static bool needs_reset = false;
static ImU16 one = 1; static ImU16 one = 1;
static int actor;
static int category = 0;
static RetrievalMethod rm;
static std::string filler = "Please select"; static std::string filler = "Please select";
static std::vector<Actor*> list;
static u16 lastSceneId = 0;
static std::string searchString = ""; static std::string searchString = "";
static s16 currentSelectedInDropdown; static s16 currentSelectedInDropdown = -1;
static std::vector<u16> actors; static std::vector<u16> actorSearchResults;
if (gPlayState != nullptr) { if (gPlayState != nullptr) {
needs_reset = lastSceneId != gPlayState->sceneNum;
if (needs_reset) {
display = &empty;
fetch = nullptr;
actor = category = 0;
filler = "Please Select";
list.clear();
needs_reset = false;
searchString = "";
currentSelectedInDropdown = -1;
actors.clear();
}
lastSceneId = gPlayState->sceneNum;
if (ImGui::BeginChild("options", ImVec2(0, 0), ImGuiChildFlags_Border | ImGuiChildFlags_AutoResizeY)) { if (ImGui::BeginChild("options", ImVec2(0, 0), ImGuiChildFlags_Border | ImGuiChildFlags_AutoResizeY)) {
bool toggled = false; bool toggled = false;
bool optionChange = false; bool optionChange = false;
@ -966,21 +938,19 @@ void ActorViewerWindow::DrawElement() {
ImGui::EndCombo(); ImGui::EndCombo();
} }
if (display == nullptr) {
filler = "Please select";
}
if (ImGui::BeginCombo("Actor", filler.c_str())) { if (ImGui::BeginCombo("Actor", filler.c_str())) {
if (gPlayState != nullptr && lastSceneId != gPlayState->sceneNum) {
PopulateActorDropdown(category, list);
lastSceneId = gPlayState->sceneNum;
}
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
std::string label = std::to_string(i) + ": " + ActorDB::Instance->RetrieveEntry(list[i]->id).name; std::string label = std::to_string(i) + ": " + ActorDB::Instance->RetrieveEntry(list[i]->id).name;
std::string description = GetActorDescription(list[i]->id); std::string description = GetActorDescription(list[i]->id);
if (description != "") if (description != "")
label += " (" + description + ")"; label += " (" + description + ")";
if (ImGui::Selectable(label.c_str())) { if (ImGui::Selectable(label.c_str(), list[i] == display)) {
rm = LIST;
display = list[i]; display = list[i];
actor = i;
filler = label; filler = label;
break; break;
} }
@ -991,87 +961,76 @@ void ActorViewerWindow::DrawElement() {
PushStyleHeader(THEME_COLOR); PushStyleHeader(THEME_COLOR);
if (ImGui::TreeNode("Selected Actor")) { if (ImGui::TreeNode("Selected Actor")) {
DrawGroupWithBorder( if (display != nullptr) {
[&]() { DrawGroupWithBorder(
ImGui::Text("Name: %s", ActorDB::Instance->RetrieveEntry(display->id).name.c_str()); [&]() {
ImGui::Text("Description: %s", GetActorDescription(display->id).c_str()); ImGui::Text("Name: %s", ActorDB::Instance->RetrieveEntry(display->id).name.c_str());
ImGui::Text("Category: %s", acMapping[display->category]); ImGui::Text("Description: %s", GetActorDescription(display->id).c_str());
ImGui::Text("ID: %d", display->id); ImGui::Text("Category: %s", acMapping[display->category]);
ImGui::Text("Parameters: %d", display->params); ImGui::Text("ID: %d", display->id);
}, ImGui::Text("Parameters: %d", display->params);
"Selected Actor"); ImGui::Text("Actor List Index: %d", GetActorListIndex(display));
ImGui::SameLine(); },
ImGui::PushItemWidth(ImGui::GetFontSize() * 6); "Selected Actor");
ImGui::SameLine();
ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
DrawGroupWithBorder( DrawGroupWithBorder(
[&]() { [&]() {
ImGui::PushItemWidth(ImGui::GetFontSize() * 6); ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
PushStyleInput(THEME_COLOR);
ImGui::Text("Actor Position");
ImGui::InputScalar("X##CurPos", ImGuiDataType_Float, &display->world.pos.x);
ImGui::InputScalar("Y##CurPos", ImGuiDataType_Float, &display->world.pos.y);
ImGui::InputScalar("Z##CurPos", ImGuiDataType_Float, &display->world.pos.z);
ImGui::PopItemWidth();
PopStyleInput();
},
"Actor Position");
ImGui::SameLine();
DrawGroupWithBorder(
[&]() {
PushStyleInput(THEME_COLOR);
ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
ImGui::Text("Actor Rotation");
ImGui::InputScalar("X##CurRot", ImGuiDataType_S16, &display->world.rot.x);
ImGui::InputScalar("Y##CurRot", ImGuiDataType_S16, &display->world.rot.y);
ImGui::InputScalar("Z##CurRot", ImGuiDataType_S16, &display->world.rot.z);
ImGui::PopItemWidth();
PopStyleInput();
},
"Actor Rotation");
if (display->category == ACTORCAT_BOSS || display->category == ACTORCAT_ENEMY) {
PushStyleInput(THEME_COLOR); PushStyleInput(THEME_COLOR);
ImGui::Text("Actor Position"); ImGui::InputScalar("Enemy Health", ImGuiDataType_U8, &display->colChkInfo.health);
ImGui::InputScalar("X##CurPos", ImGuiDataType_Float, &display->world.pos.x);
ImGui::InputScalar("Y##CurPos", ImGuiDataType_Float, &display->world.pos.y);
ImGui::InputScalar("Z##CurPos", ImGuiDataType_Float, &display->world.pos.z);
ImGui::PopItemWidth();
PopStyleInput(); PopStyleInput();
}, UIWidgets::InsertHelpHoverText("Some actors might not use this!");
"Actor Position");
ImGui::SameLine();
DrawGroupWithBorder(
[&]() {
PushStyleInput(THEME_COLOR);
ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
ImGui::Text("Actor Rotation");
ImGui::InputScalar("X##CurRot", ImGuiDataType_S16, &display->world.rot.x);
ImGui::InputScalar("Y##CurRot", ImGuiDataType_S16, &display->world.rot.y);
ImGui::InputScalar("Z##CurRot", ImGuiDataType_S16, &display->world.rot.z);
ImGui::PopItemWidth();
PopStyleInput();
},
"Actor Rotation");
if (display->category == ACTORCAT_BOSS || display->category == ACTORCAT_ENEMY) {
PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Enemy Health", ImGuiDataType_U8, &display->colChkInfo.health);
PopStyleInput();
UIWidgets::InsertHelpHoverText("Some actors might not use this!");
}
DrawGroupWithBorder(
[&]() {
ImGui::Text("flags");
UIWidgets::DrawFlagArray32("flags", display->flags);
},
"flags");
ImGui::SameLine();
DrawGroupWithBorder(
[&]() {
ImGui::Text("bgCheckFlags");
UIWidgets::DrawFlagArray16("bgCheckFlags", display->bgCheckFlags);
},
"bgCheckFlags");
if (Button("Refresh", ButtonOptions().Color(THEME_COLOR))) {
PopulateActorDropdown(category, list);
switch (rm) {
case INTERACT:
case HELD:
case TARGET:
display = fetch;
break;
case LIST:
display = list[actor];
break;
default:
break;
} }
}
if (Button("Go to Actor", ButtonOptions().Color(THEME_COLOR))) { DrawGroupWithBorder(
Player* player = GET_PLAYER(gPlayState); [&]() {
Math_Vec3f_Copy(&player->actor.world.pos, &display->world.pos); ImGui::Text("flags");
Math_Vec3f_Copy(&player->actor.home.pos, &player->actor.world.pos); UIWidgets::DrawFlagArray32("flags", display->flags);
},
"flags");
ImGui::SameLine();
DrawGroupWithBorder(
[&]() {
ImGui::Text("bgCheckFlags");
UIWidgets::DrawFlagArray16("bgCheckFlags", display->bgCheckFlags);
},
"bgCheckFlags");
if (Button("Go to Actor", ButtonOptions().Color(THEME_COLOR))) {
Player* player = GET_PLAYER(gPlayState);
Math_Vec3f_Copy(&player->actor.world.pos, &display->world.pos);
Math_Vec3f_Copy(&player->actor.home.pos, &player->actor.world.pos);
}
} else {
ImGui::Text("Select an actor to display information.");
} }
if (Button("Fetch from Target", if (Button("Fetch from Target",
@ -1079,34 +1038,28 @@ void ActorViewerWindow::DrawElement() {
.Color(THEME_COLOR) .Color(THEME_COLOR)
.Tooltip("Grabs actor with target arrow above it. You might need C-Up for enemies"))) { .Tooltip("Grabs actor with target arrow above it. You might need C-Up for enemies"))) {
Player* player = GET_PLAYER(gPlayState); Player* player = GET_PLAYER(gPlayState);
fetch = player->talkActor; if (player->talkActor != NULL) {
if (fetch != NULL) { display = player->talkActor;
display = fetch; category = display->category;
category = fetch->category;
PopulateActorDropdown(category, list); PopulateActorDropdown(category, list);
rm = TARGET;
} }
} }
if (Button("Fetch from Held", if (Button("Fetch from Held",
ButtonOptions().Color(THEME_COLOR).Tooltip("Grabs actor that Link is holding"))) { ButtonOptions().Color(THEME_COLOR).Tooltip("Grabs actor that Link is holding"))) {
Player* player = GET_PLAYER(gPlayState); Player* player = GET_PLAYER(gPlayState);
fetch = player->heldActor; if (player->heldActor != NULL) {
if (fetch != NULL) { display = player->heldActor;
display = fetch; category = display->category;
category = fetch->category;
PopulateActorDropdown(category, list); PopulateActorDropdown(category, list);
rm = HELD;
} }
} }
if (Button("Fetch from Interaction", if (Button("Fetch from Interaction",
ButtonOptions().Color(THEME_COLOR).Tooltip("Grabs actor from \"interaction range\""))) { ButtonOptions().Color(THEME_COLOR).Tooltip("Grabs actor from \"interaction range\""))) {
Player* player = GET_PLAYER(gPlayState); Player* player = GET_PLAYER(gPlayState);
fetch = player->interactRangeActor; if (player->interactRangeActor != NULL) {
if (fetch != NULL) { display = player->interactRangeActor;
display = fetch; category = display->category;
category = fetch->category;
PopulateActorDropdown(category, list); PopulateActorDropdown(category, list);
rm = INTERACT;
} }
} }
@ -1117,21 +1070,22 @@ void ActorViewerWindow::DrawElement() {
// ImGui::PushItemWidth(ImGui::GetFontSize() * 10); // ImGui::PushItemWidth(ImGui::GetFontSize() * 10);
if (InputString("Search Actor", &searchString, InputOptions().Color(THEME_COLOR))) { if (InputString("Search Actor", &searchString, InputOptions().Color(THEME_COLOR))) {
actors = GetActorsWithDescriptionContainingString(searchString); actorSearchResults = GetActorsWithDescriptionContainingString(searchString);
currentSelectedInDropdown = -1; currentSelectedInDropdown = -1;
} }
if (!SohUtils::IsStringEmpty(searchString) && !actors.empty()) { if (!SohUtils::IsStringEmpty(searchString) && !actorSearchResults.empty()) {
std::string preview = currentSelectedInDropdown == -1 std::string preview =
? "Please Select" currentSelectedInDropdown == -1
: ActorDB::Instance->RetrieveEntry(actors[currentSelectedInDropdown]).desc; ? "Please Select"
: ActorDB::Instance->RetrieveEntry(actorSearchResults[currentSelectedInDropdown]).desc;
PushStyleCombobox(THEME_COLOR); PushStyleCombobox(THEME_COLOR);
if (ImGui::BeginCombo("Results", preview.c_str())) { if (ImGui::BeginCombo("Results", preview.c_str())) {
for (u8 i = 0; i < actors.size(); i++) { for (u8 i = 0; i < actorSearchResults.size(); i++) {
if (ImGui::Selectable(ActorDB::Instance->RetrieveEntry(actors[i]).desc.c_str(), if (ImGui::Selectable(ActorDB::Instance->RetrieveEntry(actorSearchResults[i]).desc.c_str(),
i == currentSelectedInDropdown)) { i == currentSelectedInDropdown)) {
currentSelectedInDropdown = i; currentSelectedInDropdown = i;
newActor.id = actors[i]; newActor.id = actorSearchResults[i];
} }
} }
ImGui::EndCombo(); ImGui::EndCombo();
@ -1235,20 +1189,40 @@ void ActorViewerWindow::DrawElement() {
PopStyleHeader(); PopStyleHeader();
} else { } else {
ImGui::Text("Global Context needed for actor info!"); ImGui::Text("Global Context needed for actor info!");
if (needs_reset) {
fetch = nullptr;
actor = category = 0;
filler = "Please Select";
list.clear();
needs_reset = false;
searchString = "";
currentSelectedInDropdown = -1;
actors.clear();
}
} }
ImGui::EndDisabled(); ImGui::EndDisabled();
} }
void ActorViewerWindow::InitElement() {
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnActorSpawn>([this](void* refActor) {
Actor* actor = static_cast<Actor*>(refActor);
// Reload actor list if the new actor belongs to the selected category
if (category == actor->category) {
PopulateActorDropdown(actor->category, list);
}
});
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnActorDestroy>([this](void* refActor) {
Actor* actor = static_cast<Actor*>(refActor);
// If the actor belongs to the selected category, we need to manually remove it, as it has not been removed from
// the global actor array yet
if (category == actor->category) {
list.erase(std::remove(list.begin(), list.end(), actor), list.end());
}
if (display == actor) {
display = nullptr;
}
});
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneInit>([this](int16_t sceneNum) {
display = nullptr;
category = ACTORCAT_SWITCH;
list.clear();
});
}
void ActorViewer_RegisterNameTagHooks() { void ActorViewer_RegisterNameTagHooks() {
COND_HOOK(OnActorInit, CVAR_ACTOR_NAME_TAGS_ENABLED, COND_HOOK(OnActorInit, CVAR_ACTOR_NAME_TAGS_ENABLED,
[](void* actor) { ActorViewer_AddTagForActor(static_cast<Actor*>(actor)); }); [](void* actor) { ActorViewer_AddTagForActor(static_cast<Actor*>(actor)); });

View file

@ -2,11 +2,20 @@
#include <libultraship/libultraship.h> #include <libultraship/libultraship.h>
#include "z64actor.h"
#include <vector>
class ActorViewerWindow final : public Ship::GuiWindow { class ActorViewerWindow final : public Ship::GuiWindow {
public: public:
using GuiWindow::GuiWindow; using GuiWindow::GuiWindow;
void DrawElement() override; void DrawElement() override;
void InitElement() override{}; void InitElement() override;
void UpdateElement() override{}; void UpdateElement() override{};
private:
Actor* display = nullptr;
int category = ACTORCAT_SWITCH;
std::vector<Actor*> list;
}; };

View file

@ -554,6 +554,10 @@ void DrawFlagTableArray16(const FlagTable& flagTable, uint16_t row, uint16_t& fl
uint32_t bitMask = 1 << flagIndex; uint32_t bitMask = 1 << flagIndex;
ImVec4 themeColor = ColorValues.at(THEME_COLOR); ImVec4 themeColor = ColorValues.at(THEME_COLOR);
ImVec4 colorDark = { themeColor.x * 0.4f, themeColor.y * 0.4f, themeColor.z * 0.4f, themeColor.z }; ImVec4 colorDark = { themeColor.x * 0.4f, themeColor.y * 0.4f, themeColor.z * 0.4f, themeColor.z };
ImVec4& color = themeColor;
if (!hasDescription) {
color = colorDark;
}
PushStyleCheckbox(hasDescription ? themeColor : colorDark); PushStyleCheckbox(hasDescription ? themeColor : colorDark);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(4.0f, 3.0f)); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(4.0f, 3.0f));
bool flag = (flags & bitMask) != 0; bool flag = (flags & bitMask) != 0;

File diff suppressed because it is too large Load diff

View file

@ -27,6 +27,7 @@ DEFINE_HOOK(OnOcarinaSongAction, ());
DEFINE_HOOK(OnCuccoOrChickenHatch, ()); DEFINE_HOOK(OnCuccoOrChickenHatch, ());
DEFINE_HOOK(OnShopSlotChange, (uint8_t cursorIndex, int16_t price)); DEFINE_HOOK(OnShopSlotChange, (uint8_t cursorIndex, int16_t price));
DEFINE_HOOK(OnActorInit, (void* actor)); DEFINE_HOOK(OnActorInit, (void* actor));
DEFINE_HOOK(OnActorSpawn, (void* actor));
DEFINE_HOOK(OnActorUpdate, (void* actor)); DEFINE_HOOK(OnActorUpdate, (void* actor));
DEFINE_HOOK(OnActorKill, (void* actor)); DEFINE_HOOK(OnActorKill, (void* actor));
DEFINE_HOOK(OnActorDestroy, (void* actor)); DEFINE_HOOK(OnActorDestroy, (void* actor));

View file

@ -108,6 +108,13 @@ void GameInteractor_ExecuteOnActorInit(void* actor) {
GameInteractor::Instance->ExecuteHooksForFilter<GameInteractor::OnActorInit>(actor); GameInteractor::Instance->ExecuteHooksForFilter<GameInteractor::OnActorInit>(actor);
} }
void GameInteractor_ExecuteOnActorSpawn(void* actor) {
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnActorSpawn>(actor);
GameInteractor::Instance->ExecuteHooksForID<GameInteractor::OnActorSpawn>(((Actor*)actor)->id, actor);
GameInteractor::Instance->ExecuteHooksForPtr<GameInteractor::OnActorSpawn>((uintptr_t)actor, actor);
GameInteractor::Instance->ExecuteHooksForFilter<GameInteractor::OnActorSpawn>(actor);
}
void GameInteractor_ExecuteOnActorUpdate(void* actor) { void GameInteractor_ExecuteOnActorUpdate(void* actor) {
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnActorUpdate>(actor); GameInteractor::Instance->ExecuteHooks<GameInteractor::OnActorUpdate>(actor);
GameInteractor::Instance->ExecuteHooksForID<GameInteractor::OnActorUpdate>(((Actor*)actor)->id, actor); GameInteractor::Instance->ExecuteHooksForID<GameInteractor::OnActorUpdate>(((Actor*)actor)->id, actor);

View file

@ -29,6 +29,7 @@ void GameInteractor_ExecuteOnSetDoAction(uint16_t action);
void GameInteractor_ExecuteOnOcarinaSongAction(); void GameInteractor_ExecuteOnOcarinaSongAction();
void GameInteractor_ExecuteOnCuccoOrChickenHatch(); void GameInteractor_ExecuteOnCuccoOrChickenHatch();
void GameInteractor_ExecuteOnActorInit(void* actor); void GameInteractor_ExecuteOnActorInit(void* actor);
void GameInteractor_ExecuteOnActorSpawn(void* actor);
void GameInteractor_ExecuteOnActorUpdate(void* actor); void GameInteractor_ExecuteOnActorUpdate(void* actor);
void GameInteractor_ExecuteOnActorDestroy(void* actor); void GameInteractor_ExecuteOnActorDestroy(void* actor);
void GameInteractor_ExecuteOnActorKill(void* actor); void GameInteractor_ExecuteOnActorKill(void* actor);

View file

@ -134,31 +134,6 @@ void RegisterOcarinaTimeTravel() {
}); });
} }
void RegisterRupeeDash() {
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnPlayerUpdate>([]() {
if (!CVarGetInteger(CVAR_ENHANCEMENT("RupeeDash"), 0)) {
return;
}
// Initialize Timer
static uint16_t rupeeDashTimer = 0;
uint16_t rdmTime = CVarGetInteger(CVAR_ENHANCEMENT("RupeeDashInterval"), 5) * 20;
// Did time change by DashInterval?
if (rupeeDashTimer >= rdmTime) {
rupeeDashTimer = 0;
if (gSaveContext.rupees > 0) {
uint16_t walletSize = (CUR_UPG_VALUE(UPG_WALLET) + 1) * -1;
Rupees_ChangeBy(walletSize);
} else {
Health_ChangeBy(gPlayState, -16);
}
} else {
rupeeDashTimer++;
}
});
}
static bool hasAffectedHealth = false; static bool hasAffectedHealth = false;
void UpdatePermanentHeartLossState() { void UpdatePermanentHeartLossState() {
if (!GameInteractor::IsSaveLoaded()) if (!GameInteractor::IsSaveLoaded())
@ -982,7 +957,6 @@ void InitMods() {
TimeSavers_Register(); TimeSavers_Register();
RegisterTTS(); RegisterTTS();
RegisterOcarinaTimeTravel(); RegisterOcarinaTimeTravel();
RegisterRupeeDash();
RegisterPermanentHeartLoss(); RegisterPermanentHeartLoss();
RegisterDeleteFileOnDeath(); RegisterDeleteFileOnDeath();
RegisterHyperBosses(); RegisterHyperBosses();

View file

@ -1015,7 +1015,8 @@ static void RandomizeOwnDungeon(const Rando::DungeonInfo* dungeon) {
// filter out locations that may be required to have songs placed at them // filter out locations that may be required to have songs placed at them
dungeonLocations = FilterFromPool(dungeonLocations, [ctx](const auto loc) { dungeonLocations = FilterFromPool(dungeonLocations, [ctx](const auto loc) {
if (ctx->GetOption(RSK_SHUFFLE_SONGS).Is(RO_SONG_SHUFFLE_SONG_LOCATIONS)) { if (ctx->GetOption(RSK_SHUFFLE_SONGS).Is(RO_SONG_SHUFFLE_SONG_LOCATIONS) ||
ctx->GetOption(RSK_SHUFFLE_SONGS).Is(RO_SONG_SHUFFLE_OFF)) {
return !(Rando::StaticData::GetLocation(loc)->GetRCType() == RCTYPE_SONG_LOCATION); return !(Rando::StaticData::GetLocation(loc)->GetRCType() == RCTYPE_SONG_LOCATION);
} }
if (ctx->GetOption(RSK_SHUFFLE_SONGS).Is(RO_SONG_SHUFFLE_DUNGEON_REWARDS)) { if (ctx->GetOption(RSK_SHUFFLE_SONGS).Is(RO_SONG_SHUFFLE_DUNGEON_REWARDS)) {
@ -1344,8 +1345,8 @@ int Fill() {
StartPerformanceTimer(PT_LIMITED_CHECKS); StartPerformanceTimer(PT_LIMITED_CHECKS);
// Then Place songs if song shuffle is set to specific locations // Then Place songs if song shuffle is set to specific locations
if (ctx->GetOption(RSK_SHUFFLE_SONGS).IsNot(RO_SONG_SHUFFLE_ANYWHERE)) { if (ctx->GetOption(RSK_SHUFFLE_SONGS).IsNot(RO_SONG_SHUFFLE_ANYWHERE) &&
ctx->GetOption(RSK_SHUFFLE_SONGS).IsNot(RO_SONG_SHUFFLE_OFF)) {
// Get each song // Get each song
std::vector<RandomizerGet> songs = FilterAndEraseFromPool(ItemPool, [](const auto i) { std::vector<RandomizerGet> songs = FilterAndEraseFromPool(ItemPool, [](const auto i) {
return Rando::StaticData::RetrieveItem(i).GetItemType() == ITEMTYPE_SONG; return Rando::StaticData::RetrieveItem(i).GetItemType() == ITEMTYPE_SONG;

View file

@ -40,7 +40,7 @@ const CustomMessage& HintText::GetObscure() const {
return obscureText.size() > 0 ? RandomElement(obscureText) : clearText; return obscureText.size() > 0 ? RandomElement(obscureText) : clearText;
} }
const CustomMessage& HintText::GetObscure(uint8_t selection) const { const CustomMessage& HintText::GetObscure(size_t selection) const {
if (obscureText.size() > selection) { if (obscureText.size() > selection) {
return obscureText[selection]; return obscureText[selection];
} else if (obscureText.size() > 0) { } else if (obscureText.size() > 0) {
@ -53,7 +53,7 @@ const CustomMessage& HintText::GetAmbiguous() const {
return ambiguousText.size() > 0 ? RandomElement(ambiguousText) : clearText; return ambiguousText.size() > 0 ? RandomElement(ambiguousText) : clearText;
} }
const CustomMessage& HintText::GetAmbiguous(uint8_t selection) const { const CustomMessage& HintText::GetAmbiguous(size_t selection) const {
if (ambiguousText.size() > selection) { if (ambiguousText.size() > selection) {
return ambiguousText[selection]; return ambiguousText[selection];
} else if (ambiguousText.size() > 0) { } else if (ambiguousText.size() > 0) {
@ -62,15 +62,15 @@ const CustomMessage& HintText::GetAmbiguous(uint8_t selection) const {
return clearText; return clearText;
} }
uint8_t HintText::GetAmbiguousSize() const { size_t HintText::GetAmbiguousSize() const {
return static_cast<uint8_t>(ambiguousText.size()); return ambiguousText.size();
} }
uint8_t HintText::GetObscureSize() const { size_t HintText::GetObscureSize() const {
return static_cast<uint8_t>(obscureText.size()); return obscureText.size();
} }
const CustomMessage& HintText::GetHintMessage(uint8_t selection) const { const CustomMessage& HintText::GetHintMessage(size_t selection) const {
auto ctx = Rando::Context::GetInstance(); auto ctx = Rando::Context::GetInstance();
if (ctx->GetOption(RSK_HINT_CLARITY).Is(RO_HINT_CLARITY_OBSCURE)) { if (ctx->GetOption(RSK_HINT_CLARITY).Is(RO_HINT_CLARITY_OBSCURE)) {
return GetObscure(selection); return GetObscure(selection);

View file

@ -37,12 +37,12 @@ class HintText {
std::vector<CustomMessage> obscureText_ = {}); std::vector<CustomMessage> obscureText_ = {});
const CustomMessage& GetClear() const; const CustomMessage& GetClear() const;
const CustomMessage& GetObscure() const; const CustomMessage& GetObscure() const;
const CustomMessage& GetObscure(uint8_t selection) const; const CustomMessage& GetObscure(size_t selection) const;
const CustomMessage& GetAmbiguous() const; const CustomMessage& GetAmbiguous() const;
const CustomMessage& GetAmbiguous(uint8_t selection) const; const CustomMessage& GetAmbiguous(size_t selection) const;
uint8_t GetAmbiguousSize() const; size_t GetAmbiguousSize() const;
uint8_t GetObscureSize() const; size_t GetObscureSize() const;
const CustomMessage& GetHintMessage(uint8_t selection = 0) const; const CustomMessage& GetHintMessage(size_t selection = 0) const;
const CustomMessage GetMessageCopy() const; const CustomMessage GetMessageCopy() const;
bool operator==(const HintText& right) const; bool operator==(const HintText& right) const;
bool operator!=(const HintText& right) const; bool operator!=(const HintText& right) const;

View file

@ -1133,11 +1133,26 @@ void GenerateItemPool() {
} }
} }
// add extra songs only if song shuffle is anywhere if (ctx->GetOption(RSK_SHUFFLE_SONGS).IsNot(RO_SONG_SHUFFLE_OFF)) {
AddItemsToPool(ItemPool, songList); AddItemsToPool(ItemPool, songList);
if (ctx->GetOption(RSK_SHUFFLE_SONGS).Is(RO_SONG_SHUFFLE_ANYWHERE) && // add extra songs only if song shuffle is anywhere
ctx->GetOption(RSK_ITEM_POOL).Is(RO_ITEM_POOL_PLENTIFUL)) { if (ctx->GetOption(RSK_SHUFFLE_SONGS).Is(RO_SONG_SHUFFLE_ANYWHERE) &&
AddItemsToPool(PendingJunkPool, songList); ctx->GetOption(RSK_ITEM_POOL).Is(RO_ITEM_POOL_PLENTIFUL)) {
AddItemsToPool(PendingJunkPool, songList);
}
} else {
ctx->PlaceItemInLocation(RC_SHEIK_IN_FOREST, RG_MINUET_OF_FOREST, false, true);
ctx->PlaceItemInLocation(RC_SHEIK_IN_CRATER, RG_BOLERO_OF_FIRE, false, true);
ctx->PlaceItemInLocation(RC_SHEIK_IN_ICE_CAVERN, RG_SERENADE_OF_WATER, false, true);
ctx->PlaceItemInLocation(RC_SHEIK_AT_COLOSSUS, RG_REQUIEM_OF_SPIRIT, false, true);
ctx->PlaceItemInLocation(RC_SHEIK_IN_KAKARIKO, RG_NOCTURNE_OF_SHADOW, false, true);
ctx->PlaceItemInLocation(RC_SHEIK_AT_TEMPLE, RG_PRELUDE_OF_LIGHT, false, true);
ctx->PlaceItemInLocation(RC_SONG_FROM_IMPA, RG_ZELDAS_LULLABY, false, true);
ctx->PlaceItemInLocation(RC_SONG_FROM_MALON, RG_EPONAS_SONG, false, true);
ctx->PlaceItemInLocation(RC_SONG_FROM_SARIA, RG_SARIAS_SONG, false, true);
ctx->PlaceItemInLocation(RC_SONG_FROM_ROYAL_FAMILYS_TOMB, RG_SUNS_SONG, false, true);
ctx->PlaceItemInLocation(RC_SONG_FROM_OCARINA_OF_TIME, RG_SONG_OF_TIME, false, true);
ctx->PlaceItemInLocation(RC_SONG_FROM_WINDMILL, RG_SONG_OF_STORMS, false, true);
} }
/*For item pool generation, dungeon items are either placed in their vanilla /*For item pool generation, dungeon items are either placed in their vanilla

View file

@ -2,7 +2,7 @@
#include <z64.h> #include <z64.h>
#include "soh/Enhancements/item-tables/ItemTableTypes.h" #include "soh/Enhancements/item-tables/ItemTableTypes.h"
#include "randomizer_inf.h" #include "randomizerTypes.h"
typedef struct FairyIdentity { typedef struct FairyIdentity {
RandomizerInf randomizerInf; RandomizerInf randomizerInf;

View file

@ -0,0 +1,26 @@
#include "soh/ShipInit.hpp"
#include "location.h"
#include "static_data.h"
void Rando::StaticData::RegisterSongLocations() {
static bool registered = false;
if (registered)
return;
registered = true;
// clang-format off
locationTable[RC_SHEIK_IN_FOREST] = Location::Base(RC_SHEIK_IN_FOREST, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_SACRED_FOREST_MEADOW, 0x00, "Sheik in Forest", "Sheik in Forest", RHT_SHEIK_IN_FOREST, RG_MINUET_OF_FOREST, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_MINUET_OF_FOREST), true);
locationTable[RC_SHEIK_IN_CRATER] = Location::Base(RC_SHEIK_IN_CRATER, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_DEATH_MOUNTAIN_CRATER, 0x00, "Sheik in Crater", "Sheik in Crater", RHT_SHEIK_IN_CRATER, RG_BOLERO_OF_FIRE, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_BOLERO_OF_FIRE), true);
locationTable[RC_SHEIK_IN_ICE_CAVERN] = Location::Base(RC_SHEIK_IN_ICE_CAVERN, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_ICE_CAVERN, 0x00, "Sheik in Ice Cavern", "Sheik in Ice Cavern", RHT_SHEIK_IN_ICE_CAVERN, RG_SERENADE_OF_WATER, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_SERENADE_OF_WATER), true);
locationTable[RC_SHEIK_AT_COLOSSUS] = Location::Base(RC_SHEIK_AT_COLOSSUS, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_DESERT_COLOSSUS, 0x00, "Sheik at Colossus", "Sheik at Colossus", RHT_SHEIK_AT_COLOSSUS, RG_REQUIEM_OF_SPIRIT, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT), true);
locationTable[RC_SHEIK_IN_KAKARIKO] = Location::Base(RC_SHEIK_IN_KAKARIKO, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_KAKARIKO_VILLAGE, 0x00, "Sheik in Kakariko", "Sheik in Kakariko", RHT_SHEIK_IN_KAKARIKO, RG_NOCTURNE_OF_SHADOW, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL), true);
locationTable[RC_SHEIK_AT_TEMPLE] = Location::Base(RC_SHEIK_AT_TEMPLE, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_TEMPLE_OF_TIME, 0x00, "Sheik at Temple", "Sheik at Temple", RHT_SHEIK_AT_TEMPLE, RG_PRELUDE_OF_LIGHT, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT), true);
locationTable[RC_SONG_FROM_IMPA] = Location::Base(RC_SONG_FROM_IMPA, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, RCAREA_HYRULE_CASTLE, ACTOR_ID_MAX, SCENE_ID_MAX, 0x00, "Song from Impa", "Song from Impa", RHT_SONG_FROM_IMPA, RG_ZELDAS_LULLABY, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_ZELDAS_LULLABY), true);
locationTable[RC_SONG_FROM_MALON] = Location::Base(RC_SONG_FROM_MALON, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_LON_LON_RANCH, 0x00, "Song from Malon", "Song from Malon", RHT_SONG_FROM_MALON, RG_EPONAS_SONG, SpoilerCollectionCheck::RandomizerInf(RAND_INF_LEARNED_EPONA_SONG), true);
locationTable[RC_SONG_FROM_SARIA] = Location::Base(RC_SONG_FROM_SARIA, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_SACRED_FOREST_MEADOW, 0x00, "Song from Saria", "Song from Saria", RHT_SONG_FROM_SARIA, RG_SARIAS_SONG, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_SARIAS_SONG), true);
locationTable[RC_SONG_FROM_ROYAL_FAMILYS_TOMB] = Location::Base(RC_SONG_FROM_ROYAL_FAMILYS_TOMB, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_ROYAL_FAMILYS_TOMB, 0x00, "Song from Royal Family's Tomb", "Song from Royal Family's Tomb", RHT_SONG_FROM_ROYAL_FAMILYS_TOMB, RG_SUNS_SONG, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_SUNS_SONG), true);
locationTable[RC_SONG_FROM_OCARINA_OF_TIME] = Location::Base(RC_SONG_FROM_OCARINA_OF_TIME, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_HYRULE_FIELD, 0x00, "Song from Ocarina of Time", "Song from Ocarina of Time", RHT_SONG_FROM_OCARINA_OF_TIME, RG_SONG_OF_TIME, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_SONG_OF_TIME), true);
locationTable[RC_SONG_FROM_WINDMILL] = Location::Base(RC_SONG_FROM_WINDMILL, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, RCAREA_KAKARIKO_VILLAGE, ACTOR_ID_MAX, SCENE_WINDMILL_AND_DAMPES_GRAVE, 0x00, "Song from Windmill", "Song from Windmill", RHT_SONG_FROM_WINDMILL, RG_SONG_OF_STORMS, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_SONG_OF_STORMS), true);
// clang-format-on
}
static RegisterShipInitFunc initSongLocations(Rando::StaticData::RegisterSongLocations);

View file

@ -179,6 +179,7 @@ void Context::GenerateLocationPool() {
location.GetRandomizerCheck() == RC_LW_DEKU_SCRUB_NEAR_BRIDGE || location.GetRandomizerCheck() == RC_LW_DEKU_SCRUB_NEAR_BRIDGE ||
location.GetRandomizerCheck() == RC_HF_DEKU_SCRUB_GROTTO)) || location.GetRandomizerCheck() == RC_HF_DEKU_SCRUB_GROTTO)) ||
(location.GetRCType() == RCTYPE_ADULT_TRADE && mOptions[RSK_SHUFFLE_ADULT_TRADE].Is(RO_GENERIC_OFF)) || (location.GetRCType() == RCTYPE_ADULT_TRADE && mOptions[RSK_SHUFFLE_ADULT_TRADE].Is(RO_GENERIC_OFF)) ||
(location.GetRCType() == RCTYPE_SONG_LOCATION && mOptions[RSK_SHUFFLE_SONGS].Is(RO_SONG_SHUFFLE_OFF)) ||
(location.GetRCType() == RCTYPE_COW && mOptions[RSK_SHUFFLE_COWS].Is(RO_GENERIC_OFF)) || (location.GetRCType() == RCTYPE_COW && mOptions[RSK_SHUFFLE_COWS].Is(RO_GENERIC_OFF)) ||
(location.GetRandomizerCheck() == RC_LH_HYRULE_LOACH && (location.GetRandomizerCheck() == RC_LH_HYRULE_LOACH &&
mOptions[RSK_FISHSANITY].IsNot(RO_FISHSANITY_HYRULE_LOACH)) || mOptions[RSK_FISHSANITY].IsNot(RO_FISHSANITY_HYRULE_LOACH)) ||

View file

@ -174,8 +174,8 @@ void Hint::NamesChosen() {
auto ctx = Rando::Context::GetInstance(); auto ctx = Rando::Context::GetInstance();
std::vector<uint8_t> namesTemp = {}; std::vector<uint8_t> namesTemp = {};
bool saveNames = false; bool saveNames = false;
uint8_t numMessages = GetNumberOfMessages(); size_t numMessages = GetNumberOfMessages();
for (uint8_t c = 0; c < numMessages; c++) { for (size_t c = 0; c < numMessages; c++) {
uint8_t selection = GetRandomHintTextEntry(GetHintText(c)); uint8_t selection = GetRandomHintTextEntry(GetHintText(c));
if (selection > 0) { if (selection > 0) {
saveNames = true; saveNames = true;
@ -187,7 +187,7 @@ void Hint::NamesChosen() {
} }
if (hintType == HINT_TYPE_ITEM || hintType == HINT_TYPE_ITEM_AREA) { if (hintType == HINT_TYPE_ITEM || hintType == HINT_TYPE_ITEM_AREA) {
for (uint8_t c = 0; c < locations.size(); c++) { for (size_t c = 0; c < locations.size(); c++) {
namesTemp = {}; namesTemp = {};
saveNames = false; saveNames = false;
uint8_t selection = GetRandomHintTextEntry(GetItemHintText(c)); uint8_t selection = GetRandomHintTextEntry(GetItemHintText(c));
@ -218,7 +218,7 @@ void Hint::NamesChosen() {
} }
} }
uint8_t Hint::GetNumberOfMessages() const { size_t Hint::GetNumberOfMessages() const {
size_t numMessages = std::max(messages.size(), hintKeys.size()); size_t numMessages = std::max(messages.size(), hintKeys.size());
if (StaticData::staticHintInfoMap.contains(ownKey)) { if (StaticData::staticHintInfoMap.contains(ownKey)) {
numMessages = std::max(StaticData::staticHintInfoMap[ownKey].hintKeys.size(), numMessages); numMessages = std::max(StaticData::staticHintInfoMap[ownKey].hintKeys.size(), numMessages);
@ -226,20 +226,19 @@ uint8_t Hint::GetNumberOfMessages() const {
if (numMessages == 0) { if (numMessages == 0) {
numMessages = 1; // RANDOTODO make std::max actually fucking work for 3 arguments numMessages = 1; // RANDOTODO make std::max actually fucking work for 3 arguments
} }
// RANDOTODO will number of messages always be u8? return numMessages;
return static_cast<uint8_t>(numMessages);
} }
const std::vector<std::string> Hint::GetAllMessageStrings(MessageFormat format) const { const std::vector<std::string> Hint::GetAllMessageStrings(MessageFormat format) const {
std::vector<std::string> hintMessages = {}; std::vector<std::string> hintMessages = {};
uint8_t numMessages = GetNumberOfMessages(); size_t numMessages = GetNumberOfMessages();
for (int c = 0; c < numMessages; c++) { for (size_t c = 0; c < numMessages; c++) {
hintMessages.push_back(GetHintMessage(format, c).GetForCurrentLanguage(format)); hintMessages.push_back(GetHintMessage(format, c).GetForCurrentLanguage(format));
} }
return hintMessages; return hintMessages;
} }
const HintText Hint::GetHintText(uint8_t id) const { const HintText Hint::GetHintText(size_t id) const {
auto ctx = Rando::Context::GetInstance(); auto ctx = Rando::Context::GetInstance();
if (hintKeys.size() > id) { if (hintKeys.size() > id) {
return StaticData::hintTextTable[hintKeys[id]]; return StaticData::hintTextTable[hintKeys[id]];
@ -284,11 +283,11 @@ const HintText Hint::GetHintText(uint8_t id) const {
} }
} }
const CustomMessage Hint::GetHintMessage(MessageFormat format, uint8_t id) const { const CustomMessage Hint::GetHintMessage(MessageFormat format, size_t id) const {
auto ctx = Rando::Context::GetInstance(); auto ctx = Rando::Context::GetInstance();
CustomMessage hintText = CustomMessage(""); CustomMessage hintText = CustomMessage("");
uint8_t chosenMessage = 0; size_t chosenMessage = 0;
if (hintTextsChosen.size() > id) { if (hintTextsChosen.size() > id) {
chosenMessage = id; chosenMessage = id;
} }

View file

@ -23,10 +23,10 @@ class Hint {
void FillGapsInData(); void FillGapsInData();
void SetLocationsAsHinted() const; void SetLocationsAsHinted() const;
void NamesChosen(); void NamesChosen();
uint8_t GetNumberOfMessages() const; size_t GetNumberOfMessages() const;
const std::vector<std::string> GetAllMessageStrings(MessageFormat format = MF_AUTO_FORMAT) const; const std::vector<std::string> GetAllMessageStrings(MessageFormat format = MF_AUTO_FORMAT) const;
const CustomMessage GetHintMessage(MessageFormat format = MF_AUTO_FORMAT, uint8_t id = 0) const; const CustomMessage GetHintMessage(MessageFormat format = MF_AUTO_FORMAT, size_t id = 0) const;
const HintText GetHintText(uint8_t id = 0) const; const HintText GetHintText(size_t id = 0) const;
oJson toJSON(); oJson toJSON();
void logHint(oJson& jsonData); void logHint(oJson& jsonData);
const HintText GetItemHintText(uint8_t slot, bool mysterious = false) const; const HintText GetItemHintText(uint8_t slot, bool mysterious = false) const;

View file

@ -66,7 +66,7 @@ void RegionTable_Init_Kakariko() {
Entrance(RR_KAK_WINDMILL, []{return logic->CanOpenOverworldDoor(RG_WINDMILL_KEY);}), Entrance(RR_KAK_WINDMILL, []{return logic->CanOpenOverworldDoor(RG_WINDMILL_KEY);}),
Entrance(RR_KAK_BAZAAR, []{return logic->IsAdult && logic->AtDay && logic->CanOpenOverworldDoor(RG_KAK_BAZAAR_KEY);}), Entrance(RR_KAK_BAZAAR, []{return logic->IsAdult && logic->AtDay && logic->CanOpenOverworldDoor(RG_KAK_BAZAAR_KEY);}),
Entrance(RR_KAK_SHOOTING_GALLERY, []{return logic->IsAdult && logic->AtDay && logic->CanOpenOverworldDoor(RG_KAK_SHOOTING_GALLERY_KEY);}), Entrance(RR_KAK_SHOOTING_GALLERY, []{return logic->IsAdult && logic->AtDay && logic->CanOpenOverworldDoor(RG_KAK_SHOOTING_GALLERY_KEY);}),
Entrance(RR_KAK_WELL, []{return logic->IsAdult || logic->DrainWell || logic->CanUse(RG_IRON_BOOTS);}), Entrance(RR_KAK_WELL, []{return logic->IsAdult || logic->DrainWell || logic->CanUse(RG_IRON_BOOTS) || (ctx->GetTrickOption(RT_BOTTOM_OF_THE_WELL_NAVI_DIVE) && logic->IsChild && logic->HasItem(RG_BRONZE_SCALE) && logic->CanJumpslash());}),
Entrance(RR_KAK_POTION_SHOP_FRONT, []{return (logic->AtDay || logic->IsChild) && logic->CanOpenOverworldDoor(RG_KAK_POTION_SHOP_KEY);}), Entrance(RR_KAK_POTION_SHOP_FRONT, []{return (logic->AtDay || logic->IsChild) && logic->CanOpenOverworldDoor(RG_KAK_POTION_SHOP_KEY);}),
Entrance(RR_KAK_REDEAD_GROTTO, []{return logic->CanOpenBombGrotto();}), Entrance(RR_KAK_REDEAD_GROTTO, []{return logic->CanOpenBombGrotto();}),
Entrance(RR_KAK_IMPAS_LEDGE, []{return (logic->IsChild && logic->AtDay) || (logic->IsAdult && ctx->GetTrickOption(RT_VISIBLE_COLLISION));}), Entrance(RR_KAK_IMPAS_LEDGE, []{return (logic->IsChild && logic->AtDay) || (logic->IsAdult && ctx->GetTrickOption(RT_VISIBLE_COLLISION));}),

View file

@ -57,7 +57,7 @@ void RegionTable_Init_LostWoods() {
Entrance(RR_LW_FOREST_EXIT, []{return true;}), Entrance(RR_LW_FOREST_EXIT, []{return true;}),
Entrance(RR_GC_WOODS_WARP, []{return true;}), Entrance(RR_GC_WOODS_WARP, []{return true;}),
Entrance(RR_LW_BRIDGE, []{return logic->CanLeaveForest() && ((logic->IsAdult && (CanPlantBean(RR_THE_LOST_WOODS) || ctx->GetTrickOption(RT_LW_BRIDGE))) || logic->CanUse(RG_HOVER_BOOTS) || logic->CanUse(RG_LONGSHOT));}), Entrance(RR_LW_BRIDGE, []{return logic->CanLeaveForest() && ((logic->IsAdult && (CanPlantBean(RR_THE_LOST_WOODS) || ctx->GetTrickOption(RT_LW_BRIDGE))) || logic->CanUse(RG_HOVER_BOOTS) || logic->CanUse(RG_LONGSHOT));}),
Entrance(RR_ZORAS_RIVER, []{return logic->CanLeaveForest() && (logic->HasItem(RG_SILVER_SCALE) || logic->CanUse(RG_IRON_BOOTS));}), Entrance(RR_ZORAS_RIVER, []{return logic->CanLeaveForest() && (logic->HasItem(RG_SILVER_SCALE) || logic->CanUse(RG_IRON_BOOTS) || (ctx->GetTrickOption(RT_BOTTOM_OF_THE_WELL_NAVI_DIVE) && logic->IsChild && logic->HasItem(RG_BRONZE_SCALE) && logic->CanJumpslash()));}),
Entrance(RR_LW_BEYOND_MIDO, []{return logic->IsChild || logic->CanUse(RG_SARIAS_SONG) || ctx->GetTrickOption(RT_LW_MIDO_BACKFLIP);}), Entrance(RR_LW_BEYOND_MIDO, []{return logic->IsChild || logic->CanUse(RG_SARIAS_SONG) || ctx->GetTrickOption(RT_LW_MIDO_BACKFLIP);}),
Entrance(RR_LW_NEAR_SHORTCUTS_GROTTO, []{return Here(RR_THE_LOST_WOODS, []{return logic->BlastOrSmash();});}), Entrance(RR_LW_NEAR_SHORTCUTS_GROTTO, []{return Here(RR_THE_LOST_WOODS, []{return logic->BlastOrSmash();});}),
}); });

View file

@ -828,20 +828,6 @@ void Rando::StaticData::InitLocationTable() {
locationTable[RC_DMC_GREAT_FAIRY_REWARD] = Location::Base(RC_DMC_GREAT_FAIRY_REWARD, RCQUEST_BOTH, RCTYPE_STANDARD, RCAREA_DEATH_MOUNTAIN_CRATER, ACTOR_BG_DY_YOSEIZO, SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC, 2, "Great Fairy Reward", RHT_DMC_GREAT_FAIRY_REWARD, RG_PROGRESSIVE_MAGIC_METER, SpoilerCollectionCheck::RandomizerInf(RAND_INF_DMC_GREAT_FAIRY_REWARD), true); locationTable[RC_DMC_GREAT_FAIRY_REWARD] = Location::Base(RC_DMC_GREAT_FAIRY_REWARD, RCQUEST_BOTH, RCTYPE_STANDARD, RCAREA_DEATH_MOUNTAIN_CRATER, ACTOR_BG_DY_YOSEIZO, SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC, 2, "Great Fairy Reward", RHT_DMC_GREAT_FAIRY_REWARD, RG_PROGRESSIVE_MAGIC_METER, SpoilerCollectionCheck::RandomizerInf(RAND_INF_DMC_GREAT_FAIRY_REWARD), true);
locationTable[RC_OGC_GREAT_FAIRY_REWARD] = Location::Base(RC_OGC_GREAT_FAIRY_REWARD, RCQUEST_BOTH, RCTYPE_STANDARD, RCAREA_HYRULE_CASTLE, ACTOR_BG_DY_YOSEIZO, SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC, 3, "OGC Great Fairy Reward", "OGC Great Fairy Reward", RHT_OGC_GREAT_FAIRY_REWARD, RG_DOUBLE_DEFENSE, SpoilerCollectionCheck::RandomizerInf(RAND_INF_OGC_GREAT_FAIRY_REWARD), true); locationTable[RC_OGC_GREAT_FAIRY_REWARD] = Location::Base(RC_OGC_GREAT_FAIRY_REWARD, RCQUEST_BOTH, RCTYPE_STANDARD, RCAREA_HYRULE_CASTLE, ACTOR_BG_DY_YOSEIZO, SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC, 3, "OGC Great Fairy Reward", "OGC Great Fairy Reward", RHT_OGC_GREAT_FAIRY_REWARD, RG_DOUBLE_DEFENSE, SpoilerCollectionCheck::RandomizerInf(RAND_INF_OGC_GREAT_FAIRY_REWARD), true);
// Songs
locationTable[RC_SHEIK_IN_FOREST] = Location::Base(RC_SHEIK_IN_FOREST, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_SACRED_FOREST_MEADOW, 0x00, "Sheik in Forest", "Sheik in Forest", RHT_SHEIK_IN_FOREST, RG_MINUET_OF_FOREST, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_MINUET_OF_FOREST), true);
locationTable[RC_SHEIK_IN_CRATER] = Location::Base(RC_SHEIK_IN_CRATER, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_DEATH_MOUNTAIN_CRATER, 0x00, "Sheik in Crater", "Sheik in Crater", RHT_SHEIK_IN_CRATER, RG_BOLERO_OF_FIRE, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_BOLERO_OF_FIRE), true);
locationTable[RC_SHEIK_IN_ICE_CAVERN] = Location::Base(RC_SHEIK_IN_ICE_CAVERN, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_ICE_CAVERN, 0x00, "Sheik in Ice Cavern", "Sheik in Ice Cavern", RHT_SHEIK_IN_ICE_CAVERN, RG_SERENADE_OF_WATER, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_SERENADE_OF_WATER), true);
locationTable[RC_SHEIK_AT_COLOSSUS] = Location::Base(RC_SHEIK_AT_COLOSSUS, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_DESERT_COLOSSUS, 0x00, "Sheik at Colossus", "Sheik at Colossus", RHT_SHEIK_AT_COLOSSUS, RG_REQUIEM_OF_SPIRIT, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT), true);
locationTable[RC_SHEIK_IN_KAKARIKO] = Location::Base(RC_SHEIK_IN_KAKARIKO, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_KAKARIKO_VILLAGE, 0x00, "Sheik in Kakariko", "Sheik in Kakariko", RHT_SHEIK_IN_KAKARIKO, RG_NOCTURNE_OF_SHADOW, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL), true);
locationTable[RC_SHEIK_AT_TEMPLE] = Location::Base(RC_SHEIK_AT_TEMPLE, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_TEMPLE_OF_TIME, 0x00, "Sheik at Temple", "Sheik at Temple", RHT_SHEIK_AT_TEMPLE, RG_PRELUDE_OF_LIGHT, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT), true);
locationTable[RC_SONG_FROM_IMPA] = Location::Base(RC_SONG_FROM_IMPA, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, RCAREA_HYRULE_CASTLE, ACTOR_ID_MAX, SCENE_ID_MAX, 0x00, "Song from Impa", "Song from Impa", RHT_SONG_FROM_IMPA, RG_ZELDAS_LULLABY, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_ZELDAS_LULLABY), true);
locationTable[RC_SONG_FROM_MALON] = Location::Base(RC_SONG_FROM_MALON, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_LON_LON_RANCH, 0x00, "Song from Malon", "Song from Malon", RHT_SONG_FROM_MALON, RG_EPONAS_SONG, SpoilerCollectionCheck::RandomizerInf(RAND_INF_LEARNED_EPONA_SONG), true);
locationTable[RC_SONG_FROM_SARIA] = Location::Base(RC_SONG_FROM_SARIA, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_SACRED_FOREST_MEADOW, 0x00, "Song from Saria", "Song from Saria", RHT_SONG_FROM_SARIA, RG_SARIAS_SONG, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_SARIAS_SONG), true);
locationTable[RC_SONG_FROM_ROYAL_FAMILYS_TOMB] = Location::Base(RC_SONG_FROM_ROYAL_FAMILYS_TOMB, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_ROYAL_FAMILYS_TOMB, 0x00, "Song from Royal Family's Tomb", "Song from Royal Family's Tomb", RHT_SONG_FROM_ROYAL_FAMILYS_TOMB, RG_SUNS_SONG, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_SUNS_SONG), true);
locationTable[RC_SONG_FROM_OCARINA_OF_TIME] = Location::Base(RC_SONG_FROM_OCARINA_OF_TIME, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, ACTOR_ID_MAX, SCENE_HYRULE_FIELD, 0x00, "Song from Ocarina of Time", "Song from Ocarina of Time", RHT_SONG_FROM_OCARINA_OF_TIME, RG_SONG_OF_TIME, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_SONG_OF_TIME), true);
locationTable[RC_SONG_FROM_WINDMILL] = Location::Base(RC_SONG_FROM_WINDMILL, RCQUEST_BOTH, RCTYPE_SONG_LOCATION, RCAREA_KAKARIKO_VILLAGE, ACTOR_ID_MAX, SCENE_WINDMILL_AND_DAMPES_GRAVE, 0x00, "Song from Windmill", "Song from Windmill", RHT_SONG_FROM_WINDMILL, RG_SONG_OF_STORMS, SpoilerCollectionCheck::EventChkInf(EVENTCHKINF_LEARNED_SONG_OF_STORMS), true);
/*------------------------------- /*-------------------------------
--- SHOPS --- --- SHOPS ---
8 6 2 4 8 6 2 4

View file

@ -196,6 +196,8 @@ void Settings::CreateOptionDescriptions() {
mOptionDescriptions[RSK_MIX_INTERIOR_ENTRANCES] = "Interior entrances will be part of the mixed pool."; mOptionDescriptions[RSK_MIX_INTERIOR_ENTRANCES] = "Interior entrances will be part of the mixed pool.";
mOptionDescriptions[RSK_MIX_GROTTO_ENTRANCES] = "Grotto entrances will be part of the mixed pool."; mOptionDescriptions[RSK_MIX_GROTTO_ENTRANCES] = "Grotto entrances will be part of the mixed pool.";
mOptionDescriptions[RSK_SHUFFLE_SONGS] = mOptionDescriptions[RSK_SHUFFLE_SONGS] =
"Off - Songs will appear at their vanilla locations.\n"
"\n"
"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"

View file

@ -26,6 +26,7 @@
#include <tuple> #include <tuple>
#include <functional> #include <functional>
#include "draw.h" #include "draw.h"
#include "soh/OTRGlobals.h"
#include "soh/SohGui/UIWidgets.hpp" #include "soh/SohGui/UIWidgets.hpp"
#include "static_data.h" #include "static_data.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor.h"
@ -3643,14 +3644,8 @@ bool GenerateRandomizer(std::string seed /*= ""*/) {
return false; return false;
} }
static const std::unordered_map<int32_t, const char*> randomizerPresetList = { static bool locationsTabOpen = false;
{ RANDOMIZER_PRESET_DEFAULT, "Default" }, static bool tricksTabOpen = false;
{ RANDOMIZER_PRESET_BEGINNER, "Beginner" },
{ RANDOMIZER_PRESET_STANDARD, "Standard" },
{ RANDOMIZER_PRESET_ADVANCED, "Advanced" },
{ RANDOMIZER_PRESET_HELL_MODE, "Hell Mode" }
};
static int32_t randomizerPresetSelected = RANDOMIZER_PRESET_DEFAULT;
void RandomizerSettingsWindow::DrawElement() { void RandomizerSettingsWindow::DrawElement() {
auto ctx = Rando::Context::GetInstance(); auto ctx = Rando::Context::GetInstance();
@ -3658,53 +3653,12 @@ void RandomizerSettingsWindow::DrawElement() {
generated = 0; generated = 0;
randoThread.join(); randoThread.join();
} }
static bool locationsTabOpen = false; bool generating = CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0);
static bool tricksTabOpen = false; bool disableEditingRandoSettings = generating || CVarGetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0);
bool disableEditingRandoSettings =
CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0) || CVarGetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0);
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) || disableEditingRandoSettings);
const PresetTypeDefinition presetTypeDef = presetTypes.at(PRESET_TYPE_RANDOMIZER);
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);
}
const std::string presetTypeCvar = CVAR_GENERAL("SelectedPresets.") + std::to_string(PRESET_TYPE_RANDOMIZER);
randomizerPresetSelected = CVarGetInteger(presetTypeCvar.c_str(), RANDOMIZER_PRESET_DEFAULT);
if (UIWidgets::Combobox("Randomizer Presets", &randomizerPresetSelected, randomizerPresetList, DrawPresetSelector({ PRESET_SECTION_RANDOMIZER }, "Randomizer", generating);
UIWidgets::ComboboxOptions()
.DefaultIndex(RANDOMIZER_PRESET_DEFAULT)
.Tooltip(comboboxTooltip.c_str())
.Color(THEME_COLOR))) {
CVarSetInteger(presetTypeCvar.c_str(), randomizerPresetSelected);
}
ImGui::SameLine();
ImGui::SetCursorPosY(ImGui::GetCursorPos().y + 35.f);
if (UIWidgets::Button(
"Apply Preset##Randomizer",
UIWidgets::ButtonOptions().Color(THEME_COLOR).Size(UIWidgets::Sizes::Inline).Padding(ImVec2(10.f, 6.f)))) {
if (randomizerPresetSelected >= presetTypeDef.presets.size()) {
randomizerPresetSelected = 0;
}
const PresetDefinition selectedPresetDef = presetTypeDef.presets.at(randomizerPresetSelected);
for (const char* block : presetTypeDef.blocksToClear) {
CVarClearBlock(block);
}
if (randomizerPresetSelected != 0) {
applyPreset(selectedPresetDef.entries);
}
CVarSetInteger(presetTypeCvar.c_str(), randomizerPresetSelected);
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
mSettings->UpdateOptionProperties();
// force excluded location list and trick list update if tab is open.
locationsTabOpen = false;
tricksTabOpen = false;
}
ImGui::EndDisabled();
UIWidgets::Spacer(0); // UIWidgets::Spacer(0);
UIWidgets::CVarCheckbox("Manual seed entry", CVAR_RANDOMIZER_SETTING("ManualSeedEntry"), UIWidgets::CVarCheckbox("Manual seed entry", CVAR_RANDOMIZER_SETTING("ManualSeedEntry"),
UIWidgets::CheckboxOptions().Color(THEME_COLOR)); UIWidgets::CheckboxOptions().Color(THEME_COLOR));
if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ManualSeedEntry"), 0)) { if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ManualSeedEntry"), 0)) {
@ -3754,10 +3708,6 @@ void RandomizerSettingsWindow::DrawElement() {
ImGui::Text("Spoiler File: %s", spoilerfilepath.c_str()); ImGui::Text("Spoiler File: %s", spoilerfilepath.c_str());
} }
// RANDOTODO settings presets
// std::string presetfilepath = CVarGetString(CVAR_RANDOMIZER_SETTING("LoadedPreset"), "");
// ImGui::Text("Settings File: %s", presetfilepath.c_str());
UIWidgets::Separator(true, true, 0.f, 0.f); UIWidgets::Separator(true, true, 0.f, 0.f);
ImGuiWindow* window = ImGui::GetCurrentWindow(); ImGuiWindow* window = ImGui::GetCurrentWindow();
@ -4367,9 +4317,17 @@ void RandomizerSettingsWindow::DrawElement() {
UIWidgets::PopStyleTabs(); UIWidgets::PopStyleTabs();
} }
void RandomizerSettingsWindow::SetNeedsUpdate() {
mNeedsUpdate = true;
}
void RandomizerSettingsWindow::UpdateElement() { void RandomizerSettingsWindow::UpdateElement() {
if (mNeedsUpdate) { if (mNeedsUpdate) {
RandomizerCheckObjects::UpdateImGuiVisibility();
mSettings->UpdateOptionProperties(); mSettings->UpdateOptionProperties();
locationsTabOpen = false;
tricksTabOpen = false;
mNeedsUpdate = false;
} }
} }

View file

@ -2,7 +2,6 @@
#include <stdint.h> #include <stdint.h>
#include "z64item.h" #include "z64item.h"
#include "randomizer_inf.h"
#define MAX_TRICK_NAME_SIZE 50 #define MAX_TRICK_NAME_SIZE 50
@ -214,6 +213,15 @@ typedef enum {
LOGIC_MAX LOGIC_MAX
} LogicVal; } LogicVal;
#define DEFINE_RAND_INF(enum) enum,
typedef enum {
#include "randomizer_inf.h"
RAND_INF_MAX,
} RandomizerInf;
#undef DEFINE_RAND_INF
typedef enum { typedef enum {
RA_NONE, RA_NONE,
RA_LINKS_POCKET, RA_LINKS_POCKET,
@ -3697,6 +3705,8 @@ typedef enum {
RT_MEGASIDEHOP_BOMB, RT_MEGASIDEHOP_BOMB,
RT_MEGASIDEHOP_BOMBCHU, RT_MEGASIDEHOP_BOMBCHU,
RT_NAVI_DIVE, RT_NAVI_DIVE,
RT_BOTTOM_OF_THE_WELL_NAVI_DIVE,
RT_LOST_WOOD_NAVI_DIVE,
RT_OCARINA_ITEMS, RT_OCARINA_ITEMS,
RT_OCARINA_ITEMS_BOMB, RT_OCARINA_ITEMS_BOMB,
RT_OCARINA_ITEMS_ESS, RT_OCARINA_ITEMS_ESS,
@ -6139,6 +6149,7 @@ typedef enum {
// Song shuffle Settings (Song locations, Dungeon rewards, anywhere) // Song shuffle Settings (Song locations, Dungeon rewards, anywhere)
typedef enum { typedef enum {
RO_SONG_SHUFFLE_OFF,
RO_SONG_SHUFFLE_SONG_LOCATIONS, RO_SONG_SHUFFLE_SONG_LOCATIONS,
RO_SONG_SHUFFLE_DUNGEON_REWARDS, RO_SONG_SHUFFLE_DUNGEON_REWARDS,
RO_SONG_SHUFFLE_ANYWHERE, RO_SONG_SHUFFLE_ANYWHERE,

View file

@ -137,8 +137,10 @@ void RandomizerCheckObjects::UpdateImGuiVisibility() {
CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleMerchants"), RO_SHUFFLE_MERCHANTS_OFF) != CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleMerchants"), RO_SHUFFLE_MERCHANTS_OFF) !=
RO_SHUFFLE_MERCHANTS_OFF) && RO_SHUFFLE_MERCHANTS_OFF) &&
(location.GetRCType() != RCTYPE_SONG_LOCATION || (location.GetRCType() != RCTYPE_SONG_LOCATION ||
CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleSongs"), RO_SONG_SHUFFLE_SONG_LOCATIONS) != (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleSongs"), RO_SONG_SHUFFLE_SONG_LOCATIONS) !=
RO_SONG_SHUFFLE_SONG_LOCATIONS) && // song locations RO_SONG_SHUFFLE_SONG_LOCATIONS &&
CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleSongs"), RO_SONG_SHUFFLE_SONG_LOCATIONS) !=
RO_SONG_SHUFFLE_OFF)) && // song locations
((location.GetRCType() != RCTYPE_BOSS_HEART_OR_OTHER_REWARD && ((location.GetRCType() != RCTYPE_BOSS_HEART_OR_OTHER_REWARD &&
location.GetRandomizerCheck() != RC_SONG_FROM_IMPA && location.GetRandomizerCheck() != RC_SONG_FROM_IMPA &&
location.GetRandomizerCheck() != RC_SHEIK_IN_ICE_CAVERN) || location.GetRandomizerCheck() != RC_SHEIK_IN_ICE_CAVERN) ||

View file

@ -51,6 +51,7 @@ bool showBeans;
bool showScrubs; bool showScrubs;
bool showMajorScrubs; bool showMajorScrubs;
bool showMerchants; bool showMerchants;
bool showSongs;
bool showBeehives; bool showBeehives;
bool showCows; bool showCows;
bool showOverworldFreestanding; bool showOverworldFreestanding;
@ -91,6 +92,10 @@ bool previousShowHidden = false;
bool hideShopUnshuffledChecks = false; bool hideShopUnshuffledChecks = false;
bool alwaysShowGS = false; bool alwaysShowGS = false;
static bool presetLoaded = false;
static ImVec2 presetPos;
static ImVec2 presetSize;
std::map<uint32_t, RandomizerCheck> startingShopItem = { std::map<uint32_t, RandomizerCheck> startingShopItem = {
{ SCENE_KOKIRI_SHOP, RC_KF_SHOP_ITEM_1 }, { SCENE_KOKIRI_SHOP, RC_KF_SHOP_ITEM_1 },
{ SCENE_BAZAAR, RC_MARKET_BAZAAR_ITEM_1 }, { SCENE_BAZAAR, RC_MARKET_BAZAAR_ITEM_1 },
@ -979,7 +984,13 @@ void CheckTrackerWindow::DrawElement() {
} }
} }
ImGui::SetNextWindowSize(ImVec2(400, 540), ImGuiCond_FirstUseEver); if (presetLoaded) {
ImGui::SetNextWindowSize(presetSize);
ImGui::SetNextWindowPos(presetPos);
presetLoaded = false;
} else {
ImGui::SetNextWindowSize(ImVec2(400, 540), ImGuiCond_FirstUseEver);
}
BeginFloatWindows("Check Tracker", mIsVisible, ImGuiWindowFlags_NoScrollbar); BeginFloatWindows("Check Tracker", mIsVisible, ImGuiWindowFlags_NoScrollbar);
if (!GameInteractor::IsSaveLoaded() || !initialized) { if (!GameInteractor::IsSaveLoaded() || !initialized) {
@ -1296,6 +1307,9 @@ void LoadSettings() {
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_MERCHANTS) == OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_MERCHANTS) ==
RO_SHUFFLE_MERCHANTS_ALL RO_SHUFFLE_MERCHANTS_ALL
: true; : true;
showSongs = IS_RANDO
? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_SONGS) != RO_SONG_SHUFFLE_OFF
: false;
showBeehives = IS_RANDO showBeehives = IS_RANDO
? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_BEEHIVES) == RO_GENERIC_YES ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_BEEHIVES) == RO_GENERIC_YES
: false; : false;
@ -1506,6 +1520,7 @@ bool IsCheckShuffled(RandomizerCheck rc) {
(showMajorScrubs && (rc == RC_LW_DEKU_SCRUB_NEAR_BRIDGE || // The 3 scrubs that are always randomized (showMajorScrubs && (rc == RC_LW_DEKU_SCRUB_NEAR_BRIDGE || // The 3 scrubs that are always randomized
rc == RC_HF_DEKU_SCRUB_GROTTO || rc == RC_LW_DEKU_SCRUB_GROTTO_FRONT))) && rc == RC_HF_DEKU_SCRUB_GROTTO || rc == RC_LW_DEKU_SCRUB_GROTTO_FRONT))) &&
(loc->GetRCType() != RCTYPE_MERCHANT || showMerchants) && (loc->GetRCType() != RCTYPE_MERCHANT || showMerchants) &&
(loc->GetRCType() != RCTYPE_SONG_LOCATION || showSongs) &&
(loc->GetRCType() != RCTYPE_BEEHIVE || showBeehives) && (loc->GetRCType() != RCTYPE_BEEHIVE || showBeehives) &&
(loc->GetRCType() != RCTYPE_OCARINA || showOcarinas) && (loc->GetRCType() != RCTYPE_OCARINA || showOcarinas) &&
(loc->GetRCType() != RCTYPE_SKULL_TOKEN || alwaysShowGS || (loc->GetRCType() != RCTYPE_SKULL_TOKEN || alwaysShowGS ||
@ -2000,6 +2015,12 @@ void RecalculateAvailableChecks() {
GetPerformanceTimer(PT_RECALCULATE_AVAILABLE_CHECKS).count()); GetPerformanceTimer(PT_RECALCULATE_AVAILABLE_CHECKS).count());
} }
void CheckTracker_LoadFromPreset(nlohmann::json info) {
presetLoaded = true;
presetPos = { info["pos"]["x"], info["pos"]["y"] };
presetSize = { info["size"]["width"], info["size"]["height"] };
}
void CheckTrackerWindow::Draw() { void CheckTrackerWindow::Draw() {
if (!IsVisible()) { if (!IsVisible()) {
return; return;

View file

@ -62,4 +62,5 @@ void UpdateAllAreas();
void RecalculateAllAreaTotals(); void RecalculateAllAreaTotals();
void SpoilAreaFromCheck(RandomizerCheck rc); void SpoilAreaFromCheck(RandomizerCheck rc);
void RecalculateAvailableChecks(); void RecalculateAvailableChecks();
void CheckTracker_LoadFromPreset(nlohmann::json info);
} // namespace CheckTracker } // namespace CheckTracker

View file

@ -39,6 +39,10 @@ static s16 lastEntranceIndex = -1;
static s16 currentGrottoId = -1; static s16 currentGrottoId = -1;
static s16 lastSceneOrEntranceDetected = -1; static s16 lastSceneOrEntranceDetected = -1;
static bool presetLoaded = false;
static ImVec2 presetPos;
static ImVec2 presetSize;
static std::string spoilerEntranceGroupNames[] = { static std::string spoilerEntranceGroupNames[] = {
"Spawns/Warp Songs/Owls", "Spawns/Warp Songs/Owls",
"Kokiri Forest", "Kokiri Forest",
@ -445,6 +449,12 @@ const EntranceData* GetEntranceData(s16 index) {
return nullptr; return nullptr;
} }
void EntranceTracker_LoadFromPreset(nlohmann::json info) {
presetLoaded = true;
presetPos = { info["pos"]["x"], info["pos"]["y"] };
presetSize = { info["size"]["width"], info["size"]["height"] };
}
// Used for verifying the names on both sides of entrance pairs match. Keeping for ease of use for further name changes // Used for verifying the names on both sides of entrance pairs match. Keeping for ease of use for further name changes
// later // later
// TODO: Figure out how to remove the need for duplicate entrance names so this is no longer necessary // TODO: Figure out how to remove the need for duplicate entrance names so this is no longer necessary
@ -757,7 +767,13 @@ void EntranceTrackerWindow::Draw() {
} }
void EntranceTrackerWindow::DrawElement() { void EntranceTrackerWindow::DrawElement() {
ImGui::SetNextWindowSize(ImVec2(600, 375), ImGuiCond_FirstUseEver); if (presetLoaded) {
ImGui::SetNextWindowSize(presetSize);
ImGui::SetNextWindowPos(presetPos);
presetLoaded = false;
} else {
ImGui::SetNextWindowSize(ImVec2(600, 375), ImGuiCond_FirstUseEver);
}
if (!ImGui::Begin("Entrance Tracker", &mIsVisible, ImGuiWindowFlags_NoFocusOnAppearing)) { if (!ImGui::Begin("Entrance Tracker", &mIsVisible, ImGuiWindowFlags_NoFocusOnAppearing)) {
ImGui::End(); ImGui::End();

View file

@ -90,6 +90,7 @@ void InitEntranceTrackingData();
s16 GetLastEntranceOverride(); s16 GetLastEntranceOverride();
s16 GetCurrentGrottoId(); s16 GetCurrentGrottoId();
const EntranceData* GetEntranceData(s16); const EntranceData* GetEntranceData(s16);
void EntranceTracker_LoadFromPreset(nlohmann::json info);
class EntranceTrackerSettingsWindow final : public Ship::GuiWindow { class EntranceTrackerSettingsWindow final : public Ship::GuiWindow {
public: public:

File diff suppressed because it is too large Load diff

View file

@ -375,6 +375,10 @@ uint32_t notesIdleFrames = 0;
bool notesNeedSave = false; bool notesNeedSave = false;
const uint32_t notesMaxIdleFrames = 40; // two seconds of game time, since OnGameFrameUpdate is used to tick const uint32_t notesMaxIdleFrames = 40; // two seconds of game time, since OnGameFrameUpdate is used to tick
static bool presetLoaded = false;
static std::unordered_map<std::string, ImVec2> presetPos;
static std::unordered_map<std::string, ImVec2> presetSize;
void ItemTrackerOnFrame() { void ItemTrackerOnFrame() {
if (notesNeedSave && notesIdleFrames <= notesMaxIdleFrames) { if (notesNeedSave && notesIdleFrames <= notesMaxIdleFrames) {
notesIdleFrames++; notesIdleFrames++;
@ -398,6 +402,16 @@ bool HasEquipment(ItemTrackerItem item) {
return GameInteractor::IsSaveLoaded() ? (item.data & gSaveContext.inventory.equipment) : false; return GameInteractor::IsSaveLoaded() ? (item.data & gSaveContext.inventory.equipment) : false;
} }
void ItemTracker_LoadFromPreset(nlohmann::json trackerInfo) {
presetLoaded = true;
for (auto window : itemTrackerWindowIDs) {
if (trackerInfo.contains(window)) {
presetPos[window] = { trackerInfo[window]["pos"]["x"], trackerInfo[window]["pos"]["y"] };
presetSize[window] = { trackerInfo[window]["size"]["width"], trackerInfo[window]["size"]["height"] };
}
}
}
ItemTrackerNumbers GetItemCurrentAndMax(ItemTrackerItem item) { ItemTrackerNumbers GetItemCurrentAndMax(ItemTrackerItem item) {
ItemTrackerNumbers result; ItemTrackerNumbers result;
result.currentCapacity = 0; result.currentCapacity = 0;
@ -1171,6 +1185,12 @@ void BeginFloatingWindows(std::string UniqueName, ImGuiWindowFlags flags = 0) {
ImGui::PushStyleColor(ImGuiCol_WindowBg, color); ImGui::PushStyleColor(ImGuiCol_WindowBg, color);
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0)); ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 4.0f); ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 4.0f);
if (presetLoaded && presetPos.contains(UniqueName)) {
ImGui::SetNextWindowSize(presetSize[UniqueName]);
ImGui::SetNextWindowPos(presetPos[UniqueName]);
presetSize.erase(UniqueName);
presetPos.erase(UniqueName);
}
ImGui::Begin(UniqueName.c_str(), nullptr, windowFlags); ImGui::Begin(UniqueName.c_str(), nullptr, windowFlags);
} }
void EndFloatingWindows() { void EndFloatingWindows() {
@ -1525,7 +1545,7 @@ void ItemTrackerWindow::DrawElement() {
SECTION_DISPLAY_EXTENDED_MAIN_WINDOW) || SECTION_DISPLAY_EXTENDED_MAIN_WINDOW) ||
(CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Notes"), SECTION_DISPLAY_HIDDEN) == (CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Notes"), SECTION_DISPLAY_HIDDEN) ==
SECTION_DISPLAY_MAIN_WINDOW)) { SECTION_DISPLAY_MAIN_WINDOW)) {
BeginFloatingWindows("Item Tracker##main window"); BeginFloatingWindows("Item Tracker");
DrawItemsInRows(mainWindowItems, 6); DrawItemsInRows(mainWindowItems, 6);
if (CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Notes"), SECTION_DISPLAY_HIDDEN) == if (CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Notes"), SECTION_DISPLAY_HIDDEN) ==
@ -1659,6 +1679,10 @@ void ItemTrackerWindow::DrawElement() {
EndFloatingWindows(); EndFloatingWindows();
} }
} }
if (presetLoaded) {
shouldUpdateVectors = true;
presetLoaded = false;
}
} }
static std::unordered_map<int32_t, const char*> itemTrackerCapacityTrackOptions = { static std::unordered_map<int32_t, const char*> itemTrackerCapacityTrackOptions = {

View file

@ -25,6 +25,23 @@ bool HasEquipment(ItemTrackerItem);
#define ITEM_TRACKER_ITEM_CUSTOM(id, name, nameFaded, data, drawFunc) \ #define ITEM_TRACKER_ITEM_CUSTOM(id, name, nameFaded, data, drawFunc) \
{ id, #name, #nameFaded "_Faded", data, drawFunc } { id, #name, #nameFaded "_Faded", data, drawFunc }
static std::vector<const char*> itemTrackerWindowIDs = { "Item Tracker",
"Inventory Items Tracker",
"Equipment Items Tracker",
"Misc Items Tracker",
"Dungeon Rewards Tracker",
"Songs Tracker",
"Dungeon Items Tracker",
"Greg Tracker",
"Triforce Piece Tracker",
"Boss Soul Tracker",
"Ocarina Button Tracker",
"Overworld Key Tracker",
"Fishing Pole Tracker",
"Personal Notes",
"Total Checks" };
void ItemTracker_LoadFromPreset(nlohmann::json trackerInfo);
typedef struct ItemTrackerDungeon { typedef struct ItemTrackerDungeon {
uint32_t id; uint32_t id;
std::vector<uint32_t> items; std::vector<uint32_t> items;

View file

@ -13,6 +13,7 @@ class RandomizerSettingsWindow final : public Ship::GuiWindow {
void InitElement() override; void InitElement() override;
void DrawElement() override; void DrawElement() override;
void UpdateElement() override; void UpdateElement() override;
void SetNeedsUpdate();
private: private:
bool mNeedsUpdate = false; bool mNeedsUpdate = false;

View file

@ -177,7 +177,7 @@ void Settings::CreateOptions() {
OPT_U8(RSK_MQ_GANONS_CASTLE, "Ganon's Castle Quest", {"Vanilla", "Master Quest", "Random"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("MQDungeonsGanonsCastle"), "", WidgetType::Combobox, RO_MQ_SET_VANILLA); OPT_U8(RSK_MQ_GANONS_CASTLE, "Ganon's Castle Quest", {"Vanilla", "Master Quest", "Random"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("MQDungeonsGanonsCastle"), "", WidgetType::Combobox, RO_MQ_SET_VANILLA);
OPT_U8(RSK_SHUFFLE_DUNGEON_REWARDS, "Shuffle Dungeon Rewards", {"Vanilla", "End of Dungeons", "Any Dungeon", "Overworld", "Anywhere"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("ShuffleDungeonReward"), mOptionDescriptions[RSK_SHUFFLE_DUNGEON_REWARDS], WidgetType::Combobox, RO_DUNGEON_REWARDS_END_OF_DUNGEON); OPT_U8(RSK_SHUFFLE_DUNGEON_REWARDS, "Shuffle Dungeon Rewards", {"Vanilla", "End of Dungeons", "Any Dungeon", "Overworld", "Anywhere"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("ShuffleDungeonReward"), mOptionDescriptions[RSK_SHUFFLE_DUNGEON_REWARDS], WidgetType::Combobox, RO_DUNGEON_REWARDS_END_OF_DUNGEON);
OPT_U8(RSK_LINKS_POCKET, "Link's Pocket", {"Dungeon Reward", "Advancement", "Anything", "Nothing"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("LinksPocket"), "", WidgetType::Combobox, RO_LINKS_POCKET_DUNGEON_REWARD); OPT_U8(RSK_LINKS_POCKET, "Link's Pocket", {"Dungeon Reward", "Advancement", "Anything", "Nothing"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("LinksPocket"), "", WidgetType::Combobox, RO_LINKS_POCKET_DUNGEON_REWARD);
OPT_U8(RSK_SHUFFLE_SONGS, "Shuffle Songs", {"Song Locations", "Dungeon Rewards", "Anywhere"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("ShuffleSongs"), mOptionDescriptions[RSK_SHUFFLE_SONGS], WidgetType::Combobox, RO_SONG_SHUFFLE_SONG_LOCATIONS); OPT_U8(RSK_SHUFFLE_SONGS, "Shuffle Songs", {"Off", "Song Locations", "Dungeon Rewards", "Anywhere"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("ShuffleSongs"), mOptionDescriptions[RSK_SHUFFLE_SONGS], WidgetType::Combobox, RO_SONG_SHUFFLE_SONG_LOCATIONS);
OPT_U8(RSK_SHOPSANITY, "Shop Shuffle", {"Off", "Specific Count", "Random"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("Shopsanity"), mOptionDescriptions[RSK_SHOPSANITY], WidgetType::Combobox, RO_SHOPSANITY_OFF); OPT_U8(RSK_SHOPSANITY, "Shop Shuffle", {"Off", "Specific Count", "Random"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("Shopsanity"), mOptionDescriptions[RSK_SHOPSANITY], WidgetType::Combobox, RO_SHOPSANITY_OFF);
OPT_U8(RSK_SHOPSANITY_COUNT, "Shops Item Count", {NumOpts(0, 7/*8*/)}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("ShopsanityCount"), mOptionDescriptions[RSK_SHOPSANITY_COUNT], WidgetType::Slider, 0, false, IMFLAG_NONE); OPT_U8(RSK_SHOPSANITY_COUNT, "Shops Item Count", {NumOpts(0, 7/*8*/)}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("ShopsanityCount"), mOptionDescriptions[RSK_SHOPSANITY_COUNT], WidgetType::Slider, 0, false, IMFLAG_NONE);
OPT_U8(RSK_SHOPSANITY_PRICES, "Shops Prices", {"Vanilla", "Cheap Balanced", "Balanced", "Fixed", "Range", "Set By Wallet"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("ShopsanityPrices"), mOptionDescriptions[RSK_SHOPSANITY_PRICES], WidgetType::Combobox, RO_PRICE_VANILLA, false, IMFLAG_NONE); OPT_U8(RSK_SHOPSANITY_PRICES, "Shops Prices", {"Vanilla", "Cheap Balanced", "Balanced", "Fixed", "Range", "Set By Wallet"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("ShopsanityPrices"), mOptionDescriptions[RSK_SHOPSANITY_PRICES], WidgetType::Combobox, RO_PRICE_VANILLA, false, IMFLAG_NONE);
@ -410,6 +410,8 @@ void Settings::CreateOptions() {
"Hover Boots, or Bean."); "Hover Boots, or Bean.");
OPT_TRICK(RT_LW_MIDO_BACKFLIP, RCQUEST_BOTH, RA_THE_LOST_WOODS, { Tricks::Tag::NOVICE }, OPT_TRICK(RT_LW_MIDO_BACKFLIP, RCQUEST_BOTH, RA_THE_LOST_WOODS, { Tricks::Tag::NOVICE },
"Backflip over Mido as Adult", "With a specific position and angle, you can backflip over Mido."); "Backflip over Mido as Adult", "With a specific position and angle, you can backflip over Mido.");
OPT_TRICK(RT_LOST_WOOD_NAVI_DIVE, RCQUEST_BOTH, RA_THE_LOST_WOODS, { Tricks::Tag::NOVICE }, "Lost Woods Navi dive",
"You need Deku Sticks or Kokiri Sword to dive with Navi for entering Zora's River.");
OPT_TRICK(RT_LW_GS_BEAN, RCQUEST_BOTH, RA_THE_LOST_WOODS, { Tricks::Tag::INTERMEDIATE }, OPT_TRICK(RT_LW_GS_BEAN, RCQUEST_BOTH, RA_THE_LOST_WOODS, { Tricks::Tag::INTERMEDIATE },
"Lost Woods Adult GS without Bean", "Lost Woods Adult GS without Bean",
"You can collect the token with a precise Hookshot use, as long as you can kill the Skulltula somehow " "You can collect the token with a precise Hookshot use, as long as you can kill the Skulltula somehow "
@ -705,6 +707,9 @@ void Settings::CreateOptions() {
OPT_TRICK(RT_LENS_BOTW, RCQUEST_VANILLA, RA_BOTTOM_OF_THE_WELL, { Tricks::Tag::NOVICE }, OPT_TRICK(RT_LENS_BOTW, RCQUEST_VANILLA, RA_BOTTOM_OF_THE_WELL, { Tricks::Tag::NOVICE },
"Bottom of the Well without Lens of Truth", "Bottom of the Well without Lens of Truth",
"Removes the requirements for the Lens of Truth in Bottom of the Well."); "Removes the requirements for the Lens of Truth in Bottom of the Well.");
OPT_TRICK(RT_BOTTOM_OF_THE_WELL_NAVI_DIVE, RCQUEST_BOTH, RA_BOTTOM_OF_THE_WELL, { Tricks::Tag::NOVICE },
"Bottom of the Well Navi dive",
"You need Deku Sticks or Kokiri Sword to dive with Navi for entering Bottom of the Well.");
OPT_TRICK(RT_BOTW_CHILD_DEADHAND, RCQUEST_BOTH, RA_BOTTOM_OF_THE_WELL, { Tricks::Tag::NOVICE }, OPT_TRICK(RT_BOTW_CHILD_DEADHAND, RCQUEST_BOTH, RA_BOTTOM_OF_THE_WELL, { Tricks::Tag::NOVICE },
"Child Dead Hand without Kokiri Sword", "Requires 9 sticks or 5 jump slashes."); "Child Dead Hand without Kokiri Sword", "Requires 9 sticks or 5 jump slashes.");
OPT_TRICK(RT_BOTW_BASEMENT, RCQUEST_VANILLA, RA_BOTTOM_OF_THE_WELL, { Tricks::Tag::NOVICE }, OPT_TRICK(RT_BOTW_BASEMENT, RCQUEST_VANILLA, RA_BOTTOM_OF_THE_WELL, { Tricks::Tag::NOVICE },

View file

@ -49,6 +49,7 @@ class StaticData {
static std::vector<RandomizerCheck> GetPondFishLocations(); static std::vector<RandomizerCheck> GetPondFishLocations();
static std::vector<RandomizerCheck> GetOverworldFishLocations(); static std::vector<RandomizerCheck> GetOverworldFishLocations();
static std::vector<RandomizerCheck> GetOverworldFairyLocations(); static std::vector<RandomizerCheck> GetOverworldFairyLocations();
static void RegisterSongLocations();
static void RegisterBeehiveLocations(); static void RegisterBeehiveLocations();
static void RegisterCowLocations(); static void RegisterCowLocations();
static void RegisterFishLocations(); static void RegisterFishLocations();

View file

@ -0,0 +1,16 @@
#include "ActorListIndex.h"
#include "soh/ObjectExtension/ObjectExtension.h"
struct ActorListIndex {
s16 index = -1;
};
static ObjectExtension::Register<ActorListIndex> ActorListIndexRegister;
int16_t GetActorListIndex(const Actor* actor) {
const ActorListIndex* index = ObjectExtension::GetInstance().Get<ActorListIndex>(actor);
return index != nullptr ? index->index : ActorListIndex{}.index;
}
void SetActorListIndex(const Actor* actor, int16_t index) {
ObjectExtension::GetInstance().Set<ActorListIndex>(actor, ActorListIndex{ index });
}

View file

@ -0,0 +1,16 @@
#ifndef ACTOR_LIST_INDEX_H
#define ACTOR_LIST_INDEX_H
#ifdef __cplusplus
extern "C" {
#include "z64actor.h"
#endif
int16_t GetActorListIndex(const Actor* actor);
void SetActorListIndex(const Actor* actor, int16_t index);
#ifdef __cplusplus
}
#endif
#endif // ACTOR_LIST_INDEX_H

View file

@ -0,0 +1,25 @@
#include "ObjectExtension.h"
ObjectExtension& ObjectExtension::GetInstance() {
static ObjectExtension instance;
return instance;
}
ObjectExtension::Id ObjectExtension::RegisterId() {
return NextId++;
}
void ObjectExtension::Free(const void* object) {
if (object == nullptr) {
return;
}
std::erase_if(Data, [&object](const auto& iter) {
auto const& [key, value] = iter;
return key.first == object;
});
}
extern "C" void ObjectExtension_Free(const void* object) {
ObjectExtension::GetInstance().Free(object);
}

View file

@ -0,0 +1,116 @@
#pragma once
#ifdef __cplusplus
#include <libultraship/libultraship.h>
#include <any>
#include <limits>
#include <stdint.h>
#include <unordered_map>
#include <vector>
/*
* This class can attach additional data to pointers. It can only attach a single instance of each type of data.
* Use the ObjectExtension::Register class to register a type to be used as an object extension.
* An example usage is:
*
* struct MyData {
* s32 data = -1;
* };
* static ObjectExtension::Register<MyData> MyDataRegister;
*
* Then you can get with
* ObjectExtension::GetInstance().Get<MyData>(ptr);
* and set with
* ObjectExtension::GetInstance().Set<MyData>(ptr, MyData{});
* (or with the returned pointer from Get()).
*/
class ObjectExtension {
public:
using Id = uint32_t;
static constexpr Id InvalidId = std::numeric_limits<Id>::max();
// Registers type T to be used as an object extension
template <typename T> class Register {
public:
Register() {
Id = ObjectExtension::GetInstance().RegisterId();
}
static ObjectExtension::Id Id;
};
// Gets the singleton ObjectExtension instance
static ObjectExtension& GetInstance();
// Gets the data of type T associated with an object, or nullptr if no such data has been attached
template <typename T> T* Get(const void* object) {
assert(ObjectExtension::Register<T>::Id != InvalidId);
if (object == nullptr) {
return nullptr;
}
auto it = Data.find(std::make_pair(object, ObjectExtension::Register<T>::Id));
if (it == Data.end()) {
return nullptr;
}
return std::any_cast<T>(&(it->second));
}
// Sets the data of type T for an object. Data will be copied.
template <typename T> void Set(const void* object, const T&& data) {
assert(ObjectExtension::Register<T>::Id != InvalidId);
if (object != nullptr) {
Data[std::make_pair(object, ObjectExtension::Register<T>::Id)] = data;
}
}
// Returns true if an object has data of type T associated with it
template <typename T> bool Has(const void* object) {
assert(ObjectExtension::Register<T>::Id != InvalidId);
if (object == nullptr) {
return false;
}
return Data.contains(std::make_pair(object, ObjectExtension::Register<T>::Id));
}
// Removes data of type T from an object
template <typename T> void Remove(const void* object) {
assert(ObjectExtension::Register<T>::Id != InvalidId);
Data.erase(std::make_pair(object, ObjectExtension::Register<T>::Id));
}
// Removes all data from an object
void Free(const void* object);
private:
ObjectExtension() = default;
// Returns the next free object extension Id
Id RegisterId();
ObjectExtension::Id NextId = 0;
struct KeyHash {
std::size_t operator()(const std::pair<const void*, ObjectExtension::Id>& key) const {
return std::hash<const void*>{}(key.first) ^ (std::hash<ObjectExtension::Id>{}(key.second) << 1);
}
};
// Collection of all object extension data.
std::unordered_map<std::pair<const void*, ObjectExtension::Id>, std::any, KeyHash> Data;
};
// Static template globals
template <typename T> ObjectExtension::Id ObjectExtension::Register<T>::Id = ObjectExtension::InvalidId;
#else // __cplusplus
void ObjectExtension_Free(const void* object);
#endif // __cplusplus

View file

@ -922,6 +922,12 @@ void SaveManager::InitFileDebug() {
gSaveContext.playerName[i] = sPlayerName[i]; gSaveContext.playerName[i] = sPlayerName[i];
} }
gSaveContext.ship.filenameLanguage = NAME_LANGUAGE_PAL; gSaveContext.ship.filenameLanguage = NAME_LANGUAGE_PAL;
} else if (gSaveContext.language == LANGUAGE_JPN) { // Japanese
const static std::array<char, 8> sPlayerName = { 0x81, 0x87, 0x61, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF };
for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) {
gSaveContext.playerName[i] = sPlayerName[i];
}
gSaveContext.ship.filenameLanguage = NAME_LANGUAGE_NTSC_JPN;
} else { // GAME_REGION_NTSC } else { // GAME_REGION_NTSC
const static std::array<char, 8> sPlayerName = { 0xB6, 0xB3, 0xB8, 0xB5, 0xDF, 0xDF, 0xDF, 0xDF }; const static std::array<char, 8> sPlayerName = { 0xB6, 0xB3, 0xB8, 0xB5, 0xDF, 0xDF, 0xDF, 0xDF };
for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) { for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) {
@ -1037,6 +1043,12 @@ void SaveManager::InitFileMaxed() {
gSaveContext.playerName[i] = sPlayerName[i]; gSaveContext.playerName[i] = sPlayerName[i];
} }
gSaveContext.ship.filenameLanguage = NAME_LANGUAGE_PAL; gSaveContext.ship.filenameLanguage = NAME_LANGUAGE_PAL;
} else if (gSaveContext.language == LANGUAGE_JPN) { // Japanese
const static std::array<char, 8> sPlayerName = { 0x81, 0x87, 0x61, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF };
for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) {
gSaveContext.playerName[i] = sPlayerName[i];
}
gSaveContext.ship.filenameLanguage = NAME_LANGUAGE_NTSC_JPN;
} else { // GAME_REGION_NTSC } else { // GAME_REGION_NTSC
const static std::array<char, 8> sPlayerName = { 0xB6, 0xB3, 0xB8, 0xB5, 0xDF, 0xDF, 0xDF, 0xDF }; const static std::array<char, 8> sPlayerName = { 0xB6, 0xB3, 0xB8, 0xB5, 0xDF, 0xDF, 0xDF, 0xDF };
for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) { for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) {

View file

@ -3,6 +3,7 @@
#ifdef __cplusplus #ifdef __cplusplus
#include <string>
#include <vector> #include <vector>
#include <set> #include <set>
#include <unordered_map> #include <unordered_map>

View file

@ -193,13 +193,6 @@ static const std::unordered_map<int32_t, const char*> bootSequenceLabels = {
{ BOOTSEQUENCE_FILESELECT, "File Select" }, { BOOTSEQUENCE_FILESELECT, "File Select" },
}; };
static const std::unordered_map<int32_t, const char*> enhancementPresetList = {
{ ENHANCEMENT_PRESET_DEFAULT, "Default" },
{ ENHANCEMENT_PRESET_VANILLA_PLUS, "Vanilla Plus" },
{ ENHANCEMENT_PRESET_ENHANCED, "Enhanced" },
{ ENHANCEMENT_PRESET_RANDOMIZER, "Randomizer" },
};
class SohMenu : public Ship::Menu { class SohMenu : public Ship::Menu {
public: public:
SohMenu(const std::string& consoleVariable, const std::string& name); SohMenu(const std::string& consoleVariable, const std::string& name);

View file

@ -4,11 +4,9 @@
#include <soh/OTRGlobals.h> #include <soh/OTRGlobals.h>
#include <soh/Enhancements/cosmetics/authenticGfxPatches.h> #include <soh/Enhancements/cosmetics/authenticGfxPatches.h>
#include <soh/Enhancements/enemyrandomizer.h> #include <soh/Enhancements/enemyrandomizer.h>
#include <soh/Enhancements/Presets/Presets.h>
#include <soh/Enhancements/TimeDisplay/TimeDisplay.h> #include <soh/Enhancements/TimeDisplay/TimeDisplay.h>
static std::string comboboxTooltip = ""; static std::string comboboxTooltip = "";
static int32_t enhancementPresetSelected = ENHANCEMENT_PRESET_DEFAULT;
bool isBetaQuestEnabled = false; bool isBetaQuestEnabled = false;
static std::unordered_map<int32_t, const char*> bunnyHoodEffectMap = { static std::unordered_map<int32_t, const char*> bunnyHoodEffectMap = {
{ BUNNY_HOOD_VANILLA, "Vanilla" }, { BUNNY_HOOD_VANILLA, "Vanilla" },
@ -34,51 +32,8 @@ void SohMenu::AddMenuEnhancements() {
// Add Enhancements Menu // Add Enhancements Menu
AddMenuEntry("Enhancements", CVAR_SETTING("Menu.EnhancementsSidebarSection")); AddMenuEntry("Enhancements", CVAR_SETTING("Menu.EnhancementsSidebarSection"));
// Enhancements
WidgetPath path = { "Enhancements", "Presets", SECTION_COLUMN_1 };
AddSidebarEntry("Enhancements", path.sidebarName, 3);
const PresetTypeDefinition presetTypeDef = presetTypes.at(PRESET_TYPE_ENHANCEMENTS);
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);
}
AddWidget(path, "Enhancement Presets", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Select Preset", WIDGET_COMBOBOX)
.ValuePointer(&enhancementPresetSelected)
.Callback([](WidgetInfo& info) {
const std::string presetTypeCvar =
CVAR_GENERAL("SelectedPresets.") + std::to_string(PRESET_TYPE_ENHANCEMENTS);
CVarSetInteger(presetTypeCvar.c_str(), *std::get<int32_t*>(info.valuePointer));
})
.Options(ComboboxOptions()
.ComboMap(enhancementPresetList)
.DefaultIndex(ENHANCEMENT_PRESET_DEFAULT)
.Tooltip(comboboxTooltip.c_str()));
AddWidget(path, "Apply Preset##Enhancemnts", WIDGET_BUTTON)
.Options(ButtonOptions().Size(UIWidgets::Sizes::Inline))
.Callback([](WidgetInfo& info) {
const std::string presetTypeCvar =
CVAR_GENERAL("SelectedPresets.") + std::to_string(PRESET_TYPE_ENHANCEMENTS);
const PresetTypeDefinition presetTypeDef = presetTypes.at(PRESET_TYPE_ENHANCEMENTS);
uint16_t selectedPresetId = CVarGetInteger(presetTypeCvar.c_str(), 0);
if (selectedPresetId >= presetTypeDef.presets.size()) {
selectedPresetId = 0;
}
const PresetDefinition selectedPresetDef = presetTypeDef.presets.at(selectedPresetId);
for (const char* block : presetTypeDef.blocksToClear) {
CVarClearBlock(block);
}
if (selectedPresetId != 0) {
applyPreset(selectedPresetDef.entries);
}
CVarSetInteger(presetTypeCvar.c_str(), selectedPresetId);
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
});
// Quality of Life // Quality of Life
path.sidebarName = "Quality of Life"; WidgetPath path = { "Enhancements", "Quality of Life", SECTION_COLUMN_1 };
AddSidebarEntry("Enhancements", path.sidebarName, 3); AddSidebarEntry("Enhancements", path.sidebarName, 3);
path.column = SECTION_COLUMN_1; path.column = SECTION_COLUMN_1;
@ -289,16 +244,16 @@ void SohMenu::AddMenuEnhancements() {
.SameLine(true) .SameLine(true)
.Options(ButtonOptions().Size(Sizes::Inline)) .Options(ButtonOptions().Size(Sizes::Inline))
.Callback([](WidgetInfo& info) { .Callback([](WidgetInfo& info) {
CVarSetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Intro"), false); CVarClear(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Intro"));
CVarSetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Entrances"), false); CVarClear(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Entrances"));
CVarSetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), false); CVarClear(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"));
CVarSetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), false); CVarClear(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"));
CVarSetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.BossIntro"), false); CVarClear(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.BossIntro"));
CVarSetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.QuickBossDeaths"), false); CVarClear(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.QuickBossDeaths"));
CVarSetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.OnePoint"), false); CVarClear(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.OnePoint"));
CVarSetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipOwlInteractions"), false); CVarClear(CVAR_ENHANCEMENT("TimeSavers.SkipOwlInteractions"));
CVarSetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), false); CVarClear(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"));
CVarSetInteger(CVAR_ENHANCEMENT("TimeSavers.DisableTitleCard"), false); CVarClear(CVAR_ENHANCEMENT("TimeSavers.DisableTitleCard"));
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}); });
@ -837,6 +792,11 @@ void SohMenu::AddMenuEnhancements() {
.CVar(CVAR_ENHANCEMENT("FastFarores")) .CVar(CVAR_ENHANCEMENT("FastFarores"))
.Options(CheckboxOptions().Tooltip("Greatly decreases cast time of Farore's Wind magic spell.")); .Options(CheckboxOptions().Tooltip("Greatly decreases cast time of Farore's Wind magic spell."));
AddWidget(path, "Bottles", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Rebottle Blue Fire", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("RebottleBlueFire"))
.Options(CheckboxOptions().Tooltip("Blue Fire dropped from bottle can be bottled."));
// Fixes // Fixes
path.sidebarName = "Fixes"; path.sidebarName = "Fixes";
AddSidebarEntry("Enhancements", path.sidebarName, 3); AddSidebarEntry("Enhancements", path.sidebarName, 3);

View file

@ -3,6 +3,7 @@
#include <soh/Notification/Notification.h> #include <soh/Notification/Notification.h>
#include <soh/Network/Network.h> #include <soh/Network/Network.h>
#include "SohGui.hpp" #include "SohGui.hpp"
#include "soh/OTRGlobals.h"
#include <soh/Network/Sail/Sail.h> #include <soh/Network/Sail/Sail.h>
#include <soh/Network/CrowdControl/CrowdControl.h> #include <soh/Network/CrowdControl/CrowdControl.h>

View file

@ -1,5 +1,5 @@
#include "SohMenu.h" #include "SohMenu.h"
#include <macros.h> #include "soh/OTRGlobals.h"
namespace SohGui { namespace SohGui {

View file

@ -1,5 +1,6 @@
#include "SohMenu.h" #include "SohMenu.h"
#include "soh/Notification/Notification.h" #include "soh/Notification/Notification.h"
#include "soh/OTRGlobals.h"
#include <soh/GameVersions.h> #include <soh/GameVersions.h>
#include "soh/ResourceManagerHelpers.h" #include "soh/ResourceManagerHelpers.h"
#include "UIWidgets.hpp" #include "UIWidgets.hpp"

View file

@ -204,19 +204,19 @@ bool WindowButton(const char* label, const char* cvarName, std::shared_ptr<Ship:
return dirty; return dirty;
} }
void PushStyleCheckbox(const ImVec4& color) { void PushStyleCheckbox(const ImVec4& color, ImVec2 padding) {
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(color.x, color.y, color.z, 1.0f)); ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(color.x, color.y, color.z, 1.0f));
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(color.x, color.y, color.z, 0.8f)); ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(color.x, color.y, color.z, 0.8f));
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(color.x, color.y, color.z, 0.6f)); ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(color.x, color.y, color.z, 0.6f));
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.0f, 0.0f, 0.0f, 0.3f)); ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.0f, 0.0f, 0.0f, 0.3f));
ImGui::PushStyleColor(ImGuiCol_CheckMark, ImVec4(1.0f, 1.0f, 1.0f, 0.7f)); ImGui::PushStyleColor(ImGuiCol_CheckMark, ImVec4(1.0f, 1.0f, 1.0f, 0.7f));
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10.0f, 6.0f)); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, padding);
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 5.0f); ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 5.0f);
} }
void PushStyleCheckbox(Colors color) { void PushStyleCheckbox(Colors color, ImVec2 padding) {
PushStyleCheckbox(ColorValues.at(color)); PushStyleCheckbox(ColorValues.at(color), padding);
} }
void PopStyleCheckbox() { void PopStyleCheckbox() {
@ -297,6 +297,7 @@ bool Checkbox(const char* _label, bool* value, const CheckboxOptions& options) {
const char* label = labelStr.c_str(); const char* label = labelStr.c_str();
PushStyleCheckbox(options.color, options.padding);
ImGuiContext& g = *GImGui; ImGuiContext& g = *GImGui;
const ImGuiStyle& style = g.Style; const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label); const ImGuiID id = window->GetID(label);
@ -317,6 +318,7 @@ bool Checkbox(const char* _label, bool* value, const CheckboxOptions& options) {
ImGui::ItemSize(total_bb, style.FramePadding.y); ImGui::ItemSize(total_bb, style.FramePadding.y);
if (!ImGui::ItemAdd(total_bb, id)) { if (!ImGui::ItemAdd(total_bb, id)) {
PopStyleCheckbox();
ImGui::EndDisabled(); ImGui::EndDisabled();
return false; return false;
} }
@ -326,14 +328,13 @@ bool Checkbox(const char* _label, bool* value, const CheckboxOptions& options) {
*value = !(*value); *value = !(*value);
ImGui::MarkItemEdited(id); ImGui::MarkItemEdited(id);
} }
PushStyleCheckbox(options.color);
ImVec2 checkPos = pos; ImVec2 checkPos = pos;
ImVec2 labelPos = pos; ImVec2 labelPos = pos;
if (options.labelPosition == LabelPositions::Above) { if (options.labelPosition == LabelPositions::Above) {
checkPos.y += label_size.y + (style.ItemInnerSpacing.y * 2.0f); checkPos.y += label_size.y + (style.ItemInnerSpacing.y * 2.0f);
} else { } else {
// Center with checkbox automatically // Center with checkbox automatically
labelPos.y += ImGui::CalcTextSize("g").y / 8; labelPos.y += ImGui::GetStyle().FramePadding.y;
} }
if (options.alignment == ComponentAlignments::Right) { if (options.alignment == ComponentAlignments::Right) {
checkPos.x = total_bb.Max.x - square_sz; checkPos.x = total_bb.Max.x - square_sz;
@ -762,6 +763,9 @@ bool InputString(const char* label, std::string* value, const InputOptions& opti
ImGui::BeginGroup(); ImGui::BeginGroup();
ImGui::BeginDisabled(options.disabled); ImGui::BeginDisabled(options.disabled);
PushStyleInput(options.color); PushStyleInput(options.color);
if (options.hasError) {
ImGui::PushStyleColor(ImGuiCol_Border, ColorValues.at(Colors::Red));
}
float width = (options.size == ImVec2(0, 0)) ? ImGui::GetContentRegionAvail().x : options.size.x; float width = (options.size == ImVec2(0, 0)) ? ImGui::GetContentRegionAvail().x : options.size.x;
if (options.alignment == ComponentAlignments::Left) { if (options.alignment == ComponentAlignments::Left) {
if (options.labelPosition == LabelPositions::Above) { if (options.labelPosition == LabelPositions::Above) {
@ -787,11 +791,17 @@ bool InputString(const char* label, std::string* value, const InputOptions& opti
ImGui::SameLine(17.0f); ImGui::SameLine(17.0f);
ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 0.4f), "%s", options.placeholder.c_str()); ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 0.4f), "%s", options.placeholder.c_str());
} }
if (options.hasError) {
ImGui::PopStyleColor();
}
PopStyleInput(); PopStyleInput();
ImGui::EndDisabled(); ImGui::EndDisabled();
ImGui::EndGroup(); ImGui::EndGroup();
if (options.disabled && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && if (options.hasError && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) &&
!Ship_IsCStringEmpty(options.disabledTooltip)) { !Ship_IsCStringEmpty(options.errorText)) {
ImGui::SetTooltip("%s", WrappedText(options.errorText).c_str());
} else if (options.disabled && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) &&
!Ship_IsCStringEmpty(options.disabledTooltip)) {
ImGui::SetTooltip("%s", WrappedText(options.disabledTooltip).c_str()); ImGui::SetTooltip("%s", WrappedText(options.disabledTooltip).c_str());
} else if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && !Ship_IsCStringEmpty(options.tooltip)) { } else if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && !Ship_IsCStringEmpty(options.tooltip)) {
ImGui::SetTooltip("%s", WrappedText(options.tooltip).c_str()); ImGui::SetTooltip("%s", WrappedText(options.tooltip).c_str());
@ -1018,7 +1028,7 @@ bool CVarRadioButton(const char* text, const char* cvarName, int32_t id, const R
std::string make_invisible = "##" + std::string(text) + std::string(cvarName); std::string make_invisible = "##" + std::string(text) + std::string(cvarName);
bool ret = false; bool ret = false;
int val = CVarGetInteger(cvarName, 0); int val = CVarGetInteger(cvarName, options.defaultIndex);
PushStyleCheckbox(options.color); PushStyleCheckbox(options.color);
if (ImGui::RadioButton(make_invisible.c_str(), id == val)) { if (ImGui::RadioButton(make_invisible.c_str(), id == val)) {
CVarSetInteger(cvarName, id); CVarSetInteger(cvarName, id);

View file

@ -194,6 +194,7 @@ struct CheckboxOptions : WidgetOptions {
bool defaultValue = false; // Only applicable to CVarCheckbox bool defaultValue = false; // Only applicable to CVarCheckbox
ComponentAlignments alignment = ComponentAlignments::Left; ComponentAlignments alignment = ComponentAlignments::Left;
LabelPositions labelPosition = LabelPositions::Near; LabelPositions labelPosition = LabelPositions::Near;
ImVec2 padding = ImVec2(10.0f, 8.0f);
Colors color = Colors::LightBlue; Colors color = Colors::LightBlue;
CheckboxOptions& DefaultValue(bool defaultValue_) { CheckboxOptions& DefaultValue(bool defaultValue_) {
@ -220,6 +221,10 @@ struct CheckboxOptions : WidgetOptions {
WidgetOptions::disabledTooltip = disabledTooltip_; WidgetOptions::disabledTooltip = disabledTooltip_;
return *this; return *this;
} }
CheckboxOptions& Padding(ImVec2 padding_) {
padding = padding_;
return *this;
}
}; };
struct ComboboxOptions : WidgetOptions { struct ComboboxOptions : WidgetOptions {
@ -394,6 +399,7 @@ struct FloatSliderOptions : WidgetOptions {
struct RadioButtonsOptions : WidgetOptions { struct RadioButtonsOptions : WidgetOptions {
std::unordered_map<int32_t, const char*> buttonMap; std::unordered_map<int32_t, const char*> buttonMap;
int32_t defaultIndex = 0;
Colors color = Colors::LightBlue; Colors color = Colors::LightBlue;
RadioButtonsOptions& ButtonMap(std::unordered_map<int32_t, const char*> buttonMap_) { RadioButtonsOptions& ButtonMap(std::unordered_map<int32_t, const char*> buttonMap_) {
@ -408,6 +414,10 @@ struct RadioButtonsOptions : WidgetOptions {
color = color_; color = color_;
return *this; return *this;
} }
RadioButtonsOptions& DefaultIndex(int32_t defaultIndex_) {
defaultIndex = defaultIndex_;
return *this;
}
}; };
struct InputOptions : WidgetOptions { struct InputOptions : WidgetOptions {
@ -420,6 +430,8 @@ struct InputOptions : WidgetOptions {
std::string defaultValue = ""; std::string defaultValue = "";
bool secret = false; bool secret = false;
ImGuiInputFlags addedFlags = 0; ImGuiInputFlags addedFlags = 0;
bool hasError = false;
const char* errorText = "";
InputOptions& Tooltip(const char* tooltip_) { InputOptions& Tooltip(const char* tooltip_) {
WidgetOptions::tooltip = tooltip_; WidgetOptions::tooltip = tooltip_;
@ -454,6 +466,11 @@ struct InputOptions : WidgetOptions {
return *this; return *this;
} }
InputOptions& ComponentAlignment(ComponentAlignments alignment_) {
alignment = alignment_;
return *this;
}
InputOptions& DefaultValue(std::string defaultValue_) { InputOptions& DefaultValue(std::string defaultValue_) {
defaultValue = defaultValue_; defaultValue = defaultValue_;
return *this; return *this;
@ -463,6 +480,16 @@ struct InputOptions : WidgetOptions {
secret = secret_; secret = secret_;
return *this; return *this;
} }
InputOptions& HasError(bool error_ = false) {
hasError = error_;
return *this;
}
InputOptions& ErrorText(const char* errorText_) {
errorText = errorText_;
return *this;
}
}; };
void PushStyleMenu(const ImVec4& color); void PushStyleMenu(const ImVec4& color);
@ -482,8 +509,8 @@ bool Button(const char* label, const ButtonOptions& options = {});
bool WindowButton(const char* label, const char* cvarName, std::shared_ptr<Ship::GuiWindow> windowPtr, bool WindowButton(const char* label, const char* cvarName, std::shared_ptr<Ship::GuiWindow> windowPtr,
const WindowButtonOptions& options = {}); const WindowButtonOptions& options = {});
void PushStyleCheckbox(const ImVec4& color); void PushStyleCheckbox(const ImVec4& color, ImVec2 padding = ImVec2(10.0f, 6.0f));
void PushStyleCheckbox(Colors color = Colors::LightBlue); void PushStyleCheckbox(Colors color = Colors::LightBlue, ImVec2 padding = ImVec2(10.0f, 6.0f));
void PopStyleCheckbox(); void PopStyleCheckbox();
void RenderText(ImVec2 pos, const char* text, const char* text_end, bool hide_text_after_hash); void RenderText(ImVec2 pos, const char* text, const char* text_end, bool hide_text_after_hash);
bool Checkbox(const char* label, bool* v, const CheckboxOptions& options = {}); bool Checkbox(const char* label, bool* v, const CheckboxOptions& options = {});

View file

@ -1,19 +1,19 @@
#include "libultraship/libultraship.h" #include "libultraship/libultraship.h"
namespace SOH { namespace SOH {
class ConfigVersion1Updater : public Ship::ConfigVersionUpdater { class ConfigVersion1Updater final : public Ship::ConfigVersionUpdater {
public: public:
ConfigVersion1Updater(); ConfigVersion1Updater();
void Update(Ship::Config* conf); void Update(Ship::Config* conf);
}; };
class ConfigVersion2Updater : public Ship::ConfigVersionUpdater { class ConfigVersion2Updater final : public Ship::ConfigVersionUpdater {
public: public:
ConfigVersion2Updater(); ConfigVersion2Updater();
void Update(Ship::Config* conf); void Update(Ship::Config* conf);
}; };
class ConfigVersion3Updater : public Ship::ConfigVersionUpdater { class ConfigVersion3Updater final : public Ship::ConfigVersionUpdater {
public: public:
ConfigVersion3Updater(); ConfigVersion3Updater();
void Update(Ship::Config* conf); void Update(Ship::Config* conf);

View file

@ -4,7 +4,7 @@
#include "ResourceFactoryBinary.h" #include "ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryAnimationV0 : public Ship::ResourceFactoryBinary { class ResourceFactoryBinaryAnimationV0 final : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;

View file

@ -4,7 +4,7 @@
#include "resource/ResourceFactoryBinary.h" #include "resource/ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryArrayV0 : public Ship::ResourceFactoryBinary { class ResourceFactoryBinaryArrayV0 final : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;

View file

@ -4,7 +4,7 @@
#include "ResourceFactoryBinary.h" #include "ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryAudioSampleV2 : public Ship::ResourceFactoryBinary { class ResourceFactoryBinaryAudioSampleV2 final : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;

View file

@ -15,7 +15,7 @@ ResourceFactoryBinaryAudioSequenceV2::ReadResource(std::shared_ptr<Ship::File> f
audioSequence->sequence.seqDataSize = reader->ReadInt32(); audioSequence->sequence.seqDataSize = reader->ReadInt32();
audioSequence->sequenceData.reserve(audioSequence->sequence.seqDataSize); audioSequence->sequenceData.reserve(audioSequence->sequence.seqDataSize);
for (uint32_t i = 0; i < audioSequence->sequence.seqDataSize; i++) { for (int32_t i = 0; i < audioSequence->sequence.seqDataSize; i++) {
audioSequence->sequenceData.push_back(reader->ReadChar()); audioSequence->sequenceData.push_back(reader->ReadChar());
} }
audioSequence->sequence.seqData = audioSequence->sequenceData.data(); audioSequence->sequence.seqData = audioSequence->sequenceData.data();
@ -25,10 +25,10 @@ ResourceFactoryBinaryAudioSequenceV2::ReadResource(std::shared_ptr<Ship::File> f
audioSequence->sequence.cachePolicy = reader->ReadUByte(); audioSequence->sequence.cachePolicy = reader->ReadUByte();
audioSequence->sequence.numFonts = reader->ReadUInt32(); audioSequence->sequence.numFonts = reader->ReadUInt32();
for (uint32_t i = 0; i < 16; i++) { for (int32_t i = 0; i < 16; i++) {
audioSequence->sequence.fonts[i] = 0; audioSequence->sequence.fonts[i] = 0;
} }
for (uint32_t i = 0; i < audioSequence->sequence.numFonts; i++) { for (int32_t i = 0; i < audioSequence->sequence.numFonts; i++) {
audioSequence->sequence.fonts[i] = reader->ReadUByte(); audioSequence->sequence.fonts[i] = reader->ReadUByte();
} }

View file

@ -4,7 +4,7 @@
#include "ResourceFactoryBinary.h" #include "ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryAudioSequenceV2 : public Ship::ResourceFactoryBinary { class ResourceFactoryBinaryAudioSequenceV2 final : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;

View file

@ -4,7 +4,7 @@
#include "ResourceFactoryBinary.h" #include "ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryAudioSoundFontV2 : public Ship::ResourceFactoryBinary { class ResourceFactoryBinaryAudioSoundFontV2 final : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;

View file

@ -4,7 +4,7 @@
#include "resource/ResourceFactoryBinary.h" #include "resource/ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryBackgroundV0 : public Ship::ResourceFactoryBinary { class ResourceFactoryBinaryBackgroundV0 final : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;

View file

@ -5,13 +5,13 @@
#include "ResourceFactoryXML.h" #include "ResourceFactoryXML.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryCollisionHeaderV0 : public Ship::ResourceFactoryBinary { class ResourceFactoryBinaryCollisionHeaderV0 final : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;
}; };
class ResourceFactoryXMLCollisionHeaderV0 : public Ship::ResourceFactoryXML { class ResourceFactoryXMLCollisionHeaderV0 final : public Ship::ResourceFactoryXML {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;

View file

@ -4,7 +4,7 @@
#include "ResourceFactoryBinary.h" #include "ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryCutsceneV0 : public Ship::ResourceFactoryBinary { class ResourceFactoryBinaryCutsceneV0 final : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;

View file

@ -5,13 +5,13 @@
#include "ResourceFactoryXML.h" #include "ResourceFactoryXML.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryPathV0 : public Ship::ResourceFactoryBinary { class ResourceFactoryBinaryPathV0 final : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;
}; };
class ResourceFactoryXMLPathV0 : public Ship::ResourceFactoryXML { class ResourceFactoryXMLPathV0 final : public Ship::ResourceFactoryXML {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;

View file

@ -4,7 +4,7 @@
#include "ResourceFactoryBinary.h" #include "ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryPlayerAnimationV0 : public Ship::ResourceFactoryBinary { class ResourceFactoryBinaryPlayerAnimationV0 final : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;

View file

@ -8,7 +8,7 @@
#include "ResourceFactoryXML.h" #include "ResourceFactoryXML.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinarySceneV0 : public Ship::ResourceFactoryBinary { class ResourceFactoryBinarySceneV0 final : public Ship::ResourceFactoryBinary {
public: public:
ResourceFactoryBinarySceneV0(); ResourceFactoryBinarySceneV0();
@ -28,7 +28,7 @@ class ResourceFactoryBinarySceneV0 : public Ship::ResourceFactoryBinary {
std::shared_ptr<Ship::BinaryReader> reader, uint32_t index); std::shared_ptr<Ship::BinaryReader> reader, uint32_t index);
}; };
class ResourceFactoryXMLSceneV0 : public Ship::ResourceFactoryXML { class ResourceFactoryXMLSceneV0 final : public Ship::ResourceFactoryXML {
public: public:
ResourceFactoryXMLSceneV0(); ResourceFactoryXMLSceneV0();

View file

@ -23,7 +23,7 @@ ResourceFactoryBinarySkeletonV0::ReadResource(std::shared_ptr<Ship::File> file,
skeleton->limbTableCount = reader->ReadUInt32(); skeleton->limbTableCount = reader->ReadUInt32();
skeleton->limbTable.reserve(skeleton->limbTableCount); skeleton->limbTable.reserve(skeleton->limbTableCount);
for (uint32_t i = 0; i < skeleton->limbTableCount; i++) { for (int32_t i = 0; i < skeleton->limbTableCount; i++) {
std::string limbPath = reader->ReadString(); std::string limbPath = reader->ReadString();
skeleton->limbTable.push_back(limbPath); skeleton->limbTable.push_back(limbPath);

View file

@ -5,13 +5,13 @@
#include "ResourceFactoryXML.h" #include "ResourceFactoryXML.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinarySkeletonV0 : public Ship::ResourceFactoryBinary { class ResourceFactoryBinarySkeletonV0 final : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;
}; };
class ResourceFactoryXMLSkeletonV0 : public Ship::ResourceFactoryXML { class ResourceFactoryXMLSkeletonV0 final : public Ship::ResourceFactoryXML {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;

View file

@ -5,13 +5,13 @@
#include "ResourceFactoryXML.h" #include "ResourceFactoryXML.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinarySkeletonLimbV0 : public Ship::ResourceFactoryBinary { class ResourceFactoryBinarySkeletonLimbV0 final : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;
}; };
class ResourceFactoryXMLSkeletonLimbV0 : public Ship::ResourceFactoryXML { class ResourceFactoryXMLSkeletonLimbV0 final : public Ship::ResourceFactoryXML {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;

View file

@ -5,13 +5,13 @@
#include "ResourceFactoryXML.h" #include "ResourceFactoryXML.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryTextV0 : public Ship::ResourceFactoryBinary { class ResourceFactoryBinaryTextV0 final : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;
}; };
class ResourceFactoryXMLTextV0 : public Ship::ResourceFactoryXML { class ResourceFactoryXMLTextV0 final : public Ship::ResourceFactoryXML {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file,
std::shared_ptr<Ship::ResourceInitData> initData) override; std::shared_ptr<Ship::ResourceInitData> initData) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class EndMarkerFactory : public SceneCommandFactoryBinaryV0 { class EndMarkerFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class EndMarkerFactoryXML : public SceneCommandFactoryXMLV0 { class EndMarkerFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetActorListFactory : public SceneCommandFactoryBinaryV0 { class SetActorListFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetActorListFactoryXML : public SceneCommandFactoryXMLV0 { class SetActorListFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetAlternateHeadersFactory : public SceneCommandFactoryBinaryV0 { class SetAlternateHeadersFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetAlternateHeadersFactoryXML : public SceneCommandFactoryXMLV0 { class SetAlternateHeadersFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetCameraSettingsFactory : public SceneCommandFactoryBinaryV0 { class SetCameraSettingsFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetCameraSettingsFactoryXML : public SceneCommandFactoryXMLV0 { class SetCameraSettingsFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetCollisionHeaderFactory : public SceneCommandFactoryBinaryV0 { class SetCollisionHeaderFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetCollisionHeaderFactoryXML : public SceneCommandFactoryXMLV0 { class SetCollisionHeaderFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetCsCameraFactory : public SceneCommandFactoryBinaryV0 { class SetCsCameraFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetCsCameraFactoryXML : public SceneCommandFactoryXMLV0 { class SetCsCameraFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetCutscenesFactory : public SceneCommandFactoryBinaryV0 { class SetCutscenesFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetCutscenesFactoryXML : public SceneCommandFactoryXMLV0 { class SetCutscenesFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetEchoSettingsFactory : public SceneCommandFactoryBinaryV0 { class SetEchoSettingsFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetEchoSettingsFactoryXML : public SceneCommandFactoryXMLV0 { class SetEchoSettingsFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetEntranceListFactory : public SceneCommandFactoryBinaryV0 { class SetEntranceListFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetEntranceListFactoryXML : public SceneCommandFactoryXMLV0 { class SetEntranceListFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetExitListFactory : public SceneCommandFactoryBinaryV0 { class SetExitListFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetExitListFactoryXML : public SceneCommandFactoryXMLV0 { class SetExitListFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetLightListFactory : public SceneCommandFactoryBinaryV0 { class SetLightListFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetLightListFactoryXML : public SceneCommandFactoryXMLV0 { class SetLightListFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetLightingSettingsFactory : public SceneCommandFactoryBinaryV0 { class SetLightingSettingsFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetLightingSettingsFactoryXML : public SceneCommandFactoryXMLV0 { class SetLightingSettingsFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetMeshFactory : public SceneCommandFactoryBinaryV0 { class SetMeshFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetMeshFactoryXML : public SceneCommandFactoryXMLV0 { class SetMeshFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetObjectListFactory : public SceneCommandFactoryBinaryV0 { class SetObjectListFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetObjectListFactoryXML : public SceneCommandFactoryXMLV0 { class SetObjectListFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetPathwaysFactory : public SceneCommandFactoryBinaryV0 { class SetPathwaysFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetPathwaysFactoryXML : public SceneCommandFactoryXMLV0 { class SetPathwaysFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetRoomBehaviorFactory : public SceneCommandFactoryBinaryV0 { class SetRoomBehaviorFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetRoomBehaviorFactoryXML : public SceneCommandFactoryXMLV0 { class SetRoomBehaviorFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetRoomListFactory : public SceneCommandFactoryBinaryV0 { class SetRoomListFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetRoomListFactoryXML : public SceneCommandFactoryXMLV0 { class SetRoomListFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

View file

@ -3,13 +3,13 @@
#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" #include "soh/resource/importer/scenecommand/SceneCommandFactory.h"
namespace SOH { namespace SOH {
class SetSkyboxModifierFactory : public SceneCommandFactoryBinaryV0 { class SetSkyboxModifierFactory final : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<Ship::BinaryReader> reader) override; std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetSkyboxModifierFactoryXML : public SceneCommandFactoryXMLV0 { class SetSkyboxModifierFactoryXML final : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;

Some files were not shown because too many files have changed in this diff Show more