diff options
| author | AltoXorg <56553686+Alto1772@users.noreply.github.com> | 2025-07-24 11:45:46 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-23 20:45:46 -0700 |
| commit | d06cf6bf1032037d67b46bad37b8320bec9643d6 (patch) | |
| tree | ee52f04d8282476b118e328f9f8cdbc783fd1ad0 | |
| parent | d51e88b9722f99096033a90080039d7d44e68e91 (diff) | |
`timesplitdata.json` obey app directory (#5693)
| -rw-r--r-- | soh/soh/Enhancements/timesplits/TimeSplits.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/soh/soh/Enhancements/timesplits/TimeSplits.cpp b/soh/soh/Enhancements/timesplits/TimeSplits.cpp index f08235970..d590bbd07 100644 --- a/soh/soh/Enhancements/timesplits/TimeSplits.cpp +++ b/soh/soh/Enhancements/timesplits/TimeSplits.cpp @@ -4,6 +4,7 @@ #include "soh/util.h" #include <vector> #include "include/z64item.h" +#include "Context.h" #include <fstream> #include <filesystem> @@ -363,7 +364,7 @@ void TimeSplitsSkipSplit(uint32_t index) { } void TimeSplitsFileManagement(uint32_t action, const char* listEntry, std::vector<SplitObject> listData) { - std::string filename = "timesplitdata.json"; + std::string filename = Ship::Context::GetPathRelativeToAppDirectory("timesplitdata.json"); json saveFile; json listArray = nlohmann::json::array(); @@ -948,9 +949,10 @@ void TimeSplitsDrawManageList() { } void InitializeSplitDataFile() { - if (!std::filesystem::exists("timesplitdata.json")) { + std::string filename = Ship::Context::GetPathRelativeToAppDirectory("timesplitdata.json"); + if (!std::filesystem::exists(filename)) { json j; - std::ofstream file("timesplitdata.json"); + std::ofstream file(filename); file << j.dump(4); file.close(); } |
