You've already forked Shipwright
mirror of
https://github.com/CraftyBoss/Shipwright.git
synced 2026-07-14 05:07:46 -07:00
Preset Manager (#5459)
* Add presets sidebar, proof of concept row-based listing. * Complete and unify section check/x drawing. * Add error state to InputString, and corresponding members and builders to InputOptions. Implement saving and loading of preset files. * Implement `Config::SetBlock()`. Implement Apply. Implement Delete. Some json structure changes. * Apply `CVarClear()` calls in CVar-prefixed widget functions. * Comment out satellite preset pickers for now. * clang * Fix ButtonOptions initializer list. * I hate clang... * Loop new preset checkbox creation. Restore auto-resizing to new preset popup. Remove errant BeginDisabled in randomizer (merge artifact?). * Add BlockInfo struct to make array with all info for each block. Setup loops for all other same-ish situations (applying presets, setting up columns, etc) based on blockInfo. * Save tracker windows info for later restoration. Lay the groundwork for said restoration. * Complete tracker window restoration on preset application. * Fix RadioButtonsOptions builder parameter type. Add race lockout to new and apply buttons. * Revert application of CVarClear on UIWidgets widgets (need to preserve manually-set default states). * Remove enhancements satellite picker. Swap randomizer satellite picker to use the manager presets, only displays presets with randomizer section included. Move built-in presets to the asset archive, and remove delete button on them. Remove PresetEntries.cpp. * Fix locations and tricks tabs not updating live when applying preset with new system. * Apply RandoGenerating lockout to rando preset Apply button. * Fix new presets not being properly filtered in satellite selectors. * Fix currently selected presets getting deleted still being selected in satellite selectors. * Change BigPoeTargetCount in preset files to 1.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"blocks": {
|
||||
"enhancements": {
|
||||
"gCheats": null,
|
||||
"gEnhancements": null,
|
||||
"gRandoEnhancements": null
|
||||
}
|
||||
},
|
||||
"presetName": "Main Default",
|
||||
"isBuiltIn": true
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"blocks": {
|
||||
"rando": {
|
||||
"gRandoSettings": null
|
||||
}
|
||||
},
|
||||
"presetName": "Rando Default",
|
||||
"isBuiltIn": true
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,63 +1,145 @@
|
||||
#include "Presets.h"
|
||||
#include <variant>
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
#include <libultraship/bridge.h>
|
||||
#include <fstream>
|
||||
#include <config/Config.h>
|
||||
#include <libultraship/classes.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <libultraship/libultraship.h>
|
||||
#include <Json.h>
|
||||
#include "soh/OTRGlobals.h"
|
||||
#include "soh/SohGui/MenuTypes.h"
|
||||
#include "soh/SohGui/SohMenu.h"
|
||||
#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) {
|
||||
std::string locString = "";
|
||||
for (auto loc : locs) {
|
||||
locString += std::to_string(loc) + ",";
|
||||
}
|
||||
return locString;
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
namespace SohGui {
|
||||
extern std::shared_ptr<SohMenu> mSohMenu;
|
||||
extern std::shared_ptr<RandomizerSettingsWindow> mRandomizerSettingsWindow;
|
||||
} // 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) {
|
||||
for (auto& [cvar, type, value] : entries) {
|
||||
switch (type) {
|
||||
case PRESET_ENTRY_TYPE_S32:
|
||||
CVarSetInteger(cvar, std::get<int32_t>(value));
|
||||
break;
|
||||
case PRESET_ENTRY_TYPE_FLOAT:
|
||||
CVarSetFloat(cvar, std::get<float>(value));
|
||||
break;
|
||||
case PRESET_ENTRY_TYPE_STRING:
|
||||
CVarSetString(cvar, std::get<const char*>(value));
|
||||
break;
|
||||
case PRESET_ENTRY_TYPE_CPP_STRING:
|
||||
CVarSetString(cvar, std::get<std::string>(value).c_str());
|
||||
break;
|
||||
void PresetCheckboxStyle(const ImVec4& color) {
|
||||
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_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_CheckMark, ImVec4(1.0f, 1.0f, 1.0f, 0.7f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(6.0f, 6.0f));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 5.0f);
|
||||
}
|
||||
|
||||
static BlockInfo blockInfo[PRESET_SECTION_MAX] = {
|
||||
{ { CVAR_PREFIX_SETTING, CVAR_PREFIX_WINDOW }, ICON_FA_COG, { "Settings", "settings" } },
|
||||
{ { CVAR_PREFIX_ENHANCEMENT, CVAR_PREFIX_RANDOMIZER_ENHANCEMENT, CVAR_PREFIX_CHEAT },
|
||||
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) {
|
||||
const std::string presetTypeCvar = CVAR_GENERAL("SelectedPresets.") + std::to_string(presetTypeId);
|
||||
const PresetTypeDefinition presetTypeDef = presetTypes.at(presetTypeId);
|
||||
uint16_t selectedPresetId = CVarGetInteger(presetTypeCvar.c_str(), 0);
|
||||
if (selectedPresetId >= presetTypeDef.presets.size()) {
|
||||
selectedPresetId = 0;
|
||||
void DrawPresetSelector(std::vector<PresetSection> includeSections, std::string presetLoc, bool disabled) {
|
||||
std::vector<std::string> includedPresets;
|
||||
for (auto& [name, info] : presets) {
|
||||
for (auto& section : includeSections) {
|
||||
if (info.apply[section]) {
|
||||
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");
|
||||
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);
|
||||
if (ImGui::BeginCombo("##PresetsComboBox", selectedPresetDef.label)) {
|
||||
for (auto iter = presetTypeDef.presets.begin(); iter != presetTypeDef.presets.end(); ++iter) {
|
||||
if (ImGui::Selectable(iter->second.label, iter->first == selectedPresetId)) {
|
||||
CVarSetInteger(presetTypeCvar.c_str(), iter->first);
|
||||
if (ImGui::BeginCombo("##PresetsComboBox", currentIndex.c_str())) {
|
||||
for (auto iter = includedPresets.begin(); iter != includedPresets.end(); ++iter) {
|
||||
if (ImGui::Selectable(iter->c_str(), *iter == currentIndex)) {
|
||||
CVarSetString(selectorCvar.c_str(), iter->c_str());
|
||||
currentIndex = *iter;
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
||||
}
|
||||
}
|
||||
@@ -65,18 +147,300 @@ void DrawPresetSelector(PresetType presetTypeId) {
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
UIWidgets::PopStyleCombobox();
|
||||
UIWidgets::Tooltip(comboboxTooltip.c_str());
|
||||
// UIWidgets::Tooltip(comboboxTooltip.c_str());
|
||||
|
||||
UIWidgets::PushStyleButton(THEME_COLOR);
|
||||
if (ImGui::Button(("Apply Preset##" + presetTypeCvar).c_str())) {
|
||||
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();
|
||||
if (UIWidgets::Button(
|
||||
("Apply Preset##" + selectorCvar).c_str(),
|
||||
UIWidgets::ButtonOptions({ { .disabled = disabled } }).Color(THEME_COLOR).Size(UIWidgets::Sizes::Inline))) {
|
||||
applyPreset(currentIndex, includeSections);
|
||||
}
|
||||
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 (!fs::exists(presetFolder)) {
|
||||
return;
|
||||
}
|
||||
if (!presets.empty()) {
|
||||
presets.clear();
|
||||
}
|
||||
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);
|
||||
|
||||
@@ -2,57 +2,17 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <variant>
|
||||
#include "soh/OTRGlobals.h"
|
||||
|
||||
enum PresetEntryType {
|
||||
PRESET_ENTRY_TYPE_S32,
|
||||
PRESET_ENTRY_TYPE_FLOAT,
|
||||
PRESET_ENTRY_TYPE_STRING,
|
||||
PRESET_ENTRY_TYPE_CPP_STRING,
|
||||
enum PresetSection {
|
||||
PRESET_SECTION_SETTINGS,
|
||||
PRESET_SECTION_ENHANCEMENTS,
|
||||
PRESET_SECTION_AUDIO,
|
||||
PRESET_SECTION_COSMETICS,
|
||||
PRESET_SECTION_RANDOMIZER,
|
||||
PRESET_SECTION_TRACKERS,
|
||||
PRESET_SECTION_NETWORK,
|
||||
PRESET_SECTION_MAX,
|
||||
};
|
||||
|
||||
enum PresetType {
|
||||
PRESET_TYPE_ENHANCEMENTS,
|
||||
PRESET_TYPE_RANDOMIZER,
|
||||
};
|
||||
|
||||
enum EnhancementPreset {
|
||||
ENHANCEMENT_PRESET_DEFAULT,
|
||||
ENHANCEMENT_PRESET_VANILLA_PLUS,
|
||||
ENHANCEMENT_PRESET_ENHANCED,
|
||||
ENHANCEMENT_PRESET_RANDOMIZER,
|
||||
};
|
||||
|
||||
enum RandomizerPreset {
|
||||
RANDOMIZER_PRESET_DEFAULT,
|
||||
RANDOMIZER_PRESET_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;
|
||||
void DrawPresetSelector(std::vector<PresetSection> includeSections, std::string currentIndex, bool disabled);
|
||||
void applyPreset(std::string presetName, std::vector<PresetSection> includeSections = {});
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <tuple>
|
||||
#include <functional>
|
||||
#include "draw.h"
|
||||
#include "soh/OTRGlobals.h"
|
||||
#include "soh/SohGui/UIWidgets.hpp"
|
||||
#include "static_data.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
@@ -3643,14 +3644,8 @@ bool GenerateRandomizer(std::string seed /*= ""*/) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static const std::unordered_map<int32_t, const char*> randomizerPresetList = {
|
||||
{ RANDOMIZER_PRESET_DEFAULT, "Default" },
|
||||
{ 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;
|
||||
static bool locationsTabOpen = false;
|
||||
static bool tricksTabOpen = false;
|
||||
|
||||
void RandomizerSettingsWindow::DrawElement() {
|
||||
auto ctx = Rando::Context::GetInstance();
|
||||
@@ -3658,53 +3653,12 @@ void RandomizerSettingsWindow::DrawElement() {
|
||||
generated = 0;
|
||||
randoThread.join();
|
||||
}
|
||||
static bool locationsTabOpen = false;
|
||||
static bool tricksTabOpen = false;
|
||||
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);
|
||||
bool generating = CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0);
|
||||
bool disableEditingRandoSettings = generating || CVarGetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0);
|
||||
|
||||
if (UIWidgets::Combobox("Randomizer Presets", &randomizerPresetSelected, randomizerPresetList,
|
||||
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();
|
||||
DrawPresetSelector({ PRESET_SECTION_RANDOMIZER }, "Randomizer", generating);
|
||||
|
||||
UIWidgets::Spacer(0);
|
||||
// UIWidgets::Spacer(0);
|
||||
UIWidgets::CVarCheckbox("Manual seed entry", CVAR_RANDOMIZER_SETTING("ManualSeedEntry"),
|
||||
UIWidgets::CheckboxOptions().Color(THEME_COLOR));
|
||||
if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ManualSeedEntry"), 0)) {
|
||||
@@ -3754,10 +3708,6 @@ void RandomizerSettingsWindow::DrawElement() {
|
||||
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);
|
||||
|
||||
ImGuiWindow* window = ImGui::GetCurrentWindow();
|
||||
@@ -4367,9 +4317,17 @@ void RandomizerSettingsWindow::DrawElement() {
|
||||
UIWidgets::PopStyleTabs();
|
||||
}
|
||||
|
||||
void RandomizerSettingsWindow::SetNeedsUpdate() {
|
||||
mNeedsUpdate = true;
|
||||
}
|
||||
|
||||
void RandomizerSettingsWindow::UpdateElement() {
|
||||
if (mNeedsUpdate) {
|
||||
RandomizerCheckObjects::UpdateImGuiVisibility();
|
||||
mSettings->UpdateOptionProperties();
|
||||
locationsTabOpen = false;
|
||||
tricksTabOpen = false;
|
||||
mNeedsUpdate = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +91,10 @@ bool previousShowHidden = false;
|
||||
bool hideShopUnshuffledChecks = false;
|
||||
bool alwaysShowGS = false;
|
||||
|
||||
static bool presetLoaded = false;
|
||||
static ImVec2 presetPos;
|
||||
static ImVec2 presetSize;
|
||||
|
||||
std::map<uint32_t, RandomizerCheck> startingShopItem = {
|
||||
{ SCENE_KOKIRI_SHOP, RC_KF_SHOP_ITEM_1 },
|
||||
{ SCENE_BAZAAR, RC_MARKET_BAZAAR_ITEM_1 },
|
||||
@@ -979,7 +983,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);
|
||||
|
||||
if (!GameInteractor::IsSaveLoaded() || !initialized) {
|
||||
@@ -2000,6 +2010,12 @@ void RecalculateAvailableChecks() {
|
||||
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() {
|
||||
if (!IsVisible()) {
|
||||
return;
|
||||
|
||||
@@ -62,4 +62,5 @@ void UpdateAllAreas();
|
||||
void RecalculateAllAreaTotals();
|
||||
void SpoilAreaFromCheck(RandomizerCheck rc);
|
||||
void RecalculateAvailableChecks();
|
||||
void CheckTracker_LoadFromPreset(nlohmann::json info);
|
||||
} // namespace CheckTracker
|
||||
|
||||
@@ -39,6 +39,10 @@ static s16 lastEntranceIndex = -1;
|
||||
static s16 currentGrottoId = -1;
|
||||
static s16 lastSceneOrEntranceDetected = -1;
|
||||
|
||||
static bool presetLoaded = false;
|
||||
static ImVec2 presetPos;
|
||||
static ImVec2 presetSize;
|
||||
|
||||
static std::string spoilerEntranceGroupNames[] = {
|
||||
"Spawns/Warp Songs/Owls",
|
||||
"Kokiri Forest",
|
||||
@@ -445,6 +449,12 @@ const EntranceData* GetEntranceData(s16 index) {
|
||||
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
|
||||
// later
|
||||
// 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() {
|
||||
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)) {
|
||||
ImGui::End();
|
||||
|
||||
@@ -90,6 +90,7 @@ void InitEntranceTrackingData();
|
||||
s16 GetLastEntranceOverride();
|
||||
s16 GetCurrentGrottoId();
|
||||
const EntranceData* GetEntranceData(s16);
|
||||
void EntranceTracker_LoadFromPreset(nlohmann::json info);
|
||||
|
||||
class EntranceTrackerSettingsWindow final : public Ship::GuiWindow {
|
||||
public:
|
||||
|
||||
@@ -375,6 +375,10 @@ uint32_t notesIdleFrames = 0;
|
||||
bool notesNeedSave = false;
|
||||
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() {
|
||||
if (notesNeedSave && notesIdleFrames <= notesMaxIdleFrames) {
|
||||
notesIdleFrames++;
|
||||
@@ -398,6 +402,16 @@ bool HasEquipment(ItemTrackerItem item) {
|
||||
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 result;
|
||||
result.currentCapacity = 0;
|
||||
@@ -1171,6 +1185,12 @@ void BeginFloatingWindows(std::string UniqueName, ImGuiWindowFlags flags = 0) {
|
||||
ImGui::PushStyleColor(ImGuiCol_WindowBg, color);
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
|
||||
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);
|
||||
}
|
||||
void EndFloatingWindows() {
|
||||
@@ -1525,7 +1545,7 @@ void ItemTrackerWindow::DrawElement() {
|
||||
SECTION_DISPLAY_EXTENDED_MAIN_WINDOW) ||
|
||||
(CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Notes"), SECTION_DISPLAY_HIDDEN) ==
|
||||
SECTION_DISPLAY_MAIN_WINDOW)) {
|
||||
BeginFloatingWindows("Item Tracker##main window");
|
||||
BeginFloatingWindows("Item Tracker");
|
||||
DrawItemsInRows(mainWindowItems, 6);
|
||||
|
||||
if (CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Notes"), SECTION_DISPLAY_HIDDEN) ==
|
||||
@@ -1659,6 +1679,10 @@ void ItemTrackerWindow::DrawElement() {
|
||||
EndFloatingWindows();
|
||||
}
|
||||
}
|
||||
if (presetLoaded) {
|
||||
shouldUpdateVectors = true;
|
||||
presetLoaded = false;
|
||||
}
|
||||
}
|
||||
|
||||
static std::unordered_map<int32_t, const char*> itemTrackerCapacityTrackOptions = {
|
||||
|
||||
@@ -25,6 +25,23 @@ bool HasEquipment(ItemTrackerItem);
|
||||
#define ITEM_TRACKER_ITEM_CUSTOM(id, name, nameFaded, 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 {
|
||||
uint32_t id;
|
||||
std::vector<uint32_t> items;
|
||||
|
||||
@@ -13,6 +13,7 @@ class RandomizerSettingsWindow final : public Ship::GuiWindow {
|
||||
void InitElement() override;
|
||||
void DrawElement() override;
|
||||
void UpdateElement() override;
|
||||
void SetNeedsUpdate();
|
||||
|
||||
private:
|
||||
bool mNeedsUpdate = false;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user