diff --git a/soh/soh/Enhancements/randomizer/Plandomizer.cpp b/soh/soh/Enhancements/randomizer/Plandomizer.cpp index 732ef700b..fcec76887 100644 --- a/soh/soh/Enhancements/randomizer/Plandomizer.cpp +++ b/soh/soh/Enhancements/randomizer/Plandomizer.cpp @@ -361,9 +361,11 @@ void PlandomizerPopulateSeedList() { existingSeedList.clear(); auto spoilerPath = Ship::Context::GetPathRelativeToAppDirectory("Randomizer"); - for (const auto& entry : std::filesystem::directory_iterator(spoilerPath)) { - if (entry.is_regular_file() && entry.path().extension() == ".json") { - existingSeedList.push_back(entry.path().stem().string()); + if (std::filesystem::exists(spoilerPath)) { + for (const auto& entry : std::filesystem::directory_iterator(spoilerPath)) { + if (entry.is_regular_file() && entry.path().extension() == ".json") { + existingSeedList.push_back(entry.path().stem().string()); + } } } } @@ -875,15 +877,18 @@ void PlandomizerDrawOptions() { } else { ImGui::Text("No Spoiler Logs found."); } - + ImGui::BeginDisabled(existingSeedList.empty()); if (ImGui::Button("Load")) { logTemp = existingSeedList[selectedList].c_str(); PlandomizerLoadSpoilerLog(logTemp.c_str()); } + ImGui::EndDisabled(); + ImGui::BeginDisabled(spoilerLogData.empty()); ImGui::SameLine(); if (ImGui::Button("Save")) { PlandomizerSaveSpoilerLog(); } + ImGui::EndDisabled(); ImGui::TableNextColumn(); ImGui::SeparatorText("Current Seed Hash");