mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-24 07:05:34 -07:00
Fix new presets not being properly filtered in satellite selectors.
This commit is contained in:
parent
4987dd7fd0
commit
43e6192ad0
1 changed files with 4 additions and 0 deletions
|
@ -192,6 +192,9 @@ void LoadPresets() {
|
||||||
if (!fs::exists(presetFolder)) {
|
if (!fs::exists(presetFolder)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!presets.empty()) {
|
||||||
|
presets.clear();
|
||||||
|
}
|
||||||
for (auto const& preset : fs::directory_iterator(presetFolder)) {
|
for (auto const& preset : fs::directory_iterator(presetFolder)) {
|
||||||
std::ifstream ifs(preset.path());
|
std::ifstream ifs(preset.path());
|
||||||
|
|
||||||
|
@ -230,6 +233,7 @@ void SavePreset(std::string& presetName) {
|
||||||
fmt::format("{}/{}.json", Ship::Context::GetInstance()->LocateFileAcrossAppDirs("presets"), presetName));
|
fmt::format("{}/{}.json", Ship::Context::GetInstance()->LocateFileAcrossAppDirs("presets"), presetName));
|
||||||
file << presets[presetName].presetValues.dump(4);
|
file << presets[presetName].presetValues.dump(4);
|
||||||
file.close();
|
file.close();
|
||||||
|
LoadPresets();
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string newPresetName;
|
static std::string newPresetName;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue