User folders: save games and Settings.cfg in Documents\Sacred
The game's ANSI file API calls are hooked; paths under save\ and Settings.cfg are redirected to Documents\Sacred\save and Documents\Sacred\config, copied there once from the game folder. The shared chest uses the same save folder. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
198c21dbfa
commit
6c467e22c4
7 files changed
+337
-9
No files matched your search
@@ -12,7 +12,7 @@
|
||||
// serializer (vf1c(stream, 1, 0)); loadHero recreates them with
|
||||
// cObjectManager::Create(type, 0, 0, 0), vf1c(stream, 0, file version) and
|
||||
// gives them their new id. The shared chest does the same into
|
||||
// save\shared_chest.json: written whenever a hero is saved, read at the start
|
||||
// shared_chest.json in the save folder (mods/userfolders.cpp): written whenever a hero is saved, read at the start
|
||||
// of each game session; cleared when the session ends (the ids die with the
|
||||
// object manager).
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "mods/itemstack.h"
|
||||
#include "mods/sharedchest.h"
|
||||
#include "mods/skillslots.h"
|
||||
#include "re/config.h"
|
||||
#include "mods/userfolders.h"
|
||||
#include "re/hook.h"
|
||||
#include "re/log.h"
|
||||
|
||||
@@ -102,11 +102,7 @@ bool SharedOpen() {
|
||||
}
|
||||
|
||||
std::string FilePath() {
|
||||
std::string dir = re::ConfigString("paths", "GameDir", "");
|
||||
if (!dir.empty() && dir.back() != '\\' && dir.back() != '/') {
|
||||
dir += '\\';
|
||||
}
|
||||
return dir + "save\\shared_chest.json";
|
||||
return mods::userfolders::SaveDir() + "shared_chest.json";
|
||||
}
|
||||
|
||||
// --- items <-> JSON ------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user