Skip to content

Commit

Permalink
Small updates: Less folder creation messages + clarified description
Browse files Browse the repository at this point in the history
  • Loading branch information
Kewlan committed Nov 29, 2023
1 parent 3438023 commit fba4053
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
5 changes: 4 additions & 1 deletion source/custom_music/sequence_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<u32, 4> 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();
Expand Down
5 changes: 4 additions & 1 deletion source/descriptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."; //
//
//--------------//
/*------------------------------ //
Expand Down
39 changes: 20 additions & 19 deletions source/music.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,31 +335,32 @@ bool archiveFound = false;
bool musicDirsCreated = false;

void CreateMusicDirectories(FS_Archive sdmcArchive) {
std::vector<std::string> dirs;
if (R_FAILED(FSUSER_OpenDirectory(nullptr, sdmcArchive, fsMakePath(PATH_ASCII, CustomMusicRootPath.c_str())))) {
std::vector<std::string> 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;
}

Expand Down

0 comments on commit fba4053

Please sign in to comment.