mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-19 21:03:42 -07:00
timesplitdata.json
obey app directory (#5693)
This commit is contained in:
parent
d51e88b972
commit
d06cf6bf10
1 changed files with 5 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue