mirror of
https://github.com/open-goal/jak-project
synced 2026-08-22 07:04:29 -04:00
game: allow overriding the config directory location (#3477)
This is primarily driven for proper mod-support. Mods would like to isolate their settings and saves (potentially) and that is currently done by find-and-replacing code before building. Bad! Additionally, this has the side-effect of allowing for portable installations of the game so, win-win. Testing in progress, i'll merge once it is ready.
This commit is contained in:
@@ -33,7 +33,9 @@ void from_json(const json& j, DebugSettings& obj) {
|
||||
json_deserialize_if_exists(hide_imgui_key);
|
||||
}
|
||||
|
||||
DebugSettings::DebugSettings() {
|
||||
DebugSettings::DebugSettings() {}
|
||||
|
||||
void DebugSettings::load_settings() {
|
||||
try {
|
||||
std::string file_path =
|
||||
(file_util::get_user_misc_dir(g_game_version) / "debug-settings.json").string();
|
||||
@@ -71,7 +73,9 @@ void from_json(const json& j, DisplaySettings& obj) {
|
||||
json_deserialize_if_exists(window_ypos);
|
||||
}
|
||||
|
||||
DisplaySettings::DisplaySettings() {
|
||||
DisplaySettings::DisplaySettings() {}
|
||||
|
||||
void DisplaySettings::load_settings() {
|
||||
try {
|
||||
std::string file_path =
|
||||
(file_util::get_user_settings_dir(g_game_version) / "display-settings.json").string();
|
||||
@@ -114,7 +118,9 @@ void from_json(const json& j, InputSettings& obj) {
|
||||
json_deserialize_if_exists(keyboard_enabled);
|
||||
}
|
||||
|
||||
InputSettings::InputSettings() {
|
||||
InputSettings::InputSettings() {}
|
||||
|
||||
void InputSettings::load_settings() {
|
||||
try {
|
||||
keyboard_binds = DEFAULT_KEYBOARD_BINDS;
|
||||
mouse_binds = DEFAULT_MOUSE_BINDS;
|
||||
@@ -131,6 +137,7 @@ InputSettings::InputSettings() {
|
||||
lg::error("Error encountered when attempting to load input settings {}", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
void InputSettings::save_settings() {
|
||||
json data = *this;
|
||||
auto file_path = file_util::get_user_settings_dir(g_game_version) / "input-settings.json";
|
||||
|
||||
Reference in New Issue
Block a user