Shipwright/soh/soh/SaveManager.cpp

2070 lines
104 KiB
C++
Raw Normal View History

#include "SaveManager.h"
#include "OTRGlobals.h"
#include "z64.h"
#include "functions.h"
#include "macros.h"
#include <Hooks.h>
#include <libultraship/bridge.h>
#define NOGDI // avoid various windows defines that conflict with things in z64.h
#include <spdlog/spdlog.h>
#include <fstream>
#include <filesystem>
#include <array>
extern "C" SaveContext gSaveContext;
std::filesystem::path SaveManager::GetFileName(int fileNum) {
const std::filesystem::path sSavePath(Ship::Window::GetPathRelativeToAppDirectory("Save"));
return sSavePath / ("file" + std::to_string(fileNum + 1) + ".sav");
}
SaveManager::SaveManager() {
AddLoadFunction("base", 1, LoadBaseVersion1);
AddLoadFunction("base", 2, LoadBaseVersion2);
AddLoadFunction("base", 3, LoadBaseVersion3);
AddSaveFunction("base", 3, SaveBase);
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
AddLoadFunction("randomizer", 1, LoadRandomizerVersion1);
AddLoadFunction("randomizer", 2, LoadRandomizerVersion2);
AddSaveFunction("randomizer", 2, SaveRandomizer);
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
AddInitFunction(InitFileImpl);
for (SaveFileMetaInfo& info : fileMetaInfo) {
info.valid = false;
info.deaths = 0;
for (int i = 0; i < ARRAY_COUNT(info.playerName); i++) {
info.playerName[i] = '\0';
}
info.healthCapacity = 0;
info.questItems = 0;
info.defense = 0;
info.health = 0;
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
for (int i = 0; i < ARRAY_COUNT(info.seedHash); i++) {
info.seedHash[i] = 0;
}
info.randoSave = 0;
Dual OTR MQ and Vanilla Support (#1694) * Changes OTR Extraction to have specific mq and nonmq paths. Also updates the game to load resources according to whether or not Master Quest or Vanilla is loaded. * Removes unneeded code from the last commit. * Fixes some weird formatting in ZRom.c * Loads oot-mq.otr and patches oot.otr on top, if both are present. If only one or the other are present, it becomes the only and main OTR. * Adds ImGui Logic for whether or an MQ Checkbox. Checkbox checked only specifies whether new saves should be MQ or not. Checkbox is disabled or force-enabled according to which OTRs are loaded. Also as a necessity includes tracking what game versions have been loaded from the OTRs. * Adds MQ settings logic for Randomizer's ImGui menu. * Writes Master Quest dungeons to the spoiler log * Loads MQ Dungeons from spoiler, persists in save, and loads when appropriate. * Adds logic to prevent loading or creating incompatible rando saves. * Fixdes some linux build issues and new rando save issues * Makes appimage create both vanilla and mq otrs If either rom is present, it makes the corresponding OTR. If both are present, it will make both. If one OTR is present but both roms are present, it will create the missing OTR. * Makes it so a randomized save file will not be marked as MQ. * Refactors to load all OTRs from MainPath or a specific list. Also adds the ability to take a std::unordered_set of hashes to validate each OTR's version file against. * Fixes a syntax error * Makes ExtractAssets output Vanilla and MQ OTRs if both roms are present * Fixes asset generation bug. * Partially working fix for dual OTR extract_assets Currently the cmake ExtractAssets target will return with a 1 if you only end up exporting one type of OTR isntead of both. Haven't found a great way to only attempt to copy a file if it exists from within cmake. It does actually correctly copy the OTR that is generated, despite the error from copying the other one. Pushing as is for now but will keep investigating. * Adds oot-mq.otr to the gitignore. * Makes ExtractAssets not fail on only one rom/OTR. * Removes PatchesPath from the constructors requiring OTRFiles vector. * Renames OOT_UNKNOWN to just UNKNOWN to remove OOT specific reference. * Removes randomizing MQ Dungeons and re-disables MQ rando. Doing this so the PR can get merged quicker with just the Dual OTR support and won't need to wait on rando logic to be updated. That will happen in another PR directly after the merge. * Update mac startup script for dual otr * Update soh/macosx/soh-macos.sh * Update soh/macosx/soh-macos.sh * Update soh/macosx/soh-macos.sh * Implements new BinaryReader to fix Linux build issue. BinaryReader itself comes from https://github.com/Moneyl/BinaryTools I added a wrapper to adapt it to the ABI from ZAPD's Binary Reader and add Endianness checking. I also had to copy a handful of other bits and pieces from ZAPD to make it all function as expected. * A few edits to the updatream BinaryReader to compile it on Linux. * Adds the Endianness to the first byte of the version file. * Fixes Jenkins * Addresses some of Kenix's comments * Renames `ReadNullTerminatedString` to `ReadCString` * Refactors Archive::LoadFile into a private method with more arguments. * Removes BitConverter and extends existing endianness.h instead. * Fixes an endianness issue with the version file. Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2022-10-16 23:07:35 -04:00
info.requiresMasterQuest = 0;
info.requiresOriginal = 0;
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
}
}
void SaveManager::LoadRandomizerVersion1() {
for (int i = 0; i < ARRAY_COUNT(gSaveContext.itemLocations); i++) {
2022-10-03 19:15:36 -04:00
SaveManager::Instance->LoadStruct("get" + std::to_string(i), [&]() {
SaveManager::Instance->LoadData("rgID", gSaveContext.itemLocations[i].get.rgID);
SaveManager::Instance->LoadData("fakeRgID", gSaveContext.itemLocations[i].get.fakeRgID);
std::string trickName;
SaveManager::Instance->LoadData("trickName", trickName);
strncpy(gSaveContext.itemLocations[i].get.trickName, trickName.c_str(), MAX_TRICK_NAME_SIZE);
});
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
SaveManager::Instance->LoadData("check" + std::to_string(i), gSaveContext.itemLocations[i].check);
}
for (int i = 0; i < ARRAY_COUNT(gSaveContext.seedIcons); i++) {
SaveManager::Instance->LoadData("seed" + std::to_string(i), gSaveContext.seedIcons[i]);
}
for (int i = 0; i < ARRAY_COUNT(gSaveContext.randoSettings); i++) {
SaveManager::Instance->LoadData("sk" + std::to_string(i), gSaveContext.randoSettings[i].key);
SaveManager::Instance->LoadData("sv" + std::to_string(i), gSaveContext.randoSettings[i].value);
}
for (int i = 0; i < ARRAY_COUNT(gSaveContext.hintLocations); i++) {
SaveManager::Instance->LoadData("hc" + std::to_string(i), gSaveContext.hintLocations[i].check);
for (int j = 0; j < ARRAY_COUNT(gSaveContext.hintLocations[i].hintText); j++) {
SaveManager::Instance->LoadData("ht" + std::to_string(i) + "-" + std::to_string(j), gSaveContext.hintLocations[i].hintText[j]);
}
}
for (int i = 0; i < ARRAY_COUNT(gSaveContext.childAltarText); i++) {
SaveManager::Instance->LoadData("cat" + std::to_string(i), gSaveContext.childAltarText[i]);
}
for (int i = 0; i < ARRAY_COUNT(gSaveContext.adultAltarText); i++) {
SaveManager::Instance->LoadData("aat" + std::to_string(i), gSaveContext.adultAltarText[i]);
}
for (int i = 0; i < ARRAY_COUNT(gSaveContext.ganonHintText); i++) {
SaveManager::Instance->LoadData("ght" + std::to_string(i), gSaveContext.ganonHintText[i]);
}
for (int i = 0; i < ARRAY_COUNT(gSaveContext.ganonText); i++) {
SaveManager::Instance->LoadData("gt" + std::to_string(i), gSaveContext.ganonText[i]);
}
Randomizer v2 (#1065) * Revert changes to GetItemFromGet * Fixes Ganon's Boss Key shuffled while regular boss Keys aren't. * Enum + combo box * Add obtainability checks correctly * combobox title rename + no number tracking * Fix repeatable purchases and bottles rendering incorrectly * Move shopsanity option in GUI * Struct instead of ImVec + basic comportment for all case * Attempt to fix odd build issue * Cast randoGet for ganons boss key * Remove redundancy in KD room * Update logic Cvar names * Fix Ganons Trials coming from old save files. Fixes #1365 * Fixes crash when entering Ganon's Castle lobby on linux. * Makes `Item_Give` safe to use with a NULL globalCtx. This should allow it's use for giving items to Link's Pocket during rando save initialization. * Converts Song from Impa to use `Item_Give` * Adds more options for Link's starting item. * Removes unneeded `GiveLinkItem` functions. * and make it build * bring back new rando dropdown * gSaveContext access in GameMenuBar.cpp * Implement Skip Scarecrow's Song * Reimplement progressive Bombchus * Rando-next: Deku Nut and Seed ammo gives a blue rupee Fixes #1390 * Fixes Link starting with BGS * Persist item tracker notes * Adjust Hooks include * Use SohImGui::RequestCvarSaveOnNextTick * Fix issues from LUS refactor * Fix for overriding deku scrub messages * Fix mistake from merge oops * Restore checkboxes to enhancements menu These got lost in the merge * Update location access logic Including MQ locations in Spirit and GC now * Implement rando bombchu drops * Missing break * Simplify mudwall collision check There was no need to have a second collider specifically for Ice Arrow hits * Update settings.cpp * Simplify mudwall collision check * Restore checkboxes in menu Accidentally lost these during merge * Clean up bool * Update logic Cvar name * Fixed capacity on ammmo tracking * Fix for beans obtainability * Hook into file delete and clear notes * Incorporate magic arrows in rando settings * Update tooltip To inform the player that they might have to reload the room if they're enabling this for the first time. * Update tooltip * Add line break in tooltip * Tooltip wording + line break * tweak on main logic * All color logic for all types * Fix: changes to please new LUS * Ensure itemTrackerNotes vector is not fully empty * Implement's Tycoon Wallet. * Refactor DrawItemCount and Use EnhancementCombobox for tracker capacity options * small tweaks and rename * always display XX/YY when in ammo/capacity mode * Move all merchant messages to be generated on file load * added hovertext for the number display * Swap german and french translations for shop messages * Set key colors to be on by default * Add another flag to skip mask shop * Fix Sold Out bug * Fix gerudo keys, add disabled checkbox * tooltip line break * Add trials required and merchant prices to save file instead of loading from active spoiler log * Remove trialsRequired persisting in save manager * Adds slotIndex to girla (shop item actor) and uses that for IdentifyShopItem. * Fix issue when merchantPrices is empty * Fix for a single zeroed merchantPrice entry * Fix #1417 * Implements items selling out and fixes issues with purchasing some items. * Fixes order of operations so Rupees will be spent. * Fixes sold out items not getting overwritten by the randomized info. * Clarify var names and comments Also preserve chain platform cutscene in spirit based on Link's position * Remove !=0 from cvar check * Clarify var names and comments * Rename randomizerMerchantPrices to merchantPrices * Handle shop items in SaveManager * Fix merge mistake * Base whats in the bazaar shop on entranceIndex instead of age * Tidy up chain platform cutscene check * Fix merge error Didn't mean to have Zhora changes in here yet * Use 3drando item table for parsing spoiler names * Use another nested method instead of one at the top level to fetch the table * Add missing newline * Remove log * Respect custom draw functions * Fix issues with rendering songs * Fix localized item names for shopsanity * Implements a larger array of Sprites for the Icon Hash. * Uses the hash instead of seed for spoilerfile name and icons. * Removes some unused functions and variables in `spoiler_log.cpp` * Prevents leading 0s added to hash from being in file name * Changes filename format to icon indexes separated by dashes * Hopefully makes Jenkins happy * Hopefully makes Jenkins happy * [Rando] Child Gerudo Fortress 37th Heartpiece randomized Fixes #1071 * Add descriptions to save editor flags editor, and added randomizer flags (#1386) * Add descriptions to save editor flags editor, and added randomizer flags * Hide randomizer flags when not on a randomizer save * Move flag descriptions to header file * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Fix merge error * crash on pause menu on linux (only in appimage) Fixes #1437 * Applies fix to Song from Impa as well. * Allow buying tunics as child when shopsanity is on * Fix for custom draw methods overriding sold out sign * Simplify logic around shopsanity and fix some issues * Fix dungeon reward stone rotation and add particles * Fix some issues with ice traps * Fix adult wallet having its own max capacity * Fix amount of keys given for BotW * format * Use EnGirlAShopItem enum instead of raw hex values * [#1434] Renders non-warp songs more consistently with warp songs * A few changes around merchant messages * Various changes from PR feedback * Rando: Junk Hint missing french translation * Typo * Fix free scrub being at 0 instead of TEXT_SCRUB_RANDOM * Replace magic numbers in message handler * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fix BGS softlock for shopsanity * Support tycoon wallet on tracker * Revert "Fix BGS softlock for shopsanity" This reverts commit 5fdb961ea460fb9a035cf0bb6ae77bfeedc1de0f. * [#1053] Resolves an issue with shop items and bombchu bowling where BGS would display two message boxes * Implements some necessary plumbing and resolves several Ice Trap Softlocks. Adds a way for an item entry to tell what type of check it came from (NPC vs Chest vs Freestanding, etc.) Sets this value from chests and item00 actors. Relocates pendingIceTraps to save context so it can persist through cutscenes and get stored on save init for Link's Pocket and Song from Impa. Restructures pendingIceTraps into a counter rather than a true or false, so that we can be frozen multiple times in a row if applicable (atm that should only be at the start of a run if Link's Pocket and Song from Impa were both Ice Traps). Adds a textbox for Ice Traps and a special case of holding up nothing in the get item process. This fixes all the cases where Ice Traps would softlock due to the actor giving the item expecting a closing textbox. After holding the item above his head Link increments the pendingIceTraps counter by one and sets whatever flag he has pending. None of the above plumbing applies to Ice Traps from chests, those work exactly the same as before, as do freestanding item00 ice traps (thanks to the additional check for ITEM_FROM_FREESTANDING. OoT and Ruto's Letter count as NPC's, so they get the FOWL text box and set a pending ice trap rather than immediately freezing, since Link weill be in the water. Link will get frozen the next time he touches land, which in the case of OoT is after the fade to white and right before the Song of Time check. Fixes all the other softlocks I'm aware of, including Fishing, Bombchu Bowling, Skull Kid, and losing the second Gerudo Archery check. * fix bgs check in player * move bgs logic for tokensanity into MOD_NONE check * set bgs flag before `Item_Give`ing * move bgs flag into `MOD_NONE` check in girla * use existing check in `z_player` * Adds comment explaining the decision to default ITEM_FROM_NPC. * Rename pendingIceTraps to pendingIceTrapCount * Adds some RANDOTODO comments about cleaning up a couple things. * Merge branch 'develop-zhora' into ztornn * manually restore changes to `z_player.c` * Fix after some ice trap prepwork from earlier * Actual fix * Woops * More rupee names * Actually fix it * Add back comment * Fix Skip Scarecrow Song * Fix ruto's letter and LH sun stick rendering * Also fixes it for treasure chest game * Tweak: Rando French Wallet * ADD: French Tycoon * Hide dungeon items/notes by default * [#1301] Fix issue with UI not restoring after getting an item from biggoron * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Fix random crash that only affected one person for some reason Co-authored-by: Garrett Cox <garrettjcox@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Sarge-117 <adam_branston@outlook.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: lil David <1337lilDavid@gmail.com> Co-authored-by: Sarge-117 <108380086+Sarge-117@users.noreply.github.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com>
2022-09-21 00:50:22 -04:00
SaveManager::Instance->LoadData("adultTradeItems", gSaveContext.adultTradeItems);
SaveManager::Instance->LoadData("pendingIceTrapCount", gSaveContext.pendingIceTrapCount);
std::shared_ptr<Randomizer> randomizer = OTRGlobals::Instance->gRandomizer;
randomizer->LoadRandomizerSettings("");
Randomizer v2 (#1065) * Revert changes to GetItemFromGet * Fixes Ganon's Boss Key shuffled while regular boss Keys aren't. * Enum + combo box * Add obtainability checks correctly * combobox title rename + no number tracking * Fix repeatable purchases and bottles rendering incorrectly * Move shopsanity option in GUI * Struct instead of ImVec + basic comportment for all case * Attempt to fix odd build issue * Cast randoGet for ganons boss key * Remove redundancy in KD room * Update logic Cvar names * Fix Ganons Trials coming from old save files. Fixes #1365 * Fixes crash when entering Ganon's Castle lobby on linux. * Makes `Item_Give` safe to use with a NULL globalCtx. This should allow it's use for giving items to Link's Pocket during rando save initialization. * Converts Song from Impa to use `Item_Give` * Adds more options for Link's starting item. * Removes unneeded `GiveLinkItem` functions. * and make it build * bring back new rando dropdown * gSaveContext access in GameMenuBar.cpp * Implement Skip Scarecrow's Song * Reimplement progressive Bombchus * Rando-next: Deku Nut and Seed ammo gives a blue rupee Fixes #1390 * Fixes Link starting with BGS * Persist item tracker notes * Adjust Hooks include * Use SohImGui::RequestCvarSaveOnNextTick * Fix issues from LUS refactor * Fix for overriding deku scrub messages * Fix mistake from merge oops * Restore checkboxes to enhancements menu These got lost in the merge * Update location access logic Including MQ locations in Spirit and GC now * Implement rando bombchu drops * Missing break * Simplify mudwall collision check There was no need to have a second collider specifically for Ice Arrow hits * Update settings.cpp * Simplify mudwall collision check * Restore checkboxes in menu Accidentally lost these during merge * Clean up bool * Update logic Cvar name * Fixed capacity on ammmo tracking * Fix for beans obtainability * Hook into file delete and clear notes * Incorporate magic arrows in rando settings * Update tooltip To inform the player that they might have to reload the room if they're enabling this for the first time. * Update tooltip * Add line break in tooltip * Tooltip wording + line break * tweak on main logic * All color logic for all types * Fix: changes to please new LUS * Ensure itemTrackerNotes vector is not fully empty * Implement's Tycoon Wallet. * Refactor DrawItemCount and Use EnhancementCombobox for tracker capacity options * small tweaks and rename * always display XX/YY when in ammo/capacity mode * Move all merchant messages to be generated on file load * added hovertext for the number display * Swap german and french translations for shop messages * Set key colors to be on by default * Add another flag to skip mask shop * Fix Sold Out bug * Fix gerudo keys, add disabled checkbox * tooltip line break * Add trials required and merchant prices to save file instead of loading from active spoiler log * Remove trialsRequired persisting in save manager * Adds slotIndex to girla (shop item actor) and uses that for IdentifyShopItem. * Fix issue when merchantPrices is empty * Fix for a single zeroed merchantPrice entry * Fix #1417 * Implements items selling out and fixes issues with purchasing some items. * Fixes order of operations so Rupees will be spent. * Fixes sold out items not getting overwritten by the randomized info. * Clarify var names and comments Also preserve chain platform cutscene in spirit based on Link's position * Remove !=0 from cvar check * Clarify var names and comments * Rename randomizerMerchantPrices to merchantPrices * Handle shop items in SaveManager * Fix merge mistake * Base whats in the bazaar shop on entranceIndex instead of age * Tidy up chain platform cutscene check * Fix merge error Didn't mean to have Zhora changes in here yet * Use 3drando item table for parsing spoiler names * Use another nested method instead of one at the top level to fetch the table * Add missing newline * Remove log * Respect custom draw functions * Fix issues with rendering songs * Fix localized item names for shopsanity * Implements a larger array of Sprites for the Icon Hash. * Uses the hash instead of seed for spoilerfile name and icons. * Removes some unused functions and variables in `spoiler_log.cpp` * Prevents leading 0s added to hash from being in file name * Changes filename format to icon indexes separated by dashes * Hopefully makes Jenkins happy * Hopefully makes Jenkins happy * [Rando] Child Gerudo Fortress 37th Heartpiece randomized Fixes #1071 * Add descriptions to save editor flags editor, and added randomizer flags (#1386) * Add descriptions to save editor flags editor, and added randomizer flags * Hide randomizer flags when not on a randomizer save * Move flag descriptions to header file * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Fix merge error * crash on pause menu on linux (only in appimage) Fixes #1437 * Applies fix to Song from Impa as well. * Allow buying tunics as child when shopsanity is on * Fix for custom draw methods overriding sold out sign * Simplify logic around shopsanity and fix some issues * Fix dungeon reward stone rotation and add particles * Fix some issues with ice traps * Fix adult wallet having its own max capacity * Fix amount of keys given for BotW * format * Use EnGirlAShopItem enum instead of raw hex values * [#1434] Renders non-warp songs more consistently with warp songs * A few changes around merchant messages * Various changes from PR feedback * Rando: Junk Hint missing french translation * Typo * Fix free scrub being at 0 instead of TEXT_SCRUB_RANDOM * Replace magic numbers in message handler * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fix BGS softlock for shopsanity * Support tycoon wallet on tracker * Revert "Fix BGS softlock for shopsanity" This reverts commit 5fdb961ea460fb9a035cf0bb6ae77bfeedc1de0f. * [#1053] Resolves an issue with shop items and bombchu bowling where BGS would display two message boxes * Implements some necessary plumbing and resolves several Ice Trap Softlocks. Adds a way for an item entry to tell what type of check it came from (NPC vs Chest vs Freestanding, etc.) Sets this value from chests and item00 actors. Relocates pendingIceTraps to save context so it can persist through cutscenes and get stored on save init for Link's Pocket and Song from Impa. Restructures pendingIceTraps into a counter rather than a true or false, so that we can be frozen multiple times in a row if applicable (atm that should only be at the start of a run if Link's Pocket and Song from Impa were both Ice Traps). Adds a textbox for Ice Traps and a special case of holding up nothing in the get item process. This fixes all the cases where Ice Traps would softlock due to the actor giving the item expecting a closing textbox. After holding the item above his head Link increments the pendingIceTraps counter by one and sets whatever flag he has pending. None of the above plumbing applies to Ice Traps from chests, those work exactly the same as before, as do freestanding item00 ice traps (thanks to the additional check for ITEM_FROM_FREESTANDING. OoT and Ruto's Letter count as NPC's, so they get the FOWL text box and set a pending ice trap rather than immediately freezing, since Link weill be in the water. Link will get frozen the next time he touches land, which in the case of OoT is after the fade to white and right before the Song of Time check. Fixes all the other softlocks I'm aware of, including Fishing, Bombchu Bowling, Skull Kid, and losing the second Gerudo Archery check. * fix bgs check in player * move bgs logic for tokensanity into MOD_NONE check * set bgs flag before `Item_Give`ing * move bgs flag into `MOD_NONE` check in girla * use existing check in `z_player` * Adds comment explaining the decision to default ITEM_FROM_NPC. * Rename pendingIceTraps to pendingIceTrapCount * Adds some RANDOTODO comments about cleaning up a couple things. * Merge branch 'develop-zhora' into ztornn * manually restore changes to `z_player.c` * Fix after some ice trap prepwork from earlier * Actual fix * Woops * More rupee names * Actually fix it * Add back comment * Fix Skip Scarecrow Song * Fix ruto's letter and LH sun stick rendering * Also fixes it for treasure chest game * Tweak: Rando French Wallet * ADD: French Tycoon * Hide dungeon items/notes by default * [#1301] Fix issue with UI not restoring after getting an item from biggoron * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Fix random crash that only affected one person for some reason Co-authored-by: Garrett Cox <garrettjcox@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Sarge-117 <adam_branston@outlook.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: lil David <1337lilDavid@gmail.com> Co-authored-by: Sarge-117 <108380086+Sarge-117@users.noreply.github.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com>
2022-09-21 00:50:22 -04:00
size_t merchantPricesSize = 0;
if (randomizer->GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) != RO_SCRUBS_OFF) {
Randomizer v2 (#1065) * Revert changes to GetItemFromGet * Fixes Ganon's Boss Key shuffled while regular boss Keys aren't. * Enum + combo box * Add obtainability checks correctly * combobox title rename + no number tracking * Fix repeatable purchases and bottles rendering incorrectly * Move shopsanity option in GUI * Struct instead of ImVec + basic comportment for all case * Attempt to fix odd build issue * Cast randoGet for ganons boss key * Remove redundancy in KD room * Update logic Cvar names * Fix Ganons Trials coming from old save files. Fixes #1365 * Fixes crash when entering Ganon's Castle lobby on linux. * Makes `Item_Give` safe to use with a NULL globalCtx. This should allow it's use for giving items to Link's Pocket during rando save initialization. * Converts Song from Impa to use `Item_Give` * Adds more options for Link's starting item. * Removes unneeded `GiveLinkItem` functions. * and make it build * bring back new rando dropdown * gSaveContext access in GameMenuBar.cpp * Implement Skip Scarecrow's Song * Reimplement progressive Bombchus * Rando-next: Deku Nut and Seed ammo gives a blue rupee Fixes #1390 * Fixes Link starting with BGS * Persist item tracker notes * Adjust Hooks include * Use SohImGui::RequestCvarSaveOnNextTick * Fix issues from LUS refactor * Fix for overriding deku scrub messages * Fix mistake from merge oops * Restore checkboxes to enhancements menu These got lost in the merge * Update location access logic Including MQ locations in Spirit and GC now * Implement rando bombchu drops * Missing break * Simplify mudwall collision check There was no need to have a second collider specifically for Ice Arrow hits * Update settings.cpp * Simplify mudwall collision check * Restore checkboxes in menu Accidentally lost these during merge * Clean up bool * Update logic Cvar name * Fixed capacity on ammmo tracking * Fix for beans obtainability * Hook into file delete and clear notes * Incorporate magic arrows in rando settings * Update tooltip To inform the player that they might have to reload the room if they're enabling this for the first time. * Update tooltip * Add line break in tooltip * Tooltip wording + line break * tweak on main logic * All color logic for all types * Fix: changes to please new LUS * Ensure itemTrackerNotes vector is not fully empty * Implement's Tycoon Wallet. * Refactor DrawItemCount and Use EnhancementCombobox for tracker capacity options * small tweaks and rename * always display XX/YY when in ammo/capacity mode * Move all merchant messages to be generated on file load * added hovertext for the number display * Swap german and french translations for shop messages * Set key colors to be on by default * Add another flag to skip mask shop * Fix Sold Out bug * Fix gerudo keys, add disabled checkbox * tooltip line break * Add trials required and merchant prices to save file instead of loading from active spoiler log * Remove trialsRequired persisting in save manager * Adds slotIndex to girla (shop item actor) and uses that for IdentifyShopItem. * Fix issue when merchantPrices is empty * Fix for a single zeroed merchantPrice entry * Fix #1417 * Implements items selling out and fixes issues with purchasing some items. * Fixes order of operations so Rupees will be spent. * Fixes sold out items not getting overwritten by the randomized info. * Clarify var names and comments Also preserve chain platform cutscene in spirit based on Link's position * Remove !=0 from cvar check * Clarify var names and comments * Rename randomizerMerchantPrices to merchantPrices * Handle shop items in SaveManager * Fix merge mistake * Base whats in the bazaar shop on entranceIndex instead of age * Tidy up chain platform cutscene check * Fix merge error Didn't mean to have Zhora changes in here yet * Use 3drando item table for parsing spoiler names * Use another nested method instead of one at the top level to fetch the table * Add missing newline * Remove log * Respect custom draw functions * Fix issues with rendering songs * Fix localized item names for shopsanity * Implements a larger array of Sprites for the Icon Hash. * Uses the hash instead of seed for spoilerfile name and icons. * Removes some unused functions and variables in `spoiler_log.cpp` * Prevents leading 0s added to hash from being in file name * Changes filename format to icon indexes separated by dashes * Hopefully makes Jenkins happy * Hopefully makes Jenkins happy * [Rando] Child Gerudo Fortress 37th Heartpiece randomized Fixes #1071 * Add descriptions to save editor flags editor, and added randomizer flags (#1386) * Add descriptions to save editor flags editor, and added randomizer flags * Hide randomizer flags when not on a randomizer save * Move flag descriptions to header file * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Fix merge error * crash on pause menu on linux (only in appimage) Fixes #1437 * Applies fix to Song from Impa as well. * Allow buying tunics as child when shopsanity is on * Fix for custom draw methods overriding sold out sign * Simplify logic around shopsanity and fix some issues * Fix dungeon reward stone rotation and add particles * Fix some issues with ice traps * Fix adult wallet having its own max capacity * Fix amount of keys given for BotW * format * Use EnGirlAShopItem enum instead of raw hex values * [#1434] Renders non-warp songs more consistently with warp songs * A few changes around merchant messages * Various changes from PR feedback * Rando: Junk Hint missing french translation * Typo * Fix free scrub being at 0 instead of TEXT_SCRUB_RANDOM * Replace magic numbers in message handler * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fix BGS softlock for shopsanity * Support tycoon wallet on tracker * Revert "Fix BGS softlock for shopsanity" This reverts commit 5fdb961ea460fb9a035cf0bb6ae77bfeedc1de0f. * [#1053] Resolves an issue with shop items and bombchu bowling where BGS would display two message boxes * Implements some necessary plumbing and resolves several Ice Trap Softlocks. Adds a way for an item entry to tell what type of check it came from (NPC vs Chest vs Freestanding, etc.) Sets this value from chests and item00 actors. Relocates pendingIceTraps to save context so it can persist through cutscenes and get stored on save init for Link's Pocket and Song from Impa. Restructures pendingIceTraps into a counter rather than a true or false, so that we can be frozen multiple times in a row if applicable (atm that should only be at the start of a run if Link's Pocket and Song from Impa were both Ice Traps). Adds a textbox for Ice Traps and a special case of holding up nothing in the get item process. This fixes all the cases where Ice Traps would softlock due to the actor giving the item expecting a closing textbox. After holding the item above his head Link increments the pendingIceTraps counter by one and sets whatever flag he has pending. None of the above plumbing applies to Ice Traps from chests, those work exactly the same as before, as do freestanding item00 ice traps (thanks to the additional check for ITEM_FROM_FREESTANDING. OoT and Ruto's Letter count as NPC's, so they get the FOWL text box and set a pending ice trap rather than immediately freezing, since Link weill be in the water. Link will get frozen the next time he touches land, which in the case of OoT is after the fade to white and right before the Song of Time check. Fixes all the other softlocks I'm aware of, including Fishing, Bombchu Bowling, Skull Kid, and losing the second Gerudo Archery check. * fix bgs check in player * move bgs logic for tokensanity into MOD_NONE check * set bgs flag before `Item_Give`ing * move bgs flag into `MOD_NONE` check in girla * use existing check in `z_player` * Adds comment explaining the decision to default ITEM_FROM_NPC. * Rename pendingIceTraps to pendingIceTrapCount * Adds some RANDOTODO comments about cleaning up a couple things. * Merge branch 'develop-zhora' into ztornn * manually restore changes to `z_player.c` * Fix after some ice trap prepwork from earlier * Actual fix * Woops * More rupee names * Actually fix it * Add back comment * Fix Skip Scarecrow Song * Fix ruto's letter and LH sun stick rendering * Also fixes it for treasure chest game * Tweak: Rando French Wallet * ADD: French Tycoon * Hide dungeon items/notes by default * [#1301] Fix issue with UI not restoring after getting an item from biggoron * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Fix random crash that only affected one person for some reason Co-authored-by: Garrett Cox <garrettjcox@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Sarge-117 <adam_branston@outlook.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: lil David <1337lilDavid@gmail.com> Co-authored-by: Sarge-117 <108380086+Sarge-117@users.noreply.github.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com>
2022-09-21 00:50:22 -04:00
merchantPricesSize += NUM_SCRUBS;
}
if (randomizer->GetRandoSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF) {
Randomizer v2 (#1065) * Revert changes to GetItemFromGet * Fixes Ganon's Boss Key shuffled while regular boss Keys aren't. * Enum + combo box * Add obtainability checks correctly * combobox title rename + no number tracking * Fix repeatable purchases and bottles rendering incorrectly * Move shopsanity option in GUI * Struct instead of ImVec + basic comportment for all case * Attempt to fix odd build issue * Cast randoGet for ganons boss key * Remove redundancy in KD room * Update logic Cvar names * Fix Ganons Trials coming from old save files. Fixes #1365 * Fixes crash when entering Ganon's Castle lobby on linux. * Makes `Item_Give` safe to use with a NULL globalCtx. This should allow it's use for giving items to Link's Pocket during rando save initialization. * Converts Song from Impa to use `Item_Give` * Adds more options for Link's starting item. * Removes unneeded `GiveLinkItem` functions. * and make it build * bring back new rando dropdown * gSaveContext access in GameMenuBar.cpp * Implement Skip Scarecrow's Song * Reimplement progressive Bombchus * Rando-next: Deku Nut and Seed ammo gives a blue rupee Fixes #1390 * Fixes Link starting with BGS * Persist item tracker notes * Adjust Hooks include * Use SohImGui::RequestCvarSaveOnNextTick * Fix issues from LUS refactor * Fix for overriding deku scrub messages * Fix mistake from merge oops * Restore checkboxes to enhancements menu These got lost in the merge * Update location access logic Including MQ locations in Spirit and GC now * Implement rando bombchu drops * Missing break * Simplify mudwall collision check There was no need to have a second collider specifically for Ice Arrow hits * Update settings.cpp * Simplify mudwall collision check * Restore checkboxes in menu Accidentally lost these during merge * Clean up bool * Update logic Cvar name * Fixed capacity on ammmo tracking * Fix for beans obtainability * Hook into file delete and clear notes * Incorporate magic arrows in rando settings * Update tooltip To inform the player that they might have to reload the room if they're enabling this for the first time. * Update tooltip * Add line break in tooltip * Tooltip wording + line break * tweak on main logic * All color logic for all types * Fix: changes to please new LUS * Ensure itemTrackerNotes vector is not fully empty * Implement's Tycoon Wallet. * Refactor DrawItemCount and Use EnhancementCombobox for tracker capacity options * small tweaks and rename * always display XX/YY when in ammo/capacity mode * Move all merchant messages to be generated on file load * added hovertext for the number display * Swap german and french translations for shop messages * Set key colors to be on by default * Add another flag to skip mask shop * Fix Sold Out bug * Fix gerudo keys, add disabled checkbox * tooltip line break * Add trials required and merchant prices to save file instead of loading from active spoiler log * Remove trialsRequired persisting in save manager * Adds slotIndex to girla (shop item actor) and uses that for IdentifyShopItem. * Fix issue when merchantPrices is empty * Fix for a single zeroed merchantPrice entry * Fix #1417 * Implements items selling out and fixes issues with purchasing some items. * Fixes order of operations so Rupees will be spent. * Fixes sold out items not getting overwritten by the randomized info. * Clarify var names and comments Also preserve chain platform cutscene in spirit based on Link's position * Remove !=0 from cvar check * Clarify var names and comments * Rename randomizerMerchantPrices to merchantPrices * Handle shop items in SaveManager * Fix merge mistake * Base whats in the bazaar shop on entranceIndex instead of age * Tidy up chain platform cutscene check * Fix merge error Didn't mean to have Zhora changes in here yet * Use 3drando item table for parsing spoiler names * Use another nested method instead of one at the top level to fetch the table * Add missing newline * Remove log * Respect custom draw functions * Fix issues with rendering songs * Fix localized item names for shopsanity * Implements a larger array of Sprites for the Icon Hash. * Uses the hash instead of seed for spoilerfile name and icons. * Removes some unused functions and variables in `spoiler_log.cpp` * Prevents leading 0s added to hash from being in file name * Changes filename format to icon indexes separated by dashes * Hopefully makes Jenkins happy * Hopefully makes Jenkins happy * [Rando] Child Gerudo Fortress 37th Heartpiece randomized Fixes #1071 * Add descriptions to save editor flags editor, and added randomizer flags (#1386) * Add descriptions to save editor flags editor, and added randomizer flags * Hide randomizer flags when not on a randomizer save * Move flag descriptions to header file * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Fix merge error * crash on pause menu on linux (only in appimage) Fixes #1437 * Applies fix to Song from Impa as well. * Allow buying tunics as child when shopsanity is on * Fix for custom draw methods overriding sold out sign * Simplify logic around shopsanity and fix some issues * Fix dungeon reward stone rotation and add particles * Fix some issues with ice traps * Fix adult wallet having its own max capacity * Fix amount of keys given for BotW * format * Use EnGirlAShopItem enum instead of raw hex values * [#1434] Renders non-warp songs more consistently with warp songs * A few changes around merchant messages * Various changes from PR feedback * Rando: Junk Hint missing french translation * Typo * Fix free scrub being at 0 instead of TEXT_SCRUB_RANDOM * Replace magic numbers in message handler * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fix BGS softlock for shopsanity * Support tycoon wallet on tracker * Revert "Fix BGS softlock for shopsanity" This reverts commit 5fdb961ea460fb9a035cf0bb6ae77bfeedc1de0f. * [#1053] Resolves an issue with shop items and bombchu bowling where BGS would display two message boxes * Implements some necessary plumbing and resolves several Ice Trap Softlocks. Adds a way for an item entry to tell what type of check it came from (NPC vs Chest vs Freestanding, etc.) Sets this value from chests and item00 actors. Relocates pendingIceTraps to save context so it can persist through cutscenes and get stored on save init for Link's Pocket and Song from Impa. Restructures pendingIceTraps into a counter rather than a true or false, so that we can be frozen multiple times in a row if applicable (atm that should only be at the start of a run if Link's Pocket and Song from Impa were both Ice Traps). Adds a textbox for Ice Traps and a special case of holding up nothing in the get item process. This fixes all the cases where Ice Traps would softlock due to the actor giving the item expecting a closing textbox. After holding the item above his head Link increments the pendingIceTraps counter by one and sets whatever flag he has pending. None of the above plumbing applies to Ice Traps from chests, those work exactly the same as before, as do freestanding item00 ice traps (thanks to the additional check for ITEM_FROM_FREESTANDING. OoT and Ruto's Letter count as NPC's, so they get the FOWL text box and set a pending ice trap rather than immediately freezing, since Link weill be in the water. Link will get frozen the next time he touches land, which in the case of OoT is after the fade to white and right before the Song of Time check. Fixes all the other softlocks I'm aware of, including Fishing, Bombchu Bowling, Skull Kid, and losing the second Gerudo Archery check. * fix bgs check in player * move bgs logic for tokensanity into MOD_NONE check * set bgs flag before `Item_Give`ing * move bgs flag into `MOD_NONE` check in girla * use existing check in `z_player` * Adds comment explaining the decision to default ITEM_FROM_NPC. * Rename pendingIceTraps to pendingIceTrapCount * Adds some RANDOTODO comments about cleaning up a couple things. * Merge branch 'develop-zhora' into ztornn * manually restore changes to `z_player.c` * Fix after some ice trap prepwork from earlier * Actual fix * Woops * More rupee names * Actually fix it * Add back comment * Fix Skip Scarecrow Song * Fix ruto's letter and LH sun stick rendering * Also fixes it for treasure chest game * Tweak: Rando French Wallet * ADD: French Tycoon * Hide dungeon items/notes by default * [#1301] Fix issue with UI not restoring after getting an item from biggoron * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Fix random crash that only affected one person for some reason Co-authored-by: Garrett Cox <garrettjcox@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Sarge-117 <adam_branston@outlook.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: lil David <1337lilDavid@gmail.com> Co-authored-by: Sarge-117 <108380086+Sarge-117@users.noreply.github.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com>
2022-09-21 00:50:22 -04:00
merchantPricesSize += NUM_SHOP_ITEMS;
}
SaveManager::Instance->LoadArray("merchantPrices", merchantPricesSize, [&](size_t i) {
SaveManager::Instance->LoadStruct("", [&]() {
RandomizerCheck rc;
SaveManager::Instance->LoadData("check", rc);
uint32_t price;
SaveManager::Instance->LoadData("price", price);
randomizer->merchantPrices[rc] = price;
});
});
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
}
void SaveManager::LoadRandomizerVersion2() {
SaveManager::Instance->LoadArray("itemLocations", RC_MAX, [&](size_t i) {
gSaveContext.itemLocations[i].check = RandomizerCheck(i);
2022-10-03 19:15:36 -04:00
SaveManager::Instance->LoadStruct("", [&]() {
SaveManager::Instance->LoadData("rgID", gSaveContext.itemLocations[i].get.rgID);
SaveManager::Instance->LoadData("fakeRgID", gSaveContext.itemLocations[i].get.fakeRgID);
std::string trickName;
SaveManager::Instance->LoadData("trickName", trickName);
strncpy(gSaveContext.itemLocations[i].get.trickName, trickName.c_str(), MAX_TRICK_NAME_SIZE);
});
});
Nintendo switch support (#935) * Moved gfx effects to the gpu and removed loadtexbyname on some textures * Readded empty if * Added nintendo switch support * Fixed compilation errors and window closing issue on linux * Fixed kaleido on 64 bit * Fixed audio on nintendo switch * Implemented performance mode switcher * Added suggestions from pr review * Fixed ftruncate errors * Fixed compilation errors * Added missing include rule * Fixed libstorm path * Removed ftruncate extern to use a correct posix version * Merge branch 'develop' from HarbourMasters into znx (#3) * Add Support for macOS (#441) * Fixed soh filters * add more makefile changes * almost ready * more updates * update * update * Update Makefiles to handle both platforms * Allow for overriding the CXX and CC executables * Restore original structure while supporting custom CXX flags * Remove some platform specific libs * Dynamic target name * Make X11 paths package-agnostic * Remove changes to `gfx_opengl.cpp` * Use OpenGL2 on MacOS instead of OpenGL3 * make it actually render something * render at least the first texture, still need to figure out the second one * Let’s use OpenGL 3 again * maybe this works to get the right texture? link's eyes still look off a bit * did this work? * set the platform to macos * actual numbers are right, but logic is ugly XXX/TODO, i know * add zlib to ldflags for ZAPDUtils * A bit of cleanup * Revert unneeded changes * Remove GL_CHECK * Fix issues with z64 branch * use an std::map instead of a giant array * three point filter fix (#2) * Fix mac compilation * fix audio for 64 bit * revert audio heap size, keep bigger pools * Add more Apple specific checks to our modifications * Add building instructions for macOS * Remove unecessary step from building instructions * Add missing SDL2 & GLEW to Linux LDLIBS * Update BUILDING.md Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Update soh/.gitignore to include other arch binaries Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Use right platform name for debugging window Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Fix stormlib on macos (arm64) * Simplify some of the ifdef checks * Revert an older no longer necessary fix * Remove remaining unecessary deviations * Update building instructions after StormLib changes * Feature: Use OpenGL 4.1 (#1) * Further tweak the BUILDING * Tidy up * reword -j message * Add Jenkins CI Support (#2) * Fix type issues * add target <appbundle> and <filledappbundle> add makefile targets to create an .app `filledappbundle` creates the target with the .otr included this should perhaps be moved to Application Support though * pull gcc's rpath from otool output * move make target to the end so it's not default * Add Jenkins and make exe in par with other platforms * Actually save build artefacts * Fix artefact path * Remove x11 mentions and linking (not used) * Update building instructions for generating app * use appsupport directory * Add new app icon * Update target to match macOS types * Update more audio types * fix null deref in Audio_PlayFanfare * Remove old import from z64 * address final nit with apple ifdefs Co-authored-by: KiritoDev <36680385+KiritoDv@users.noreply.github.com> Co-authored-by: Jeffrey Crowell <github@crowell.biz> Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Move macOS to parallel stage * fix linux crash * Ignore all named saves Necessary after new save format * DPad items * Move UI location arrays from static to global to accomodate customizable UI * FIX: Increased the maximum actor limit for draw distance Fix issue #529 * FIX: Remove duplicates of gNewDrops from the enhancements menu * Get rid of erroneous int casts * casts jya_cobra's shadowTexture pointer to uintptr_t instead of s32. * Fix ability to assign equipment you don't own * Fix title cards for market potion shop and bombchu shop * Invalidate message item icon texture before drawing * Add margins for dpad * Fixed some instances where the original OOT save is erroneously preserved or recreated, leading to another conversion next time you launched the game * Headphones setting in game should now work. Resolves #13 * Map Select name fixes * Change Power to Upgrades * Rename Soh* files * Update names * Add more files * Add more files * Add toggles for disabling heart drops and random drops (#507) * Adds toggles for disabling random drops and fixed heart drops * Changed the "No Fixed Heart Drops" toggle to the more useful "No Random Heart Drops" toggle * Adds an explanation that the no heart drops option is similar to Hero Mode * Moved difficulty options into their own sub-menu Moved time saver options into their own sub-menu Moved clutter reducing options into their own sub-menu * fixed the tag name of mweep speed * Moved Skip Text to Experimental * Fix testing masks of DPad * Fix audio, boot commands, and save staes. * add menu from https://github.com/PurpleHato/Shipwright/tree/ResetMenu * implement reset * Update README.md * command on mac * special char doesn't work with default imgui font * change name based on PR comment * missed a couple spots * change sunset in save editor so dampe is out * Update to latest `docking` imgui (#582) * Update to latest `docking` imgui commit: 67410d53f739b6a0df138e2252f0e5136b42062f * Fix modified import for SDL * Update imgui_impl_sdl.cpp * Add Imgui include path for better imports * Controller Navigation Fix-Up (#544) * Controller Navigation Fix-Up * [MISC] Fix typo * Use Macro for __FILE__ & __LINE__ when possible (#559) * First batch some overlay * Almost all overlay * effect & gamestate * kaleido stuffs * more overlay * more left over from code folder * remaining hardcoded line and file * Open & Close _DISP __FILE__ & __LINE__ clean up * Some if (1) {} remove * LOG_xxxx __FILE__ , __LINE__ cleaned * ASSERT macro __FILE__ __LINE__ * mtx without line/file in functions * " if (1) {} " & "if (0) {}" and tab/white place * LogUtils as macro * GameState_, GameAlloc_, SystemArena_ & ZeldaArena_ * Revert "GameState_, GameAlloc_, SystemArena_ & ZeldaArena_" This reverts commit 0d85caaf7e342648c01a15fe21e93637352dc596. * Like last commit but as macro * Fix matrix not using macros * use function not macro * DebugArena_* functions GameAlloc_MallocDebug BgCheck_PosErrorCheck as macros removed issues with ; in macro file * MM Bunny Hood enhancements: no age restrictions & wear across entrances (#560) * Remove age restriction on MM Bunny Hood * Handle mask slot changing; init Link wearing mask * Reset mask state after selling * Use unordered maps in some hot paths (#566) * Use unordered maps in some hot paths * Address PR comments * Cheat: Infinite Epona Boost (#577) * Cheat: Infinite Epona Boost * Edit for readability * update pulseaudio for 44.1khz audio (#587) * use pulseaudio defaults * spaces/tabs * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate Co-authored-by: briaguya <briaguya@alice> * Restoration Item Sliders (#595) * Allows players to set custom restoration values for potions and milk * Fixed a dumb oversight * implemented fairy sliders * use ini window resolution (#410) * use ini window resolution * use arguments for directx window size * default 640x480 not 320x240 * kick off a build * and revert * default config 640x480 not 320x240 * add todo Co-authored-by: briaguya <briaguya@alice> * 3D Drops & Projectiles update (#548) * Fix remaining rupee and keys * fix tabs -> spaces * more fix about tabs -> spaces * Better up <-> down mouvement for hearts * remove useless comment * Cosmetics menu rework (#589) * - * DPad/some margin fix(left side) * various ImGui stuff and fixes * disabled kaleido menu (non working) * fix win being dumb * same for C btn this time * Fix windows build * Beating hearts fix * Default win size and some placement fix * Fix Dpad Ammo & C notes, Kaleido, white dog * some texts fix and tab move * Add stone of agony, some fixes and build correctly * precise item place with Dpad * Gamecube -> GameCube Co-authored-by: Baoulettes <iMacWin10> * [CI] Create an Appimage for 64bit builds (#570) * [CI] Create AppImage file * [CI] Updated Jenkinsfile * [MISC] fix indentation * [MISC] Fix indentation * [MISC] Fix indentation * [CI] 7z appimage and readme * [CI] AppImage icon file (#597) * [CI] Add patchelf * [BUILD] Include Hi-Res icon * Fix portability use of std::clamp (#596) * Add N64 weird frames and OOB Bombchus cvars (#602) * Add gN64WeirdFrames and gBombchuOOB cvars * Rename gBombchuOOB to gBombchusOOB * Fix pipeline * [BUILD] Do not strip ZAPD (#598) * [BUILD] Do not strip ZAPD * [BUILD] Reuse Icon Asset * [APPIMAGE] Handle paths with spaces * [macos] Distribute optimized builds (#599) * Cosmetics texts fixes (#604) * branch init + few fixes * Reset button * Several texts fixes and default color to GameCube * space issues * some more extra space that was not needed. * space yes last time ... * Arrows being able to be rainbow some more texts fixes * more texts fixes * c-buttons some plurial fix * Fixes bug in demo effect due to removed display list set. * King dodongo room crash (#613) * first attempt * force camera setting to be at least 0 (dirty!) * - * reverted something to just include fix * Invalidate text box icon before drawing (#607) * [APPIMAGE] Set lib path for ZAPD (#611) * New drop runtime fix (#614) * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * Fix Ganon's Castle title cards (#606) * Checkered room crash workaround (#615) * Increase poly and vertex count for dyna actors * Add TODO * Only apply fix in Forest Temple * Enable globally * Match case of 'Shipwright' in Linux build (#619) * Fix 0xabababab crash (#617) * Unconditionally setup the normal skybox * Only call Skybox_Setup once ever * Equipment upgrade text fix and any pause slot enhancement fix (#620) * Fix upgrade name text not rendering * Use cvar and don't render equip help for empty item slots * Fix rendering logic * Fix incorrect item name rendered for one frame * Reorder comparison * Remove extra indent * Remove accidental changes * ImGui grammer, consistency, and clarity fixes (#625) * ImGui grammer, consistency, and clarity fixes Co-Authored-By: Stormghetti <56653191+Stormghetti@users.noreply.github.com> * Adds more new lines for users on smaller displays Co-Authored-By: Stormghetti <56653191+Stormghetti@users.noreply.github.com> Co-authored-by: Stormghetti <56653191+Stormghetti@users.noreply.github.com> * New drops shadows & rotation fixes (#627) * fixes * forgot to add heart pieces in rotation logic * Dodongo's Cavern blue warp crash fix (#622) * Doodong's Cavern blue warp crash fix * >= not > * Don't waste a line of space * add support for clang compiler (#592) * hacks to align strings for clang... wow just wow * start work to getting built with clang * fix issues with struct constructors, all builds, doesn't link still * fix some narrowing issues that clang complains about * fix compliation of zapd * fix null deref in VersionInfo * builds with clang * make stringbuilding use StringHelper instead of addition * fix linking * add CLANG SHIP overlay on clang built versions * doesn't need to be volatile * mark unknown strings as extern * rename some stuff * can't align extern * hopefully fix compilation for everythign * expandtab * allow setting LD * Revert "allow setting LD" This reverts commit 711aba6db2c41bab476bd34e878af6a37a7f5559. maybe to use lld it should be a LDFLAG? * -Wno-deprecated-declarations is required for newer versions of clang on macOS 13 beta sdk, the version of apple clang requires this * Add jenkins support for clang * Forward CXX flags to stormlib compilation * Move GCC only flags to check * use exports to set multiarch setup * Fix Jenkins forever * use make instead of cmake --build add some flags to build with clang-11 as well * address review coments - rework extraction to allow multi thread - misc readability cleanup * update makefile to add WARN on linux+clang Co-authored-by: David Chavez <david@dcvz.io> * Fix develop * Fixes grey screen issue + tooltip for 2 handed shield * Don't close controller after SDL has quit (#642) * Don't close controller after SDL has quit * Don't check if controller can rumble if null * Fixes Barinade's set whenever boss fight is reloaded (#639) * Reimplements unused Barinade reset function. * Removes the Jellyfish from Barinade's body on reset. * add the ability to pull graves during the day (#637) * change max internal res multiplier to 3x, use float and % instead of int (#638) * change max internal res multiplier to 3x, use float and % instead of int * Update libultraship/libultraship/ImGuiImpl.cpp Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> * Fixes crash on Biggoron trade failure screen wipe Resolves #621 * fixes center docking (#652) * testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com> * Cosmetics hotfixes (#640) * Initial branch creation * Revert Main Game so it do not conflict later * should fix window build, made namespace for Cosmetics * forgot to edit one title * Ability to add hidden window (usefull for Rainbow) Fix building issues * Line break, unused bool remove * add descriptive todo for death crash bandaid (#655) Co-authored-by: briaguya <briaguya@alice> * Removed legacy audio mode and fixed ganon sound bug (#657) * Free Camera (#337) * wip free cam * Almost done, needs collision still * Added free cam behind cvar * added WIP collision * Fixed & implemented "Manual mode" from WW & TP * Fixed camera not rotating when Link is moving * fixed initialized camera rotation * Fixed camera getting stuck + made it smoother * reduced deadzone * fixed epona camera height + added WW z-target free camera * Adjusted player camera height & fixed fov * Fixed camera roll * fixed fov when moving the camera while in z-target * Camera resets to Auto when going through doors or changing maps * Fixed building * touch * more touch work * Added WIP mouse support to the free cam * gui stuff * fixed building * fixed building error * ok fixed building for real this time * oops * Fix compilation issues * removed mouse stuff that magically appeared in this branch * smoothed out stick values & removed remains of mouse support * re-added manual camera when pressing Z * reduced minimum Y position of camera * Addressed dcsv's nitpicks * part 2 * oops Co-authored-by: David Chavez <david@dcvz.io> * Rando: Allows Malon's Item Check to be obtained by pulling out the Ocarina. [FIXED PR] (#672) * Fixes using the Ocarina to get the check from Malon. Still some cleanup to do here. For some reason the player can shield before receiving the check. It doesn't set the flag if the player does that so they can still try again, but would prefer a different solution if possible. * Prevents Shielding from blocking the Item_Give from happening. * Code Cleanup and comments explaining the new rando flow. * Removes inventory check when pulling out Ocarina This allows OI to properly give the check, which is important for Glitched logic later down the line. Talking to Malon still requires the Ocarina in your inventory. * Prevents non-malon textboxes from triggering the check. Also adds a comment explaining the condtional for getting the check from talking to Malon since it got pretty long. * Actually fixes checking for text boxes. * Relocates a comment for improved clarity. * Fix Rando Water Temple Softlock (#665) We use 3DS logic to generate item placement, but didn't have this specific door in Water Temple unlocked from the beginning like 3DS does. This meant that if people took specific paths through the temple, they could softlock themselves by missing a key. * Rando: GtG and carpenter prompts skip (#663) * Skip gtg and carpenter prompt For rando. Tested and just works. * Fixed missing break * Hide debug overlay behind gDebugEnabled (#660) * Introduce App Directory Path (#572) * Introduce app directory path concept * macos: Remove hacky way of using applicaiton directory * Update the new SaveManager * Address stack user after return * Remove unecessary property * Use std::string for filepath * Improve clang specific detections * Use new path system for imgui files * Improve helper for getting relative paths * fix hidden wnd (#744) * Split damage multiplication into its own PR (#656) * Split damage multiplication into its own PR * Found a more elegant implementation of the powers char*[] * Fixes Maps, Compasses, and Boss Keys in Vanilla. (#751) * .xiF slebaL * Update Keese labels * Fixed soundfont issues * Skip warp song cutscenes in rando (#664) Does it by skipping to the last part of the cutscene data. Tested on all songs, both adult and child. * don't spawn blocking mido after we've already shown him the sword/shield (#675) Co-authored-by: briaguya <briaguya@alice> * Controller Configuration UI and JSON Config (#760) * Initial controller hud ui * Reverted fbdemo changes * Moved config to json and implemented controller config * fix build on linux, gitignore new config file * fix build * Fix compilation and file directory paths * Call save on cvar save * Fixed cvar loading and added deck slots to the config * Changed control deck port 0 to use a physical device by default * Added gyro and rumble & fixed loading errors * Save config on toggle menubar * fix linux build * Fixed drift calculation * Controller config now saves when pressing F1 * Removed ExitGame hook from ImGuiImpl * Moved mappings to a map * Added GetKeyName * untranslate scancodes * Fixed hud layout on keyboard device * Fixed keyboard read on hud * Fixed crash when reloading controllers * Removed ConfigFile and changed file extension * Changed Dummy to Disconnected and fixed filters * Removed function leftover * Changed ControllerHud to InputEditor Co-authored-by: briaguya <briaguya@alice> Co-authored-by: David Chavez <david@dcvz.io> * Enough! My ship sails in the morning. * Fixed menubar items position (#763) * Fixed menubar items position * Reverted tooltip tab position * Fixes macOS randomizer functionality with App Directory (#761) * Fixes macOS randomizer functionality with App Directory * Fix windows build * Update soh/soh/Enhancements/randomizer/3drando/rando_main.cpp * Update soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp * Revert band-aid fix Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> * Fix migration cvar deletion path (#765) * Various controller fixes (#771) * Fix controller * Also fix rumble strength being a bool * Remove ControllerHud.cpp * Downgrade platform toolset back to previous version * Fix gyro * Fix bug that makes binding axes difficult and clear buttons before reading * Exaggerate gyro display and adjust stick binding threshold * Initialize drift thresholds * git subrepo push soh subrepo: subdir: "soh" merged: "75ccbade8" upstream: origin: "https://github.com/HarbourMasters/soh.git" branch: "master" commit: "75ccbade8" git-subrepo: version: "0.4.1" origin: "???" commit: "???" * One more change from PR review * Fix some paths * Fix merge conflict messup * More merge conflict fixes * And another conflict fix * And another fix * Remove reference to removed build files * Add full path to switch cmake Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: KiritoDev <36680385+KiritoDv@users.noreply.github.com> Co-authored-by: Jeffrey Crowell <github@crowell.biz> Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> Co-authored-by: sholdee <102821812+sholdee@users.noreply.github.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: rozlette <Rozelette@users.noreply.github.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: vaguerant <vaguerant@users.noreply.github.com> Co-authored-by: earthcrafterman <banddstudios@gmail.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com> Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: qurious-pixel <62252937+qurious-pixel@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Sirius902 <10891979+Sirius902@users.noreply.github.com> Co-authored-by: modestposer <modestposer@gmail.com> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com> Co-authored-by: Stormghetti <56653191+Stormghetti@users.noreply.github.com> Co-authored-by: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Co-authored-by: MelonSpeedruns <melonspeedruns@outlook.com> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com> Co-authored-by: ChristopherJTrent <ChristopherJTrent@outlook.com> Co-authored-by: agamache <aaroncgamache@gmail.com> Co-authored-by: M4xw <m4x@m4xw.net> * Fixed switch compilation * Fixed responsive on switch imgui * Remove config save hook * Added physical slots into controller name * Add `ifdef` for switch specific code * Add `ifdef` for switch specific code * Added applet mode detection * Replaced homebrew icon * Fixed randomness on applet mode view * Fixed clkrst initialization * Switch profiles cleanup * Cleaned code based on dcvz comments * Remove unused hooks in Mercury * Fixed compilation * Use IMGUI_IMPL_OPENGL_LOADER_CUSTOM * Fix up StormLib modifications * Handle touch events at ImGui/SDL level * Enable opening menu with - * Load Nintendo Switch font * Updates to window initiation * Handle virtual keyboard via SDL * Print OTR missing message to screen * Rename makefile for Switch * Some more additional fixes * Branch creation plus edit Changed ItemWidth & made label invisible (else issues) Added a submit button next to the text field * Removed set_texture_filter on imgui draw * Readded nintendo switch font * Fixed randomizer crash * Fix issue with strdup windows * [SWITCH] Update Jenkins file (#9) * [SWITCH] Update Jenkins file * [SWITCH] Dockerfile.switch Can be combined with other Dockerfile * [SWITCH] Add entrypoint file * Update Jenkinsfile * [SWITCH] Dockerfile mtab link link `/proc/self/mounts /etc/mtab` Co-authored-by: David Chavez <david@dcvz.io> * Cleaned code based on PR comments * Fixed switch compilation * Cleaned full texture cache instead of doing it per char * Randomizer only saves when its not a vanilla save * Disabled input when menubar is opened * Removed return from SetupFont * Cleaned code based on comments * Cleaned up random texts on switch error screen * Killed * Removed debug and changed compilation flags Co-authored-by: KiritoDv <nohomoboi01@gmail.com> Co-authored-by: Felipe Guaycuru <guaycuru@gmail.com> Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: Jeffrey Crowell <github@crowell.biz> Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> Co-authored-by: sholdee <102821812+sholdee@users.noreply.github.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: rozlette <Rozelette@users.noreply.github.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: vaguerant <vaguerant@users.noreply.github.com> Co-authored-by: earthcrafterman <banddstudios@gmail.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com> Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: qurious-pixel <62252937+qurious-pixel@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Sirius902 <10891979+Sirius902@users.noreply.github.com> Co-authored-by: modestposer <modestposer@gmail.com> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com> Co-authored-by: Stormghetti <56653191+Stormghetti@users.noreply.github.com> Co-authored-by: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Co-authored-by: MelonSpeedruns <melonspeedruns@outlook.com> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com> Co-authored-by: ChristopherJTrent <ChristopherJTrent@outlook.com> Co-authored-by: agamache <aaroncgamache@gmail.com> Co-authored-by: M4xw <m4x@m4xw.net>
2022-07-25 21:11:53 -04:00
2022-11-14 06:13:21 -05:00
SaveManager::Instance->LoadArray("entrances", ARRAY_COUNT(gSaveContext.entranceOverrides), [&](size_t i) {
SaveManager::Instance->LoadStruct("", [&]() {
SaveManager::Instance->LoadData("index", gSaveContext.entranceOverrides[i].index);
SaveManager::Instance->LoadData("destination", gSaveContext.entranceOverrides[i].destination);
SaveManager::Instance->LoadData("blueWarp", gSaveContext.entranceOverrides[i].blueWarp);
SaveManager::Instance->LoadData("override", gSaveContext.entranceOverrides[i].override);
SaveManager::Instance->LoadData("overrideDestination", gSaveContext.entranceOverrides[i].overrideDestination);
});
});
SaveManager::Instance->LoadArray("seed", ARRAY_COUNT(gSaveContext.seedIcons), [&](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.seedIcons[i]);
});
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
SaveManager::Instance->LoadArray("randoSettings", RSK_MAX, [&](size_t i) {
gSaveContext.randoSettings[i].key = RandomizerSettingKey(i);
SaveManager::Instance->LoadData("", gSaveContext.randoSettings[i].value);
});
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
SaveManager::Instance->LoadArray("hintLocations", ARRAY_COUNT(gSaveContext.hintLocations), [&](size_t i) {
SaveManager::Instance->LoadStruct("", [&]() {
SaveManager::Instance->LoadData("check", gSaveContext.hintLocations[i].check);
std::string hintText;
SaveManager::Instance->LoadData("hintText", hintText);
memcpy(gSaveContext.hintLocations[i].hintText, hintText.c_str(), hintText.length());
});
});
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
std::string childAltarText;
SaveManager::Instance->LoadData("childAltarText", childAltarText);
memcpy(gSaveContext.childAltarText, childAltarText.c_str(), childAltarText.length());
std::string adultAltarText;
SaveManager::Instance->LoadData("adultAltarText", adultAltarText);
memcpy(gSaveContext.adultAltarText, adultAltarText.c_str(), adultAltarText.length());
std::string ganonHintText;
SaveManager::Instance->LoadData("ganonHintText", ganonHintText);
memcpy(gSaveContext.ganonHintText, ganonHintText.c_str(), ganonHintText.length());
std::string ganonText;
SaveManager::Instance->LoadData("ganonText", ganonText);
memcpy(gSaveContext.ganonText, ganonText.c_str(), ganonText.length());
std::string dampeText;
SaveManager::Instance->LoadData("dampeText", dampeText);
memcpy(gSaveContext.dampeText, dampeText.c_str(), dampeText.length());
2022-12-06 18:37:50 -05:00
std::string warpMinuetText;
SaveManager::Instance->LoadData("warpMinuetText", warpMinuetText);
memcpy(gSaveContext.warpMinuetText, warpMinuetText.c_str(), warpMinuetText.length());
std::string warpBoleroText;
SaveManager::Instance->LoadData("warpBoleroText", warpBoleroText);
memcpy(gSaveContext.warpBoleroText, warpBoleroText.c_str(), warpBoleroText.length());
std::string warpSerenadeText;
SaveManager::Instance->LoadData("warpSerenadeText", warpSerenadeText);
memcpy(gSaveContext.warpSerenadeText, warpSerenadeText.c_str(), warpSerenadeText.length());
std::string warpRequiemText;
SaveManager::Instance->LoadData("warpRequiemText", warpRequiemText);
memcpy(gSaveContext.warpRequiemText, warpRequiemText.c_str(), warpRequiemText.length());
std::string warpNocturneText;
SaveManager::Instance->LoadData("warpNocturneText", warpNocturneText);
memcpy(gSaveContext.warpNocturneText, warpNocturneText.c_str(), warpNocturneText.length());
std::string warpPreludeText;
SaveManager::Instance->LoadData("warpPreludeText", warpPreludeText);
memcpy(gSaveContext.warpPreludeText, warpPreludeText.c_str(), warpPreludeText.length());
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
SaveManager::Instance->LoadData("adultTradeItems", gSaveContext.adultTradeItems);
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
SaveManager::Instance->LoadData("pendingIceTrapCount", gSaveContext.pendingIceTrapCount);
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
std::shared_ptr<Randomizer> randomizer = OTRGlobals::Instance->gRandomizer;
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
size_t merchantPricesSize = 0;
SaveManager::Instance->LoadData("merchantPricesSize", merchantPricesSize);
Randomizer v2 (#1065) * Revert changes to GetItemFromGet * Fixes Ganon's Boss Key shuffled while regular boss Keys aren't. * Enum + combo box * Add obtainability checks correctly * combobox title rename + no number tracking * Fix repeatable purchases and bottles rendering incorrectly * Move shopsanity option in GUI * Struct instead of ImVec + basic comportment for all case * Attempt to fix odd build issue * Cast randoGet for ganons boss key * Remove redundancy in KD room * Update logic Cvar names * Fix Ganons Trials coming from old save files. Fixes #1365 * Fixes crash when entering Ganon's Castle lobby on linux. * Makes `Item_Give` safe to use with a NULL globalCtx. This should allow it's use for giving items to Link's Pocket during rando save initialization. * Converts Song from Impa to use `Item_Give` * Adds more options for Link's starting item. * Removes unneeded `GiveLinkItem` functions. * and make it build * bring back new rando dropdown * gSaveContext access in GameMenuBar.cpp * Implement Skip Scarecrow's Song * Reimplement progressive Bombchus * Rando-next: Deku Nut and Seed ammo gives a blue rupee Fixes #1390 * Fixes Link starting with BGS * Persist item tracker notes * Adjust Hooks include * Use SohImGui::RequestCvarSaveOnNextTick * Fix issues from LUS refactor * Fix for overriding deku scrub messages * Fix mistake from merge oops * Restore checkboxes to enhancements menu These got lost in the merge * Update location access logic Including MQ locations in Spirit and GC now * Implement rando bombchu drops * Missing break * Simplify mudwall collision check There was no need to have a second collider specifically for Ice Arrow hits * Update settings.cpp * Simplify mudwall collision check * Restore checkboxes in menu Accidentally lost these during merge * Clean up bool * Update logic Cvar name * Fixed capacity on ammmo tracking * Fix for beans obtainability * Hook into file delete and clear notes * Incorporate magic arrows in rando settings * Update tooltip To inform the player that they might have to reload the room if they're enabling this for the first time. * Update tooltip * Add line break in tooltip * Tooltip wording + line break * tweak on main logic * All color logic for all types * Fix: changes to please new LUS * Ensure itemTrackerNotes vector is not fully empty * Implement's Tycoon Wallet. * Refactor DrawItemCount and Use EnhancementCombobox for tracker capacity options * small tweaks and rename * always display XX/YY when in ammo/capacity mode * Move all merchant messages to be generated on file load * added hovertext for the number display * Swap german and french translations for shop messages * Set key colors to be on by default * Add another flag to skip mask shop * Fix Sold Out bug * Fix gerudo keys, add disabled checkbox * tooltip line break * Add trials required and merchant prices to save file instead of loading from active spoiler log * Remove trialsRequired persisting in save manager * Adds slotIndex to girla (shop item actor) and uses that for IdentifyShopItem. * Fix issue when merchantPrices is empty * Fix for a single zeroed merchantPrice entry * Fix #1417 * Implements items selling out and fixes issues with purchasing some items. * Fixes order of operations so Rupees will be spent. * Fixes sold out items not getting overwritten by the randomized info. * Clarify var names and comments Also preserve chain platform cutscene in spirit based on Link's position * Remove !=0 from cvar check * Clarify var names and comments * Rename randomizerMerchantPrices to merchantPrices * Handle shop items in SaveManager * Fix merge mistake * Base whats in the bazaar shop on entranceIndex instead of age * Tidy up chain platform cutscene check * Fix merge error Didn't mean to have Zhora changes in here yet * Use 3drando item table for parsing spoiler names * Use another nested method instead of one at the top level to fetch the table * Add missing newline * Remove log * Respect custom draw functions * Fix issues with rendering songs * Fix localized item names for shopsanity * Implements a larger array of Sprites for the Icon Hash. * Uses the hash instead of seed for spoilerfile name and icons. * Removes some unused functions and variables in `spoiler_log.cpp` * Prevents leading 0s added to hash from being in file name * Changes filename format to icon indexes separated by dashes * Hopefully makes Jenkins happy * Hopefully makes Jenkins happy * [Rando] Child Gerudo Fortress 37th Heartpiece randomized Fixes #1071 * Add descriptions to save editor flags editor, and added randomizer flags (#1386) * Add descriptions to save editor flags editor, and added randomizer flags * Hide randomizer flags when not on a randomizer save * Move flag descriptions to header file * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Fix merge error * crash on pause menu on linux (only in appimage) Fixes #1437 * Applies fix to Song from Impa as well. * Allow buying tunics as child when shopsanity is on * Fix for custom draw methods overriding sold out sign * Simplify logic around shopsanity and fix some issues * Fix dungeon reward stone rotation and add particles * Fix some issues with ice traps * Fix adult wallet having its own max capacity * Fix amount of keys given for BotW * format * Use EnGirlAShopItem enum instead of raw hex values * [#1434] Renders non-warp songs more consistently with warp songs * A few changes around merchant messages * Various changes from PR feedback * Rando: Junk Hint missing french translation * Typo * Fix free scrub being at 0 instead of TEXT_SCRUB_RANDOM * Replace magic numbers in message handler * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fix BGS softlock for shopsanity * Support tycoon wallet on tracker * Revert "Fix BGS softlock for shopsanity" This reverts commit 5fdb961ea460fb9a035cf0bb6ae77bfeedc1de0f. * [#1053] Resolves an issue with shop items and bombchu bowling where BGS would display two message boxes * Implements some necessary plumbing and resolves several Ice Trap Softlocks. Adds a way for an item entry to tell what type of check it came from (NPC vs Chest vs Freestanding, etc.) Sets this value from chests and item00 actors. Relocates pendingIceTraps to save context so it can persist through cutscenes and get stored on save init for Link's Pocket and Song from Impa. Restructures pendingIceTraps into a counter rather than a true or false, so that we can be frozen multiple times in a row if applicable (atm that should only be at the start of a run if Link's Pocket and Song from Impa were both Ice Traps). Adds a textbox for Ice Traps and a special case of holding up nothing in the get item process. This fixes all the cases where Ice Traps would softlock due to the actor giving the item expecting a closing textbox. After holding the item above his head Link increments the pendingIceTraps counter by one and sets whatever flag he has pending. None of the above plumbing applies to Ice Traps from chests, those work exactly the same as before, as do freestanding item00 ice traps (thanks to the additional check for ITEM_FROM_FREESTANDING. OoT and Ruto's Letter count as NPC's, so they get the FOWL text box and set a pending ice trap rather than immediately freezing, since Link weill be in the water. Link will get frozen the next time he touches land, which in the case of OoT is after the fade to white and right before the Song of Time check. Fixes all the other softlocks I'm aware of, including Fishing, Bombchu Bowling, Skull Kid, and losing the second Gerudo Archery check. * fix bgs check in player * move bgs logic for tokensanity into MOD_NONE check * set bgs flag before `Item_Give`ing * move bgs flag into `MOD_NONE` check in girla * use existing check in `z_player` * Adds comment explaining the decision to default ITEM_FROM_NPC. * Rename pendingIceTraps to pendingIceTrapCount * Adds some RANDOTODO comments about cleaning up a couple things. * Merge branch 'develop-zhora' into ztornn * manually restore changes to `z_player.c` * Fix after some ice trap prepwork from earlier * Actual fix * Woops * More rupee names * Actually fix it * Add back comment * Fix Skip Scarecrow Song * Fix ruto's letter and LH sun stick rendering * Also fixes it for treasure chest game * Tweak: Rando French Wallet * ADD: French Tycoon * Hide dungeon items/notes by default * [#1301] Fix issue with UI not restoring after getting an item from biggoron * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Fix random crash that only affected one person for some reason Co-authored-by: Garrett Cox <garrettjcox@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Sarge-117 <adam_branston@outlook.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: lil David <1337lilDavid@gmail.com> Co-authored-by: Sarge-117 <108380086+Sarge-117@users.noreply.github.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com>
2022-09-21 00:50:22 -04:00
SaveManager::Instance->LoadArray("merchantPrices", merchantPricesSize, [&](size_t i) {
SaveManager::Instance->LoadStruct("", [&]() {
RandomizerCheck rc;
SaveManager::Instance->LoadData("check", rc);
uint32_t price;
SaveManager::Instance->LoadData("price", price);
randomizer->merchantPrices[rc] = price;
});
});
Dual OTR MQ and Vanilla Support (#1694) * Changes OTR Extraction to have specific mq and nonmq paths. Also updates the game to load resources according to whether or not Master Quest or Vanilla is loaded. * Removes unneeded code from the last commit. * Fixes some weird formatting in ZRom.c * Loads oot-mq.otr and patches oot.otr on top, if both are present. If only one or the other are present, it becomes the only and main OTR. * Adds ImGui Logic for whether or an MQ Checkbox. Checkbox checked only specifies whether new saves should be MQ or not. Checkbox is disabled or force-enabled according to which OTRs are loaded. Also as a necessity includes tracking what game versions have been loaded from the OTRs. * Adds MQ settings logic for Randomizer's ImGui menu. * Writes Master Quest dungeons to the spoiler log * Loads MQ Dungeons from spoiler, persists in save, and loads when appropriate. * Adds logic to prevent loading or creating incompatible rando saves. * Fixdes some linux build issues and new rando save issues * Makes appimage create both vanilla and mq otrs If either rom is present, it makes the corresponding OTR. If both are present, it will make both. If one OTR is present but both roms are present, it will create the missing OTR. * Makes it so a randomized save file will not be marked as MQ. * Refactors to load all OTRs from MainPath or a specific list. Also adds the ability to take a std::unordered_set of hashes to validate each OTR's version file against. * Fixes a syntax error * Makes ExtractAssets output Vanilla and MQ OTRs if both roms are present * Fixes asset generation bug. * Partially working fix for dual OTR extract_assets Currently the cmake ExtractAssets target will return with a 1 if you only end up exporting one type of OTR isntead of both. Haven't found a great way to only attempt to copy a file if it exists from within cmake. It does actually correctly copy the OTR that is generated, despite the error from copying the other one. Pushing as is for now but will keep investigating. * Adds oot-mq.otr to the gitignore. * Makes ExtractAssets not fail on only one rom/OTR. * Removes PatchesPath from the constructors requiring OTRFiles vector. * Renames OOT_UNKNOWN to just UNKNOWN to remove OOT specific reference. * Removes randomizing MQ Dungeons and re-disables MQ rando. Doing this so the PR can get merged quicker with just the Dual OTR support and won't need to wait on rando logic to be updated. That will happen in another PR directly after the merge. * Update mac startup script for dual otr * Update soh/macosx/soh-macos.sh * Update soh/macosx/soh-macos.sh * Update soh/macosx/soh-macos.sh * Implements new BinaryReader to fix Linux build issue. BinaryReader itself comes from https://github.com/Moneyl/BinaryTools I added a wrapper to adapt it to the ABI from ZAPD's Binary Reader and add Endianness checking. I also had to copy a handful of other bits and pieces from ZAPD to make it all function as expected. * A few edits to the updatream BinaryReader to compile it on Linux. * Adds the Endianness to the first byte of the version file. * Fixes Jenkins * Addresses some of Kenix's comments * Renames `ReadNullTerminatedString` to `ReadCString` * Refactors Archive::LoadFile into a private method with more arguments. * Removes BitConverter and extends existing endianness.h instead. * Fixes an endianness issue with the version file. Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2022-10-16 23:07:35 -04:00
SaveManager::Instance->LoadData("masterQuestDungeonCount", gSaveContext.mqDungeonCount, (uint8_t)0);
Dual OTR MQ and Vanilla Support (#1694) * Changes OTR Extraction to have specific mq and nonmq paths. Also updates the game to load resources according to whether or not Master Quest or Vanilla is loaded. * Removes unneeded code from the last commit. * Fixes some weird formatting in ZRom.c * Loads oot-mq.otr and patches oot.otr on top, if both are present. If only one or the other are present, it becomes the only and main OTR. * Adds ImGui Logic for whether or an MQ Checkbox. Checkbox checked only specifies whether new saves should be MQ or not. Checkbox is disabled or force-enabled according to which OTRs are loaded. Also as a necessity includes tracking what game versions have been loaded from the OTRs. * Adds MQ settings logic for Randomizer's ImGui menu. * Writes Master Quest dungeons to the spoiler log * Loads MQ Dungeons from spoiler, persists in save, and loads when appropriate. * Adds logic to prevent loading or creating incompatible rando saves. * Fixdes some linux build issues and new rando save issues * Makes appimage create both vanilla and mq otrs If either rom is present, it makes the corresponding OTR. If both are present, it will make both. If one OTR is present but both roms are present, it will create the missing OTR. * Makes it so a randomized save file will not be marked as MQ. * Refactors to load all OTRs from MainPath or a specific list. Also adds the ability to take a std::unordered_set of hashes to validate each OTR's version file against. * Fixes a syntax error * Makes ExtractAssets output Vanilla and MQ OTRs if both roms are present * Fixes asset generation bug. * Partially working fix for dual OTR extract_assets Currently the cmake ExtractAssets target will return with a 1 if you only end up exporting one type of OTR isntead of both. Haven't found a great way to only attempt to copy a file if it exists from within cmake. It does actually correctly copy the OTR that is generated, despite the error from copying the other one. Pushing as is for now but will keep investigating. * Adds oot-mq.otr to the gitignore. * Makes ExtractAssets not fail on only one rom/OTR. * Removes PatchesPath from the constructors requiring OTRFiles vector. * Renames OOT_UNKNOWN to just UNKNOWN to remove OOT specific reference. * Removes randomizing MQ Dungeons and re-disables MQ rando. Doing this so the PR can get merged quicker with just the Dual OTR support and won't need to wait on rando logic to be updated. That will happen in another PR directly after the merge. * Update mac startup script for dual otr * Update soh/macosx/soh-macos.sh * Update soh/macosx/soh-macos.sh * Update soh/macosx/soh-macos.sh * Implements new BinaryReader to fix Linux build issue. BinaryReader itself comes from https://github.com/Moneyl/BinaryTools I added a wrapper to adapt it to the ABI from ZAPD's Binary Reader and add Endianness checking. I also had to copy a handful of other bits and pieces from ZAPD to make it all function as expected. * A few edits to the updatream BinaryReader to compile it on Linux. * Adds the Endianness to the first byte of the version file. * Fixes Jenkins * Addresses some of Kenix's comments * Renames `ReadNullTerminatedString` to `ReadCString` * Refactors Archive::LoadFile into a private method with more arguments. * Removes BitConverter and extends existing endianness.h instead. * Fixes an endianness issue with the version file. Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2022-10-16 23:07:35 -04:00
OTRGlobals::Instance->gRandomizer->masterQuestDungeons.clear();
SaveManager::Instance->LoadArray("masterQuestDungeons", gSaveContext.mqDungeonCount, [&](size_t i) {
Dual OTR MQ and Vanilla Support (#1694) * Changes OTR Extraction to have specific mq and nonmq paths. Also updates the game to load resources according to whether or not Master Quest or Vanilla is loaded. * Removes unneeded code from the last commit. * Fixes some weird formatting in ZRom.c * Loads oot-mq.otr and patches oot.otr on top, if both are present. If only one or the other are present, it becomes the only and main OTR. * Adds ImGui Logic for whether or an MQ Checkbox. Checkbox checked only specifies whether new saves should be MQ or not. Checkbox is disabled or force-enabled according to which OTRs are loaded. Also as a necessity includes tracking what game versions have been loaded from the OTRs. * Adds MQ settings logic for Randomizer's ImGui menu. * Writes Master Quest dungeons to the spoiler log * Loads MQ Dungeons from spoiler, persists in save, and loads when appropriate. * Adds logic to prevent loading or creating incompatible rando saves. * Fixdes some linux build issues and new rando save issues * Makes appimage create both vanilla and mq otrs If either rom is present, it makes the corresponding OTR. If both are present, it will make both. If one OTR is present but both roms are present, it will create the missing OTR. * Makes it so a randomized save file will not be marked as MQ. * Refactors to load all OTRs from MainPath or a specific list. Also adds the ability to take a std::unordered_set of hashes to validate each OTR's version file against. * Fixes a syntax error * Makes ExtractAssets output Vanilla and MQ OTRs if both roms are present * Fixes asset generation bug. * Partially working fix for dual OTR extract_assets Currently the cmake ExtractAssets target will return with a 1 if you only end up exporting one type of OTR isntead of both. Haven't found a great way to only attempt to copy a file if it exists from within cmake. It does actually correctly copy the OTR that is generated, despite the error from copying the other one. Pushing as is for now but will keep investigating. * Adds oot-mq.otr to the gitignore. * Makes ExtractAssets not fail on only one rom/OTR. * Removes PatchesPath from the constructors requiring OTRFiles vector. * Renames OOT_UNKNOWN to just UNKNOWN to remove OOT specific reference. * Removes randomizing MQ Dungeons and re-disables MQ rando. Doing this so the PR can get merged quicker with just the Dual OTR support and won't need to wait on rando logic to be updated. That will happen in another PR directly after the merge. * Update mac startup script for dual otr * Update soh/macosx/soh-macos.sh * Update soh/macosx/soh-macos.sh * Update soh/macosx/soh-macos.sh * Implements new BinaryReader to fix Linux build issue. BinaryReader itself comes from https://github.com/Moneyl/BinaryTools I added a wrapper to adapt it to the ABI from ZAPD's Binary Reader and add Endianness checking. I also had to copy a handful of other bits and pieces from ZAPD to make it all function as expected. * A few edits to the updatream BinaryReader to compile it on Linux. * Adds the Endianness to the first byte of the version file. * Fixes Jenkins * Addresses some of Kenix's comments * Renames `ReadNullTerminatedString` to `ReadCString` * Refactors Archive::LoadFile into a private method with more arguments. * Removes BitConverter and extends existing endianness.h instead. * Fixes an endianness issue with the version file. Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2022-10-16 23:07:35 -04:00
uint16_t scene;
SaveManager::Instance->LoadData("", scene);
randomizer->masterQuestDungeons.emplace(scene);
});
}
void SaveManager::SaveRandomizer() {
if(!gSaveContext.n64ddFlag) return;
SaveManager::Instance->SaveArray("itemLocations", RC_MAX, [&](size_t i) {
2022-10-03 19:15:36 -04:00
SaveManager::Instance->SaveStruct("", [&]() {
SaveManager::Instance->SaveData("rgID", gSaveContext.itemLocations[i].get.rgID);
SaveManager::Instance->SaveData("fakeRgID", gSaveContext.itemLocations[i].get.fakeRgID);
SaveManager::Instance->SaveData("trickName", gSaveContext.itemLocations[i].get.trickName);
});
});
2022-11-14 06:13:21 -05:00
SaveManager::Instance->SaveArray("entrances", ARRAY_COUNT(gSaveContext.entranceOverrides), [&](size_t i) {
SaveManager::Instance->SaveStruct("", [&]() {
SaveManager::Instance->SaveData("index", gSaveContext.entranceOverrides[i].index);
SaveManager::Instance->SaveData("destination", gSaveContext.entranceOverrides[i].destination);
SaveManager::Instance->SaveData("blueWarp", gSaveContext.entranceOverrides[i].blueWarp);
SaveManager::Instance->SaveData("override", gSaveContext.entranceOverrides[i].override);
SaveManager::Instance->SaveData("overrideDestination", gSaveContext.entranceOverrides[i].overrideDestination);
});
});
SaveManager::Instance->SaveArray("seed", ARRAY_COUNT(gSaveContext.seedIcons), [&](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.seedIcons[i]);
});
SaveManager::Instance->SaveArray("randoSettings", RSK_MAX, [&](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.randoSettings[i].value);
});
SaveManager::Instance->SaveArray("hintLocations", ARRAY_COUNT(gSaveContext.hintLocations), [&](size_t i) {
SaveManager::Instance->SaveStruct("", [&]() {
SaveManager::Instance->SaveData("check", gSaveContext.hintLocations[i].check);
SaveManager::Instance->SaveData("hintText", gSaveContext.hintLocations[i].hintText);
});
});
SaveManager::Instance->SaveData("childAltarText", gSaveContext.childAltarText);
SaveManager::Instance->SaveData("adultAltarText", gSaveContext.adultAltarText);
SaveManager::Instance->SaveData("ganonHintText", gSaveContext.ganonHintText);
SaveManager::Instance->SaveData("ganonText", gSaveContext.ganonText);
SaveManager::Instance->SaveData("dampeText", gSaveContext.dampeText);
2022-12-06 18:37:50 -05:00
SaveManager::Instance->SaveData("warpMinuetText", gSaveContext.warpMinuetText);
SaveManager::Instance->SaveData("warpBoleroText", gSaveContext.warpBoleroText);
SaveManager::Instance->SaveData("warpSerenadeText", gSaveContext.warpSerenadeText);
SaveManager::Instance->SaveData("warpRequiemText", gSaveContext.warpRequiemText);
SaveManager::Instance->SaveData("warpNocturneText", gSaveContext.warpNocturneText);
SaveManager::Instance->SaveData("warpPreludeText", gSaveContext.warpPreludeText);
Randomizer v2 (#1065) * Revert changes to GetItemFromGet * Fixes Ganon's Boss Key shuffled while regular boss Keys aren't. * Enum + combo box * Add obtainability checks correctly * combobox title rename + no number tracking * Fix repeatable purchases and bottles rendering incorrectly * Move shopsanity option in GUI * Struct instead of ImVec + basic comportment for all case * Attempt to fix odd build issue * Cast randoGet for ganons boss key * Remove redundancy in KD room * Update logic Cvar names * Fix Ganons Trials coming from old save files. Fixes #1365 * Fixes crash when entering Ganon's Castle lobby on linux. * Makes `Item_Give` safe to use with a NULL globalCtx. This should allow it's use for giving items to Link's Pocket during rando save initialization. * Converts Song from Impa to use `Item_Give` * Adds more options for Link's starting item. * Removes unneeded `GiveLinkItem` functions. * and make it build * bring back new rando dropdown * gSaveContext access in GameMenuBar.cpp * Implement Skip Scarecrow's Song * Reimplement progressive Bombchus * Rando-next: Deku Nut and Seed ammo gives a blue rupee Fixes #1390 * Fixes Link starting with BGS * Persist item tracker notes * Adjust Hooks include * Use SohImGui::RequestCvarSaveOnNextTick * Fix issues from LUS refactor * Fix for overriding deku scrub messages * Fix mistake from merge oops * Restore checkboxes to enhancements menu These got lost in the merge * Update location access logic Including MQ locations in Spirit and GC now * Implement rando bombchu drops * Missing break * Simplify mudwall collision check There was no need to have a second collider specifically for Ice Arrow hits * Update settings.cpp * Simplify mudwall collision check * Restore checkboxes in menu Accidentally lost these during merge * Clean up bool * Update logic Cvar name * Fixed capacity on ammmo tracking * Fix for beans obtainability * Hook into file delete and clear notes * Incorporate magic arrows in rando settings * Update tooltip To inform the player that they might have to reload the room if they're enabling this for the first time. * Update tooltip * Add line break in tooltip * Tooltip wording + line break * tweak on main logic * All color logic for all types * Fix: changes to please new LUS * Ensure itemTrackerNotes vector is not fully empty * Implement's Tycoon Wallet. * Refactor DrawItemCount and Use EnhancementCombobox for tracker capacity options * small tweaks and rename * always display XX/YY when in ammo/capacity mode * Move all merchant messages to be generated on file load * added hovertext for the number display * Swap german and french translations for shop messages * Set key colors to be on by default * Add another flag to skip mask shop * Fix Sold Out bug * Fix gerudo keys, add disabled checkbox * tooltip line break * Add trials required and merchant prices to save file instead of loading from active spoiler log * Remove trialsRequired persisting in save manager * Adds slotIndex to girla (shop item actor) and uses that for IdentifyShopItem. * Fix issue when merchantPrices is empty * Fix for a single zeroed merchantPrice entry * Fix #1417 * Implements items selling out and fixes issues with purchasing some items. * Fixes order of operations so Rupees will be spent. * Fixes sold out items not getting overwritten by the randomized info. * Clarify var names and comments Also preserve chain platform cutscene in spirit based on Link's position * Remove !=0 from cvar check * Clarify var names and comments * Rename randomizerMerchantPrices to merchantPrices * Handle shop items in SaveManager * Fix merge mistake * Base whats in the bazaar shop on entranceIndex instead of age * Tidy up chain platform cutscene check * Fix merge error Didn't mean to have Zhora changes in here yet * Use 3drando item table for parsing spoiler names * Use another nested method instead of one at the top level to fetch the table * Add missing newline * Remove log * Respect custom draw functions * Fix issues with rendering songs * Fix localized item names for shopsanity * Implements a larger array of Sprites for the Icon Hash. * Uses the hash instead of seed for spoilerfile name and icons. * Removes some unused functions and variables in `spoiler_log.cpp` * Prevents leading 0s added to hash from being in file name * Changes filename format to icon indexes separated by dashes * Hopefully makes Jenkins happy * Hopefully makes Jenkins happy * [Rando] Child Gerudo Fortress 37th Heartpiece randomized Fixes #1071 * Add descriptions to save editor flags editor, and added randomizer flags (#1386) * Add descriptions to save editor flags editor, and added randomizer flags * Hide randomizer flags when not on a randomizer save * Move flag descriptions to header file * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Fix merge error * crash on pause menu on linux (only in appimage) Fixes #1437 * Applies fix to Song from Impa as well. * Allow buying tunics as child when shopsanity is on * Fix for custom draw methods overriding sold out sign * Simplify logic around shopsanity and fix some issues * Fix dungeon reward stone rotation and add particles * Fix some issues with ice traps * Fix adult wallet having its own max capacity * Fix amount of keys given for BotW * format * Use EnGirlAShopItem enum instead of raw hex values * [#1434] Renders non-warp songs more consistently with warp songs * A few changes around merchant messages * Various changes from PR feedback * Rando: Junk Hint missing french translation * Typo * Fix free scrub being at 0 instead of TEXT_SCRUB_RANDOM * Replace magic numbers in message handler * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fix BGS softlock for shopsanity * Support tycoon wallet on tracker * Revert "Fix BGS softlock for shopsanity" This reverts commit 5fdb961ea460fb9a035cf0bb6ae77bfeedc1de0f. * [#1053] Resolves an issue with shop items and bombchu bowling where BGS would display two message boxes * Implements some necessary plumbing and resolves several Ice Trap Softlocks. Adds a way for an item entry to tell what type of check it came from (NPC vs Chest vs Freestanding, etc.) Sets this value from chests and item00 actors. Relocates pendingIceTraps to save context so it can persist through cutscenes and get stored on save init for Link's Pocket and Song from Impa. Restructures pendingIceTraps into a counter rather than a true or false, so that we can be frozen multiple times in a row if applicable (atm that should only be at the start of a run if Link's Pocket and Song from Impa were both Ice Traps). Adds a textbox for Ice Traps and a special case of holding up nothing in the get item process. This fixes all the cases where Ice Traps would softlock due to the actor giving the item expecting a closing textbox. After holding the item above his head Link increments the pendingIceTraps counter by one and sets whatever flag he has pending. None of the above plumbing applies to Ice Traps from chests, those work exactly the same as before, as do freestanding item00 ice traps (thanks to the additional check for ITEM_FROM_FREESTANDING. OoT and Ruto's Letter count as NPC's, so they get the FOWL text box and set a pending ice trap rather than immediately freezing, since Link weill be in the water. Link will get frozen the next time he touches land, which in the case of OoT is after the fade to white and right before the Song of Time check. Fixes all the other softlocks I'm aware of, including Fishing, Bombchu Bowling, Skull Kid, and losing the second Gerudo Archery check. * fix bgs check in player * move bgs logic for tokensanity into MOD_NONE check * set bgs flag before `Item_Give`ing * move bgs flag into `MOD_NONE` check in girla * use existing check in `z_player` * Adds comment explaining the decision to default ITEM_FROM_NPC. * Rename pendingIceTraps to pendingIceTrapCount * Adds some RANDOTODO comments about cleaning up a couple things. * Merge branch 'develop-zhora' into ztornn * manually restore changes to `z_player.c` * Fix after some ice trap prepwork from earlier * Actual fix * Woops * More rupee names * Actually fix it * Add back comment * Fix Skip Scarecrow Song * Fix ruto's letter and LH sun stick rendering * Also fixes it for treasure chest game * Tweak: Rando French Wallet * ADD: French Tycoon * Hide dungeon items/notes by default * [#1301] Fix issue with UI not restoring after getting an item from biggoron * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Fix random crash that only affected one person for some reason Co-authored-by: Garrett Cox <garrettjcox@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Sarge-117 <adam_branston@outlook.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: lil David <1337lilDavid@gmail.com> Co-authored-by: Sarge-117 <108380086+Sarge-117@users.noreply.github.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com>
2022-09-21 00:50:22 -04:00
SaveManager::Instance->SaveData("adultTradeItems", gSaveContext.adultTradeItems);
SaveManager::Instance->SaveData("pendingIceTrapCount", gSaveContext.pendingIceTrapCount);
std::shared_ptr<Randomizer> randomizer = OTRGlobals::Instance->gRandomizer;
std::vector<std::pair<RandomizerCheck, u16>> merchantPrices;
for (const auto & [ check, price ] : randomizer->merchantPrices) {
merchantPrices.push_back(std::make_pair(check, price));
}
SaveManager::Instance->SaveData("merchantPricesSize", merchantPrices.size());
Randomizer v2 (#1065) * Revert changes to GetItemFromGet * Fixes Ganon's Boss Key shuffled while regular boss Keys aren't. * Enum + combo box * Add obtainability checks correctly * combobox title rename + no number tracking * Fix repeatable purchases and bottles rendering incorrectly * Move shopsanity option in GUI * Struct instead of ImVec + basic comportment for all case * Attempt to fix odd build issue * Cast randoGet for ganons boss key * Remove redundancy in KD room * Update logic Cvar names * Fix Ganons Trials coming from old save files. Fixes #1365 * Fixes crash when entering Ganon's Castle lobby on linux. * Makes `Item_Give` safe to use with a NULL globalCtx. This should allow it's use for giving items to Link's Pocket during rando save initialization. * Converts Song from Impa to use `Item_Give` * Adds more options for Link's starting item. * Removes unneeded `GiveLinkItem` functions. * and make it build * bring back new rando dropdown * gSaveContext access in GameMenuBar.cpp * Implement Skip Scarecrow's Song * Reimplement progressive Bombchus * Rando-next: Deku Nut and Seed ammo gives a blue rupee Fixes #1390 * Fixes Link starting with BGS * Persist item tracker notes * Adjust Hooks include * Use SohImGui::RequestCvarSaveOnNextTick * Fix issues from LUS refactor * Fix for overriding deku scrub messages * Fix mistake from merge oops * Restore checkboxes to enhancements menu These got lost in the merge * Update location access logic Including MQ locations in Spirit and GC now * Implement rando bombchu drops * Missing break * Simplify mudwall collision check There was no need to have a second collider specifically for Ice Arrow hits * Update settings.cpp * Simplify mudwall collision check * Restore checkboxes in menu Accidentally lost these during merge * Clean up bool * Update logic Cvar name * Fixed capacity on ammmo tracking * Fix for beans obtainability * Hook into file delete and clear notes * Incorporate magic arrows in rando settings * Update tooltip To inform the player that they might have to reload the room if they're enabling this for the first time. * Update tooltip * Add line break in tooltip * Tooltip wording + line break * tweak on main logic * All color logic for all types * Fix: changes to please new LUS * Ensure itemTrackerNotes vector is not fully empty * Implement's Tycoon Wallet. * Refactor DrawItemCount and Use EnhancementCombobox for tracker capacity options * small tweaks and rename * always display XX/YY when in ammo/capacity mode * Move all merchant messages to be generated on file load * added hovertext for the number display * Swap german and french translations for shop messages * Set key colors to be on by default * Add another flag to skip mask shop * Fix Sold Out bug * Fix gerudo keys, add disabled checkbox * tooltip line break * Add trials required and merchant prices to save file instead of loading from active spoiler log * Remove trialsRequired persisting in save manager * Adds slotIndex to girla (shop item actor) and uses that for IdentifyShopItem. * Fix issue when merchantPrices is empty * Fix for a single zeroed merchantPrice entry * Fix #1417 * Implements items selling out and fixes issues with purchasing some items. * Fixes order of operations so Rupees will be spent. * Fixes sold out items not getting overwritten by the randomized info. * Clarify var names and comments Also preserve chain platform cutscene in spirit based on Link's position * Remove !=0 from cvar check * Clarify var names and comments * Rename randomizerMerchantPrices to merchantPrices * Handle shop items in SaveManager * Fix merge mistake * Base whats in the bazaar shop on entranceIndex instead of age * Tidy up chain platform cutscene check * Fix merge error Didn't mean to have Zhora changes in here yet * Use 3drando item table for parsing spoiler names * Use another nested method instead of one at the top level to fetch the table * Add missing newline * Remove log * Respect custom draw functions * Fix issues with rendering songs * Fix localized item names for shopsanity * Implements a larger array of Sprites for the Icon Hash. * Uses the hash instead of seed for spoilerfile name and icons. * Removes some unused functions and variables in `spoiler_log.cpp` * Prevents leading 0s added to hash from being in file name * Changes filename format to icon indexes separated by dashes * Hopefully makes Jenkins happy * Hopefully makes Jenkins happy * [Rando] Child Gerudo Fortress 37th Heartpiece randomized Fixes #1071 * Add descriptions to save editor flags editor, and added randomizer flags (#1386) * Add descriptions to save editor flags editor, and added randomizer flags * Hide randomizer flags when not on a randomizer save * Move flag descriptions to header file * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Fix merge error * crash on pause menu on linux (only in appimage) Fixes #1437 * Applies fix to Song from Impa as well. * Allow buying tunics as child when shopsanity is on * Fix for custom draw methods overriding sold out sign * Simplify logic around shopsanity and fix some issues * Fix dungeon reward stone rotation and add particles * Fix some issues with ice traps * Fix adult wallet having its own max capacity * Fix amount of keys given for BotW * format * Use EnGirlAShopItem enum instead of raw hex values * [#1434] Renders non-warp songs more consistently with warp songs * A few changes around merchant messages * Various changes from PR feedback * Rando: Junk Hint missing french translation * Typo * Fix free scrub being at 0 instead of TEXT_SCRUB_RANDOM * Replace magic numbers in message handler * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fix BGS softlock for shopsanity * Support tycoon wallet on tracker * Revert "Fix BGS softlock for shopsanity" This reverts commit 5fdb961ea460fb9a035cf0bb6ae77bfeedc1de0f. * [#1053] Resolves an issue with shop items and bombchu bowling where BGS would display two message boxes * Implements some necessary plumbing and resolves several Ice Trap Softlocks. Adds a way for an item entry to tell what type of check it came from (NPC vs Chest vs Freestanding, etc.) Sets this value from chests and item00 actors. Relocates pendingIceTraps to save context so it can persist through cutscenes and get stored on save init for Link's Pocket and Song from Impa. Restructures pendingIceTraps into a counter rather than a true or false, so that we can be frozen multiple times in a row if applicable (atm that should only be at the start of a run if Link's Pocket and Song from Impa were both Ice Traps). Adds a textbox for Ice Traps and a special case of holding up nothing in the get item process. This fixes all the cases where Ice Traps would softlock due to the actor giving the item expecting a closing textbox. After holding the item above his head Link increments the pendingIceTraps counter by one and sets whatever flag he has pending. None of the above plumbing applies to Ice Traps from chests, those work exactly the same as before, as do freestanding item00 ice traps (thanks to the additional check for ITEM_FROM_FREESTANDING. OoT and Ruto's Letter count as NPC's, so they get the FOWL text box and set a pending ice trap rather than immediately freezing, since Link weill be in the water. Link will get frozen the next time he touches land, which in the case of OoT is after the fade to white and right before the Song of Time check. Fixes all the other softlocks I'm aware of, including Fishing, Bombchu Bowling, Skull Kid, and losing the second Gerudo Archery check. * fix bgs check in player * move bgs logic for tokensanity into MOD_NONE check * set bgs flag before `Item_Give`ing * move bgs flag into `MOD_NONE` check in girla * use existing check in `z_player` * Adds comment explaining the decision to default ITEM_FROM_NPC. * Rename pendingIceTraps to pendingIceTrapCount * Adds some RANDOTODO comments about cleaning up a couple things. * Merge branch 'develop-zhora' into ztornn * manually restore changes to `z_player.c` * Fix after some ice trap prepwork from earlier * Actual fix * Woops * More rupee names * Actually fix it * Add back comment * Fix Skip Scarecrow Song * Fix ruto's letter and LH sun stick rendering * Also fixes it for treasure chest game * Tweak: Rando French Wallet * ADD: French Tycoon * Hide dungeon items/notes by default * [#1301] Fix issue with UI not restoring after getting an item from biggoron * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Fix random crash that only affected one person for some reason Co-authored-by: Garrett Cox <garrettjcox@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Sarge-117 <adam_branston@outlook.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: lil David <1337lilDavid@gmail.com> Co-authored-by: Sarge-117 <108380086+Sarge-117@users.noreply.github.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com>
2022-09-21 00:50:22 -04:00
SaveManager::Instance->SaveArray("merchantPrices", merchantPrices.size(), [&](size_t i) {
SaveManager::Instance->SaveStruct("", [&]() {
SaveManager::Instance->SaveData("check", merchantPrices[i].first);
SaveManager::Instance->SaveData("price", merchantPrices[i].second);
});
});
Dual OTR MQ and Vanilla Support (#1694) * Changes OTR Extraction to have specific mq and nonmq paths. Also updates the game to load resources according to whether or not Master Quest or Vanilla is loaded. * Removes unneeded code from the last commit. * Fixes some weird formatting in ZRom.c * Loads oot-mq.otr and patches oot.otr on top, if both are present. If only one or the other are present, it becomes the only and main OTR. * Adds ImGui Logic for whether or an MQ Checkbox. Checkbox checked only specifies whether new saves should be MQ or not. Checkbox is disabled or force-enabled according to which OTRs are loaded. Also as a necessity includes tracking what game versions have been loaded from the OTRs. * Adds MQ settings logic for Randomizer's ImGui menu. * Writes Master Quest dungeons to the spoiler log * Loads MQ Dungeons from spoiler, persists in save, and loads when appropriate. * Adds logic to prevent loading or creating incompatible rando saves. * Fixdes some linux build issues and new rando save issues * Makes appimage create both vanilla and mq otrs If either rom is present, it makes the corresponding OTR. If both are present, it will make both. If one OTR is present but both roms are present, it will create the missing OTR. * Makes it so a randomized save file will not be marked as MQ. * Refactors to load all OTRs from MainPath or a specific list. Also adds the ability to take a std::unordered_set of hashes to validate each OTR's version file against. * Fixes a syntax error * Makes ExtractAssets output Vanilla and MQ OTRs if both roms are present * Fixes asset generation bug. * Partially working fix for dual OTR extract_assets Currently the cmake ExtractAssets target will return with a 1 if you only end up exporting one type of OTR isntead of both. Haven't found a great way to only attempt to copy a file if it exists from within cmake. It does actually correctly copy the OTR that is generated, despite the error from copying the other one. Pushing as is for now but will keep investigating. * Adds oot-mq.otr to the gitignore. * Makes ExtractAssets not fail on only one rom/OTR. * Removes PatchesPath from the constructors requiring OTRFiles vector. * Renames OOT_UNKNOWN to just UNKNOWN to remove OOT specific reference. * Removes randomizing MQ Dungeons and re-disables MQ rando. Doing this so the PR can get merged quicker with just the Dual OTR support and won't need to wait on rando logic to be updated. That will happen in another PR directly after the merge. * Update mac startup script for dual otr * Update soh/macosx/soh-macos.sh * Update soh/macosx/soh-macos.sh * Update soh/macosx/soh-macos.sh * Implements new BinaryReader to fix Linux build issue. BinaryReader itself comes from https://github.com/Moneyl/BinaryTools I added a wrapper to adapt it to the ABI from ZAPD's Binary Reader and add Endianness checking. I also had to copy a handful of other bits and pieces from ZAPD to make it all function as expected. * A few edits to the updatream BinaryReader to compile it on Linux. * Adds the Endianness to the first byte of the version file. * Fixes Jenkins * Addresses some of Kenix's comments * Renames `ReadNullTerminatedString` to `ReadCString` * Refactors Archive::LoadFile into a private method with more arguments. * Removes BitConverter and extends existing endianness.h instead. * Fixes an endianness issue with the version file. Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2022-10-16 23:07:35 -04:00
SaveManager::Instance->SaveData("masterQuestDungeonCount", gSaveContext.mqDungeonCount);
std::vector<uint16_t> masterQuestDungeons;
for (const auto scene : randomizer->masterQuestDungeons) {
masterQuestDungeons.push_back(scene);
}
SaveManager::Instance->SaveArray("masterQuestDungeons", masterQuestDungeons.size(), [&](size_t i) {
SaveManager::Instance->SaveData("", masterQuestDungeons[i]);
});
}
void SaveManager::Init() {
const std::filesystem::path sSavePath(Ship::Window::GetPathRelativeToAppDirectory("Save"));
const std::filesystem::path sGlobalPath = sSavePath / std::string("global.sav");
auto sOldSavePath = Ship::Window::GetPathRelativeToAppDirectory("oot_save.sav");
auto sOldBackupSavePath = Ship::Window::GetPathRelativeToAppDirectory("oot_save.bak");
// If the save directory does not exist, create it
if (!std::filesystem::exists(sSavePath)) {
std::filesystem::create_directory(sSavePath);
}
// If there is a lingering unversioned save, convert it
if (std::filesystem::exists(sOldSavePath)) {
ConvertFromUnversioned();
std::filesystem::rename(sOldSavePath, sOldBackupSavePath);
}
// If the global save file exist, load it. Otherwise, create it.
if (std::filesystem::exists(sGlobalPath)) {
std::ifstream input(sGlobalPath);
nlohmann::json globalBlock;
input >> globalBlock;
if (!globalBlock.contains("version")) {
SPDLOG_WARN("Global save does not contain a version. We are reconstructing it.");
CreateDefaultGlobal();
return;
}
switch (globalBlock["version"].get<int>()) {
case 1:
currentJsonContext = &globalBlock;
LoadData("audioSetting", gSaveContext.audioSetting);
LoadData("zTargetSetting", gSaveContext.zTargetSetting);
LoadData("language", gSaveContext.language);
break;
default:
SPDLOG_WARN("Global save has a unrecognized version. We are reconstructing it.");
CreateDefaultGlobal();
break;
}
} else {
CreateDefaultGlobal();
}
Nintendo switch support (#935) * Moved gfx effects to the gpu and removed loadtexbyname on some textures * Readded empty if * Added nintendo switch support * Fixed compilation errors and window closing issue on linux * Fixed kaleido on 64 bit * Fixed audio on nintendo switch * Implemented performance mode switcher * Added suggestions from pr review * Fixed ftruncate errors * Fixed compilation errors * Added missing include rule * Fixed libstorm path * Removed ftruncate extern to use a correct posix version * Merge branch 'develop' from HarbourMasters into znx (#3) * Add Support for macOS (#441) * Fixed soh filters * add more makefile changes * almost ready * more updates * update * update * Update Makefiles to handle both platforms * Allow for overriding the CXX and CC executables * Restore original structure while supporting custom CXX flags * Remove some platform specific libs * Dynamic target name * Make X11 paths package-agnostic * Remove changes to `gfx_opengl.cpp` * Use OpenGL2 on MacOS instead of OpenGL3 * make it actually render something * render at least the first texture, still need to figure out the second one * Let’s use OpenGL 3 again * maybe this works to get the right texture? link's eyes still look off a bit * did this work? * set the platform to macos * actual numbers are right, but logic is ugly XXX/TODO, i know * add zlib to ldflags for ZAPDUtils * A bit of cleanup * Revert unneeded changes * Remove GL_CHECK * Fix issues with z64 branch * use an std::map instead of a giant array * three point filter fix (#2) * Fix mac compilation * fix audio for 64 bit * revert audio heap size, keep bigger pools * Add more Apple specific checks to our modifications * Add building instructions for macOS * Remove unecessary step from building instructions * Add missing SDL2 & GLEW to Linux LDLIBS * Update BUILDING.md Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Update soh/.gitignore to include other arch binaries Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Use right platform name for debugging window Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Fix stormlib on macos (arm64) * Simplify some of the ifdef checks * Revert an older no longer necessary fix * Remove remaining unecessary deviations * Update building instructions after StormLib changes * Feature: Use OpenGL 4.1 (#1) * Further tweak the BUILDING * Tidy up * reword -j message * Add Jenkins CI Support (#2) * Fix type issues * add target <appbundle> and <filledappbundle> add makefile targets to create an .app `filledappbundle` creates the target with the .otr included this should perhaps be moved to Application Support though * pull gcc's rpath from otool output * move make target to the end so it's not default * Add Jenkins and make exe in par with other platforms * Actually save build artefacts * Fix artefact path * Remove x11 mentions and linking (not used) * Update building instructions for generating app * use appsupport directory * Add new app icon * Update target to match macOS types * Update more audio types * fix null deref in Audio_PlayFanfare * Remove old import from z64 * address final nit with apple ifdefs Co-authored-by: KiritoDev <36680385+KiritoDv@users.noreply.github.com> Co-authored-by: Jeffrey Crowell <github@crowell.biz> Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Move macOS to parallel stage * fix linux crash * Ignore all named saves Necessary after new save format * DPad items * Move UI location arrays from static to global to accomodate customizable UI * FIX: Increased the maximum actor limit for draw distance Fix issue #529 * FIX: Remove duplicates of gNewDrops from the enhancements menu * Get rid of erroneous int casts * casts jya_cobra's shadowTexture pointer to uintptr_t instead of s32. * Fix ability to assign equipment you don't own * Fix title cards for market potion shop and bombchu shop * Invalidate message item icon texture before drawing * Add margins for dpad * Fixed some instances where the original OOT save is erroneously preserved or recreated, leading to another conversion next time you launched the game * Headphones setting in game should now work. Resolves #13 * Map Select name fixes * Change Power to Upgrades * Rename Soh* files * Update names * Add more files * Add more files * Add toggles for disabling heart drops and random drops (#507) * Adds toggles for disabling random drops and fixed heart drops * Changed the "No Fixed Heart Drops" toggle to the more useful "No Random Heart Drops" toggle * Adds an explanation that the no heart drops option is similar to Hero Mode * Moved difficulty options into their own sub-menu Moved time saver options into their own sub-menu Moved clutter reducing options into their own sub-menu * fixed the tag name of mweep speed * Moved Skip Text to Experimental * Fix testing masks of DPad * Fix audio, boot commands, and save staes. * add menu from https://github.com/PurpleHato/Shipwright/tree/ResetMenu * implement reset * Update README.md * command on mac * special char doesn't work with default imgui font * change name based on PR comment * missed a couple spots * change sunset in save editor so dampe is out * Update to latest `docking` imgui (#582) * Update to latest `docking` imgui commit: 67410d53f739b6a0df138e2252f0e5136b42062f * Fix modified import for SDL * Update imgui_impl_sdl.cpp * Add Imgui include path for better imports * Controller Navigation Fix-Up (#544) * Controller Navigation Fix-Up * [MISC] Fix typo * Use Macro for __FILE__ & __LINE__ when possible (#559) * First batch some overlay * Almost all overlay * effect & gamestate * kaleido stuffs * more overlay * more left over from code folder * remaining hardcoded line and file * Open & Close _DISP __FILE__ & __LINE__ clean up * Some if (1) {} remove * LOG_xxxx __FILE__ , __LINE__ cleaned * ASSERT macro __FILE__ __LINE__ * mtx without line/file in functions * " if (1) {} " & "if (0) {}" and tab/white place * LogUtils as macro * GameState_, GameAlloc_, SystemArena_ & ZeldaArena_ * Revert "GameState_, GameAlloc_, SystemArena_ & ZeldaArena_" This reverts commit 0d85caaf7e342648c01a15fe21e93637352dc596. * Like last commit but as macro * Fix matrix not using macros * use function not macro * DebugArena_* functions GameAlloc_MallocDebug BgCheck_PosErrorCheck as macros removed issues with ; in macro file * MM Bunny Hood enhancements: no age restrictions & wear across entrances (#560) * Remove age restriction on MM Bunny Hood * Handle mask slot changing; init Link wearing mask * Reset mask state after selling * Use unordered maps in some hot paths (#566) * Use unordered maps in some hot paths * Address PR comments * Cheat: Infinite Epona Boost (#577) * Cheat: Infinite Epona Boost * Edit for readability * update pulseaudio for 44.1khz audio (#587) * use pulseaudio defaults * spaces/tabs * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate Co-authored-by: briaguya <briaguya@alice> * Restoration Item Sliders (#595) * Allows players to set custom restoration values for potions and milk * Fixed a dumb oversight * implemented fairy sliders * use ini window resolution (#410) * use ini window resolution * use arguments for directx window size * default 640x480 not 320x240 * kick off a build * and revert * default config 640x480 not 320x240 * add todo Co-authored-by: briaguya <briaguya@alice> * 3D Drops & Projectiles update (#548) * Fix remaining rupee and keys * fix tabs -> spaces * more fix about tabs -> spaces * Better up <-> down mouvement for hearts * remove useless comment * Cosmetics menu rework (#589) * - * DPad/some margin fix(left side) * various ImGui stuff and fixes * disabled kaleido menu (non working) * fix win being dumb * same for C btn this time * Fix windows build * Beating hearts fix * Default win size and some placement fix * Fix Dpad Ammo & C notes, Kaleido, white dog * some texts fix and tab move * Add stone of agony, some fixes and build correctly * precise item place with Dpad * Gamecube -> GameCube Co-authored-by: Baoulettes <iMacWin10> * [CI] Create an Appimage for 64bit builds (#570) * [CI] Create AppImage file * [CI] Updated Jenkinsfile * [MISC] fix indentation * [MISC] Fix indentation * [MISC] Fix indentation * [CI] 7z appimage and readme * [CI] AppImage icon file (#597) * [CI] Add patchelf * [BUILD] Include Hi-Res icon * Fix portability use of std::clamp (#596) * Add N64 weird frames and OOB Bombchus cvars (#602) * Add gN64WeirdFrames and gBombchuOOB cvars * Rename gBombchuOOB to gBombchusOOB * Fix pipeline * [BUILD] Do not strip ZAPD (#598) * [BUILD] Do not strip ZAPD * [BUILD] Reuse Icon Asset * [APPIMAGE] Handle paths with spaces * [macos] Distribute optimized builds (#599) * Cosmetics texts fixes (#604) * branch init + few fixes * Reset button * Several texts fixes and default color to GameCube * space issues * some more extra space that was not needed. * space yes last time ... * Arrows being able to be rainbow some more texts fixes * more texts fixes * c-buttons some plurial fix * Fixes bug in demo effect due to removed display list set. * King dodongo room crash (#613) * first attempt * force camera setting to be at least 0 (dirty!) * - * reverted something to just include fix * Invalidate text box icon before drawing (#607) * [APPIMAGE] Set lib path for ZAPD (#611) * New drop runtime fix (#614) * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * Fix Ganon's Castle title cards (#606) * Checkered room crash workaround (#615) * Increase poly and vertex count for dyna actors * Add TODO * Only apply fix in Forest Temple * Enable globally * Match case of 'Shipwright' in Linux build (#619) * Fix 0xabababab crash (#617) * Unconditionally setup the normal skybox * Only call Skybox_Setup once ever * Equipment upgrade text fix and any pause slot enhancement fix (#620) * Fix upgrade name text not rendering * Use cvar and don't render equip help for empty item slots * Fix rendering logic * Fix incorrect item name rendered for one frame * Reorder comparison * Remove extra indent * Remove accidental changes * ImGui grammer, consistency, and clarity fixes (#625) * ImGui grammer, consistency, and clarity fixes Co-Authored-By: Stormghetti <56653191+Stormghetti@users.noreply.github.com> * Adds more new lines for users on smaller displays Co-Authored-By: Stormghetti <56653191+Stormghetti@users.noreply.github.com> Co-authored-by: Stormghetti <56653191+Stormghetti@users.noreply.github.com> * New drops shadows & rotation fixes (#627) * fixes * forgot to add heart pieces in rotation logic * Dodongo's Cavern blue warp crash fix (#622) * Doodong's Cavern blue warp crash fix * >= not > * Don't waste a line of space * add support for clang compiler (#592) * hacks to align strings for clang... wow just wow * start work to getting built with clang * fix issues with struct constructors, all builds, doesn't link still * fix some narrowing issues that clang complains about * fix compliation of zapd * fix null deref in VersionInfo * builds with clang * make stringbuilding use StringHelper instead of addition * fix linking * add CLANG SHIP overlay on clang built versions * doesn't need to be volatile * mark unknown strings as extern * rename some stuff * can't align extern * hopefully fix compilation for everythign * expandtab * allow setting LD * Revert "allow setting LD" This reverts commit 711aba6db2c41bab476bd34e878af6a37a7f5559. maybe to use lld it should be a LDFLAG? * -Wno-deprecated-declarations is required for newer versions of clang on macOS 13 beta sdk, the version of apple clang requires this * Add jenkins support for clang * Forward CXX flags to stormlib compilation * Move GCC only flags to check * use exports to set multiarch setup * Fix Jenkins forever * use make instead of cmake --build add some flags to build with clang-11 as well * address review coments - rework extraction to allow multi thread - misc readability cleanup * update makefile to add WARN on linux+clang Co-authored-by: David Chavez <david@dcvz.io> * Fix develop * Fixes grey screen issue + tooltip for 2 handed shield * Don't close controller after SDL has quit (#642) * Don't close controller after SDL has quit * Don't check if controller can rumble if null * Fixes Barinade's set whenever boss fight is reloaded (#639) * Reimplements unused Barinade reset function. * Removes the Jellyfish from Barinade's body on reset. * add the ability to pull graves during the day (#637) * change max internal res multiplier to 3x, use float and % instead of int (#638) * change max internal res multiplier to 3x, use float and % instead of int * Update libultraship/libultraship/ImGuiImpl.cpp Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> * Fixes crash on Biggoron trade failure screen wipe Resolves #621 * fixes center docking (#652) * testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com> * Cosmetics hotfixes (#640) * Initial branch creation * Revert Main Game so it do not conflict later * should fix window build, made namespace for Cosmetics * forgot to edit one title * Ability to add hidden window (usefull for Rainbow) Fix building issues * Line break, unused bool remove * add descriptive todo for death crash bandaid (#655) Co-authored-by: briaguya <briaguya@alice> * Removed legacy audio mode and fixed ganon sound bug (#657) * Free Camera (#337) * wip free cam * Almost done, needs collision still * Added free cam behind cvar * added WIP collision * Fixed & implemented "Manual mode" from WW & TP * Fixed camera not rotating when Link is moving * fixed initialized camera rotation * Fixed camera getting stuck + made it smoother * reduced deadzone * fixed epona camera height + added WW z-target free camera * Adjusted player camera height & fixed fov * Fixed camera roll * fixed fov when moving the camera while in z-target * Camera resets to Auto when going through doors or changing maps * Fixed building * touch * more touch work * Added WIP mouse support to the free cam * gui stuff * fixed building * fixed building error * ok fixed building for real this time * oops * Fix compilation issues * removed mouse stuff that magically appeared in this branch * smoothed out stick values & removed remains of mouse support * re-added manual camera when pressing Z * reduced minimum Y position of camera * Addressed dcsv's nitpicks * part 2 * oops Co-authored-by: David Chavez <david@dcvz.io> * Rando: Allows Malon's Item Check to be obtained by pulling out the Ocarina. [FIXED PR] (#672) * Fixes using the Ocarina to get the check from Malon. Still some cleanup to do here. For some reason the player can shield before receiving the check. It doesn't set the flag if the player does that so they can still try again, but would prefer a different solution if possible. * Prevents Shielding from blocking the Item_Give from happening. * Code Cleanup and comments explaining the new rando flow. * Removes inventory check when pulling out Ocarina This allows OI to properly give the check, which is important for Glitched logic later down the line. Talking to Malon still requires the Ocarina in your inventory. * Prevents non-malon textboxes from triggering the check. Also adds a comment explaining the condtional for getting the check from talking to Malon since it got pretty long. * Actually fixes checking for text boxes. * Relocates a comment for improved clarity. * Fix Rando Water Temple Softlock (#665) We use 3DS logic to generate item placement, but didn't have this specific door in Water Temple unlocked from the beginning like 3DS does. This meant that if people took specific paths through the temple, they could softlock themselves by missing a key. * Rando: GtG and carpenter prompts skip (#663) * Skip gtg and carpenter prompt For rando. Tested and just works. * Fixed missing break * Hide debug overlay behind gDebugEnabled (#660) * Introduce App Directory Path (#572) * Introduce app directory path concept * macos: Remove hacky way of using applicaiton directory * Update the new SaveManager * Address stack user after return * Remove unecessary property * Use std::string for filepath * Improve clang specific detections * Use new path system for imgui files * Improve helper for getting relative paths * fix hidden wnd (#744) * Split damage multiplication into its own PR (#656) * Split damage multiplication into its own PR * Found a more elegant implementation of the powers char*[] * Fixes Maps, Compasses, and Boss Keys in Vanilla. (#751) * .xiF slebaL * Update Keese labels * Fixed soundfont issues * Skip warp song cutscenes in rando (#664) Does it by skipping to the last part of the cutscene data. Tested on all songs, both adult and child. * don't spawn blocking mido after we've already shown him the sword/shield (#675) Co-authored-by: briaguya <briaguya@alice> * Controller Configuration UI and JSON Config (#760) * Initial controller hud ui * Reverted fbdemo changes * Moved config to json and implemented controller config * fix build on linux, gitignore new config file * fix build * Fix compilation and file directory paths * Call save on cvar save * Fixed cvar loading and added deck slots to the config * Changed control deck port 0 to use a physical device by default * Added gyro and rumble & fixed loading errors * Save config on toggle menubar * fix linux build * Fixed drift calculation * Controller config now saves when pressing F1 * Removed ExitGame hook from ImGuiImpl * Moved mappings to a map * Added GetKeyName * untranslate scancodes * Fixed hud layout on keyboard device * Fixed keyboard read on hud * Fixed crash when reloading controllers * Removed ConfigFile and changed file extension * Changed Dummy to Disconnected and fixed filters * Removed function leftover * Changed ControllerHud to InputEditor Co-authored-by: briaguya <briaguya@alice> Co-authored-by: David Chavez <david@dcvz.io> * Enough! My ship sails in the morning. * Fixed menubar items position (#763) * Fixed menubar items position * Reverted tooltip tab position * Fixes macOS randomizer functionality with App Directory (#761) * Fixes macOS randomizer functionality with App Directory * Fix windows build * Update soh/soh/Enhancements/randomizer/3drando/rando_main.cpp * Update soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp * Revert band-aid fix Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> * Fix migration cvar deletion path (#765) * Various controller fixes (#771) * Fix controller * Also fix rumble strength being a bool * Remove ControllerHud.cpp * Downgrade platform toolset back to previous version * Fix gyro * Fix bug that makes binding axes difficult and clear buttons before reading * Exaggerate gyro display and adjust stick binding threshold * Initialize drift thresholds * git subrepo push soh subrepo: subdir: "soh" merged: "75ccbade8" upstream: origin: "https://github.com/HarbourMasters/soh.git" branch: "master" commit: "75ccbade8" git-subrepo: version: "0.4.1" origin: "???" commit: "???" * One more change from PR review * Fix some paths * Fix merge conflict messup * More merge conflict fixes * And another conflict fix * And another fix * Remove reference to removed build files * Add full path to switch cmake Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: KiritoDev <36680385+KiritoDv@users.noreply.github.com> Co-authored-by: Jeffrey Crowell <github@crowell.biz> Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> Co-authored-by: sholdee <102821812+sholdee@users.noreply.github.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: rozlette <Rozelette@users.noreply.github.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: vaguerant <vaguerant@users.noreply.github.com> Co-authored-by: earthcrafterman <banddstudios@gmail.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com> Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: qurious-pixel <62252937+qurious-pixel@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Sirius902 <10891979+Sirius902@users.noreply.github.com> Co-authored-by: modestposer <modestposer@gmail.com> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com> Co-authored-by: Stormghetti <56653191+Stormghetti@users.noreply.github.com> Co-authored-by: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Co-authored-by: MelonSpeedruns <melonspeedruns@outlook.com> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com> Co-authored-by: ChristopherJTrent <ChristopherJTrent@outlook.com> Co-authored-by: agamache <aaroncgamache@gmail.com> Co-authored-by: M4xw <m4x@m4xw.net> * Fixed switch compilation * Fixed responsive on switch imgui * Remove config save hook * Added physical slots into controller name * Add `ifdef` for switch specific code * Add `ifdef` for switch specific code * Added applet mode detection * Replaced homebrew icon * Fixed randomness on applet mode view * Fixed clkrst initialization * Switch profiles cleanup * Cleaned code based on dcvz comments * Remove unused hooks in Mercury * Fixed compilation * Use IMGUI_IMPL_OPENGL_LOADER_CUSTOM * Fix up StormLib modifications * Handle touch events at ImGui/SDL level * Enable opening menu with - * Load Nintendo Switch font * Updates to window initiation * Handle virtual keyboard via SDL * Print OTR missing message to screen * Rename makefile for Switch * Some more additional fixes * Branch creation plus edit Changed ItemWidth & made label invisible (else issues) Added a submit button next to the text field * Removed set_texture_filter on imgui draw * Readded nintendo switch font * Fixed randomizer crash * Fix issue with strdup windows * [SWITCH] Update Jenkins file (#9) * [SWITCH] Update Jenkins file * [SWITCH] Dockerfile.switch Can be combined with other Dockerfile * [SWITCH] Add entrypoint file * Update Jenkinsfile * [SWITCH] Dockerfile mtab link link `/proc/self/mounts /etc/mtab` Co-authored-by: David Chavez <david@dcvz.io> * Cleaned code based on PR comments * Fixed switch compilation * Cleaned full texture cache instead of doing it per char * Randomizer only saves when its not a vanilla save * Disabled input when menubar is opened * Removed return from SetupFont * Cleaned code based on comments * Cleaned up random texts on switch error screen * Killed * Removed debug and changed compilation flags Co-authored-by: KiritoDv <nohomoboi01@gmail.com> Co-authored-by: Felipe Guaycuru <guaycuru@gmail.com> Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: Jeffrey Crowell <github@crowell.biz> Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> Co-authored-by: sholdee <102821812+sholdee@users.noreply.github.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: rozlette <Rozelette@users.noreply.github.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: vaguerant <vaguerant@users.noreply.github.com> Co-authored-by: earthcrafterman <banddstudios@gmail.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com> Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: qurious-pixel <62252937+qurious-pixel@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Sirius902 <10891979+Sirius902@users.noreply.github.com> Co-authored-by: modestposer <modestposer@gmail.com> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com> Co-authored-by: Stormghetti <56653191+Stormghetti@users.noreply.github.com> Co-authored-by: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Co-authored-by: MelonSpeedruns <melonspeedruns@outlook.com> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com> Co-authored-by: ChristopherJTrent <ChristopherJTrent@outlook.com> Co-authored-by: agamache <aaroncgamache@gmail.com> Co-authored-by: M4xw <m4x@m4xw.net>
2022-07-25 21:11:53 -04:00
// Load files to initialize metadata
for (int fileNum = 0; fileNum < MaxFiles; fileNum++) {
if (std::filesystem::exists(GetFileName(fileNum))) {
LoadFile(fileNum);
}
}
}
void SaveManager::InitMeta(int fileNum) {
fileMetaInfo[fileNum].valid = true;
fileMetaInfo[fileNum].deaths = gSaveContext.deaths;
for (int i = 0; i < ARRAY_COUNT(fileMetaInfo[fileNum].playerName); i++) {
fileMetaInfo[fileNum].playerName[i] = gSaveContext.playerName[i];
}
fileMetaInfo[fileNum].healthCapacity = gSaveContext.healthCapacity;
fileMetaInfo[fileNum].questItems = gSaveContext.inventory.questItems;
fileMetaInfo[fileNum].defense = gSaveContext.inventory.defenseHearts;
fileMetaInfo[fileNum].health = gSaveContext.health;
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
for (int i = 0; i < ARRAY_COUNT(fileMetaInfo[fileNum].seedHash); i++) {
fileMetaInfo[fileNum].seedHash[i] = gSaveContext.seedIcons[i];
}
fileMetaInfo[fileNum].randoSave = gSaveContext.n64ddFlag;
// If the file is marked as a Master Quest file or if we're randomized and have at least one master quest dungeon, we need the mq otr.
fileMetaInfo[fileNum].requiresMasterQuest = gSaveContext.isMasterQuest > 0 || (gSaveContext.n64ddFlag && gSaveContext.mqDungeonCount > 0);
// If the file is not marked as Master Quest, it could still theoretically be a rando save with all 12 MQ dungeons, in which case
// we don't actually require a vanilla OTR.
fileMetaInfo[fileNum].requiresOriginal = !gSaveContext.isMasterQuest && (!gSaveContext.n64ddFlag || gSaveContext.mqDungeonCount < 12);
}
void SaveManager::InitFile(bool isDebug) {
for (InitFunc& func : initFuncs) {
func(isDebug);
}
}
void SaveManager::InitFileImpl(bool isDebug) {
if (isDebug) {
InitFileDebug();
} else {
InitFileNormal();
}
}
void SaveManager::InitFileNormal() {
gSaveContext.totalDays = 0;
gSaveContext.bgsDayCount = 0;
gSaveContext.deaths = 0;
for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) {
gSaveContext.playerName[i] = 0x3E;
}
gSaveContext.n64ddFlag = 0;
gSaveContext.healthCapacity = 0x30;
gSaveContext.health = 0x30;
gSaveContext.magicLevel = 0;
gSaveContext.magic = 0x30;
gSaveContext.rupees = 0;
gSaveContext.swordHealth = 0;
gSaveContext.naviTimer = 0;
gSaveContext.isMagicAcquired = 0;
gSaveContext.isDoubleMagicAcquired = 0;
gSaveContext.isDoubleDefenseAcquired = 0;
gSaveContext.bgsFlag = 0;
gSaveContext.ocarinaGameRoundNum = 0;
for (int button = 0; button < ARRAY_COUNT(gSaveContext.childEquips.buttonItems); button++) {
gSaveContext.childEquips.buttonItems[button] = ITEM_NONE;
}
for (int button = 0; button < ARRAY_COUNT(gSaveContext.childEquips.cButtonSlots); button++) {
gSaveContext.childEquips.cButtonSlots[button] = SLOT_NONE;
}
gSaveContext.childEquips.equipment = 0;
for (int button = 0; button < ARRAY_COUNT(gSaveContext.adultEquips.buttonItems); button++) {
gSaveContext.adultEquips.buttonItems[button] = ITEM_NONE;
}
for (int button = 0; button < ARRAY_COUNT(gSaveContext.adultEquips.cButtonSlots); button++) {
gSaveContext.adultEquips.cButtonSlots[button] = SLOT_NONE;
}
gSaveContext.adultEquips.equipment = 0;
gSaveContext.unk_54 = 0;
gSaveContext.savedSceneNum = 0x34;
// Equipment
for (int button = 0; button < ARRAY_COUNT(gSaveContext.equips.buttonItems); button++) {
gSaveContext.equips.buttonItems[button] = ITEM_NONE;
}
for (int button = 0; button < ARRAY_COUNT(gSaveContext.equips.cButtonSlots); button++) {
gSaveContext.equips.cButtonSlots[button] = SLOT_NONE;
}
gSaveContext.equips.equipment = 0x1100;
// Inventory
for (int item = 0; item < ARRAY_COUNT(gSaveContext.inventory.items); item++) {
gSaveContext.inventory.items[item] = ITEM_NONE;
}
for (int ammo = 0; ammo < ARRAY_COUNT(gSaveContext.inventory.ammo); ammo++) {
gSaveContext.inventory.ammo[ammo] = 0;
}
gSaveContext.inventory.equipment = 0x1100;
gSaveContext.inventory.upgrades = 0;
gSaveContext.inventory.questItems = 0;
for (int dungeon = 0; dungeon < ARRAY_COUNT(gSaveContext.inventory.dungeonItems); dungeon++) {
gSaveContext.inventory.dungeonItems[dungeon] = 0;
}
for (int dungeon = 0; dungeon < ARRAY_COUNT(gSaveContext.inventory.dungeonKeys); dungeon++) {
gSaveContext.inventory.dungeonKeys[dungeon] = 0xFF;
}
gSaveContext.inventory.defenseHearts = 0;
gSaveContext.inventory.gsTokens = 0;
gSaveContext.sohStats.heartPieces = 0;
gSaveContext.sohStats.heartContainers = 0;
for (int dungeon = 0; dungeon < ARRAY_COUNT(gSaveContext.sohStats.dungeonKeys); dungeon++) {
gSaveContext.sohStats.dungeonKeys[dungeon] = 0;
}
gSaveContext.sohStats.playTimer = 0;
gSaveContext.sohStats.pauseTimer = 0;
for (int timestamp = 0; timestamp < ARRAY_COUNT(gSaveContext.sohStats.timestamp); timestamp++) {
gSaveContext.sohStats.timestamp[timestamp] = 0;
}
for (int count = 0; count < ARRAY_COUNT(gSaveContext.sohStats.count); count++) {
gSaveContext.sohStats.count[count] = 0;
}
gSaveContext.sohStats.gameComplete = false;
for (int scenesIdx = 0; scenesIdx < ARRAY_COUNT(gSaveContext.sohStats.scenesDiscovered); scenesIdx++) {
gSaveContext.sohStats.scenesDiscovered[scenesIdx] = 0;
}
for (int entrancesIdx = 0; entrancesIdx < ARRAY_COUNT(gSaveContext.sohStats.entrancesDiscovered); entrancesIdx++) {
gSaveContext.sohStats.entrancesDiscovered[entrancesIdx] = 0;
}
for (int scene = 0; scene < ARRAY_COUNT(gSaveContext.sceneFlags); scene++) {
gSaveContext.sceneFlags[scene].chest = 0;
gSaveContext.sceneFlags[scene].swch = 0;
gSaveContext.sceneFlags[scene].clear = 0;
gSaveContext.sceneFlags[scene].collect = 0;
gSaveContext.sceneFlags[scene].unk = 0;
gSaveContext.sceneFlags[scene].rooms = 0;
gSaveContext.sceneFlags[scene].floors = 0;
}
gSaveContext.fw.pos.x = 0;
gSaveContext.fw.pos.y = 0;
gSaveContext.fw.pos.z = 0;
gSaveContext.fw.yaw = 0;
gSaveContext.fw.playerParams = 0;
gSaveContext.fw.entranceIndex = 0;
gSaveContext.fw.roomIndex = 0;
gSaveContext.fw.set = 0;
gSaveContext.fw.tempSwchFlags = 0;
gSaveContext.fw.tempCollectFlags = 0;
gSaveContext.backupFW = gSaveContext.fw;
for (int flag = 0; flag < ARRAY_COUNT(gSaveContext.gsFlags); flag++) {
gSaveContext.gsFlags[flag] = 0;
}
for (int highscore = 0; highscore < ARRAY_COUNT(gSaveContext.highScores); highscore++) {
gSaveContext.highScores[highscore] = 0;
}
for (int flag = 0; flag < ARRAY_COUNT(gSaveContext.eventChkInf); flag++) {
gSaveContext.eventChkInf[flag] = 0;
}
for (int flag = 0; flag < ARRAY_COUNT(gSaveContext.itemGetInf); flag++) {
gSaveContext.itemGetInf[flag] = 0;
}
for (int flag = 0; flag < ARRAY_COUNT(gSaveContext.infTable); flag++) {
gSaveContext.infTable[flag] = 0;
}
gSaveContext.worldMapAreaData = 0;
gSaveContext.scarecrowLongSongSet = 0;
for (int i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowLongSong); i++) {
gSaveContext.scarecrowLongSong[i].noteIdx = 0;
gSaveContext.scarecrowLongSong[i].unk_01 = 0;
gSaveContext.scarecrowLongSong[i].unk_02 = 0;
gSaveContext.scarecrowLongSong[i].volume = 0;
gSaveContext.scarecrowLongSong[i].vibrato = 0;
gSaveContext.scarecrowLongSong[i].tone = 0;
gSaveContext.scarecrowLongSong[i].semitone = 0;
}
gSaveContext.scarecrowSpawnSongSet = 0;
for (int i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowSpawnSong); i++) {
gSaveContext.scarecrowSpawnSong[i].noteIdx = 0;
gSaveContext.scarecrowSpawnSong[i].unk_01 = 0;
gSaveContext.scarecrowSpawnSong[i].unk_02 = 0;
gSaveContext.scarecrowSpawnSong[i].volume = 0;
gSaveContext.scarecrowSpawnSong[i].vibrato = 0;
gSaveContext.scarecrowSpawnSong[i].tone = 0;
gSaveContext.scarecrowSpawnSong[i].semitone = 0;
}
gSaveContext.horseData.scene = SCENE_SPOT00;
gSaveContext.horseData.pos.x = -1840;
gSaveContext.horseData.pos.y = 72;
gSaveContext.horseData.pos.z = 5497;
gSaveContext.horseData.angle = -0x6AD9;
gSaveContext.magicLevel = 0;
gSaveContext.infTable[29] = 1;
gSaveContext.sceneFlags[5].swch = 0x40000000;
gSaveContext.pendingSale = ITEM_NONE;
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
//RANDOTODO (ADD ITEMLOCATIONS TO GSAVECONTEXT)
}
void SaveManager::InitFileDebug() {
InitFileNormal();
gSaveContext.totalDays = 0;
gSaveContext.bgsDayCount = 0;
gSaveContext.deaths = 0;
static std::array<char, 8> sPlayerName = { 0x15, 0x12, 0x17, 0x14, 0x3E, 0x3E, 0x3E, 0x3E };
for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) {
gSaveContext.playerName[i] = sPlayerName[i];
}
gSaveContext.n64ddFlag = 0;
gSaveContext.healthCapacity = 0xE0;
gSaveContext.health = 0xE0;
gSaveContext.magicLevel = 0;
gSaveContext.magic = 0x30;
gSaveContext.rupees = 150;
gSaveContext.swordHealth = 8;
gSaveContext.naviTimer = 0;
gSaveContext.isMagicAcquired = 1;
gSaveContext.isDoubleMagicAcquired = 0;
gSaveContext.isDoubleDefenseAcquired = 0;
gSaveContext.bgsFlag = 0;
gSaveContext.ocarinaGameRoundNum = 0;
for (int button = 0; button < ARRAY_COUNT(gSaveContext.childEquips.buttonItems); button++) {
gSaveContext.childEquips.buttonItems[button] = ITEM_NONE;
}
for (int button = 0; button < ARRAY_COUNT(gSaveContext.childEquips.cButtonSlots); button++) {
gSaveContext.childEquips.cButtonSlots[button] = SLOT_NONE;
}
gSaveContext.childEquips.equipment = 0;
for (int button = 0; button < ARRAY_COUNT(gSaveContext.adultEquips.buttonItems); button++) {
gSaveContext.adultEquips.buttonItems[button] = ITEM_NONE;
}
for (int button = 0; button < ARRAY_COUNT(gSaveContext.adultEquips.cButtonSlots); button++) {
gSaveContext.adultEquips.cButtonSlots[button] = SLOT_NONE;
}
gSaveContext.adultEquips.equipment = 0;
gSaveContext.unk_54 = 0;
gSaveContext.savedSceneNum = 0x51;
// Equipment
2022-06-22 22:24:20 -04:00
static std::array<u8, 8> sButtonItems = { ITEM_SWORD_MASTER, ITEM_BOW, ITEM_BOMB, ITEM_OCARINA_FAIRY, ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE };
for (int button = 0; button < ARRAY_COUNT(gSaveContext.equips.buttonItems); button++) {
gSaveContext.equips.buttonItems[button] = sButtonItems[button];
}
2022-06-22 22:24:20 -04:00
static std::array<u8, 7> sCButtonSlots = { SLOT_BOW, SLOT_BOMB, SLOT_OCARINA, SLOT_NONE, SLOT_NONE, SLOT_NONE, SLOT_NONE };
for (int button = 0; button < ARRAY_COUNT(gSaveContext.equips.cButtonSlots); button++) {
gSaveContext.equips.cButtonSlots[button] = sCButtonSlots[button];
}
gSaveContext.equips.equipment = 0x1122;
// Inventory
static std::array<u8, 24> sItems = {
ITEM_STICK, ITEM_NUT, ITEM_BOMB, ITEM_BOW, ITEM_ARROW_FIRE, ITEM_DINS_FIRE,
ITEM_SLINGSHOT, ITEM_OCARINA_FAIRY, ITEM_BOMBCHU, ITEM_HOOKSHOT, ITEM_ARROW_ICE, ITEM_FARORES_WIND,
ITEM_BOOMERANG, ITEM_LENS, ITEM_BEAN, ITEM_HAMMER, ITEM_ARROW_LIGHT, ITEM_NAYRUS_LOVE,
ITEM_BOTTLE, ITEM_POTION_RED, ITEM_POTION_GREEN, ITEM_POTION_BLUE, ITEM_POCKET_EGG, ITEM_WEIRD_EGG,
};
for (int item = 0; item < ARRAY_COUNT(gSaveContext.inventory.items); item++) {
gSaveContext.inventory.items[item] = sItems[item];
}
static std::array<s8, 16> sAmmo = { 50, 50, 10, 30, 1, 1, 30, 1, 50, 1, 1, 1, 1, 1, 1, 1 };
for (int ammo = 0; ammo < ARRAY_COUNT(gSaveContext.inventory.ammo); ammo++) {
gSaveContext.inventory.ammo[ammo] = sAmmo[ammo];
}
gSaveContext.inventory.equipment = 0x7777;
gSaveContext.inventory.upgrades = 0x125249;
gSaveContext.inventory.questItems = 0x1E3FFFF;
static std::array<u8, 20> sDungeonItems = { 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
for (int dungeon = 0; dungeon < ARRAY_COUNT(gSaveContext.inventory.dungeonItems); dungeon++) {
gSaveContext.inventory.dungeonItems[dungeon] = sDungeonItems[dungeon];
}
for (int dungeon = 0; dungeon < ARRAY_COUNT(gSaveContext.inventory.dungeonKeys); dungeon++) {
gSaveContext.inventory.dungeonKeys[dungeon] = 8;
}
gSaveContext.inventory.defenseHearts = 0;
gSaveContext.inventory.gsTokens = 0;
gSaveContext.sohStats.heartPieces = 8;
gSaveContext.sohStats.heartContainers = 8;
for (int dungeon = 0; dungeon < ARRAY_COUNT(gSaveContext.sohStats.dungeonKeys); dungeon++) {
gSaveContext.sohStats.dungeonKeys[dungeon] = 8;
}
gSaveContext.horseData.scene = SCENE_SPOT00;
gSaveContext.horseData.pos.x = -1840;
gSaveContext.horseData.pos.y = 72;
gSaveContext.horseData.pos.z = 5497;
gSaveContext.horseData.angle = -0x6AD9;
gSaveContext.infTable[0] |= 0x5009;
gSaveContext.infTable[29] = 0; // unset flag from normal file setup
gSaveContext.eventChkInf[0] |= 0x123F;
gSaveContext.eventChkInf[8] |= 1;
gSaveContext.eventChkInf[12] |= 0x10;
if (LINK_AGE_IN_YEARS == YEARS_CHILD) {
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KOKIRI;
Inventory_ChangeEquipment(EQUIP_SWORD, 1);
if (gSaveContext.fileNum == 0xFF) {
gSaveContext.equips.buttonItems[1] = ITEM_SLINGSHOT;
gSaveContext.equips.cButtonSlots[0] = SLOT_SLINGSHOT;
Inventory_ChangeEquipment(EQUIP_SHIELD, 1);
}
}
gSaveContext.entranceIndex = 0xCD;
gSaveContext.magicLevel = 0;
gSaveContext.sceneFlags[5].swch = 0x40000000;
}
void SaveManager::SaveFile(int fileNum) {
if (fileNum == 0xFF) {
return;
}
nlohmann::json baseBlock;
baseBlock["version"] = 1;
baseBlock["sections"] = nlohmann::json::object();
for (auto& section : sectionSaveHandlers) {
nlohmann::json& sectionBlock = baseBlock["sections"][section.first];
sectionBlock["version"] = section.second.first;
currentJsonContext = &sectionBlock["data"];
section.second.second();
}
#if defined(__SWITCH__) || defined(__WIIU__)
FILE* w = fopen(GetFileName(fileNum).c_str(), "w");
2022-09-25 12:19:53 -04:00
std::string json_string = baseBlock.dump(4);
fwrite(json_string.c_str(), sizeof(char), json_string.length(), w);
fclose(w);
#else
std::ofstream output(GetFileName(fileNum));
output << std::setw(4) << baseBlock << std::endl;
#endif
InitMeta(fileNum);
}
void SaveManager::SaveGlobal() {
nlohmann::json globalBlock;
globalBlock["version"] = 1;
globalBlock["audioSetting"] = gSaveContext.audioSetting;
globalBlock["zTargetSetting"] = gSaveContext.zTargetSetting;
globalBlock["language"] = gSaveContext.language;
const std::filesystem::path sSavePath(Ship::Window::GetPathRelativeToAppDirectory("Save"));
const std::filesystem::path sGlobalPath = sSavePath / std::string("global.sav");
std::ofstream output(sGlobalPath);
output << std::setw(4) << globalBlock << std::endl;
}
void SaveManager::LoadFile(int fileNum) {
assert(std::filesystem::exists(GetFileName(fileNum)));
InitFile(false);
std::ifstream input(GetFileName(fileNum));
nlohmann::json saveBlock;
input >> saveBlock;
if (!saveBlock.contains("version")) {
SPDLOG_ERROR("Save at " + GetFileName(fileNum).string() + " contains no version");
assert(false);
}
switch (saveBlock["version"].get<int>()) {
case 1:
for (auto& block : saveBlock["sections"].items()) {
int sectionVersion = block.value()["version"];
std::string sectionName = block.key();
if (!sectionLoadHandlers.contains(sectionName)) {
// Unloadable sections aren't necessarily errors, they are probably mods that were unloaded
// TODO report in a more noticeable manner
SPDLOG_WARN("Save " + GetFileName(fileNum).string() + " contains unloadable section " + sectionName);
continue;
}
SectionLoadHandler& handler = sectionLoadHandlers[sectionName];
if (!handler.contains(sectionVersion)) {
// A section that has a loader without a handler for the specific version means that the user has a mod
// at an earlier version than the save has. In this case, the user probably wants to load the save.
// Report the error so that the user can rectify the error.
// TODO report in a more noticeable manner
SPDLOG_ERROR("Save " + GetFileName(fileNum).string() + " contains section " + sectionName +
" with an unloadable version " + std::to_string(sectionVersion));
assert(false);
continue;
}
currentJsonContext = &block.value()["data"];
handler[sectionVersion]();
}
break;
default:
SPDLOG_ERROR("Unrecognized save version " + std::to_string(saveBlock["version"].get<int>()) + " in " +
GetFileName(fileNum).string());
assert(false);
break;
}
InitMeta(fileNum);
}
2022-07-21 18:36:46 -04:00
bool SaveManager::SaveFile_Exist(int fileNum) {
try {
bool exists = std::filesystem::exists(GetFileName(fileNum));
SPDLOG_INFO("File[{}] - {}", fileNum, exists ? "exists" : "does not exist" );
return exists;
2022-07-21 18:36:46 -04:00
}
catch(std::filesystem::filesystem_error const& ex) {
SPDLOG_ERROR("Filesystem error");
2022-07-21 18:36:46 -04:00
return false;
}
}
void SaveManager::AddInitFunction(InitFunc func) {
initFuncs.emplace_back(func);
}
void SaveManager::AddLoadFunction(const std::string& name, int version, LoadFunc func) {
if (!sectionLoadHandlers.contains(name)) {
sectionLoadHandlers[name] = SectionLoadHandler();
}
if (sectionLoadHandlers[name].contains(version)) {
SPDLOG_ERROR("Adding load function for section and version that already has one: " + name + ", " + std::to_string(version));
assert(false);
return;
}
sectionLoadHandlers[name][version] = func;
}
void SaveManager::AddSaveFunction(const std::string& name, int version, SaveFunc func) {
if (sectionSaveHandlers.contains(name)) {
SPDLOG_ERROR("Adding save function for section that already has one: " + name);
assert(false);
return;
}
sectionSaveHandlers[name] = std::make_pair(version, func);
}
void SaveManager::AddPostFunction(const std::string& name, PostFunc func) {
if (postHandlers.contains(name)) {
SPDLOG_ERROR("Adding post function for section that already has one: " + name);
assert(false);
return;
}
postHandlers[name] = func;
}
void SaveManager::CreateDefaultGlobal() {
gSaveContext.audioSetting = 0;
gSaveContext.zTargetSetting = 0;
gSaveContext.language = CVarGetInteger("gLanguages", LANGUAGE_ENG);
SaveGlobal();
}
void SaveManager::LoadBaseVersion1() {
SaveManager::Instance->LoadData("entranceIndex", gSaveContext.entranceIndex);
SaveManager::Instance->LoadData("linkAge", gSaveContext.linkAge);
SaveManager::Instance->LoadData("cutsceneIndex", gSaveContext.cutsceneIndex);
SaveManager::Instance->LoadData("dayTime", gSaveContext.dayTime);
SaveManager::Instance->LoadData("nightFlag", gSaveContext.nightFlag);
SaveManager::Instance->LoadData("totalDays", gSaveContext.totalDays);
SaveManager::Instance->LoadData("bgsDayCount", gSaveContext.bgsDayCount);
SaveManager::Instance->LoadData("deaths", gSaveContext.deaths);
SaveManager::Instance->LoadArray("playerName", ARRAY_COUNT(gSaveContext.playerName), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.playerName[i]);
});
SaveManager::Instance->LoadData("n64ddFlag", gSaveContext.n64ddFlag);
SaveManager::Instance->LoadData("healthCapacity", gSaveContext.healthCapacity);
SaveManager::Instance->LoadData("health", gSaveContext.health);
SaveManager::Instance->LoadData("magicLevel", gSaveContext.magicLevel);
SaveManager::Instance->LoadData("magic", gSaveContext.magic);
SaveManager::Instance->LoadData("rupees", gSaveContext.rupees);
SaveManager::Instance->LoadData("swordHealth", gSaveContext.swordHealth);
SaveManager::Instance->LoadData("naviTimer", gSaveContext.naviTimer);
SaveManager::Instance->LoadData("magicAcquired", gSaveContext.isMagicAcquired);
SaveManager::Instance->LoadData("doubleMagic", gSaveContext.isDoubleMagicAcquired);
SaveManager::Instance->LoadData("doubleDefense", gSaveContext.isDoubleDefenseAcquired);
SaveManager::Instance->LoadData("bgsFlag", gSaveContext.bgsFlag);
SaveManager::Instance->LoadData("ocarinaGameRoundNum", gSaveContext.ocarinaGameRoundNum);
SaveManager::Instance->LoadStruct("childEquips", []() {
SaveManager::Instance->LoadArray("buttonItems", ARRAY_COUNT(gSaveContext.childEquips.buttonItems), [](size_t i) {
2022-06-22 22:24:20 -04:00
SaveManager::Instance->LoadData("", gSaveContext.childEquips.buttonItems[i],
static_cast<uint8_t>(ITEM_NONE));
});
SaveManager::Instance->LoadArray("cButtonSlots", ARRAY_COUNT(gSaveContext.childEquips.cButtonSlots), [](size_t i) {
2022-06-22 22:24:20 -04:00
SaveManager::Instance->LoadData("", gSaveContext.childEquips.cButtonSlots[i],
static_cast<uint8_t>(SLOT_NONE));
});
SaveManager::Instance->LoadData("equipment", gSaveContext.childEquips.equipment);
});
SaveManager::Instance->LoadStruct("adultEquips", []() {
SaveManager::Instance->LoadArray("buttonItems", ARRAY_COUNT(gSaveContext.adultEquips.buttonItems), [](size_t i) {
2022-06-22 22:24:20 -04:00
SaveManager::Instance->LoadData("", gSaveContext.adultEquips.buttonItems[i],
static_cast<uint8_t>(ITEM_NONE));
});
SaveManager::Instance->LoadArray("cButtonSlots", ARRAY_COUNT(gSaveContext.adultEquips.cButtonSlots), [](size_t i) {
2022-06-22 22:24:20 -04:00
SaveManager::Instance->LoadData("", gSaveContext.adultEquips.cButtonSlots[i],
static_cast<uint8_t>(SLOT_NONE));
});
SaveManager::Instance->LoadData("equipment", gSaveContext.adultEquips.equipment);
});
SaveManager::Instance->LoadData("unk_54", gSaveContext.unk_54);
SaveManager::Instance->LoadData("savedSceneNum", gSaveContext.savedSceneNum);
SaveManager::Instance->LoadStruct("equips", []() {
SaveManager::Instance->LoadArray("buttonItems", ARRAY_COUNT(gSaveContext.equips.buttonItems), [](size_t i) {
2022-06-22 22:24:20 -04:00
SaveManager::Instance->LoadData("", gSaveContext.equips.buttonItems[i], static_cast<uint8_t>(ITEM_NONE));
});
SaveManager::Instance->LoadArray("cButtonSlots", ARRAY_COUNT(gSaveContext.equips.cButtonSlots), [](size_t i) {
2022-06-22 22:24:20 -04:00
SaveManager::Instance->LoadData("", gSaveContext.equips.cButtonSlots[i], static_cast<uint8_t>(SLOT_NONE));
});
SaveManager::Instance->LoadData("equipment", gSaveContext.equips.equipment);
});
SaveManager::Instance->LoadStruct("inventory", []() {
SaveManager::Instance->LoadArray("items", ARRAY_COUNT(gSaveContext.inventory.items), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.inventory.items[i]);
});
SaveManager::Instance->LoadArray("ammo", ARRAY_COUNT(gSaveContext.inventory.ammo), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.inventory.ammo[i]);
});
SaveManager::Instance->LoadData("equipment", gSaveContext.inventory.equipment);
SaveManager::Instance->LoadData("upgrades", gSaveContext.inventory.upgrades);
SaveManager::Instance->LoadData("questItems", gSaveContext.inventory.questItems);
SaveManager::Instance->LoadArray("dungeonItems", ARRAY_COUNT(gSaveContext.inventory.dungeonItems), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.inventory.dungeonItems[i]);
});
SaveManager::Instance->LoadArray("dungeonKeys", ARRAY_COUNT(gSaveContext.inventory.dungeonKeys), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.inventory.dungeonKeys[i]);
});
SaveManager::Instance->LoadData("defenseHearts", gSaveContext.inventory.defenseHearts);
SaveManager::Instance->LoadData("gsTokens", gSaveContext.inventory.gsTokens);
});
SaveManager::Instance->LoadArray("sceneFlags", ARRAY_COUNT(gSaveContext.sceneFlags), [](size_t i) {
SaveManager::Instance->LoadStruct("", [&i]() {
SaveManager::Instance->LoadData("chest", gSaveContext.sceneFlags[i].chest);
SaveManager::Instance->LoadData("swch", gSaveContext.sceneFlags[i].swch);
SaveManager::Instance->LoadData("clear", gSaveContext.sceneFlags[i].clear);
SaveManager::Instance->LoadData("collect", gSaveContext.sceneFlags[i].collect);
SaveManager::Instance->LoadData("unk", gSaveContext.sceneFlags[i].unk);
SaveManager::Instance->LoadData("rooms", gSaveContext.sceneFlags[i].rooms);
SaveManager::Instance->LoadData("floors", gSaveContext.sceneFlags[i].floors);
});
});
SaveManager::Instance->LoadStruct("fw", []() {
SaveManager::Instance->LoadStruct("pos", []() {
SaveManager::Instance->LoadData("x", gSaveContext.fw.pos.x);
SaveManager::Instance->LoadData("y", gSaveContext.fw.pos.y);
SaveManager::Instance->LoadData("z", gSaveContext.fw.pos.z);
});
SaveManager::Instance->LoadData("yaw", gSaveContext.fw.yaw);
SaveManager::Instance->LoadData("playerParams", gSaveContext.fw.playerParams);
SaveManager::Instance->LoadData("entranceIndex", gSaveContext.fw.entranceIndex);
SaveManager::Instance->LoadData("roomIndex", gSaveContext.fw.roomIndex);
SaveManager::Instance->LoadData("set", gSaveContext.fw.set);
SaveManager::Instance->LoadData("tempSwchFlags", gSaveContext.fw.tempSwchFlags);
SaveManager::Instance->LoadData("tempCollectFlags", gSaveContext.fw.tempCollectFlags);
});
SaveManager::Instance->LoadArray("gsFlags", ARRAY_COUNT(gSaveContext.gsFlags), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.gsFlags[i]);
});
SaveManager::Instance->LoadArray("highScores", ARRAY_COUNT(gSaveContext.highScores), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.highScores[i]);
});
SaveManager::Instance->LoadArray("eventChkInf", ARRAY_COUNT(gSaveContext.eventChkInf), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.eventChkInf[i]);
});
SaveManager::Instance->LoadArray("itemGetInf", ARRAY_COUNT(gSaveContext.itemGetInf), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.itemGetInf[i]);
});
SaveManager::Instance->LoadArray("infTable", ARRAY_COUNT(gSaveContext.infTable), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.infTable[i]);
});
SaveManager::Instance->LoadData("worldMapAreaData", gSaveContext.worldMapAreaData);
SaveManager::Instance->LoadData("scarecrowCustomSongSet", gSaveContext.scarecrowLongSongSet);
SaveManager::Instance->LoadArray("scarecrowCustomSong", sizeof(gSaveContext.scarecrowLongSong), [](size_t i) {
SaveManager::Instance->LoadData("", ((u8*)&gSaveContext.scarecrowLongSong)[i]);
});
SaveManager::Instance->LoadData("scarecrowSpawnSongSet", gSaveContext.scarecrowSpawnSongSet);
SaveManager::Instance->LoadArray("scarecrowSpawnSong", sizeof(gSaveContext.scarecrowSpawnSong), [](size_t i) {
SaveManager::Instance->LoadData("", ((u8*)&gSaveContext.scarecrowSpawnSong)[i]);
});
SaveManager::Instance->LoadStruct("horseData", []() {
SaveManager::Instance->LoadData("scene", gSaveContext.horseData.scene);
SaveManager::Instance->LoadStruct("pos", []() {
SaveManager::Instance->LoadData("x", gSaveContext.horseData.pos.x);
SaveManager::Instance->LoadData("y", gSaveContext.horseData.pos.y);
SaveManager::Instance->LoadData("z", gSaveContext.horseData.pos.z);
});
SaveManager::Instance->LoadData("angle", gSaveContext.horseData.angle);
});
Randomizer v2 (#1065) * Revert changes to GetItemFromGet * Fixes Ganon's Boss Key shuffled while regular boss Keys aren't. * Enum + combo box * Add obtainability checks correctly * combobox title rename + no number tracking * Fix repeatable purchases and bottles rendering incorrectly * Move shopsanity option in GUI * Struct instead of ImVec + basic comportment for all case * Attempt to fix odd build issue * Cast randoGet for ganons boss key * Remove redundancy in KD room * Update logic Cvar names * Fix Ganons Trials coming from old save files. Fixes #1365 * Fixes crash when entering Ganon's Castle lobby on linux. * Makes `Item_Give` safe to use with a NULL globalCtx. This should allow it's use for giving items to Link's Pocket during rando save initialization. * Converts Song from Impa to use `Item_Give` * Adds more options for Link's starting item. * Removes unneeded `GiveLinkItem` functions. * and make it build * bring back new rando dropdown * gSaveContext access in GameMenuBar.cpp * Implement Skip Scarecrow's Song * Reimplement progressive Bombchus * Rando-next: Deku Nut and Seed ammo gives a blue rupee Fixes #1390 * Fixes Link starting with BGS * Persist item tracker notes * Adjust Hooks include * Use SohImGui::RequestCvarSaveOnNextTick * Fix issues from LUS refactor * Fix for overriding deku scrub messages * Fix mistake from merge oops * Restore checkboxes to enhancements menu These got lost in the merge * Update location access logic Including MQ locations in Spirit and GC now * Implement rando bombchu drops * Missing break * Simplify mudwall collision check There was no need to have a second collider specifically for Ice Arrow hits * Update settings.cpp * Simplify mudwall collision check * Restore checkboxes in menu Accidentally lost these during merge * Clean up bool * Update logic Cvar name * Fixed capacity on ammmo tracking * Fix for beans obtainability * Hook into file delete and clear notes * Incorporate magic arrows in rando settings * Update tooltip To inform the player that they might have to reload the room if they're enabling this for the first time. * Update tooltip * Add line break in tooltip * Tooltip wording + line break * tweak on main logic * All color logic for all types * Fix: changes to please new LUS * Ensure itemTrackerNotes vector is not fully empty * Implement's Tycoon Wallet. * Refactor DrawItemCount and Use EnhancementCombobox for tracker capacity options * small tweaks and rename * always display XX/YY when in ammo/capacity mode * Move all merchant messages to be generated on file load * added hovertext for the number display * Swap german and french translations for shop messages * Set key colors to be on by default * Add another flag to skip mask shop * Fix Sold Out bug * Fix gerudo keys, add disabled checkbox * tooltip line break * Add trials required and merchant prices to save file instead of loading from active spoiler log * Remove trialsRequired persisting in save manager * Adds slotIndex to girla (shop item actor) and uses that for IdentifyShopItem. * Fix issue when merchantPrices is empty * Fix for a single zeroed merchantPrice entry * Fix #1417 * Implements items selling out and fixes issues with purchasing some items. * Fixes order of operations so Rupees will be spent. * Fixes sold out items not getting overwritten by the randomized info. * Clarify var names and comments Also preserve chain platform cutscene in spirit based on Link's position * Remove !=0 from cvar check * Clarify var names and comments * Rename randomizerMerchantPrices to merchantPrices * Handle shop items in SaveManager * Fix merge mistake * Base whats in the bazaar shop on entranceIndex instead of age * Tidy up chain platform cutscene check * Fix merge error Didn't mean to have Zhora changes in here yet * Use 3drando item table for parsing spoiler names * Use another nested method instead of one at the top level to fetch the table * Add missing newline * Remove log * Respect custom draw functions * Fix issues with rendering songs * Fix localized item names for shopsanity * Implements a larger array of Sprites for the Icon Hash. * Uses the hash instead of seed for spoilerfile name and icons. * Removes some unused functions and variables in `spoiler_log.cpp` * Prevents leading 0s added to hash from being in file name * Changes filename format to icon indexes separated by dashes * Hopefully makes Jenkins happy * Hopefully makes Jenkins happy * [Rando] Child Gerudo Fortress 37th Heartpiece randomized Fixes #1071 * Add descriptions to save editor flags editor, and added randomizer flags (#1386) * Add descriptions to save editor flags editor, and added randomizer flags * Hide randomizer flags when not on a randomizer save * Move flag descriptions to header file * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Fix merge error * crash on pause menu on linux (only in appimage) Fixes #1437 * Applies fix to Song from Impa as well. * Allow buying tunics as child when shopsanity is on * Fix for custom draw methods overriding sold out sign * Simplify logic around shopsanity and fix some issues * Fix dungeon reward stone rotation and add particles * Fix some issues with ice traps * Fix adult wallet having its own max capacity * Fix amount of keys given for BotW * format * Use EnGirlAShopItem enum instead of raw hex values * [#1434] Renders non-warp songs more consistently with warp songs * A few changes around merchant messages * Various changes from PR feedback * Rando: Junk Hint missing french translation * Typo * Fix free scrub being at 0 instead of TEXT_SCRUB_RANDOM * Replace magic numbers in message handler * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fix BGS softlock for shopsanity * Support tycoon wallet on tracker * Revert "Fix BGS softlock for shopsanity" This reverts commit 5fdb961ea460fb9a035cf0bb6ae77bfeedc1de0f. * [#1053] Resolves an issue with shop items and bombchu bowling where BGS would display two message boxes * Implements some necessary plumbing and resolves several Ice Trap Softlocks. Adds a way for an item entry to tell what type of check it came from (NPC vs Chest vs Freestanding, etc.) Sets this value from chests and item00 actors. Relocates pendingIceTraps to save context so it can persist through cutscenes and get stored on save init for Link's Pocket and Song from Impa. Restructures pendingIceTraps into a counter rather than a true or false, so that we can be frozen multiple times in a row if applicable (atm that should only be at the start of a run if Link's Pocket and Song from Impa were both Ice Traps). Adds a textbox for Ice Traps and a special case of holding up nothing in the get item process. This fixes all the cases where Ice Traps would softlock due to the actor giving the item expecting a closing textbox. After holding the item above his head Link increments the pendingIceTraps counter by one and sets whatever flag he has pending. None of the above plumbing applies to Ice Traps from chests, those work exactly the same as before, as do freestanding item00 ice traps (thanks to the additional check for ITEM_FROM_FREESTANDING. OoT and Ruto's Letter count as NPC's, so they get the FOWL text box and set a pending ice trap rather than immediately freezing, since Link weill be in the water. Link will get frozen the next time he touches land, which in the case of OoT is after the fade to white and right before the Song of Time check. Fixes all the other softlocks I'm aware of, including Fishing, Bombchu Bowling, Skull Kid, and losing the second Gerudo Archery check. * fix bgs check in player * move bgs logic for tokensanity into MOD_NONE check * set bgs flag before `Item_Give`ing * move bgs flag into `MOD_NONE` check in girla * use existing check in `z_player` * Adds comment explaining the decision to default ITEM_FROM_NPC. * Rename pendingIceTraps to pendingIceTrapCount * Adds some RANDOTODO comments about cleaning up a couple things. * Merge branch 'develop-zhora' into ztornn * manually restore changes to `z_player.c` * Fix after some ice trap prepwork from earlier * Actual fix * Woops * More rupee names * Actually fix it * Add back comment * Fix Skip Scarecrow Song * Fix ruto's letter and LH sun stick rendering * Also fixes it for treasure chest game * Tweak: Rando French Wallet * ADD: French Tycoon * Hide dungeon items/notes by default * [#1301] Fix issue with UI not restoring after getting an item from biggoron * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Fix random crash that only affected one person for some reason Co-authored-by: Garrett Cox <garrettjcox@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Sarge-117 <adam_branston@outlook.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: lil David <1337lilDavid@gmail.com> Co-authored-by: Sarge-117 <108380086+Sarge-117@users.noreply.github.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com>
2022-09-21 00:50:22 -04:00
SaveManager::Instance->LoadArray("randomizerInf", ARRAY_COUNT(gSaveContext.randomizerInf), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.randomizerInf[i]);
});
}
void SaveManager::LoadBaseVersion2() {
SaveManager::Instance->LoadData("entranceIndex", gSaveContext.entranceIndex);
SaveManager::Instance->LoadData("linkAge", gSaveContext.linkAge);
SaveManager::Instance->LoadData("cutsceneIndex", gSaveContext.cutsceneIndex);
SaveManager::Instance->LoadData("dayTime", gSaveContext.dayTime);
SaveManager::Instance->LoadData("nightFlag", gSaveContext.nightFlag);
SaveManager::Instance->LoadData("totalDays", gSaveContext.totalDays);
SaveManager::Instance->LoadData("bgsDayCount", gSaveContext.bgsDayCount);
SaveManager::Instance->LoadData("deaths", gSaveContext.deaths);
SaveManager::Instance->LoadArray("playerName", ARRAY_COUNT(gSaveContext.playerName), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.playerName[i]);
});
SaveManager::Instance->LoadData("n64ddFlag", gSaveContext.n64ddFlag);
SaveManager::Instance->LoadData("healthCapacity", gSaveContext.healthCapacity);
SaveManager::Instance->LoadData("health", gSaveContext.health);
SaveManager::Instance->LoadData("magicLevel", gSaveContext.magicLevel);
SaveManager::Instance->LoadData("magic", gSaveContext.magic);
SaveManager::Instance->LoadData("rupees", gSaveContext.rupees);
SaveManager::Instance->LoadData("swordHealth", gSaveContext.swordHealth);
SaveManager::Instance->LoadData("naviTimer", gSaveContext.naviTimer);
SaveManager::Instance->LoadData("magicAcquired", gSaveContext.isMagicAcquired);
SaveManager::Instance->LoadData("doubleMagic", gSaveContext.isDoubleMagicAcquired);
SaveManager::Instance->LoadData("doubleDefense", gSaveContext.isDoubleDefenseAcquired);
SaveManager::Instance->LoadData("bgsFlag", gSaveContext.bgsFlag);
SaveManager::Instance->LoadData("ocarinaGameRoundNum", gSaveContext.ocarinaGameRoundNum);
SaveManager::Instance->LoadStruct("childEquips", []() {
SaveManager::Instance->LoadArray("buttonItems", ARRAY_COUNT(gSaveContext.childEquips.buttonItems), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.childEquips.buttonItems[i],
static_cast<uint8_t>(ITEM_NONE));
});
SaveManager::Instance->LoadArray("cButtonSlots", ARRAY_COUNT(gSaveContext.childEquips.cButtonSlots), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.childEquips.cButtonSlots[i],
static_cast<uint8_t>(SLOT_NONE));
});
SaveManager::Instance->LoadData("equipment", gSaveContext.childEquips.equipment);
});
SaveManager::Instance->LoadStruct("adultEquips", []() {
SaveManager::Instance->LoadArray("buttonItems", ARRAY_COUNT(gSaveContext.adultEquips.buttonItems), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.adultEquips.buttonItems[i],
static_cast<uint8_t>(ITEM_NONE));
});
SaveManager::Instance->LoadArray("cButtonSlots", ARRAY_COUNT(gSaveContext.adultEquips.cButtonSlots), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.adultEquips.cButtonSlots[i],
static_cast<uint8_t>(SLOT_NONE));
});
SaveManager::Instance->LoadData("equipment", gSaveContext.adultEquips.equipment);
});
SaveManager::Instance->LoadData("unk_54", gSaveContext.unk_54);
SaveManager::Instance->LoadData("savedSceneNum", gSaveContext.savedSceneNum);
SaveManager::Instance->LoadStruct("equips", []() {
SaveManager::Instance->LoadArray("buttonItems", ARRAY_COUNT(gSaveContext.equips.buttonItems), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.equips.buttonItems[i], static_cast<uint8_t>(ITEM_NONE));
});
SaveManager::Instance->LoadArray("cButtonSlots", ARRAY_COUNT(gSaveContext.equips.cButtonSlots), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.equips.cButtonSlots[i], static_cast<uint8_t>(SLOT_NONE));
});
SaveManager::Instance->LoadData("equipment", gSaveContext.equips.equipment);
});
SaveManager::Instance->LoadStruct("inventory", []() {
SaveManager::Instance->LoadArray("items", ARRAY_COUNT(gSaveContext.inventory.items), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.inventory.items[i]);
});
SaveManager::Instance->LoadArray("ammo", ARRAY_COUNT(gSaveContext.inventory.ammo), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.inventory.ammo[i]);
});
SaveManager::Instance->LoadData("equipment", gSaveContext.inventory.equipment);
SaveManager::Instance->LoadData("upgrades", gSaveContext.inventory.upgrades);
SaveManager::Instance->LoadData("questItems", gSaveContext.inventory.questItems);
SaveManager::Instance->LoadArray("dungeonItems", ARRAY_COUNT(gSaveContext.inventory.dungeonItems), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.inventory.dungeonItems[i]);
});
SaveManager::Instance->LoadArray("dungeonKeys", ARRAY_COUNT(gSaveContext.inventory.dungeonKeys), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.inventory.dungeonKeys[i]);
});
SaveManager::Instance->LoadData("defenseHearts", gSaveContext.inventory.defenseHearts);
SaveManager::Instance->LoadData("gsTokens", gSaveContext.inventory.gsTokens);
});
SaveManager::Instance->LoadStruct("sohStats", []() {
SaveManager::Instance->LoadData("heartPieces", gSaveContext.sohStats.heartPieces);
SaveManager::Instance->LoadData("heartContainers", gSaveContext.sohStats.heartContainers);
SaveManager::Instance->LoadArray("dungeonKeys", ARRAY_COUNT(gSaveContext.sohStats.dungeonKeys), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.sohStats.dungeonKeys[i]);
});
SaveManager::Instance->LoadData("playTimer", gSaveContext.sohStats.playTimer);
SaveManager::Instance->LoadData("pauseTimer", gSaveContext.sohStats.pauseTimer);
SaveManager::Instance->LoadArray("timestamps", ARRAY_COUNT(gSaveContext.sohStats.timestamp), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.sohStats.timestamp[i]);
});
SaveManager::Instance->LoadArray("counts", ARRAY_COUNT(gSaveContext.sohStats.count), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.sohStats.count[i]);
});
SaveManager::Instance->LoadArray("scenesDiscovered", ARRAY_COUNT(gSaveContext.sohStats.scenesDiscovered), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.sohStats.scenesDiscovered[i]);
});
SaveManager::Instance->LoadArray("entrancesDiscovered", ARRAY_COUNT(gSaveContext.sohStats.entrancesDiscovered), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.sohStats.entrancesDiscovered[i]);
});
});
SaveManager::Instance->LoadArray("sceneFlags", ARRAY_COUNT(gSaveContext.sceneFlags), [](size_t i) {
SaveManager::Instance->LoadStruct("", [&i]() {
SaveManager::Instance->LoadData("chest", gSaveContext.sceneFlags[i].chest);
SaveManager::Instance->LoadData("swch", gSaveContext.sceneFlags[i].swch);
SaveManager::Instance->LoadData("clear", gSaveContext.sceneFlags[i].clear);
SaveManager::Instance->LoadData("collect", gSaveContext.sceneFlags[i].collect);
SaveManager::Instance->LoadData("unk", gSaveContext.sceneFlags[i].unk);
SaveManager::Instance->LoadData("rooms", gSaveContext.sceneFlags[i].rooms);
SaveManager::Instance->LoadData("floors", gSaveContext.sceneFlags[i].floors);
});
});
SaveManager::Instance->LoadStruct("fw", []() {
SaveManager::Instance->LoadStruct("pos", []() {
SaveManager::Instance->LoadData("x", gSaveContext.fw.pos.x);
SaveManager::Instance->LoadData("y", gSaveContext.fw.pos.y);
SaveManager::Instance->LoadData("z", gSaveContext.fw.pos.z);
});
SaveManager::Instance->LoadData("yaw", gSaveContext.fw.yaw);
SaveManager::Instance->LoadData("playerParams", gSaveContext.fw.playerParams);
SaveManager::Instance->LoadData("entranceIndex", gSaveContext.fw.entranceIndex);
SaveManager::Instance->LoadData("roomIndex", gSaveContext.fw.roomIndex);
SaveManager::Instance->LoadData("set", gSaveContext.fw.set);
SaveManager::Instance->LoadData("tempSwchFlags", gSaveContext.fw.tempSwchFlags);
SaveManager::Instance->LoadData("tempCollectFlags", gSaveContext.fw.tempCollectFlags);
});
SaveManager::Instance->LoadArray("gsFlags", ARRAY_COUNT(gSaveContext.gsFlags), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.gsFlags[i]);
});
SaveManager::Instance->LoadArray("highScores", ARRAY_COUNT(gSaveContext.highScores), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.highScores[i]);
});
SaveManager::Instance->LoadArray("eventChkInf", ARRAY_COUNT(gSaveContext.eventChkInf), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.eventChkInf[i]);
});
SaveManager::Instance->LoadArray("itemGetInf", ARRAY_COUNT(gSaveContext.itemGetInf), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.itemGetInf[i]);
});
SaveManager::Instance->LoadArray("infTable", ARRAY_COUNT(gSaveContext.infTable), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.infTable[i]);
});
SaveManager::Instance->LoadData("worldMapAreaData", gSaveContext.worldMapAreaData);
SaveManager::Instance->LoadData("scarecrowCustomSongSet", gSaveContext.scarecrowLongSongSet);
SaveManager::Instance->LoadArray("scarecrowCustomSong", ARRAY_COUNT(gSaveContext.scarecrowLongSong), [](size_t i) {
SaveManager::Instance->LoadStruct("", [&i]() {
SaveManager::Instance->LoadData("noteIdx", gSaveContext.scarecrowLongSong[i].noteIdx);
SaveManager::Instance->LoadData("unk_01", gSaveContext.scarecrowLongSong[i].unk_01);
SaveManager::Instance->LoadData("unk_02", gSaveContext.scarecrowLongSong[i].unk_02);
SaveManager::Instance->LoadData("volume", gSaveContext.scarecrowLongSong[i].volume);
SaveManager::Instance->LoadData("vibrato", gSaveContext.scarecrowLongSong[i].vibrato);
SaveManager::Instance->LoadData("tone", gSaveContext.scarecrowLongSong[i].tone);
SaveManager::Instance->LoadData("semitone", gSaveContext.scarecrowLongSong[i].semitone);
});
});
SaveManager::Instance->LoadData("scarecrowSpawnSongSet", gSaveContext.scarecrowSpawnSongSet);
SaveManager::Instance->LoadArray("scarecrowSpawnSong", ARRAY_COUNT(gSaveContext.scarecrowSpawnSong), [](size_t i) {
SaveManager::Instance->LoadStruct("", [&i]() {
SaveManager::Instance->LoadData("noteIdx", gSaveContext.scarecrowSpawnSong[i].noteIdx);
SaveManager::Instance->LoadData("unk_01", gSaveContext.scarecrowSpawnSong[i].unk_01);
SaveManager::Instance->LoadData("unk_02", gSaveContext.scarecrowSpawnSong[i].unk_02);
SaveManager::Instance->LoadData("volume", gSaveContext.scarecrowSpawnSong[i].volume);
SaveManager::Instance->LoadData("vibrato", gSaveContext.scarecrowSpawnSong[i].vibrato);
SaveManager::Instance->LoadData("tone", gSaveContext.scarecrowSpawnSong[i].tone);
SaveManager::Instance->LoadData("semitone", gSaveContext.scarecrowSpawnSong[i].semitone);
});
});
SaveManager::Instance->LoadStruct("horseData", []() {
SaveManager::Instance->LoadData("scene", gSaveContext.horseData.scene);
SaveManager::Instance->LoadStruct("pos", []() {
SaveManager::Instance->LoadData("x", gSaveContext.horseData.pos.x);
SaveManager::Instance->LoadData("y", gSaveContext.horseData.pos.y);
SaveManager::Instance->LoadData("z", gSaveContext.horseData.pos.z);
});
SaveManager::Instance->LoadData("angle", gSaveContext.horseData.angle);
});
SaveManager::Instance->LoadArray("randomizerInf", ARRAY_COUNT(gSaveContext.randomizerInf), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.randomizerInf[i]);
});
SaveManager::Instance->LoadData("isMasterQuest", gSaveContext.isMasterQuest);
// Workaround for breaking save compatibility from 5.0.2 -> 5.1.0 in commit d7c35221421bf712b5ead56a360f81f624aca4bc
if (!gSaveContext.isMagicAcquired) {
SaveManager::Instance->LoadData("isMagicAcquired", gSaveContext.isMagicAcquired);
}
if (!gSaveContext.isDoubleMagicAcquired) {
SaveManager::Instance->LoadData("isDoubleMagicAcquired", gSaveContext.isDoubleMagicAcquired);
}
if (!gSaveContext.isDoubleDefenseAcquired) {
SaveManager::Instance->LoadData("isDoubleDefenseAcquired", gSaveContext.isDoubleDefenseAcquired);
}
if (!gSaveContext.scarecrowLongSongSet) {
SaveManager::Instance->LoadData("scarecrowLongSongSet", gSaveContext.scarecrowLongSongSet);
if (gSaveContext.scarecrowLongSongSet) {
SaveManager::Instance->LoadArray("scarecrowLongSong", ARRAY_COUNT(gSaveContext.scarecrowLongSong), [](size_t i) {
SaveManager::Instance->LoadStruct("", [&i]() {
SaveManager::Instance->LoadData("noteIdx", gSaveContext.scarecrowLongSong[i].noteIdx);
SaveManager::Instance->LoadData("unk_01", gSaveContext.scarecrowLongSong[i].unk_01);
SaveManager::Instance->LoadData("unk_02", gSaveContext.scarecrowLongSong[i].unk_02);
SaveManager::Instance->LoadData("volume", gSaveContext.scarecrowLongSong[i].volume);
SaveManager::Instance->LoadData("vibrato", gSaveContext.scarecrowLongSong[i].vibrato);
SaveManager::Instance->LoadData("tone", gSaveContext.scarecrowLongSong[i].tone);
SaveManager::Instance->LoadData("semitone", gSaveContext.scarecrowLongSong[i].semitone);
});
});
}
}
}
void SaveManager::LoadBaseVersion3() {
SaveManager::Instance->LoadData("entranceIndex", gSaveContext.entranceIndex);
SaveManager::Instance->LoadData("linkAge", gSaveContext.linkAge);
SaveManager::Instance->LoadData("cutsceneIndex", gSaveContext.cutsceneIndex);
SaveManager::Instance->LoadData("dayTime", gSaveContext.dayTime);
SaveManager::Instance->LoadData("nightFlag", gSaveContext.nightFlag);
SaveManager::Instance->LoadData("totalDays", gSaveContext.totalDays);
SaveManager::Instance->LoadData("bgsDayCount", gSaveContext.bgsDayCount);
SaveManager::Instance->LoadData("deaths", gSaveContext.deaths);
SaveManager::Instance->LoadArray("playerName", ARRAY_COUNT(gSaveContext.playerName), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.playerName[i]);
});
SaveManager::Instance->LoadData("n64ddFlag", gSaveContext.n64ddFlag);
SaveManager::Instance->LoadData("healthCapacity", gSaveContext.healthCapacity);
SaveManager::Instance->LoadData("health", gSaveContext.health);
SaveManager::Instance->LoadData("magicLevel", gSaveContext.magicLevel);
SaveManager::Instance->LoadData("magic", gSaveContext.magic);
SaveManager::Instance->LoadData("rupees", gSaveContext.rupees);
SaveManager::Instance->LoadData("swordHealth", gSaveContext.swordHealth);
SaveManager::Instance->LoadData("naviTimer", gSaveContext.naviTimer);
SaveManager::Instance->LoadData("isMagicAcquired", gSaveContext.isMagicAcquired);
SaveManager::Instance->LoadData("isDoubleMagicAcquired", gSaveContext.isDoubleMagicAcquired);
SaveManager::Instance->LoadData("isDoubleDefenseAcquired", gSaveContext.isDoubleDefenseAcquired);
SaveManager::Instance->LoadData("bgsFlag", gSaveContext.bgsFlag);
SaveManager::Instance->LoadData("ocarinaGameRoundNum", gSaveContext.ocarinaGameRoundNum);
SaveManager::Instance->LoadStruct("childEquips", []() {
SaveManager::Instance->LoadArray("buttonItems", ARRAY_COUNT(gSaveContext.childEquips.buttonItems), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.childEquips.buttonItems[i],
static_cast<uint8_t>(ITEM_NONE));
});
SaveManager::Instance->LoadArray("cButtonSlots", ARRAY_COUNT(gSaveContext.childEquips.cButtonSlots), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.childEquips.cButtonSlots[i],
static_cast<uint8_t>(SLOT_NONE));
});
SaveManager::Instance->LoadData("equipment", gSaveContext.childEquips.equipment);
});
SaveManager::Instance->LoadStruct("adultEquips", []() {
SaveManager::Instance->LoadArray("buttonItems", ARRAY_COUNT(gSaveContext.adultEquips.buttonItems), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.adultEquips.buttonItems[i],
static_cast<uint8_t>(ITEM_NONE));
});
SaveManager::Instance->LoadArray("cButtonSlots", ARRAY_COUNT(gSaveContext.adultEquips.cButtonSlots), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.adultEquips.cButtonSlots[i],
static_cast<uint8_t>(SLOT_NONE));
});
SaveManager::Instance->LoadData("equipment", gSaveContext.adultEquips.equipment);
});
SaveManager::Instance->LoadData("unk_54", gSaveContext.unk_54);
SaveManager::Instance->LoadData("savedSceneNum", gSaveContext.savedSceneNum);
SaveManager::Instance->LoadStruct("equips", []() {
SaveManager::Instance->LoadArray("buttonItems", ARRAY_COUNT(gSaveContext.equips.buttonItems), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.equips.buttonItems[i], static_cast<uint8_t>(ITEM_NONE));
});
SaveManager::Instance->LoadArray("cButtonSlots", ARRAY_COUNT(gSaveContext.equips.cButtonSlots), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.equips.cButtonSlots[i], static_cast<uint8_t>(SLOT_NONE));
});
SaveManager::Instance->LoadData("equipment", gSaveContext.equips.equipment);
});
SaveManager::Instance->LoadStruct("inventory", []() {
SaveManager::Instance->LoadArray("items", ARRAY_COUNT(gSaveContext.inventory.items), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.inventory.items[i]);
});
SaveManager::Instance->LoadArray("ammo", ARRAY_COUNT(gSaveContext.inventory.ammo), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.inventory.ammo[i]);
});
SaveManager::Instance->LoadData("equipment", gSaveContext.inventory.equipment);
SaveManager::Instance->LoadData("upgrades", gSaveContext.inventory.upgrades);
SaveManager::Instance->LoadData("questItems", gSaveContext.inventory.questItems);
SaveManager::Instance->LoadArray("dungeonItems", ARRAY_COUNT(gSaveContext.inventory.dungeonItems), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.inventory.dungeonItems[i]);
});
SaveManager::Instance->LoadArray("dungeonKeys", ARRAY_COUNT(gSaveContext.inventory.dungeonKeys), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.inventory.dungeonKeys[i]);
});
SaveManager::Instance->LoadData("defenseHearts", gSaveContext.inventory.defenseHearts);
SaveManager::Instance->LoadData("gsTokens", gSaveContext.inventory.gsTokens);
});
SaveManager::Instance->LoadStruct("sohStats", []() {
SaveManager::Instance->LoadData("heartPieces", gSaveContext.sohStats.heartPieces);
SaveManager::Instance->LoadData("heartContainers", gSaveContext.sohStats.heartContainers);
SaveManager::Instance->LoadArray("dungeonKeys", ARRAY_COUNT(gSaveContext.sohStats.dungeonKeys), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.sohStats.dungeonKeys[i]);
});
SaveManager::Instance->LoadData("playTimer", gSaveContext.sohStats.playTimer);
SaveManager::Instance->LoadData("pauseTimer", gSaveContext.sohStats.pauseTimer);
SaveManager::Instance->LoadArray("timestamps", ARRAY_COUNT(gSaveContext.sohStats.timestamp), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.sohStats.timestamp[i]);
});
SaveManager::Instance->LoadArray("counts", ARRAY_COUNT(gSaveContext.sohStats.count), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.sohStats.count[i]);
});
SaveManager::Instance->LoadArray("scenesDiscovered", ARRAY_COUNT(gSaveContext.sohStats.scenesDiscovered), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.sohStats.scenesDiscovered[i]);
});
SaveManager::Instance->LoadArray("entrancesDiscovered", ARRAY_COUNT(gSaveContext.sohStats.entrancesDiscovered), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.sohStats.entrancesDiscovered[i]);
});
});
SaveManager::Instance->LoadArray("sceneFlags", ARRAY_COUNT(gSaveContext.sceneFlags), [](size_t i) {
SaveManager::Instance->LoadStruct("", [&i]() {
SaveManager::Instance->LoadData("chest", gSaveContext.sceneFlags[i].chest);
SaveManager::Instance->LoadData("swch", gSaveContext.sceneFlags[i].swch);
SaveManager::Instance->LoadData("clear", gSaveContext.sceneFlags[i].clear);
SaveManager::Instance->LoadData("collect", gSaveContext.sceneFlags[i].collect);
SaveManager::Instance->LoadData("unk", gSaveContext.sceneFlags[i].unk);
SaveManager::Instance->LoadData("rooms", gSaveContext.sceneFlags[i].rooms);
SaveManager::Instance->LoadData("floors", gSaveContext.sceneFlags[i].floors);
});
});
SaveManager::Instance->LoadStruct("fw", []() {
SaveManager::Instance->LoadStruct("pos", []() {
SaveManager::Instance->LoadData("x", gSaveContext.fw.pos.x);
SaveManager::Instance->LoadData("y", gSaveContext.fw.pos.y);
SaveManager::Instance->LoadData("z", gSaveContext.fw.pos.z);
});
SaveManager::Instance->LoadData("yaw", gSaveContext.fw.yaw);
SaveManager::Instance->LoadData("playerParams", gSaveContext.fw.playerParams);
SaveManager::Instance->LoadData("entranceIndex", gSaveContext.fw.entranceIndex);
SaveManager::Instance->LoadData("roomIndex", gSaveContext.fw.roomIndex);
SaveManager::Instance->LoadData("set", gSaveContext.fw.set);
SaveManager::Instance->LoadData("tempSwchFlags", gSaveContext.fw.tempSwchFlags);
SaveManager::Instance->LoadData("tempCollectFlags", gSaveContext.fw.tempCollectFlags);
});
SaveManager::Instance->LoadArray("gsFlags", ARRAY_COUNT(gSaveContext.gsFlags), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.gsFlags[i]);
});
SaveManager::Instance->LoadArray("highScores", ARRAY_COUNT(gSaveContext.highScores), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.highScores[i]);
});
SaveManager::Instance->LoadArray("eventChkInf", ARRAY_COUNT(gSaveContext.eventChkInf), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.eventChkInf[i]);
});
SaveManager::Instance->LoadArray("itemGetInf", ARRAY_COUNT(gSaveContext.itemGetInf), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.itemGetInf[i]);
});
SaveManager::Instance->LoadArray("infTable", ARRAY_COUNT(gSaveContext.infTable), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.infTable[i]);
});
SaveManager::Instance->LoadData("worldMapAreaData", gSaveContext.worldMapAreaData);
SaveManager::Instance->LoadData("scarecrowLongSongSet", gSaveContext.scarecrowLongSongSet);
SaveManager::Instance->LoadArray("scarecrowLongSong", ARRAY_COUNT(gSaveContext.scarecrowLongSong), [](size_t i) {
SaveManager::Instance->LoadStruct("", [&i]() {
SaveManager::Instance->LoadData("noteIdx", gSaveContext.scarecrowLongSong[i].noteIdx);
SaveManager::Instance->LoadData("unk_01", gSaveContext.scarecrowLongSong[i].unk_01);
SaveManager::Instance->LoadData("unk_02", gSaveContext.scarecrowLongSong[i].unk_02);
SaveManager::Instance->LoadData("volume", gSaveContext.scarecrowLongSong[i].volume);
SaveManager::Instance->LoadData("vibrato", gSaveContext.scarecrowLongSong[i].vibrato);
SaveManager::Instance->LoadData("tone", gSaveContext.scarecrowLongSong[i].tone);
SaveManager::Instance->LoadData("semitone", gSaveContext.scarecrowLongSong[i].semitone);
});
});
SaveManager::Instance->LoadData("scarecrowSpawnSongSet", gSaveContext.scarecrowSpawnSongSet);
SaveManager::Instance->LoadArray("scarecrowSpawnSong", ARRAY_COUNT(gSaveContext.scarecrowSpawnSong), [](size_t i) {
SaveManager::Instance->LoadStruct("", [&i]() {
SaveManager::Instance->LoadData("noteIdx", gSaveContext.scarecrowSpawnSong[i].noteIdx);
SaveManager::Instance->LoadData("unk_01", gSaveContext.scarecrowSpawnSong[i].unk_01);
SaveManager::Instance->LoadData("unk_02", gSaveContext.scarecrowSpawnSong[i].unk_02);
SaveManager::Instance->LoadData("volume", gSaveContext.scarecrowSpawnSong[i].volume);
SaveManager::Instance->LoadData("vibrato", gSaveContext.scarecrowSpawnSong[i].vibrato);
SaveManager::Instance->LoadData("tone", gSaveContext.scarecrowSpawnSong[i].tone);
SaveManager::Instance->LoadData("semitone", gSaveContext.scarecrowSpawnSong[i].semitone);
});
});
SaveManager::Instance->LoadStruct("horseData", []() {
SaveManager::Instance->LoadData("scene", gSaveContext.horseData.scene);
SaveManager::Instance->LoadStruct("pos", []() {
SaveManager::Instance->LoadData("x", gSaveContext.horseData.pos.x);
SaveManager::Instance->LoadData("y", gSaveContext.horseData.pos.y);
SaveManager::Instance->LoadData("z", gSaveContext.horseData.pos.z);
});
SaveManager::Instance->LoadData("angle", gSaveContext.horseData.angle);
});
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
Randomizer v2 (#1065) * Revert changes to GetItemFromGet * Fixes Ganon's Boss Key shuffled while regular boss Keys aren't. * Enum + combo box * Add obtainability checks correctly * combobox title rename + no number tracking * Fix repeatable purchases and bottles rendering incorrectly * Move shopsanity option in GUI * Struct instead of ImVec + basic comportment for all case * Attempt to fix odd build issue * Cast randoGet for ganons boss key * Remove redundancy in KD room * Update logic Cvar names * Fix Ganons Trials coming from old save files. Fixes #1365 * Fixes crash when entering Ganon's Castle lobby on linux. * Makes `Item_Give` safe to use with a NULL globalCtx. This should allow it's use for giving items to Link's Pocket during rando save initialization. * Converts Song from Impa to use `Item_Give` * Adds more options for Link's starting item. * Removes unneeded `GiveLinkItem` functions. * and make it build * bring back new rando dropdown * gSaveContext access in GameMenuBar.cpp * Implement Skip Scarecrow's Song * Reimplement progressive Bombchus * Rando-next: Deku Nut and Seed ammo gives a blue rupee Fixes #1390 * Fixes Link starting with BGS * Persist item tracker notes * Adjust Hooks include * Use SohImGui::RequestCvarSaveOnNextTick * Fix issues from LUS refactor * Fix for overriding deku scrub messages * Fix mistake from merge oops * Restore checkboxes to enhancements menu These got lost in the merge * Update location access logic Including MQ locations in Spirit and GC now * Implement rando bombchu drops * Missing break * Simplify mudwall collision check There was no need to have a second collider specifically for Ice Arrow hits * Update settings.cpp * Simplify mudwall collision check * Restore checkboxes in menu Accidentally lost these during merge * Clean up bool * Update logic Cvar name * Fixed capacity on ammmo tracking * Fix for beans obtainability * Hook into file delete and clear notes * Incorporate magic arrows in rando settings * Update tooltip To inform the player that they might have to reload the room if they're enabling this for the first time. * Update tooltip * Add line break in tooltip * Tooltip wording + line break * tweak on main logic * All color logic for all types * Fix: changes to please new LUS * Ensure itemTrackerNotes vector is not fully empty * Implement's Tycoon Wallet. * Refactor DrawItemCount and Use EnhancementCombobox for tracker capacity options * small tweaks and rename * always display XX/YY when in ammo/capacity mode * Move all merchant messages to be generated on file load * added hovertext for the number display * Swap german and french translations for shop messages * Set key colors to be on by default * Add another flag to skip mask shop * Fix Sold Out bug * Fix gerudo keys, add disabled checkbox * tooltip line break * Add trials required and merchant prices to save file instead of loading from active spoiler log * Remove trialsRequired persisting in save manager * Adds slotIndex to girla (shop item actor) and uses that for IdentifyShopItem. * Fix issue when merchantPrices is empty * Fix for a single zeroed merchantPrice entry * Fix #1417 * Implements items selling out and fixes issues with purchasing some items. * Fixes order of operations so Rupees will be spent. * Fixes sold out items not getting overwritten by the randomized info. * Clarify var names and comments Also preserve chain platform cutscene in spirit based on Link's position * Remove !=0 from cvar check * Clarify var names and comments * Rename randomizerMerchantPrices to merchantPrices * Handle shop items in SaveManager * Fix merge mistake * Base whats in the bazaar shop on entranceIndex instead of age * Tidy up chain platform cutscene check * Fix merge error Didn't mean to have Zhora changes in here yet * Use 3drando item table for parsing spoiler names * Use another nested method instead of one at the top level to fetch the table * Add missing newline * Remove log * Respect custom draw functions * Fix issues with rendering songs * Fix localized item names for shopsanity * Implements a larger array of Sprites for the Icon Hash. * Uses the hash instead of seed for spoilerfile name and icons. * Removes some unused functions and variables in `spoiler_log.cpp` * Prevents leading 0s added to hash from being in file name * Changes filename format to icon indexes separated by dashes * Hopefully makes Jenkins happy * Hopefully makes Jenkins happy * [Rando] Child Gerudo Fortress 37th Heartpiece randomized Fixes #1071 * Add descriptions to save editor flags editor, and added randomizer flags (#1386) * Add descriptions to save editor flags editor, and added randomizer flags * Hide randomizer flags when not on a randomizer save * Move flag descriptions to header file * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Fix merge error * crash on pause menu on linux (only in appimage) Fixes #1437 * Applies fix to Song from Impa as well. * Allow buying tunics as child when shopsanity is on * Fix for custom draw methods overriding sold out sign * Simplify logic around shopsanity and fix some issues * Fix dungeon reward stone rotation and add particles * Fix some issues with ice traps * Fix adult wallet having its own max capacity * Fix amount of keys given for BotW * format * Use EnGirlAShopItem enum instead of raw hex values * [#1434] Renders non-warp songs more consistently with warp songs * A few changes around merchant messages * Various changes from PR feedback * Rando: Junk Hint missing french translation * Typo * Fix free scrub being at 0 instead of TEXT_SCRUB_RANDOM * Replace magic numbers in message handler * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fix BGS softlock for shopsanity * Support tycoon wallet on tracker * Revert "Fix BGS softlock for shopsanity" This reverts commit 5fdb961ea460fb9a035cf0bb6ae77bfeedc1de0f. * [#1053] Resolves an issue with shop items and bombchu bowling where BGS would display two message boxes * Implements some necessary plumbing and resolves several Ice Trap Softlocks. Adds a way for an item entry to tell what type of check it came from (NPC vs Chest vs Freestanding, etc.) Sets this value from chests and item00 actors. Relocates pendingIceTraps to save context so it can persist through cutscenes and get stored on save init for Link's Pocket and Song from Impa. Restructures pendingIceTraps into a counter rather than a true or false, so that we can be frozen multiple times in a row if applicable (atm that should only be at the start of a run if Link's Pocket and Song from Impa were both Ice Traps). Adds a textbox for Ice Traps and a special case of holding up nothing in the get item process. This fixes all the cases where Ice Traps would softlock due to the actor giving the item expecting a closing textbox. After holding the item above his head Link increments the pendingIceTraps counter by one and sets whatever flag he has pending. None of the above plumbing applies to Ice Traps from chests, those work exactly the same as before, as do freestanding item00 ice traps (thanks to the additional check for ITEM_FROM_FREESTANDING. OoT and Ruto's Letter count as NPC's, so they get the FOWL text box and set a pending ice trap rather than immediately freezing, since Link weill be in the water. Link will get frozen the next time he touches land, which in the case of OoT is after the fade to white and right before the Song of Time check. Fixes all the other softlocks I'm aware of, including Fishing, Bombchu Bowling, Skull Kid, and losing the second Gerudo Archery check. * fix bgs check in player * move bgs logic for tokensanity into MOD_NONE check * set bgs flag before `Item_Give`ing * move bgs flag into `MOD_NONE` check in girla * use existing check in `z_player` * Adds comment explaining the decision to default ITEM_FROM_NPC. * Rename pendingIceTraps to pendingIceTrapCount * Adds some RANDOTODO comments about cleaning up a couple things. * Merge branch 'develop-zhora' into ztornn * manually restore changes to `z_player.c` * Fix after some ice trap prepwork from earlier * Actual fix * Woops * More rupee names * Actually fix it * Add back comment * Fix Skip Scarecrow Song * Fix ruto's letter and LH sun stick rendering * Also fixes it for treasure chest game * Tweak: Rando French Wallet * ADD: French Tycoon * Hide dungeon items/notes by default * [#1301] Fix issue with UI not restoring after getting an item from biggoron * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Fix random crash that only affected one person for some reason Co-authored-by: Garrett Cox <garrettjcox@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Sarge-117 <adam_branston@outlook.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: lil David <1337lilDavid@gmail.com> Co-authored-by: Sarge-117 <108380086+Sarge-117@users.noreply.github.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com>
2022-09-21 00:50:22 -04:00
SaveManager::Instance->LoadArray("randomizerInf", ARRAY_COUNT(gSaveContext.randomizerInf), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.randomizerInf[i]);
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
});
SaveManager::Instance->LoadData("isMasterQuest", gSaveContext.isMasterQuest);
SaveManager::Instance->LoadStruct("backupFW", []() {
SaveManager::Instance->LoadStruct("pos", []() {
SaveManager::Instance->LoadData("x", gSaveContext.backupFW.pos.x);
SaveManager::Instance->LoadData("y", gSaveContext.backupFW.pos.y);
SaveManager::Instance->LoadData("z", gSaveContext.backupFW.pos.z);
});
SaveManager::Instance->LoadData("yaw", gSaveContext.backupFW.yaw);
SaveManager::Instance->LoadData("playerParams", gSaveContext.backupFW.playerParams);
SaveManager::Instance->LoadData("entranceIndex", gSaveContext.backupFW.entranceIndex);
SaveManager::Instance->LoadData("roomIndex", gSaveContext.backupFW.roomIndex);
SaveManager::Instance->LoadData("set", gSaveContext.backupFW.set);
SaveManager::Instance->LoadData("tempSwchFlags", gSaveContext.backupFW.tempSwchFlags);
SaveManager::Instance->LoadData("tempCollectFlags", gSaveContext.backupFW.tempCollectFlags);
});
SaveManager::Instance->LoadData("dogParams", gSaveContext.dogParams);
}
void SaveManager::SaveBase() {
SaveManager::Instance->SaveData("entranceIndex", gSaveContext.entranceIndex);
SaveManager::Instance->SaveData("linkAge", gSaveContext.linkAge);
SaveManager::Instance->SaveData("cutsceneIndex", gSaveContext.cutsceneIndex);
SaveManager::Instance->SaveData("dayTime", gSaveContext.dayTime);
SaveManager::Instance->SaveData("nightFlag", gSaveContext.nightFlag);
SaveManager::Instance->SaveData("totalDays", gSaveContext.totalDays);
SaveManager::Instance->SaveData("bgsDayCount", gSaveContext.bgsDayCount);
SaveManager::Instance->SaveData("deaths", gSaveContext.deaths);
SaveManager::Instance->SaveArray("playerName", ARRAY_COUNT(gSaveContext.playerName), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.playerName[i]);
});
SaveManager::Instance->SaveData("n64ddFlag", gSaveContext.n64ddFlag);
SaveManager::Instance->SaveData("healthCapacity", gSaveContext.healthCapacity);
SaveManager::Instance->SaveData("health", gSaveContext.health);
SaveManager::Instance->SaveData("magicLevel", gSaveContext.magicLevel);
SaveManager::Instance->SaveData("magic", gSaveContext.magic);
SaveManager::Instance->SaveData("rupees", gSaveContext.rupees);
SaveManager::Instance->SaveData("swordHealth", gSaveContext.swordHealth);
SaveManager::Instance->SaveData("naviTimer", gSaveContext.naviTimer);
SaveManager::Instance->SaveData("isMagicAcquired", gSaveContext.isMagicAcquired);
SaveManager::Instance->SaveData("isDoubleMagicAcquired", gSaveContext.isDoubleMagicAcquired);
SaveManager::Instance->SaveData("isDoubleDefenseAcquired", gSaveContext.isDoubleDefenseAcquired);
SaveManager::Instance->SaveData("bgsFlag", gSaveContext.bgsFlag);
SaveManager::Instance->SaveData("ocarinaGameRoundNum", gSaveContext.ocarinaGameRoundNum);
SaveManager::Instance->SaveStruct("childEquips", []() {
SaveManager::Instance->SaveArray("buttonItems", ARRAY_COUNT(gSaveContext.childEquips.buttonItems), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.childEquips.buttonItems[i]);
});
SaveManager::Instance->SaveArray("cButtonSlots", ARRAY_COUNT(gSaveContext.childEquips.cButtonSlots), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.childEquips.cButtonSlots[i]);
});
SaveManager::Instance->SaveData("equipment", gSaveContext.childEquips.equipment);
});
SaveManager::Instance->SaveStruct("adultEquips", []() {
SaveManager::Instance->SaveArray("buttonItems", ARRAY_COUNT(gSaveContext.adultEquips.buttonItems), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.adultEquips.buttonItems[i]);
});
SaveManager::Instance->SaveArray("cButtonSlots", ARRAY_COUNT(gSaveContext.adultEquips.cButtonSlots), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.adultEquips.cButtonSlots[i]);
});
SaveManager::Instance->SaveData("equipment", gSaveContext.adultEquips.equipment);
});
SaveManager::Instance->SaveData("unk_54", gSaveContext.unk_54);
SaveManager::Instance->SaveData("savedSceneNum", gSaveContext.savedSceneNum);
SaveManager::Instance->SaveStruct("equips", []() {
SaveManager::Instance->SaveArray("buttonItems", ARRAY_COUNT(gSaveContext.equips.buttonItems), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.equips.buttonItems[i]);
});
SaveManager::Instance->SaveArray("cButtonSlots", ARRAY_COUNT(gSaveContext.equips.cButtonSlots), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.equips.cButtonSlots[i]);
});
SaveManager::Instance->SaveData("equipment", gSaveContext.equips.equipment);
});
SaveManager::Instance->SaveStruct("inventory", []() {
SaveManager::Instance->SaveArray("items", ARRAY_COUNT(gSaveContext.inventory.items), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.inventory.items[i]);
});
SaveManager::Instance->SaveArray("ammo", ARRAY_COUNT(gSaveContext.inventory.ammo), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.inventory.ammo[i]);
});
SaveManager::Instance->SaveData("equipment", gSaveContext.inventory.equipment);
SaveManager::Instance->SaveData("upgrades", gSaveContext.inventory.upgrades);
SaveManager::Instance->SaveData("questItems", gSaveContext.inventory.questItems);
SaveManager::Instance->SaveArray("dungeonItems", ARRAY_COUNT(gSaveContext.inventory.dungeonItems), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.inventory.dungeonItems[i]);
});
SaveManager::Instance->SaveArray("dungeonKeys", ARRAY_COUNT(gSaveContext.inventory.dungeonKeys), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.inventory.dungeonKeys[i]);
});
SaveManager::Instance->SaveData("defenseHearts", gSaveContext.inventory.defenseHearts);
SaveManager::Instance->SaveData("gsTokens", gSaveContext.inventory.gsTokens);
});
SaveManager::Instance->SaveStruct("sohStats", []() {
SaveManager::Instance->SaveData("heartPieces", gSaveContext.sohStats.heartPieces);
SaveManager::Instance->SaveData("heartContainers", gSaveContext.sohStats.heartContainers);
SaveManager::Instance->SaveArray("dungeonKeys", ARRAY_COUNT(gSaveContext.sohStats.dungeonKeys), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.sohStats.dungeonKeys[i]);
});
SaveManager::Instance->SaveData("playTimer", gSaveContext.sohStats.playTimer);
SaveManager::Instance->SaveData("pauseTimer", gSaveContext.sohStats.pauseTimer);
SaveManager::Instance->SaveArray("timestamps", ARRAY_COUNT(gSaveContext.sohStats.timestamp), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.sohStats.timestamp[i]);
});
SaveManager::Instance->SaveArray("counts", ARRAY_COUNT(gSaveContext.sohStats.count), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.sohStats.count[i]);
});
SaveManager::Instance->SaveArray("scenesDiscovered", ARRAY_COUNT(gSaveContext.sohStats.scenesDiscovered), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.sohStats.scenesDiscovered[i]);
});
SaveManager::Instance->SaveArray("entrancesDiscovered", ARRAY_COUNT(gSaveContext.sohStats.entrancesDiscovered), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.sohStats.entrancesDiscovered[i]);
});
});
SaveManager::Instance->SaveArray("sceneFlags", ARRAY_COUNT(gSaveContext.sceneFlags), [](size_t i) {
SaveManager::Instance->SaveStruct("", [&i]() {
SaveManager::Instance->SaveData("chest", gSaveContext.sceneFlags[i].chest);
SaveManager::Instance->SaveData("swch", gSaveContext.sceneFlags[i].swch);
SaveManager::Instance->SaveData("clear", gSaveContext.sceneFlags[i].clear);
SaveManager::Instance->SaveData("collect", gSaveContext.sceneFlags[i].collect);
SaveManager::Instance->SaveData("unk", gSaveContext.sceneFlags[i].unk);
SaveManager::Instance->SaveData("rooms", gSaveContext.sceneFlags[i].rooms);
SaveManager::Instance->SaveData("floors", gSaveContext.sceneFlags[i].floors);
});
});
SaveManager::Instance->SaveStruct("fw", []() {
SaveManager::Instance->SaveStruct("pos", []() {
SaveManager::Instance->SaveData("x", gSaveContext.fw.pos.x);
SaveManager::Instance->SaveData("y", gSaveContext.fw.pos.y);
SaveManager::Instance->SaveData("z", gSaveContext.fw.pos.z);
});
SaveManager::Instance->SaveData("yaw", gSaveContext.fw.yaw);
SaveManager::Instance->SaveData("playerParams", gSaveContext.fw.playerParams);
SaveManager::Instance->SaveData("entranceIndex", gSaveContext.fw.entranceIndex);
SaveManager::Instance->SaveData("roomIndex", gSaveContext.fw.roomIndex);
SaveManager::Instance->SaveData("set", gSaveContext.fw.set);
SaveManager::Instance->SaveData("tempSwchFlags", gSaveContext.fw.tempSwchFlags);
SaveManager::Instance->SaveData("tempCollectFlags", gSaveContext.fw.tempCollectFlags);
});
SaveManager::Instance->SaveArray("gsFlags", ARRAY_COUNT(gSaveContext.gsFlags), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.gsFlags[i]);
});
SaveManager::Instance->SaveArray("highScores", ARRAY_COUNT(gSaveContext.highScores), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.highScores[i]);
});
SaveManager::Instance->SaveArray("eventChkInf", ARRAY_COUNT(gSaveContext.eventChkInf), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.eventChkInf[i]);
});
SaveManager::Instance->SaveArray("itemGetInf", ARRAY_COUNT(gSaveContext.itemGetInf), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.itemGetInf[i]);
});
SaveManager::Instance->SaveArray("infTable", ARRAY_COUNT(gSaveContext.infTable), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.infTable[i]);
});
SaveManager::Instance->SaveData("worldMapAreaData", gSaveContext.worldMapAreaData);
SaveManager::Instance->SaveData("scarecrowLongSongSet", gSaveContext.scarecrowLongSongSet);
SaveManager::Instance->SaveArray("scarecrowLongSong", ARRAY_COUNT(gSaveContext.scarecrowLongSong), [](size_t i) {
SaveManager::Instance->SaveStruct("", [&i]() {
SaveManager::Instance->SaveData("noteIdx", gSaveContext.scarecrowLongSong[i].noteIdx);
SaveManager::Instance->SaveData("unk_01", gSaveContext.scarecrowLongSong[i].unk_01);
SaveManager::Instance->SaveData("unk_02", gSaveContext.scarecrowLongSong[i].unk_02);
SaveManager::Instance->SaveData("volume", gSaveContext.scarecrowLongSong[i].volume);
SaveManager::Instance->SaveData("vibrato", gSaveContext.scarecrowLongSong[i].vibrato);
SaveManager::Instance->SaveData("tone", gSaveContext.scarecrowLongSong[i].tone);
SaveManager::Instance->SaveData("semitone", gSaveContext.scarecrowLongSong[i].semitone);
});
});
SaveManager::Instance->SaveData("scarecrowSpawnSongSet", gSaveContext.scarecrowSpawnSongSet);
SaveManager::Instance->SaveArray("scarecrowSpawnSong", ARRAY_COUNT(gSaveContext.scarecrowSpawnSong), [](size_t i) {
SaveManager::Instance->SaveStruct("", [&i]() {
SaveManager::Instance->SaveData("noteIdx", gSaveContext.scarecrowSpawnSong[i].noteIdx);
SaveManager::Instance->SaveData("unk_01", gSaveContext.scarecrowSpawnSong[i].unk_01);
SaveManager::Instance->SaveData("unk_02", gSaveContext.scarecrowSpawnSong[i].unk_02);
SaveManager::Instance->SaveData("volume", gSaveContext.scarecrowSpawnSong[i].volume);
SaveManager::Instance->SaveData("vibrato", gSaveContext.scarecrowSpawnSong[i].vibrato);
SaveManager::Instance->SaveData("tone", gSaveContext.scarecrowSpawnSong[i].tone);
SaveManager::Instance->SaveData("semitone", gSaveContext.scarecrowSpawnSong[i].semitone);
});
});
SaveManager::Instance->SaveStruct("horseData", []() {
SaveManager::Instance->SaveData("scene", gSaveContext.horseData.scene);
SaveManager::Instance->SaveStruct("pos", []() {
SaveManager::Instance->SaveData("x", gSaveContext.horseData.pos.x);
SaveManager::Instance->SaveData("y", gSaveContext.horseData.pos.y);
SaveManager::Instance->SaveData("z", gSaveContext.horseData.pos.z);
});
SaveManager::Instance->SaveData("angle", gSaveContext.horseData.angle);
});
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
Randomizer v2 (#1065) * Revert changes to GetItemFromGet * Fixes Ganon's Boss Key shuffled while regular boss Keys aren't. * Enum + combo box * Add obtainability checks correctly * combobox title rename + no number tracking * Fix repeatable purchases and bottles rendering incorrectly * Move shopsanity option in GUI * Struct instead of ImVec + basic comportment for all case * Attempt to fix odd build issue * Cast randoGet for ganons boss key * Remove redundancy in KD room * Update logic Cvar names * Fix Ganons Trials coming from old save files. Fixes #1365 * Fixes crash when entering Ganon's Castle lobby on linux. * Makes `Item_Give` safe to use with a NULL globalCtx. This should allow it's use for giving items to Link's Pocket during rando save initialization. * Converts Song from Impa to use `Item_Give` * Adds more options for Link's starting item. * Removes unneeded `GiveLinkItem` functions. * and make it build * bring back new rando dropdown * gSaveContext access in GameMenuBar.cpp * Implement Skip Scarecrow's Song * Reimplement progressive Bombchus * Rando-next: Deku Nut and Seed ammo gives a blue rupee Fixes #1390 * Fixes Link starting with BGS * Persist item tracker notes * Adjust Hooks include * Use SohImGui::RequestCvarSaveOnNextTick * Fix issues from LUS refactor * Fix for overriding deku scrub messages * Fix mistake from merge oops * Restore checkboxes to enhancements menu These got lost in the merge * Update location access logic Including MQ locations in Spirit and GC now * Implement rando bombchu drops * Missing break * Simplify mudwall collision check There was no need to have a second collider specifically for Ice Arrow hits * Update settings.cpp * Simplify mudwall collision check * Restore checkboxes in menu Accidentally lost these during merge * Clean up bool * Update logic Cvar name * Fixed capacity on ammmo tracking * Fix for beans obtainability * Hook into file delete and clear notes * Incorporate magic arrows in rando settings * Update tooltip To inform the player that they might have to reload the room if they're enabling this for the first time. * Update tooltip * Add line break in tooltip * Tooltip wording + line break * tweak on main logic * All color logic for all types * Fix: changes to please new LUS * Ensure itemTrackerNotes vector is not fully empty * Implement's Tycoon Wallet. * Refactor DrawItemCount and Use EnhancementCombobox for tracker capacity options * small tweaks and rename * always display XX/YY when in ammo/capacity mode * Move all merchant messages to be generated on file load * added hovertext for the number display * Swap german and french translations for shop messages * Set key colors to be on by default * Add another flag to skip mask shop * Fix Sold Out bug * Fix gerudo keys, add disabled checkbox * tooltip line break * Add trials required and merchant prices to save file instead of loading from active spoiler log * Remove trialsRequired persisting in save manager * Adds slotIndex to girla (shop item actor) and uses that for IdentifyShopItem. * Fix issue when merchantPrices is empty * Fix for a single zeroed merchantPrice entry * Fix #1417 * Implements items selling out and fixes issues with purchasing some items. * Fixes order of operations so Rupees will be spent. * Fixes sold out items not getting overwritten by the randomized info. * Clarify var names and comments Also preserve chain platform cutscene in spirit based on Link's position * Remove !=0 from cvar check * Clarify var names and comments * Rename randomizerMerchantPrices to merchantPrices * Handle shop items in SaveManager * Fix merge mistake * Base whats in the bazaar shop on entranceIndex instead of age * Tidy up chain platform cutscene check * Fix merge error Didn't mean to have Zhora changes in here yet * Use 3drando item table for parsing spoiler names * Use another nested method instead of one at the top level to fetch the table * Add missing newline * Remove log * Respect custom draw functions * Fix issues with rendering songs * Fix localized item names for shopsanity * Implements a larger array of Sprites for the Icon Hash. * Uses the hash instead of seed for spoilerfile name and icons. * Removes some unused functions and variables in `spoiler_log.cpp` * Prevents leading 0s added to hash from being in file name * Changes filename format to icon indexes separated by dashes * Hopefully makes Jenkins happy * Hopefully makes Jenkins happy * [Rando] Child Gerudo Fortress 37th Heartpiece randomized Fixes #1071 * Add descriptions to save editor flags editor, and added randomizer flags (#1386) * Add descriptions to save editor flags editor, and added randomizer flags * Hide randomizer flags when not on a randomizer save * Move flag descriptions to header file * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Fix merge error * crash on pause menu on linux (only in appimage) Fixes #1437 * Applies fix to Song from Impa as well. * Allow buying tunics as child when shopsanity is on * Fix for custom draw methods overriding sold out sign * Simplify logic around shopsanity and fix some issues * Fix dungeon reward stone rotation and add particles * Fix some issues with ice traps * Fix adult wallet having its own max capacity * Fix amount of keys given for BotW * format * Use EnGirlAShopItem enum instead of raw hex values * [#1434] Renders non-warp songs more consistently with warp songs * A few changes around merchant messages * Various changes from PR feedback * Rando: Junk Hint missing french translation * Typo * Fix free scrub being at 0 instead of TEXT_SCRUB_RANDOM * Replace magic numbers in message handler * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fix BGS softlock for shopsanity * Support tycoon wallet on tracker * Revert "Fix BGS softlock for shopsanity" This reverts commit 5fdb961ea460fb9a035cf0bb6ae77bfeedc1de0f. * [#1053] Resolves an issue with shop items and bombchu bowling where BGS would display two message boxes * Implements some necessary plumbing and resolves several Ice Trap Softlocks. Adds a way for an item entry to tell what type of check it came from (NPC vs Chest vs Freestanding, etc.) Sets this value from chests and item00 actors. Relocates pendingIceTraps to save context so it can persist through cutscenes and get stored on save init for Link's Pocket and Song from Impa. Restructures pendingIceTraps into a counter rather than a true or false, so that we can be frozen multiple times in a row if applicable (atm that should only be at the start of a run if Link's Pocket and Song from Impa were both Ice Traps). Adds a textbox for Ice Traps and a special case of holding up nothing in the get item process. This fixes all the cases where Ice Traps would softlock due to the actor giving the item expecting a closing textbox. After holding the item above his head Link increments the pendingIceTraps counter by one and sets whatever flag he has pending. None of the above plumbing applies to Ice Traps from chests, those work exactly the same as before, as do freestanding item00 ice traps (thanks to the additional check for ITEM_FROM_FREESTANDING. OoT and Ruto's Letter count as NPC's, so they get the FOWL text box and set a pending ice trap rather than immediately freezing, since Link weill be in the water. Link will get frozen the next time he touches land, which in the case of OoT is after the fade to white and right before the Song of Time check. Fixes all the other softlocks I'm aware of, including Fishing, Bombchu Bowling, Skull Kid, and losing the second Gerudo Archery check. * fix bgs check in player * move bgs logic for tokensanity into MOD_NONE check * set bgs flag before `Item_Give`ing * move bgs flag into `MOD_NONE` check in girla * use existing check in `z_player` * Adds comment explaining the decision to default ITEM_FROM_NPC. * Rename pendingIceTraps to pendingIceTrapCount * Adds some RANDOTODO comments about cleaning up a couple things. * Merge branch 'develop-zhora' into ztornn * manually restore changes to `z_player.c` * Fix after some ice trap prepwork from earlier * Actual fix * Woops * More rupee names * Actually fix it * Add back comment * Fix Skip Scarecrow Song * Fix ruto's letter and LH sun stick rendering * Also fixes it for treasure chest game * Tweak: Rando French Wallet * ADD: French Tycoon * Hide dungeon items/notes by default * [#1301] Fix issue with UI not restoring after getting an item from biggoron * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Fix random crash that only affected one person for some reason Co-authored-by: Garrett Cox <garrettjcox@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Sarge-117 <adam_branston@outlook.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: lil David <1337lilDavid@gmail.com> Co-authored-by: Sarge-117 <108380086+Sarge-117@users.noreply.github.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com>
2022-09-21 00:50:22 -04:00
SaveManager::Instance->SaveArray("randomizerInf", ARRAY_COUNT(gSaveContext.randomizerInf), [](size_t i) {
SaveManager::Instance->SaveData("", gSaveContext.randomizerInf[i]);
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
});
SaveManager::Instance->SaveData("isMasterQuest", gSaveContext.isMasterQuest);
SaveManager::Instance->SaveStruct("backupFW", []() {
SaveManager::Instance->SaveStruct("pos", []() {
SaveManager::Instance->SaveData("x", gSaveContext.backupFW.pos.x);
SaveManager::Instance->SaveData("y", gSaveContext.backupFW.pos.y);
SaveManager::Instance->SaveData("z", gSaveContext.backupFW.pos.z);
});
SaveManager::Instance->SaveData("yaw", gSaveContext.backupFW.yaw);
SaveManager::Instance->SaveData("playerParams", gSaveContext.backupFW.playerParams);
SaveManager::Instance->SaveData("entranceIndex", gSaveContext.backupFW.entranceIndex);
SaveManager::Instance->SaveData("roomIndex", gSaveContext.backupFW.roomIndex);
SaveManager::Instance->SaveData("set", gSaveContext.backupFW.set);
SaveManager::Instance->SaveData("tempSwchFlags", gSaveContext.backupFW.tempSwchFlags);
SaveManager::Instance->SaveData("tempCollectFlags", gSaveContext.backupFW.tempCollectFlags);
});
SaveManager::Instance->SaveData("dogParams", gSaveContext.dogParams);
}
void SaveManager::SaveArray(const std::string& name, const size_t size, SaveArrayFunc func) {
// Create an empty array and set it as the current save context, then call the function that saves an array entry.
nlohmann::json* saveJsonContext = currentJsonContext;
currentJsonContext = &(*currentJsonContext)[name.c_str()];
*currentJsonContext = nlohmann::json::array();
for (size_t i = 0; i < size; i++) {
func(i);
}
currentJsonContext = saveJsonContext;
}
void SaveManager::SaveStruct(const std::string& name, SaveStructFunc func) {
// Create an empty struct and set it as the current save context, then call the function that saves the struct.
// If it is an array entry, save it to the array instead.
if (name == "") {
nlohmann::json* saveJsonContext = currentJsonContext;
nlohmann::json object = nlohmann::json::object();
currentJsonContext = &object;
func();
currentJsonContext = saveJsonContext;
(*currentJsonContext).push_back(object);
} else {
nlohmann::json* saveJsonContext = currentJsonContext;
currentJsonContext = &(*currentJsonContext)[name.c_str()];
*currentJsonContext = nlohmann::json::object();
func();
currentJsonContext = saveJsonContext;
}
}
void SaveManager::LoadArray(const std::string& name, const size_t size, LoadArrayFunc func) {
// Create an empty array and set it as the current save context, then call the function that loads an array entry.
nlohmann::json* saveJsonContext = currentJsonContext;
currentJsonContext = &(*currentJsonContext)[name.c_str()];
currentJsonArrayContext = currentJsonContext->begin();
size_t i = 0;
for (; (currentJsonArrayContext != currentJsonContext->end()) && (i < size); i++, currentJsonArrayContext++) {
func(i);
}
// Handle remainer of items. Either this was data that was manually deleted, or a later version extended the size of the array.
// The later members will be default constructed.
for (; i < size; i++) {
func(i);
}
currentJsonContext = saveJsonContext;
}
Nintendo switch support (#935) * Moved gfx effects to the gpu and removed loadtexbyname on some textures * Readded empty if * Added nintendo switch support * Fixed compilation errors and window closing issue on linux * Fixed kaleido on 64 bit * Fixed audio on nintendo switch * Implemented performance mode switcher * Added suggestions from pr review * Fixed ftruncate errors * Fixed compilation errors * Added missing include rule * Fixed libstorm path * Removed ftruncate extern to use a correct posix version * Merge branch 'develop' from HarbourMasters into znx (#3) * Add Support for macOS (#441) * Fixed soh filters * add more makefile changes * almost ready * more updates * update * update * Update Makefiles to handle both platforms * Allow for overriding the CXX and CC executables * Restore original structure while supporting custom CXX flags * Remove some platform specific libs * Dynamic target name * Make X11 paths package-agnostic * Remove changes to `gfx_opengl.cpp` * Use OpenGL2 on MacOS instead of OpenGL3 * make it actually render something * render at least the first texture, still need to figure out the second one * Let’s use OpenGL 3 again * maybe this works to get the right texture? link's eyes still look off a bit * did this work? * set the platform to macos * actual numbers are right, but logic is ugly XXX/TODO, i know * add zlib to ldflags for ZAPDUtils * A bit of cleanup * Revert unneeded changes * Remove GL_CHECK * Fix issues with z64 branch * use an std::map instead of a giant array * three point filter fix (#2) * Fix mac compilation * fix audio for 64 bit * revert audio heap size, keep bigger pools * Add more Apple specific checks to our modifications * Add building instructions for macOS * Remove unecessary step from building instructions * Add missing SDL2 & GLEW to Linux LDLIBS * Update BUILDING.md Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Update soh/.gitignore to include other arch binaries Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Use right platform name for debugging window Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Fix stormlib on macos (arm64) * Simplify some of the ifdef checks * Revert an older no longer necessary fix * Remove remaining unecessary deviations * Update building instructions after StormLib changes * Feature: Use OpenGL 4.1 (#1) * Further tweak the BUILDING * Tidy up * reword -j message * Add Jenkins CI Support (#2) * Fix type issues * add target <appbundle> and <filledappbundle> add makefile targets to create an .app `filledappbundle` creates the target with the .otr included this should perhaps be moved to Application Support though * pull gcc's rpath from otool output * move make target to the end so it's not default * Add Jenkins and make exe in par with other platforms * Actually save build artefacts * Fix artefact path * Remove x11 mentions and linking (not used) * Update building instructions for generating app * use appsupport directory * Add new app icon * Update target to match macOS types * Update more audio types * fix null deref in Audio_PlayFanfare * Remove old import from z64 * address final nit with apple ifdefs Co-authored-by: KiritoDev <36680385+KiritoDv@users.noreply.github.com> Co-authored-by: Jeffrey Crowell <github@crowell.biz> Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> * Move macOS to parallel stage * fix linux crash * Ignore all named saves Necessary after new save format * DPad items * Move UI location arrays from static to global to accomodate customizable UI * FIX: Increased the maximum actor limit for draw distance Fix issue #529 * FIX: Remove duplicates of gNewDrops from the enhancements menu * Get rid of erroneous int casts * casts jya_cobra's shadowTexture pointer to uintptr_t instead of s32. * Fix ability to assign equipment you don't own * Fix title cards for market potion shop and bombchu shop * Invalidate message item icon texture before drawing * Add margins for dpad * Fixed some instances where the original OOT save is erroneously preserved or recreated, leading to another conversion next time you launched the game * Headphones setting in game should now work. Resolves #13 * Map Select name fixes * Change Power to Upgrades * Rename Soh* files * Update names * Add more files * Add more files * Add toggles for disabling heart drops and random drops (#507) * Adds toggles for disabling random drops and fixed heart drops * Changed the "No Fixed Heart Drops" toggle to the more useful "No Random Heart Drops" toggle * Adds an explanation that the no heart drops option is similar to Hero Mode * Moved difficulty options into their own sub-menu Moved time saver options into their own sub-menu Moved clutter reducing options into their own sub-menu * fixed the tag name of mweep speed * Moved Skip Text to Experimental * Fix testing masks of DPad * Fix audio, boot commands, and save staes. * add menu from https://github.com/PurpleHato/Shipwright/tree/ResetMenu * implement reset * Update README.md * command on mac * special char doesn't work with default imgui font * change name based on PR comment * missed a couple spots * change sunset in save editor so dampe is out * Update to latest `docking` imgui (#582) * Update to latest `docking` imgui commit: 67410d53f739b6a0df138e2252f0e5136b42062f * Fix modified import for SDL * Update imgui_impl_sdl.cpp * Add Imgui include path for better imports * Controller Navigation Fix-Up (#544) * Controller Navigation Fix-Up * [MISC] Fix typo * Use Macro for __FILE__ & __LINE__ when possible (#559) * First batch some overlay * Almost all overlay * effect & gamestate * kaleido stuffs * more overlay * more left over from code folder * remaining hardcoded line and file * Open & Close _DISP __FILE__ & __LINE__ clean up * Some if (1) {} remove * LOG_xxxx __FILE__ , __LINE__ cleaned * ASSERT macro __FILE__ __LINE__ * mtx without line/file in functions * " if (1) {} " & "if (0) {}" and tab/white place * LogUtils as macro * GameState_, GameAlloc_, SystemArena_ & ZeldaArena_ * Revert "GameState_, GameAlloc_, SystemArena_ & ZeldaArena_" This reverts commit 0d85caaf7e342648c01a15fe21e93637352dc596. * Like last commit but as macro * Fix matrix not using macros * use function not macro * DebugArena_* functions GameAlloc_MallocDebug BgCheck_PosErrorCheck as macros removed issues with ; in macro file * MM Bunny Hood enhancements: no age restrictions & wear across entrances (#560) * Remove age restriction on MM Bunny Hood * Handle mask slot changing; init Link wearing mask * Reset mask state after selling * Use unordered maps in some hot paths (#566) * Use unordered maps in some hot paths * Address PR comments * Cheat: Infinite Epona Boost (#577) * Cheat: Infinite Epona Boost * Edit for readability * update pulseaudio for 44.1khz audio (#587) * use pulseaudio defaults * spaces/tabs * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate Co-authored-by: briaguya <briaguya@alice> * Restoration Item Sliders (#595) * Allows players to set custom restoration values for potions and milk * Fixed a dumb oversight * implemented fairy sliders * use ini window resolution (#410) * use ini window resolution * use arguments for directx window size * default 640x480 not 320x240 * kick off a build * and revert * default config 640x480 not 320x240 * add todo Co-authored-by: briaguya <briaguya@alice> * 3D Drops & Projectiles update (#548) * Fix remaining rupee and keys * fix tabs -> spaces * more fix about tabs -> spaces * Better up <-> down mouvement for hearts * remove useless comment * Cosmetics menu rework (#589) * - * DPad/some margin fix(left side) * various ImGui stuff and fixes * disabled kaleido menu (non working) * fix win being dumb * same for C btn this time * Fix windows build * Beating hearts fix * Default win size and some placement fix * Fix Dpad Ammo & C notes, Kaleido, white dog * some texts fix and tab move * Add stone of agony, some fixes and build correctly * precise item place with Dpad * Gamecube -> GameCube Co-authored-by: Baoulettes <iMacWin10> * [CI] Create an Appimage for 64bit builds (#570) * [CI] Create AppImage file * [CI] Updated Jenkinsfile * [MISC] fix indentation * [MISC] Fix indentation * [MISC] Fix indentation * [CI] 7z appimage and readme * [CI] AppImage icon file (#597) * [CI] Add patchelf * [BUILD] Include Hi-Res icon * Fix portability use of std::clamp (#596) * Add N64 weird frames and OOB Bombchus cvars (#602) * Add gN64WeirdFrames and gBombchuOOB cvars * Rename gBombchuOOB to gBombchusOOB * Fix pipeline * [BUILD] Do not strip ZAPD (#598) * [BUILD] Do not strip ZAPD * [BUILD] Reuse Icon Asset * [APPIMAGE] Handle paths with spaces * [macos] Distribute optimized builds (#599) * Cosmetics texts fixes (#604) * branch init + few fixes * Reset button * Several texts fixes and default color to GameCube * space issues * some more extra space that was not needed. * space yes last time ... * Arrows being able to be rainbow some more texts fixes * more texts fixes * c-buttons some plurial fix * Fixes bug in demo effect due to removed display list set. * King dodongo room crash (#613) * first attempt * force camera setting to be at least 0 (dirty!) * - * reverted something to just include fix * Invalidate text box icon before drawing (#607) * [APPIMAGE] Set lib path for ZAPD (#611) * New drop runtime fix (#614) * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * Fix Ganon's Castle title cards (#606) * Checkered room crash workaround (#615) * Increase poly and vertex count for dyna actors * Add TODO * Only apply fix in Forest Temple * Enable globally * Match case of 'Shipwright' in Linux build (#619) * Fix 0xabababab crash (#617) * Unconditionally setup the normal skybox * Only call Skybox_Setup once ever * Equipment upgrade text fix and any pause slot enhancement fix (#620) * Fix upgrade name text not rendering * Use cvar and don't render equip help for empty item slots * Fix rendering logic * Fix incorrect item name rendered for one frame * Reorder comparison * Remove extra indent * Remove accidental changes * ImGui grammer, consistency, and clarity fixes (#625) * ImGui grammer, consistency, and clarity fixes Co-Authored-By: Stormghetti <56653191+Stormghetti@users.noreply.github.com> * Adds more new lines for users on smaller displays Co-Authored-By: Stormghetti <56653191+Stormghetti@users.noreply.github.com> Co-authored-by: Stormghetti <56653191+Stormghetti@users.noreply.github.com> * New drops shadows & rotation fixes (#627) * fixes * forgot to add heart pieces in rotation logic * Dodongo's Cavern blue warp crash fix (#622) * Doodong's Cavern blue warp crash fix * >= not > * Don't waste a line of space * add support for clang compiler (#592) * hacks to align strings for clang... wow just wow * start work to getting built with clang * fix issues with struct constructors, all builds, doesn't link still * fix some narrowing issues that clang complains about * fix compliation of zapd * fix null deref in VersionInfo * builds with clang * make stringbuilding use StringHelper instead of addition * fix linking * add CLANG SHIP overlay on clang built versions * doesn't need to be volatile * mark unknown strings as extern * rename some stuff * can't align extern * hopefully fix compilation for everythign * expandtab * allow setting LD * Revert "allow setting LD" This reverts commit 711aba6db2c41bab476bd34e878af6a37a7f5559. maybe to use lld it should be a LDFLAG? * -Wno-deprecated-declarations is required for newer versions of clang on macOS 13 beta sdk, the version of apple clang requires this * Add jenkins support for clang * Forward CXX flags to stormlib compilation * Move GCC only flags to check * use exports to set multiarch setup * Fix Jenkins forever * use make instead of cmake --build add some flags to build with clang-11 as well * address review coments - rework extraction to allow multi thread - misc readability cleanup * update makefile to add WARN on linux+clang Co-authored-by: David Chavez <david@dcvz.io> * Fix develop * Fixes grey screen issue + tooltip for 2 handed shield * Don't close controller after SDL has quit (#642) * Don't close controller after SDL has quit * Don't check if controller can rumble if null * Fixes Barinade's set whenever boss fight is reloaded (#639) * Reimplements unused Barinade reset function. * Removes the Jellyfish from Barinade's body on reset. * add the ability to pull graves during the day (#637) * change max internal res multiplier to 3x, use float and % instead of int (#638) * change max internal res multiplier to 3x, use float and % instead of int * Update libultraship/libultraship/ImGuiImpl.cpp Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> * Fixes crash on Biggoron trade failure screen wipe Resolves #621 * fixes center docking (#652) * testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com> * Cosmetics hotfixes (#640) * Initial branch creation * Revert Main Game so it do not conflict later * should fix window build, made namespace for Cosmetics * forgot to edit one title * Ability to add hidden window (usefull for Rainbow) Fix building issues * Line break, unused bool remove * add descriptive todo for death crash bandaid (#655) Co-authored-by: briaguya <briaguya@alice> * Removed legacy audio mode and fixed ganon sound bug (#657) * Free Camera (#337) * wip free cam * Almost done, needs collision still * Added free cam behind cvar * added WIP collision * Fixed & implemented "Manual mode" from WW & TP * Fixed camera not rotating when Link is moving * fixed initialized camera rotation * Fixed camera getting stuck + made it smoother * reduced deadzone * fixed epona camera height + added WW z-target free camera * Adjusted player camera height & fixed fov * Fixed camera roll * fixed fov when moving the camera while in z-target * Camera resets to Auto when going through doors or changing maps * Fixed building * touch * more touch work * Added WIP mouse support to the free cam * gui stuff * fixed building * fixed building error * ok fixed building for real this time * oops * Fix compilation issues * removed mouse stuff that magically appeared in this branch * smoothed out stick values & removed remains of mouse support * re-added manual camera when pressing Z * reduced minimum Y position of camera * Addressed dcsv's nitpicks * part 2 * oops Co-authored-by: David Chavez <david@dcvz.io> * Rando: Allows Malon's Item Check to be obtained by pulling out the Ocarina. [FIXED PR] (#672) * Fixes using the Ocarina to get the check from Malon. Still some cleanup to do here. For some reason the player can shield before receiving the check. It doesn't set the flag if the player does that so they can still try again, but would prefer a different solution if possible. * Prevents Shielding from blocking the Item_Give from happening. * Code Cleanup and comments explaining the new rando flow. * Removes inventory check when pulling out Ocarina This allows OI to properly give the check, which is important for Glitched logic later down the line. Talking to Malon still requires the Ocarina in your inventory. * Prevents non-malon textboxes from triggering the check. Also adds a comment explaining the condtional for getting the check from talking to Malon since it got pretty long. * Actually fixes checking for text boxes. * Relocates a comment for improved clarity. * Fix Rando Water Temple Softlock (#665) We use 3DS logic to generate item placement, but didn't have this specific door in Water Temple unlocked from the beginning like 3DS does. This meant that if people took specific paths through the temple, they could softlock themselves by missing a key. * Rando: GtG and carpenter prompts skip (#663) * Skip gtg and carpenter prompt For rando. Tested and just works. * Fixed missing break * Hide debug overlay behind gDebugEnabled (#660) * Introduce App Directory Path (#572) * Introduce app directory path concept * macos: Remove hacky way of using applicaiton directory * Update the new SaveManager * Address stack user after return * Remove unecessary property * Use std::string for filepath * Improve clang specific detections * Use new path system for imgui files * Improve helper for getting relative paths * fix hidden wnd (#744) * Split damage multiplication into its own PR (#656) * Split damage multiplication into its own PR * Found a more elegant implementation of the powers char*[] * Fixes Maps, Compasses, and Boss Keys in Vanilla. (#751) * .xiF slebaL * Update Keese labels * Fixed soundfont issues * Skip warp song cutscenes in rando (#664) Does it by skipping to the last part of the cutscene data. Tested on all songs, both adult and child. * don't spawn blocking mido after we've already shown him the sword/shield (#675) Co-authored-by: briaguya <briaguya@alice> * Controller Configuration UI and JSON Config (#760) * Initial controller hud ui * Reverted fbdemo changes * Moved config to json and implemented controller config * fix build on linux, gitignore new config file * fix build * Fix compilation and file directory paths * Call save on cvar save * Fixed cvar loading and added deck slots to the config * Changed control deck port 0 to use a physical device by default * Added gyro and rumble & fixed loading errors * Save config on toggle menubar * fix linux build * Fixed drift calculation * Controller config now saves when pressing F1 * Removed ExitGame hook from ImGuiImpl * Moved mappings to a map * Added GetKeyName * untranslate scancodes * Fixed hud layout on keyboard device * Fixed keyboard read on hud * Fixed crash when reloading controllers * Removed ConfigFile and changed file extension * Changed Dummy to Disconnected and fixed filters * Removed function leftover * Changed ControllerHud to InputEditor Co-authored-by: briaguya <briaguya@alice> Co-authored-by: David Chavez <david@dcvz.io> * Enough! My ship sails in the morning. * Fixed menubar items position (#763) * Fixed menubar items position * Reverted tooltip tab position * Fixes macOS randomizer functionality with App Directory (#761) * Fixes macOS randomizer functionality with App Directory * Fix windows build * Update soh/soh/Enhancements/randomizer/3drando/rando_main.cpp * Update soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp * Revert band-aid fix Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> * Fix migration cvar deletion path (#765) * Various controller fixes (#771) * Fix controller * Also fix rumble strength being a bool * Remove ControllerHud.cpp * Downgrade platform toolset back to previous version * Fix gyro * Fix bug that makes binding axes difficult and clear buttons before reading * Exaggerate gyro display and adjust stick binding threshold * Initialize drift thresholds * git subrepo push soh subrepo: subdir: "soh" merged: "75ccbade8" upstream: origin: "https://github.com/HarbourMasters/soh.git" branch: "master" commit: "75ccbade8" git-subrepo: version: "0.4.1" origin: "???" commit: "???" * One more change from PR review * Fix some paths * Fix merge conflict messup * More merge conflict fixes * And another conflict fix * And another fix * Remove reference to removed build files * Add full path to switch cmake Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: KiritoDev <36680385+KiritoDv@users.noreply.github.com> Co-authored-by: Jeffrey Crowell <github@crowell.biz> Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> Co-authored-by: sholdee <102821812+sholdee@users.noreply.github.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: rozlette <Rozelette@users.noreply.github.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: vaguerant <vaguerant@users.noreply.github.com> Co-authored-by: earthcrafterman <banddstudios@gmail.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com> Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: qurious-pixel <62252937+qurious-pixel@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Sirius902 <10891979+Sirius902@users.noreply.github.com> Co-authored-by: modestposer <modestposer@gmail.com> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com> Co-authored-by: Stormghetti <56653191+Stormghetti@users.noreply.github.com> Co-authored-by: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Co-authored-by: MelonSpeedruns <melonspeedruns@outlook.com> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com> Co-authored-by: ChristopherJTrent <ChristopherJTrent@outlook.com> Co-authored-by: agamache <aaroncgamache@gmail.com> Co-authored-by: M4xw <m4x@m4xw.net> * Fixed switch compilation * Fixed responsive on switch imgui * Remove config save hook * Added physical slots into controller name * Add `ifdef` for switch specific code * Add `ifdef` for switch specific code * Added applet mode detection * Replaced homebrew icon * Fixed randomness on applet mode view * Fixed clkrst initialization * Switch profiles cleanup * Cleaned code based on dcvz comments * Remove unused hooks in Mercury * Fixed compilation * Use IMGUI_IMPL_OPENGL_LOADER_CUSTOM * Fix up StormLib modifications * Handle touch events at ImGui/SDL level * Enable opening menu with - * Load Nintendo Switch font * Updates to window initiation * Handle virtual keyboard via SDL * Print OTR missing message to screen * Rename makefile for Switch * Some more additional fixes * Branch creation plus edit Changed ItemWidth & made label invisible (else issues) Added a submit button next to the text field * Removed set_texture_filter on imgui draw * Readded nintendo switch font * Fixed randomizer crash * Fix issue with strdup windows * [SWITCH] Update Jenkins file (#9) * [SWITCH] Update Jenkins file * [SWITCH] Dockerfile.switch Can be combined with other Dockerfile * [SWITCH] Add entrypoint file * Update Jenkinsfile * [SWITCH] Dockerfile mtab link link `/proc/self/mounts /etc/mtab` Co-authored-by: David Chavez <david@dcvz.io> * Cleaned code based on PR comments * Fixed switch compilation * Cleaned full texture cache instead of doing it per char * Randomizer only saves when its not a vanilla save * Disabled input when menubar is opened * Removed return from SetupFont * Cleaned code based on comments * Cleaned up random texts on switch error screen * Killed * Removed debug and changed compilation flags Co-authored-by: KiritoDv <nohomoboi01@gmail.com> Co-authored-by: Felipe Guaycuru <guaycuru@gmail.com> Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: Jeffrey Crowell <github@crowell.biz> Co-authored-by: BountyChocolate123456 <101743444+BountyChocolate123456@users.noreply.github.com> Co-authored-by: sholdee <102821812+sholdee@users.noreply.github.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: rozlette <Rozelette@users.noreply.github.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: vaguerant <vaguerant@users.noreply.github.com> Co-authored-by: earthcrafterman <banddstudios@gmail.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com> Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: qurious-pixel <62252937+qurious-pixel@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Sirius902 <10891979+Sirius902@users.noreply.github.com> Co-authored-by: modestposer <modestposer@gmail.com> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com> Co-authored-by: Stormghetti <56653191+Stormghetti@users.noreply.github.com> Co-authored-by: Sirius902 <3645979-Sirius902@users.noreply.gitlab.com> Co-authored-by: MelonSpeedruns <melonspeedruns@outlook.com> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com> Co-authored-by: ChristopherJTrent <ChristopherJTrent@outlook.com> Co-authored-by: agamache <aaroncgamache@gmail.com> Co-authored-by: M4xw <m4x@m4xw.net>
2022-07-25 21:11:53 -04:00
void SaveManager::LoadStruct(const std::string& name, LoadStructFunc func) {
// Create an empty struct and set it as the current load context, then call the function that loads the struct.
// If it is an array entry, load it from the array instead.
if (name == "") {
nlohmann::json* saveJsonContext = currentJsonContext;
nlohmann::json emptyObject = nlohmann::json::object();
if (currentJsonArrayContext != currentJsonContext->end()) {
currentJsonContext = &currentJsonArrayContext.value();
} else {
// This array member is past the data in the json file. Therefore, default construct it.
// By assigning an empty object here, all attempts to load data members of it will default construct them.
currentJsonContext = &emptyObject;
}
func();
currentJsonContext = saveJsonContext;
} else {
nlohmann::json* saveJsonContext = currentJsonContext;
currentJsonContext = &(*currentJsonContext)[name.c_str()];
func();
currentJsonContext = saveJsonContext;
}
}
#if defined(__WIIU__) || defined(__SWITCH__)
// std::filesystem::copy_file doesn't work properly with the Wii U's toolchain atm
int copy_file(const char* src, const char* dst)
{
alignas(0x40) uint8_t buf[4096];
FILE* r = fopen(src, "r");
if (!r) {
return -1;
}
FILE* w = fopen(dst, "w");
if (!w) {
return -2;
}
size_t res;
while ((res = fread(buf, 1, sizeof(buf), r)) > 0) {
if (fwrite(buf, 1, res, w) != res) {
break;
}
}
fclose(r);
fclose(w);
return res >= 0 ? 0 : res;
}
#endif
void SaveManager::CopyZeldaFile(int from, int to) {
assert(std::filesystem::exists(GetFileName(from)));
DeleteZeldaFile(to);
#if defined(__WIIU__) || defined(__SWITCH__)
copy_file(GetFileName(from).c_str(), GetFileName(to).c_str());
#else
std::filesystem::copy_file(GetFileName(from), GetFileName(to));
#endif
fileMetaInfo[to].valid = true;
fileMetaInfo[to].deaths = fileMetaInfo[from].deaths;
for (int i = 0; i < ARRAY_COUNT(fileMetaInfo[to].playerName); i++) {
fileMetaInfo[to].playerName[i] = fileMetaInfo[from].playerName[i];
}
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
for (int i = 0; i < ARRAY_COUNT(fileMetaInfo[to].seedHash); i++) {
fileMetaInfo[to].seedHash[i] = fileMetaInfo[from].seedHash[i];
}
fileMetaInfo[to].healthCapacity = fileMetaInfo[from].healthCapacity;
fileMetaInfo[to].questItems = fileMetaInfo[from].questItems;
fileMetaInfo[to].defense = fileMetaInfo[from].defense;
fileMetaInfo[to].health = fileMetaInfo[from].health;
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
fileMetaInfo[to].randoSave = fileMetaInfo[from].randoSave;
Dual OTR MQ and Vanilla Support (#1694) * Changes OTR Extraction to have specific mq and nonmq paths. Also updates the game to load resources according to whether or not Master Quest or Vanilla is loaded. * Removes unneeded code from the last commit. * Fixes some weird formatting in ZRom.c * Loads oot-mq.otr and patches oot.otr on top, if both are present. If only one or the other are present, it becomes the only and main OTR. * Adds ImGui Logic for whether or an MQ Checkbox. Checkbox checked only specifies whether new saves should be MQ or not. Checkbox is disabled or force-enabled according to which OTRs are loaded. Also as a necessity includes tracking what game versions have been loaded from the OTRs. * Adds MQ settings logic for Randomizer's ImGui menu. * Writes Master Quest dungeons to the spoiler log * Loads MQ Dungeons from spoiler, persists in save, and loads when appropriate. * Adds logic to prevent loading or creating incompatible rando saves. * Fixdes some linux build issues and new rando save issues * Makes appimage create both vanilla and mq otrs If either rom is present, it makes the corresponding OTR. If both are present, it will make both. If one OTR is present but both roms are present, it will create the missing OTR. * Makes it so a randomized save file will not be marked as MQ. * Refactors to load all OTRs from MainPath or a specific list. Also adds the ability to take a std::unordered_set of hashes to validate each OTR's version file against. * Fixes a syntax error * Makes ExtractAssets output Vanilla and MQ OTRs if both roms are present * Fixes asset generation bug. * Partially working fix for dual OTR extract_assets Currently the cmake ExtractAssets target will return with a 1 if you only end up exporting one type of OTR isntead of both. Haven't found a great way to only attempt to copy a file if it exists from within cmake. It does actually correctly copy the OTR that is generated, despite the error from copying the other one. Pushing as is for now but will keep investigating. * Adds oot-mq.otr to the gitignore. * Makes ExtractAssets not fail on only one rom/OTR. * Removes PatchesPath from the constructors requiring OTRFiles vector. * Renames OOT_UNKNOWN to just UNKNOWN to remove OOT specific reference. * Removes randomizing MQ Dungeons and re-disables MQ rando. Doing this so the PR can get merged quicker with just the Dual OTR support and won't need to wait on rando logic to be updated. That will happen in another PR directly after the merge. * Update mac startup script for dual otr * Update soh/macosx/soh-macos.sh * Update soh/macosx/soh-macos.sh * Update soh/macosx/soh-macos.sh * Implements new BinaryReader to fix Linux build issue. BinaryReader itself comes from https://github.com/Moneyl/BinaryTools I added a wrapper to adapt it to the ABI from ZAPD's Binary Reader and add Endianness checking. I also had to copy a handful of other bits and pieces from ZAPD to make it all function as expected. * A few edits to the updatream BinaryReader to compile it on Linux. * Adds the Endianness to the first byte of the version file. * Fixes Jenkins * Addresses some of Kenix's comments * Renames `ReadNullTerminatedString` to `ReadCString` * Refactors Archive::LoadFile into a private method with more arguments. * Removes BitConverter and extends existing endianness.h instead. * Fixes an endianness issue with the version file. Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2022-10-16 23:07:35 -04:00
fileMetaInfo[to].requiresMasterQuest = fileMetaInfo[from].requiresMasterQuest;
fileMetaInfo[to].requiresOriginal = fileMetaInfo[from].requiresOriginal;
}
void SaveManager::DeleteZeldaFile(int fileNum) {
if (std::filesystem::exists(GetFileName(fileNum))) {
std::filesystem::remove(GetFileName(fileNum));
}
fileMetaInfo[fileNum].valid = false;
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
fileMetaInfo[fileNum].randoSave = false;
}
bool SaveManager::IsRandoFile() {
return gSaveContext.n64ddFlag != 0 ? true : false;
}
// Functionality required to convert old saves into versioned saves
// DO NOT EDIT ANY OF THE FOLLOWING STRUCTS
// They MUST remain unchanged to handle parsing the binary saves of old
typedef struct {
/* 0x00 */ u8 buttonItems[4];
/* 0x04 */ u8 cButtonSlots[3];
/* 0x08 */ u16 equipment;
} ItemEquips_v0; // size = 0x0A
typedef struct {
/* 0x00 */ u8 items[24];
/* 0x18 */ s8 ammo[16];
/* 0x28 */ u16 equipment;
/* 0x2C */ u32 upgrades;
/* 0x30 */ u32 questItems;
/* 0x34 */ u8 dungeonItems[20];
/* 0x48 */ s8 dungeonKeys[19];
/* 0x5B */ s8 defenseHearts;
/* 0x5C */ s16 gsTokens;
} Inventory_v0; // size = 0x5E
typedef struct {
/* 0x00 */ u32 chest;
/* 0x04 */ u32 swch;
/* 0x08 */ u32 clear;
/* 0x0C */ u32 collect;
/* 0x10 */ u32 unk;
/* 0x14 */ u32 rooms;
/* 0x18 */ u32 floors;
} SavedSceneFlags_v0; // size = 0x1C
typedef struct {
s32 x, y, z;
} Vec3i_v0; // size = 0x0C
typedef struct {
/* 0x00 */ Vec3i_v0 pos;
/* 0x0C */ s32 yaw;
/* 0x10 */ s32 playerParams;
/* 0x14 */ s32 entranceIndex;
/* 0x18 */ s32 roomIndex;
/* 0x1C */ s32 set;
/* 0x20 */ s32 tempSwchFlags;
/* 0x24 */ s32 tempCollectFlags;
} FaroresWindData_v0; // size = 0x28
typedef struct {
s16 x, y, z;
} Vec3s_v0; // size = 0x06
typedef struct {
/* 0x00 */ s16 scene;
/* 0x02 */ Vec3s_v0 pos;
/* 0x08 */ s16 angle;
} HorseData_v0; // size = 0x0A
typedef struct {
f32 x, y, z;
} Vec3f_v0; // size = 0x0C
typedef struct {
/* 0x00 */ Vec3f_v0 pos;
/* 0x0C */ s16 yaw;
/* 0x0E */ s16 playerParams;
/* 0x10 */ s16 entranceIndex;
/* 0x12 */ u8 roomIndex;
/* 0x13 */ s8 data;
/* 0x14 */ u32 tempSwchFlags;
/* 0x18 */ u32 tempCollectFlags;
} RespawnData_v0; // size = 0x1C
typedef struct {
/* 0x0000 */ s32 entranceIndex; // start of `save` substruct, originally called "memory"
/* 0x0004 */ s32 linkAge; // 0: Adult; 1: Child
/* 0x0008 */ s32 cutsceneIndex;
/* 0x000C */ u16 dayTime; // "zelda_time"
/* 0x0010 */ s32 nightFlag;
/* 0x0014 */ s32 totalDays;
/* 0x0018 */ s32 bgsDayCount; // increments with totalDays, can be cleared with `Environment_ClearBgsDayCount`
/* 0x001C */ char newf[6]; // string "ZELDAZ". start of `info` substruct, originally called "information"
/* 0x0022 */ u16 deaths;
/* 0x0024 */ char playerName[8];
/* 0x002C */ s16 n64ddFlag;
/* 0x002E */ s16 healthCapacity; // "max_life"
/* 0x0030 */ s16 health; // "now_life"
/* 0x0032 */ s8 magicLevel;
/* 0x0033 */ s8 magic;
/* 0x0034 */ s16 rupees;
/* 0x0036 */ u16 swordHealth;
/* 0x0038 */ u16 naviTimer;
/* 0x003A */ u8 magicAcquired;
/* 0x003B */ char unk_3B[0x01];
/* 0x003C */ u8 doubleMagic;
/* 0x003D */ u8 doubleDefense;
/* 0x003E */ u8 bgsFlag;
/* 0x003F */ u8 ocarinaGameRoundNum;
/* 0x0040 */ ItemEquips_v0 childEquips;
/* 0x004A */ ItemEquips_v0 adultEquips;
/* 0x0054 */ u32 unk_54; // this may be incorrect, currently used for alignement
/* 0x0058 */ char unk_58[0x0E];
/* 0x0066 */ s16 savedSceneNum;
/* 0x0068 */ ItemEquips_v0 equips;
/* 0x0074 */ Inventory_v0 inventory;
/* 0x00D4 */ SavedSceneFlags_v0 sceneFlags[124];
/* 0x0E64 */ FaroresWindData_v0 fw;
/* 0x0E8C */ char unk_E8C[0x10];
/* 0x0E9C */ s32 gsFlags[6];
/* 0x0EB4 */ char unk_EB4[0x4];
/* 0x0EB8 */ s32 highScores[7];
/* 0x0ED4 */ u16 eventChkInf[14]; // "event_chk_inf"
/* 0x0EF0 */ u16 itemGetInf[4]; // "item_get_inf"
/* 0x0EF8 */ u16 infTable[30]; // "inf_table"
/* 0x0F34 */ char unk_F34[0x04];
/* 0x0F38 */ u32 worldMapAreaData; // "area_arrival"
/* 0x0F3C */ char unk_F3C[0x4];
/* 0x0F40 */ u8 scarecrowCustomSongSet;
/* 0x0F41 */ u8 scarecrowCustomSong[0x360];
/* 0x12A1 */ char unk_12A1[0x24];
/* 0x12C5 */ u8 scarecrowSpawnSongSet;
/* 0x12C6 */ u8 scarecrowSpawnSong[0x80];
/* 0x1346 */ char unk_1346[0x02];
/* 0x1348 */ HorseData_v0 horseData;
/* 0x1352 */ u16 checksum; // "check_sum"
/* 0x1354 */ s32 fileNum; // "file_no"
/* 0x1358 */ char unk_1358[0x0004];
/* 0x135C */ s32 gameMode;
/* 0x1360 */ s32 sceneSetupIndex;
/* 0x1364 */ s32 respawnFlag; // "restart_flag"
/* 0x1368 */ RespawnData_v0 respawn[3]; // "restart_data"
/* 0x13BC */ f32 entranceSpeed;
/* 0x13C0 */ u16 entranceSound;
/* 0x13C2 */ char unk_13C2[0x0001];
/* 0x13C3 */ u8 unk_13C3;
/* 0x13C4 */ s16 dogParams;
/* 0x13C6 */ u8 textTriggerFlags;
/* 0x13C7 */ u8 showTitleCard;
/* 0x13C8 */ s16 nayrusLoveTimer;
/* 0x13CA */ char unk_13CA[0x0002];
/* 0x13CC */ s16 rupeeAccumulator;
/* 0x13CE */ s16 timer1State;
/* 0x13D0 */ s16 timer1Value;
/* 0x13D2 */ s16 timer2State;
/* 0x13D4 */ s16 timer2Value;
/* 0x13D6 */ s16 timerX[2];
/* 0x13DA */ s16 timerY[2];
/* 0x13DE */ char unk_13DE[0x0002];
/* 0x13E0 */ u8 seqId;
/* 0x13E1 */ u8 natureAmbienceId;
/* 0x13E2 */ u8 buttonStatus[5];
/* 0x13E7 */ u8 unk_13E7; // alpha related
/* 0x13E8 */ u16 unk_13E8; // alpha type?
/* 0x13EA */ u16 unk_13EA; // also alpha type?
/* 0x13EC */ u16 unk_13EC; // alpha type counter?
/* 0x13EE */ u16 unk_13EE; // previous alpha type?
/* 0x13F0 */ s16 unk_13F0; // magic related
/* 0x13F2 */ s16 unk_13F2; // magic related
/* 0x13F4 */ s16 unk_13F4; // magic related
/* 0x13F6 */ s16 unk_13F6; // magic related
/* 0x13F8 */ s16 unk_13F8; // magic related
/* 0x13FA */ u16 eventInf[4]; // "event_inf"
/* 0x1402 */ u16 mapIndex; // intended for maps/minimaps but commonly used as the dungeon index
/* 0x1404 */ u16 minigameState;
/* 0x1406 */ u16 minigameScore; // "yabusame_total"
/* 0x1408 */ char unk_1408[0x0001];
/* 0x1409 */ u8 language; // NTSC 0: Japanese; 1: English | PAL 0: English; 1: German; 2: French
/* 0x140A */ u8 audioSetting;
/* 0x140B */ char unk_140B[0x0001];
/* 0x140C */ u8 zTargetSetting; // 0: Switch; 1: Hold
/* 0x140E */ u16 forcedSeqId; // immediately start playing the sequence if set
/* 0x1410 */ u8 unk_1410; // transition related
/* 0x1411 */ char unk_1411[0x0001];
/* 0x1412 */ u16 nextCutsceneIndex;
/* 0x1414 */ u8 cutsceneTrigger;
/* 0x1415 */ u8 chamberCutsceneNum;
/* 0x1416 */ u16 nextDayTime; // "next_zelda_time"
/* 0x1418 */ u8 fadeDuration;
/* 0x1419 */ u8 unk_1419; // transition related
/* 0x141A */ u16 skyboxTime;
/* 0x141C */ u8 dogIsLost;
/* 0x141D */ u8 nextTransition;
/* 0x141E */ char unk_141E[0x0002];
/* 0x1420 */ s16 worldMapArea;
/* 0x1422 */ s16 sunsSongState; // controls the effects of suns song
/* 0x1424 */ s16 healthAccumulator;
} SaveContext_v0; // size = 0x1428
void CopyV0Save(SaveContext_v0& src, SaveContext& dst) {
dst.entranceIndex = src.entranceIndex;
dst.linkAge = src.linkAge;
dst.cutsceneIndex = src.cutsceneIndex;
dst.dayTime = src.dayTime;
dst.nightFlag = src.nightFlag;
dst.totalDays = src.totalDays;
dst.bgsDayCount = src.bgsDayCount;
dst.deaths = src.deaths;
for (size_t i = 0; i < ARRAY_COUNT(src.playerName); i++) {
dst.playerName[i] = src.playerName[i];
}
dst.n64ddFlag = src.n64ddFlag;
dst.healthCapacity = src.healthCapacity;
dst.health = src.health;
dst.magicLevel = src.magicLevel;
dst.magic = src.magic;
dst.rupees = src.rupees;
dst.swordHealth = src.swordHealth;
dst.naviTimer = src.naviTimer;
dst.isMagicAcquired = src.magicAcquired;
dst.isDoubleMagicAcquired = src.doubleMagic;
dst.isDoubleDefenseAcquired = src.doubleDefense;
dst.bgsFlag = src.bgsFlag;
dst.ocarinaGameRoundNum = src.ocarinaGameRoundNum;
for (size_t i = 0; i < ARRAY_COUNT(src.childEquips.buttonItems); i++) {
dst.childEquips.buttonItems[i] = src.childEquips.buttonItems[i];
}
for (size_t i = 0; i < ARRAY_COUNT(src.childEquips.cButtonSlots); i++) {
dst.childEquips.cButtonSlots[i] = src.childEquips.cButtonSlots[i];
}
dst.childEquips.equipment = src.childEquips.equipment;
for (size_t i = 0; i < ARRAY_COUNT(src.adultEquips.buttonItems); i++) {
dst.adultEquips.buttonItems[i] = src.adultEquips.buttonItems[i];
}
for (size_t i = 0; i < ARRAY_COUNT(src.adultEquips.cButtonSlots); i++) {
dst.adultEquips.cButtonSlots[i] = src.adultEquips.cButtonSlots[i];
}
dst.adultEquips.equipment = src.adultEquips.equipment;
dst.unk_54 = src.unk_54;
dst.savedSceneNum = src.savedSceneNum;
for (size_t i = 0; i < ARRAY_COUNT(src.equips.buttonItems); i++) {
dst.equips.buttonItems[i] = src.equips.buttonItems[i];
}
for (size_t i = 0; i < ARRAY_COUNT(src.equips.cButtonSlots); i++) {
dst.equips.cButtonSlots[i] = src.equips.cButtonSlots[i];
}
dst.equips.equipment = src.equips.equipment;
for (size_t i = 0; i < ARRAY_COUNT(src.inventory.items); i++) {
dst.inventory.items[i] = src.inventory.items[i];
}
for (size_t i = 0; i < ARRAY_COUNT(src.inventory.ammo); i++) {
dst.inventory.ammo[i] = src.inventory.ammo[i];
}
dst.inventory.equipment = src.inventory.equipment;
dst.inventory.upgrades = src.inventory.upgrades;
dst.inventory.questItems = src.inventory.questItems;
for (size_t i = 0; i < ARRAY_COUNT(src.inventory.dungeonItems); i++) {
dst.inventory.dungeonItems[i] = src.inventory.dungeonItems[i];
}
for (size_t i = 0; i < ARRAY_COUNT(src.inventory.dungeonKeys); i++) {
dst.inventory.dungeonKeys[i] = src.inventory.dungeonKeys[i];
}
dst.inventory.defenseHearts = src.inventory.defenseHearts;
dst.inventory.gsTokens = src.inventory.gsTokens;
for (size_t i = 0; i < ARRAY_COUNT(src.sceneFlags); i++) {
dst.sceneFlags[i].chest = src.sceneFlags[i].chest;
dst.sceneFlags[i].swch = src.sceneFlags[i].swch;
dst.sceneFlags[i].clear = src.sceneFlags[i].clear;
dst.sceneFlags[i].collect = src.sceneFlags[i].collect;
dst.sceneFlags[i].unk = src.sceneFlags[i].unk;
dst.sceneFlags[i].rooms = src.sceneFlags[i].rooms;
dst.sceneFlags[i].floors = src.sceneFlags[i].floors;
}
dst.fw.pos.x = src.fw.pos.x;
dst.fw.pos.y = src.fw.pos.y;
dst.fw.pos.z = src.fw.pos.z;
dst.fw.yaw = src.fw.yaw;
dst.fw.playerParams = src.fw.playerParams;
dst.fw.entranceIndex = src.fw.entranceIndex;
dst.fw.roomIndex = src.fw.roomIndex;
dst.fw.set = src.fw.set;
dst.fw.tempSwchFlags = src.fw.tempSwchFlags;
dst.fw.tempCollectFlags = src.fw.tempCollectFlags;
for (size_t i = 0; i < ARRAY_COUNT(src.gsFlags); i++) {
dst.gsFlags[i] = src.gsFlags[i];
}
for (size_t i = 0; i < ARRAY_COUNT(src.highScores); i++) {
dst.highScores[i] = src.highScores[i];
}
for (size_t i = 0; i < ARRAY_COUNT(src.eventChkInf); i++) {
dst.eventChkInf[i] = src.eventChkInf[i];
}
for (size_t i = 0; i < ARRAY_COUNT(src.itemGetInf); i++) {
dst.itemGetInf[i] = src.itemGetInf[i];
}
for (size_t i = 0; i < ARRAY_COUNT(src.infTable); i++) {
dst.infTable[i] = src.infTable[i];
}
dst.worldMapAreaData = src.worldMapAreaData;
dst.scarecrowLongSongSet = src.scarecrowCustomSongSet;
memcpy(&dst.scarecrowLongSong[0], &src.scarecrowCustomSong[0], sizeof(src.scarecrowCustomSong));
dst.scarecrowSpawnSongSet = src.scarecrowSpawnSongSet;
memcpy(&dst.scarecrowSpawnSong[0], &src.scarecrowSpawnSong[0], sizeof(src.scarecrowSpawnSong));
dst.horseData.scene = src.horseData.scene;
dst.horseData.pos.x = src.horseData.pos.x;
dst.horseData.pos.y = src.horseData.pos.y;
dst.horseData.pos.z = src.horseData.pos.z;
dst.horseData.angle = src.horseData.angle;
}
void SaveManager::ConvertFromUnversioned() {
static char sZeldaMagic[] = { '\0', '\0', '\0', '\x98', '\x09', '\x10', '\x21', 'Z', 'E', 'L', 'D', 'A' };
#define SLOT_SIZE (sizeof(SaveContext_v0) + 0x28)
#define SLOT_OFFSET(index) (SRAM_HEADER_SIZE + 0x10 + (index * SLOT_SIZE))
std::ifstream input("oot_save.sav", std::ios::binary);
std::vector<char> data(std::istreambuf_iterator<char>(input), {});
input.close();
for (size_t i = 0; i < ARRAY_COUNT(sZeldaMagic) - 3; i++) {
if (sZeldaMagic[i + SRAM_HEADER_MAGIC] != data[i + SRAM_HEADER_MAGIC]) {
CreateDefaultGlobal();
return;
}
}
gSaveContext.audioSetting = data[SRAM_HEADER_SOUND] & 3;
gSaveContext.zTargetSetting = data[SRAM_HEADER_ZTARGET] & 1;
gSaveContext.language = data[SRAM_HEADER_LANGUAGE];
if (gSaveContext.language >= LANGUAGE_MAX) {
gSaveContext.language = CVarGetInteger("gLanguages", LANGUAGE_ENG);
}
SaveGlobal();
for (int fileNum = 0; fileNum < 3; fileNum++) {
SaveContext_v0* file = reinterpret_cast<SaveContext_v0*>(&data[SLOT_OFFSET(fileNum)]);
if ((file->newf[0] == 'Z') && (file->newf[1] == 'E') && (file->newf[2] == 'L') && (file->newf[3] == 'D') &&
(file->newf[4] == 'A') && (file->newf[5] == 'Z')) {
// If a save is valid, convert the save by storing the current save context, converting the file, loading
// it, saving it, then restoring the save context.
static SaveContext saveContextSave = gSaveContext;
InitFile(false);
CopyV0Save(*file, gSaveContext);
SaveFile(fileNum);
InitMeta(fileNum);
gSaveContext = saveContextSave;
}
}
#undef SLOT_SIZE
#undef SLOT_OFFSET
}
// C to C++ bridge
extern "C" void Save_Init(void) {
SaveManager::Instance->Init();
}
extern "C" void Save_InitFile(int isDebug) {
SaveManager::Instance->InitFile(isDebug != 0);
}
extern "C" void Save_SaveFile(void) {
SaveManager::Instance->SaveFile(gSaveContext.fileNum);
}
extern "C" void Save_SaveGlobal(void) {
SaveManager::Instance->SaveGlobal();
}
extern "C" void Save_LoadFile(void) {
SaveManager::Instance->LoadFile(gSaveContext.fileNum);
Randomizer v2 (#1065) * Revert changes to GetItemFromGet * Fixes Ganon's Boss Key shuffled while regular boss Keys aren't. * Enum + combo box * Add obtainability checks correctly * combobox title rename + no number tracking * Fix repeatable purchases and bottles rendering incorrectly * Move shopsanity option in GUI * Struct instead of ImVec + basic comportment for all case * Attempt to fix odd build issue * Cast randoGet for ganons boss key * Remove redundancy in KD room * Update logic Cvar names * Fix Ganons Trials coming from old save files. Fixes #1365 * Fixes crash when entering Ganon's Castle lobby on linux. * Makes `Item_Give` safe to use with a NULL globalCtx. This should allow it's use for giving items to Link's Pocket during rando save initialization. * Converts Song from Impa to use `Item_Give` * Adds more options for Link's starting item. * Removes unneeded `GiveLinkItem` functions. * and make it build * bring back new rando dropdown * gSaveContext access in GameMenuBar.cpp * Implement Skip Scarecrow's Song * Reimplement progressive Bombchus * Rando-next: Deku Nut and Seed ammo gives a blue rupee Fixes #1390 * Fixes Link starting with BGS * Persist item tracker notes * Adjust Hooks include * Use SohImGui::RequestCvarSaveOnNextTick * Fix issues from LUS refactor * Fix for overriding deku scrub messages * Fix mistake from merge oops * Restore checkboxes to enhancements menu These got lost in the merge * Update location access logic Including MQ locations in Spirit and GC now * Implement rando bombchu drops * Missing break * Simplify mudwall collision check There was no need to have a second collider specifically for Ice Arrow hits * Update settings.cpp * Simplify mudwall collision check * Restore checkboxes in menu Accidentally lost these during merge * Clean up bool * Update logic Cvar name * Fixed capacity on ammmo tracking * Fix for beans obtainability * Hook into file delete and clear notes * Incorporate magic arrows in rando settings * Update tooltip To inform the player that they might have to reload the room if they're enabling this for the first time. * Update tooltip * Add line break in tooltip * Tooltip wording + line break * tweak on main logic * All color logic for all types * Fix: changes to please new LUS * Ensure itemTrackerNotes vector is not fully empty * Implement's Tycoon Wallet. * Refactor DrawItemCount and Use EnhancementCombobox for tracker capacity options * small tweaks and rename * always display XX/YY when in ammo/capacity mode * Move all merchant messages to be generated on file load * added hovertext for the number display * Swap german and french translations for shop messages * Set key colors to be on by default * Add another flag to skip mask shop * Fix Sold Out bug * Fix gerudo keys, add disabled checkbox * tooltip line break * Add trials required and merchant prices to save file instead of loading from active spoiler log * Remove trialsRequired persisting in save manager * Adds slotIndex to girla (shop item actor) and uses that for IdentifyShopItem. * Fix issue when merchantPrices is empty * Fix for a single zeroed merchantPrice entry * Fix #1417 * Implements items selling out and fixes issues with purchasing some items. * Fixes order of operations so Rupees will be spent. * Fixes sold out items not getting overwritten by the randomized info. * Clarify var names and comments Also preserve chain platform cutscene in spirit based on Link's position * Remove !=0 from cvar check * Clarify var names and comments * Rename randomizerMerchantPrices to merchantPrices * Handle shop items in SaveManager * Fix merge mistake * Base whats in the bazaar shop on entranceIndex instead of age * Tidy up chain platform cutscene check * Fix merge error Didn't mean to have Zhora changes in here yet * Use 3drando item table for parsing spoiler names * Use another nested method instead of one at the top level to fetch the table * Add missing newline * Remove log * Respect custom draw functions * Fix issues with rendering songs * Fix localized item names for shopsanity * Implements a larger array of Sprites for the Icon Hash. * Uses the hash instead of seed for spoilerfile name and icons. * Removes some unused functions and variables in `spoiler_log.cpp` * Prevents leading 0s added to hash from being in file name * Changes filename format to icon indexes separated by dashes * Hopefully makes Jenkins happy * Hopefully makes Jenkins happy * [Rando] Child Gerudo Fortress 37th Heartpiece randomized Fixes #1071 * Add descriptions to save editor flags editor, and added randomizer flags (#1386) * Add descriptions to save editor flags editor, and added randomizer flags * Hide randomizer flags when not on a randomizer save * Move flag descriptions to header file * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Fix merge error * crash on pause menu on linux (only in appimage) Fixes #1437 * Applies fix to Song from Impa as well. * Allow buying tunics as child when shopsanity is on * Fix for custom draw methods overriding sold out sign * Simplify logic around shopsanity and fix some issues * Fix dungeon reward stone rotation and add particles * Fix some issues with ice traps * Fix adult wallet having its own max capacity * Fix amount of keys given for BotW * format * Use EnGirlAShopItem enum instead of raw hex values * [#1434] Renders non-warp songs more consistently with warp songs * A few changes around merchant messages * Various changes from PR feedback * Rando: Junk Hint missing french translation * Typo * Fix free scrub being at 0 instead of TEXT_SCRUB_RANDOM * Replace magic numbers in message handler * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fix BGS softlock for shopsanity * Support tycoon wallet on tracker * Revert "Fix BGS softlock for shopsanity" This reverts commit 5fdb961ea460fb9a035cf0bb6ae77bfeedc1de0f. * [#1053] Resolves an issue with shop items and bombchu bowling where BGS would display two message boxes * Implements some necessary plumbing and resolves several Ice Trap Softlocks. Adds a way for an item entry to tell what type of check it came from (NPC vs Chest vs Freestanding, etc.) Sets this value from chests and item00 actors. Relocates pendingIceTraps to save context so it can persist through cutscenes and get stored on save init for Link's Pocket and Song from Impa. Restructures pendingIceTraps into a counter rather than a true or false, so that we can be frozen multiple times in a row if applicable (atm that should only be at the start of a run if Link's Pocket and Song from Impa were both Ice Traps). Adds a textbox for Ice Traps and a special case of holding up nothing in the get item process. This fixes all the cases where Ice Traps would softlock due to the actor giving the item expecting a closing textbox. After holding the item above his head Link increments the pendingIceTraps counter by one and sets whatever flag he has pending. None of the above plumbing applies to Ice Traps from chests, those work exactly the same as before, as do freestanding item00 ice traps (thanks to the additional check for ITEM_FROM_FREESTANDING. OoT and Ruto's Letter count as NPC's, so they get the FOWL text box and set a pending ice trap rather than immediately freezing, since Link weill be in the water. Link will get frozen the next time he touches land, which in the case of OoT is after the fade to white and right before the Song of Time check. Fixes all the other softlocks I'm aware of, including Fishing, Bombchu Bowling, Skull Kid, and losing the second Gerudo Archery check. * fix bgs check in player * move bgs logic for tokensanity into MOD_NONE check * set bgs flag before `Item_Give`ing * move bgs flag into `MOD_NONE` check in girla * use existing check in `z_player` * Adds comment explaining the decision to default ITEM_FROM_NPC. * Rename pendingIceTraps to pendingIceTrapCount * Adds some RANDOTODO comments about cleaning up a couple things. * Merge branch 'develop-zhora' into ztornn * manually restore changes to `z_player.c` * Fix after some ice trap prepwork from earlier * Actual fix * Woops * More rupee names * Actually fix it * Add back comment * Fix Skip Scarecrow Song * Fix ruto's letter and LH sun stick rendering * Also fixes it for treasure chest game * Tweak: Rando French Wallet * ADD: French Tycoon * Hide dungeon items/notes by default * [#1301] Fix issue with UI not restoring after getting an item from biggoron * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Fix random crash that only affected one person for some reason Co-authored-by: Garrett Cox <garrettjcox@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Sarge-117 <adam_branston@outlook.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: lil David <1337lilDavid@gmail.com> Co-authored-by: Sarge-117 <108380086+Sarge-117@users.noreply.github.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com>
2022-09-21 00:50:22 -04:00
Ship::ExecuteHooks<Ship::LoadFile>(gSaveContext.fileNum);
}
extern "C" void Save_AddLoadFunction(char* name, int version, SaveManager::LoadFunc func) {
SaveManager::Instance->AddLoadFunction(name, version, func);
}
extern "C" void Save_AddSaveFunction(char* name, int version, SaveManager::SaveFunc func) {
SaveManager::Instance->AddSaveFunction(name, version, func);
}
extern "C" SaveFileMetaInfo* Save_GetSaveMetaInfo(int fileNum) {
return &SaveManager::Instance->fileMetaInfo[fileNum];
}
extern "C" void Save_CopyFile(int from, int to) {
SaveManager::Instance->CopyZeldaFile(from, to);
}
extern "C" void Save_DeleteFile(int fileNum) {
SaveManager::Instance->DeleteZeldaFile(fileNum);
Randomizer v2 (#1065) * Revert changes to GetItemFromGet * Fixes Ganon's Boss Key shuffled while regular boss Keys aren't. * Enum + combo box * Add obtainability checks correctly * combobox title rename + no number tracking * Fix repeatable purchases and bottles rendering incorrectly * Move shopsanity option in GUI * Struct instead of ImVec + basic comportment for all case * Attempt to fix odd build issue * Cast randoGet for ganons boss key * Remove redundancy in KD room * Update logic Cvar names * Fix Ganons Trials coming from old save files. Fixes #1365 * Fixes crash when entering Ganon's Castle lobby on linux. * Makes `Item_Give` safe to use with a NULL globalCtx. This should allow it's use for giving items to Link's Pocket during rando save initialization. * Converts Song from Impa to use `Item_Give` * Adds more options for Link's starting item. * Removes unneeded `GiveLinkItem` functions. * and make it build * bring back new rando dropdown * gSaveContext access in GameMenuBar.cpp * Implement Skip Scarecrow's Song * Reimplement progressive Bombchus * Rando-next: Deku Nut and Seed ammo gives a blue rupee Fixes #1390 * Fixes Link starting with BGS * Persist item tracker notes * Adjust Hooks include * Use SohImGui::RequestCvarSaveOnNextTick * Fix issues from LUS refactor * Fix for overriding deku scrub messages * Fix mistake from merge oops * Restore checkboxes to enhancements menu These got lost in the merge * Update location access logic Including MQ locations in Spirit and GC now * Implement rando bombchu drops * Missing break * Simplify mudwall collision check There was no need to have a second collider specifically for Ice Arrow hits * Update settings.cpp * Simplify mudwall collision check * Restore checkboxes in menu Accidentally lost these during merge * Clean up bool * Update logic Cvar name * Fixed capacity on ammmo tracking * Fix for beans obtainability * Hook into file delete and clear notes * Incorporate magic arrows in rando settings * Update tooltip To inform the player that they might have to reload the room if they're enabling this for the first time. * Update tooltip * Add line break in tooltip * Tooltip wording + line break * tweak on main logic * All color logic for all types * Fix: changes to please new LUS * Ensure itemTrackerNotes vector is not fully empty * Implement's Tycoon Wallet. * Refactor DrawItemCount and Use EnhancementCombobox for tracker capacity options * small tweaks and rename * always display XX/YY when in ammo/capacity mode * Move all merchant messages to be generated on file load * added hovertext for the number display * Swap german and french translations for shop messages * Set key colors to be on by default * Add another flag to skip mask shop * Fix Sold Out bug * Fix gerudo keys, add disabled checkbox * tooltip line break * Add trials required and merchant prices to save file instead of loading from active spoiler log * Remove trialsRequired persisting in save manager * Adds slotIndex to girla (shop item actor) and uses that for IdentifyShopItem. * Fix issue when merchantPrices is empty * Fix for a single zeroed merchantPrice entry * Fix #1417 * Implements items selling out and fixes issues with purchasing some items. * Fixes order of operations so Rupees will be spent. * Fixes sold out items not getting overwritten by the randomized info. * Clarify var names and comments Also preserve chain platform cutscene in spirit based on Link's position * Remove !=0 from cvar check * Clarify var names and comments * Rename randomizerMerchantPrices to merchantPrices * Handle shop items in SaveManager * Fix merge mistake * Base whats in the bazaar shop on entranceIndex instead of age * Tidy up chain platform cutscene check * Fix merge error Didn't mean to have Zhora changes in here yet * Use 3drando item table for parsing spoiler names * Use another nested method instead of one at the top level to fetch the table * Add missing newline * Remove log * Respect custom draw functions * Fix issues with rendering songs * Fix localized item names for shopsanity * Implements a larger array of Sprites for the Icon Hash. * Uses the hash instead of seed for spoilerfile name and icons. * Removes some unused functions and variables in `spoiler_log.cpp` * Prevents leading 0s added to hash from being in file name * Changes filename format to icon indexes separated by dashes * Hopefully makes Jenkins happy * Hopefully makes Jenkins happy * [Rando] Child Gerudo Fortress 37th Heartpiece randomized Fixes #1071 * Add descriptions to save editor flags editor, and added randomizer flags (#1386) * Add descriptions to save editor flags editor, and added randomizer flags * Hide randomizer flags when not on a randomizer save * Move flag descriptions to header file * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Update soh/soh/Enhancements/debugger/debugSaveEditor.h * Fix merge error * crash on pause menu on linux (only in appimage) Fixes #1437 * Applies fix to Song from Impa as well. * Allow buying tunics as child when shopsanity is on * Fix for custom draw methods overriding sold out sign * Simplify logic around shopsanity and fix some issues * Fix dungeon reward stone rotation and add particles * Fix some issues with ice traps * Fix adult wallet having its own max capacity * Fix amount of keys given for BotW * format * Use EnGirlAShopItem enum instead of raw hex values * [#1434] Renders non-warp songs more consistently with warp songs * A few changes around merchant messages * Various changes from PR feedback * Rando: Junk Hint missing french translation * Typo * Fix free scrub being at 0 instead of TEXT_SCRUB_RANDOM * Replace magic numbers in message handler * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fix BGS softlock for shopsanity * Support tycoon wallet on tracker * Revert "Fix BGS softlock for shopsanity" This reverts commit 5fdb961ea460fb9a035cf0bb6ae77bfeedc1de0f. * [#1053] Resolves an issue with shop items and bombchu bowling where BGS would display two message boxes * Implements some necessary plumbing and resolves several Ice Trap Softlocks. Adds a way for an item entry to tell what type of check it came from (NPC vs Chest vs Freestanding, etc.) Sets this value from chests and item00 actors. Relocates pendingIceTraps to save context so it can persist through cutscenes and get stored on save init for Link's Pocket and Song from Impa. Restructures pendingIceTraps into a counter rather than a true or false, so that we can be frozen multiple times in a row if applicable (atm that should only be at the start of a run if Link's Pocket and Song from Impa were both Ice Traps). Adds a textbox for Ice Traps and a special case of holding up nothing in the get item process. This fixes all the cases where Ice Traps would softlock due to the actor giving the item expecting a closing textbox. After holding the item above his head Link increments the pendingIceTraps counter by one and sets whatever flag he has pending. None of the above plumbing applies to Ice Traps from chests, those work exactly the same as before, as do freestanding item00 ice traps (thanks to the additional check for ITEM_FROM_FREESTANDING. OoT and Ruto's Letter count as NPC's, so they get the FOWL text box and set a pending ice trap rather than immediately freezing, since Link weill be in the water. Link will get frozen the next time he touches land, which in the case of OoT is after the fade to white and right before the Song of Time check. Fixes all the other softlocks I'm aware of, including Fishing, Bombchu Bowling, Skull Kid, and losing the second Gerudo Archery check. * fix bgs check in player * move bgs logic for tokensanity into MOD_NONE check * set bgs flag before `Item_Give`ing * move bgs flag into `MOD_NONE` check in girla * use existing check in `z_player` * Adds comment explaining the decision to default ITEM_FROM_NPC. * Rename pendingIceTraps to pendingIceTrapCount * Adds some RANDOTODO comments about cleaning up a couple things. * Merge branch 'develop-zhora' into ztornn * manually restore changes to `z_player.c` * Fix after some ice trap prepwork from earlier * Actual fix * Woops * More rupee names * Actually fix it * Add back comment * Fix Skip Scarecrow Song * Fix ruto's letter and LH sun stick rendering * Also fixes it for treasure chest game * Tweak: Rando French Wallet * ADD: French Tycoon * Hide dungeon items/notes by default * [#1301] Fix issue with UI not restoring after getting an item from biggoron * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Update soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c * Fix random crash that only affected one person for some reason Co-authored-by: Garrett Cox <garrettjcox@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Sarge-117 <adam_branston@outlook.com> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: lil David <1337lilDavid@gmail.com> Co-authored-by: Sarge-117 <108380086+Sarge-117@users.noreply.github.com> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com>
2022-09-21 00:50:22 -04:00
Ship::ExecuteHooks<Ship::DeleteFile>(fileNum);
}
2022-07-21 18:36:46 -04:00
extern "C" u32 Save_Exist(int fileNum) {
2022-07-21 18:36:46 -04:00
return SaveManager::Instance->SaveFile_Exist(fileNum);
}