diff --git a/soh/soh/Enhancements/randomizer/3drando/menu.cpp b/soh/soh/Enhancements/randomizer/3drando/menu.cpp index 781dbead7..f8e0bb398 100644 --- a/soh/soh/Enhancements/randomizer/3drando/menu.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/menu.cpp @@ -542,7 +542,7 @@ std::string GenerateRandomizer(std::unordered_map Settings::Keysanity.RestoreDelayedOption(); } - return "./Randomizer/" + Settings::seed + ".json"; + return "./Randomizer/" + Settings::hash + ".json"; } std::string GetInput(const char* hintText) { diff --git a/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp b/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp index ee1a86424..87fba2e50 100644 --- a/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp @@ -39,6 +39,7 @@ int Playthrough_Init(uint32_t seed, std::unordered_map{}(Settings::seed + settingsStr); Random_Init(finalHash); + Settings::hash = std::to_string(finalHash); Logic::UpdateHelpers(); diff --git a/soh/soh/Enhancements/randomizer/3drando/settings.cpp b/soh/soh/Enhancements/randomizer/3drando/settings.cpp index b5efcfc70..ba6aedfa8 100644 --- a/soh/soh/Enhancements/randomizer/3drando/settings.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/settings.cpp @@ -20,6 +20,7 @@ using namespace SFX; namespace Settings { std::string seed; + std::string hash; std::string version = RANDOMIZER_VERSION "-" COMMIT_NUMBER; std::array hashIconIndexes; diff --git a/soh/soh/Enhancements/randomizer/3drando/settings.hpp b/soh/soh/Enhancements/randomizer/3drando/settings.hpp index 2daf1fa7f..1498e36cf 100644 --- a/soh/soh/Enhancements/randomizer/3drando/settings.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/settings.hpp @@ -863,6 +863,7 @@ void UpdateSettings(std::unordered_map cvarSettin extern std::string seed; extern std::string version; extern std::array hashIconIndexes; + extern std::string hash; extern bool skipChildZelda; diff --git a/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp b/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp index 461b54cb9..f1b344450 100644 --- a/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp @@ -40,8 +40,11 @@ static RandomizerHash randomizerHash; static SpoilerData spoilerData; void GenerateHash() { - for (size_t i = 0; i < Settings::hashIconIndexes.size(); i++) { - int number = Settings::seed[i] - '0'; + while (Settings::hash.length() < 10) { + Settings::hash = "0" + Settings::hash; + } + for (size_t i = 0, j = 0; i < Settings::hashIconIndexes.size(); i++, j += 2) { + int number = std::stoi(Settings::hash.substr(j, 2)); Settings::hashIconIndexes[i] = number; } @@ -740,11 +743,11 @@ const char* SpoilerLog_Write(int language) { std::string jsonString = jsonData.dump(4); std::ofstream jsonFile(Ship::Window::GetPathRelativeToAppDirectory( - (std::string("Randomizer/") + std::string(Settings::seed) + std::string(".json")).c_str())); + (std::string("Randomizer/") + std::string(Settings::hash) + std::string(".json")).c_str())); jsonFile << std::setw(4) << jsonString << std::endl; jsonFile.close(); - return Settings::seed.c_str(); + return Settings::hash.c_str(); } void PlacementLog_Msg(std::string_view msg) { diff --git a/soh/soh/Enhancements/randomizer/rando_hash.h b/soh/soh/Enhancements/randomizer/rando_hash.h index d095c3138..236bf2460 100644 --- a/soh/soh/Enhancements/randomizer/rando_hash.h +++ b/soh/soh/Enhancements/randomizer/rando_hash.h @@ -89,23 +89,23 @@ std::array gSeedTextures = { { { dgGiantsWalletIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 78 }, { dgDekuSeedsIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 79 }, { dgFishingPoleIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 80 }, - { dgForestMedallionIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 81 }, - { dgFireMedallionIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 82 }, - { dgWaterMedallionIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 83 }, - { dgSpiritMedallionIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 84 }, - { dgShadowMedallionIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 85 }, - { dgLightMedallionIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 86 }, - { dgKokiriEmeraldIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 87 }, - { dgGoronRubyIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 88 }, - { dgZoraSapphireIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 89 }, - { dgStoneOfAgonyIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 90 }, - { dgGerudosCardIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 91 }, - { dgGoldSkulltulaIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 92 }, - { dgHeartContainerIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 93 }, - { dgBossKeyIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 94 }, - { dgCompassIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 95 }, - { dgDungeonMapIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 96 }, - { dgSmallKeyIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 97 }, - { dgSmallMagicJarIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 98 }, - { dgBigMagicJarIconTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 99 }, + { dgForestMedallionIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 81 }, + { dgFireMedallionIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 82 }, + { dgWaterMedallionIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 83 }, + { dgSpiritMedallionIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 84 }, + { dgShadowMedallionIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 85 }, + { dgLightMedallionIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 86 }, + { dgKokiriEmeraldIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 87 }, + { dgGoronRubyIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 88 }, + { dgZoraSapphireIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 89 }, + { dgStoneOfAgonyIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 90 }, + { dgGerudosCardIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 91 }, + { dgGoldSkulltulaIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 92 }, + { dgHeartContainerIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 93 }, + { dgBossKeyIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 94 }, + { dgCompassIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 95 }, + { dgDungeonMapIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 96 }, + { dgSmallKeyIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 97 }, + { dgSmallMagicJarIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 98 }, + { dgBigMagicJarIconTex, 24, 24, G_IM_FMT_RGBA, G_IM_SIZ_32b, 99 }, } }; \ No newline at end of file