app: portable saves folder next to the executable
This commit is contained in:
parent
df4f7b1f11
commit
3a35cc7955
2 changed files with 16 additions and 1 deletions
|
|
@ -213,6 +213,7 @@ void SetRestartArgument(std::vector<std::string>& args, std::string name, std::s
|
||||||
constexpr std::string_view kUserDirectoryName = "skate3";
|
constexpr std::string_view kUserDirectoryName = "skate3";
|
||||||
constexpr std::string_view kSettingsFilename = "settings.toml";
|
constexpr std::string_view kSettingsFilename = "settings.toml";
|
||||||
constexpr std::string_view kDlcDirectoryName = "dlc";
|
constexpr std::string_view kDlcDirectoryName = "dlc";
|
||||||
|
constexpr std::string_view kSavesDirectoryName = "saves";
|
||||||
constexpr double kSixteenNineAspect = 16.0 / 9.0;
|
constexpr double kSixteenNineAspect = 16.0 / 9.0;
|
||||||
constexpr double kUltrawideAspectEpsilon = 0.01;
|
constexpr double kUltrawideAspectEpsilon = 0.01;
|
||||||
|
|
||||||
|
|
@ -807,6 +808,20 @@ void Skate3BaseApp::OnPostSetup() {
|
||||||
if (std::getenv("SKATE3_DISABLE_BIG_ALIASES") == nullptr) {
|
if (std::getenv("SKATE3_DISABLE_BIG_ALIASES") == nullptr) {
|
||||||
InstallBigDeviceAliases();
|
InstallBigDeviceAliases();
|
||||||
}
|
}
|
||||||
|
// Portable saves: a "saves" folder next to the executable takes over
|
||||||
|
// saved-game content when it exists (launcher-managed installs). Layout is
|
||||||
|
// flattened to saves/<xuid>/<save>; nothing is migrated from the user
|
||||||
|
// content tree, and without the folder the default location is unchanged.
|
||||||
|
{
|
||||||
|
const auto portable_saves =
|
||||||
|
rex::filesystem::GetExecutableFolder() / std::string(kSavesDirectoryName);
|
||||||
|
if (std::filesystem::is_directory(portable_saves) && runtime()->kernel_state() &&
|
||||||
|
runtime()->kernel_state()->content_manager()) {
|
||||||
|
runtime()->kernel_state()->content_manager()->SetContentTypeRoot(
|
||||||
|
rex::system::XContentType::kSavedGame, portable_saves);
|
||||||
|
REXLOG_INFO("Skate 3 saves: using portable folder {}", portable_saves.string());
|
||||||
|
}
|
||||||
|
}
|
||||||
InstallDlcPackages();
|
InstallDlcPackages();
|
||||||
InstallRecipeOverlay();
|
InstallRecipeOverlay();
|
||||||
|
|
||||||
|
|
|
||||||
2
third_party/rexglue-sdk
vendored
2
third_party/rexglue-sdk
vendored
|
|
@ -1 +1 @@
|
||||||
Subproject commit 9181630ecec1b34d70a110e903df6d522e0e6cd2
|
Subproject commit 8130e534bca688b5992b67e5c551e2be763a7b34
|
||||||
Loading…
Add table
Reference in a new issue