From 9b85fb25dc142ce4ba1ce188f3164c1eaa5bba74 Mon Sep 17 00:00:00 2001 From: Colin E <5352197+Kewlan@users.noreply.github.com> Date: Wed, 20 Dec 2023 17:11:02 +0100 Subject: [PATCH] Small updates: Less folder creation messages + clarified description (#710) Temporarily remove new GS loc in Zelda's Garden, as it can become inaccessible depending on story flags. --- source/custom_music/sequence_data.cpp | 5 ++- source/descriptions.cpp | 5 ++- source/gold_skulltulas/gs_castle_town.cpp | 34 ++++++++++---------- source/music.cpp | 39 ++++++++++++----------- 4 files changed, 46 insertions(+), 37 deletions(-) diff --git a/source/custom_music/sequence_data.cpp b/source/custom_music/sequence_data.cpp index bb9b410e..971d4b4c 100644 --- a/source/custom_music/sequence_data.cpp +++ b/source/custom_music/sequence_data.cpp @@ -110,11 +110,14 @@ void MusicCategoryNode::AddNewSeqData(SequenceData seqData) { } void MusicCategoryNode::AddExternalSeqDatas(FS_Archive sdmcArchive) { + // Make sure directory exists to avoid issues + FSUSER_CreateDirectory(sdmcArchive, fsMakePath(PATH_ASCII, GetFullPath().c_str()), FS_ATTRIBUTE_DIRECTORY); + for (const auto& bcseq : fs::directory_iterator(GetFullPath())) { if (bcseq.is_regular_file() && bcseq.path().extension().string() == bcseqExtension) { std::array banks = { 7, 7, 7, 7 }; // Set banks to Orchestra by default u16 chFlags = -1; // Enable all channel flags by default - u8 volume = 127; // 100% by default + u8 volume = 127; // 100% (assumed, as it's unsigned) by default // Check for cmeta file auto fileName = bcseq.path().stem().string(); diff --git a/source/descriptions.cpp b/source/descriptions.cpp index d7a9d47d..687c3fcb 100644 --- a/source/descriptions.cpp +++ b/source/descriptions.cpp @@ -1290,7 +1290,10 @@ string_view randomGsLocationsDesc = "Moves Gold Skulltulas to different loca "The logic is updated for any that are moved."; // // string_view gsLocGuaranteeNewDesc = "Excludes the original location from the Gold\n" // - "Skulltula's available locations pool."; // + "Skulltula's available locations pool.\n" // + "\n" // + "If no new locations are available, the original\n"// + "will be used regardless."; // // //--------------// /*------------------------------ // diff --git a/source/gold_skulltulas/gs_castle_town.cpp b/source/gold_skulltulas/gs_castle_town.cpp index 4c9ff337..c4b186a6 100644 --- a/source/gold_skulltulas/gs_castle_town.cpp +++ b/source/gold_skulltulas/gs_castle_town.cpp @@ -141,23 +141,25 @@ void GsTable_Init_CastleTown() { { [] { return IsChild && CanGetNightTimeGS && (CanJumpslash || CanUseProjectile || CanUse(DINS_FIRE)); } } }, + // Can become inaccessible if the guards start blocking during day time. + // TODO: Decide if the garden should always be open or if this should be removed. // https://noclip.website/#oot3d/nakaniwa;ShareData=AE$m_9vfZdTi+]mTbqHC+)/!KRcb;wUiU+_9L_kFVFpi?8o,BO9JmZv97ju?+5 - { HC_GARDEN, - "Under the stone bridge where Zelda stands.", - GsScene{ 0x4A }, - Room{ 0 }, - GsTimeCondition{ GS_TIME_ALWAYS }, - SettingRequirements{ nullptr }, - PosRot{ - { -430, 64, -10 }, - { -32768, 0, 0 }, - }, - { [] { return IsChild && (CanJumpslash || CanUseProjectile); }, - /*Glitched*/ - [] { - return IsChild && CanDoGlitch(GlitchType::RestrictedItems, GlitchDifficulty::NOVICE) && - (HasBottle || (FaroresWind && FaroresWindAnywhere)) && CanUse(DINS_FIRE); - } } }, + //{ HC_GARDEN, + // "Under the stone bridge where Zelda stands.", + // GsScene{ 0x4A }, + // Room{ 0 }, + // GsTimeCondition{ GS_TIME_ALWAYS }, + // SettingRequirements{ nullptr }, + // PosRot{ + // { -430, 64, -10 }, + // { -32768, 0, 0 }, + // }, + // { [] { return IsChild && (CanJumpslash || CanUseProjectile); }, + // /*Glitched*/ + // [] { + // return IsChild && CanDoGlitch(GlitchType::RestrictedItems, GlitchDifficulty::NOVICE) && + // (HasBottle || (FaroresWind && FaroresWindAnywhere)) && CanUse(DINS_FIRE); + // } } }, }); gsTable[MARKET_GS_GUARD_HOUSE] = new GoldSkulltulaData( // diff --git a/source/music.cpp b/source/music.cpp index 588e8449..83f3619a 100644 --- a/source/music.cpp +++ b/source/music.cpp @@ -335,31 +335,32 @@ bool archiveFound = false; bool musicDirsCreated = false; void CreateMusicDirectories(FS_Archive sdmcArchive) { - std::vector dirs; + if (R_FAILED(FSUSER_OpenDirectory(nullptr, sdmcArchive, fsMakePath(PATH_ASCII, CustomMusicRootPath.c_str())))) { + std::vector dirs; - dirs.push_back("/OoT3DR/"); - dirs.push_back(CustomMusicRootPath); + dirs.push_back("/OoT3DR/"); + dirs.push_back(CustomMusicRootPath); - auto bgmDirs = mcBgm_Root.GetDirectories(); - dirs.insert(dirs.end(), bgmDirs.begin(), bgmDirs.end()); + auto bgmDirs = mcBgm_Root.GetDirectories(); + dirs.insert(dirs.end(), bgmDirs.begin(), bgmDirs.end()); - auto melodyDirs = mcMelodies_Root.GetDirectories(); - dirs.insert(dirs.end(), melodyDirs.begin(), melodyDirs.end()); + auto melodyDirs = mcMelodies_Root.GetDirectories(); + dirs.insert(dirs.end(), melodyDirs.begin(), melodyDirs.end()); - const auto printInfo = [&](int progress) { - consoleClear(); - printf("\x1b[10;10HCreating Music Directories"); - printf("\x1b[11;10HProgress: %d/%d", progress, dirs.size()); - printf("\x1b[13;10HIf this is slow, don't worry."); - printf("\x1b[14;10HThis only has to be done once."); - }; + const auto printInfo = [&](int progress) { + consoleClear(); + printf("\x1b[10;10HCreating Music Directories"); + printf("\x1b[11;10HProgress: %d/%d", progress, dirs.size()); - printInfo(0); - for (size_t i = 0; i < dirs.size(); i++) { - FSUSER_CreateDirectory(sdmcArchive, fsMakePath(PATH_ASCII, dirs[i].c_str()), FS_ATTRIBUTE_DIRECTORY); - printInfo(i + 1); - } + printf("\x1b[13;10HOnly needs to be done once."); + }; + printInfo(0); + for (size_t i = 0; i < dirs.size(); i++) { + FSUSER_CreateDirectory(sdmcArchive, fsMakePath(PATH_ASCII, dirs[i].c_str()), FS_ATTRIBUTE_DIRECTORY); + printInfo(i + 1); + } + } musicDirsCreated = true; }