Skip to content

Commit

Permalink
fix(web): set default saves folder to /local/saves
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Aug 31, 2023
1 parent 2c638f1 commit 01e6922
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 14 deletions.
6 changes: 4 additions & 2 deletions resources/base_config/zc.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# current_module = modules/classic.zmod

[Theme]
theme_filename = themes/mooshmood.ztheme
theme_filename = themes/mooshmood.ztheme #? web = themes/dark.ztheme

[SAVEFILE]
save_filename = zc.sav
save_filename = zc.sav #? web = /local/zc.sav

[Controls]
joystick_index = 0
Expand Down Expand Up @@ -170,6 +170,8 @@ multiple_instances = 0
cursor_scale_large = 1.5
cursor_scale_small = 1

save_folder = saves #? web = /local/saves

# debug =

[ZSCRIPT]
Expand Down
6 changes: 0 additions & 6 deletions resources/zc_web.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[SAVEFILE]
save_filename = /local/zc.sav

[zeldadx]
key_a = 26
key_b = 24
Expand Down Expand Up @@ -31,6 +28,3 @@ btn_up = 13
btn_down = 14
btn_left = 15
btn_right = 16

[Theme]
theme_filename = themes/dark.ztheme
1 change: 1 addition & 0 deletions scripts/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def do_packaging(package_dir: Path, files):
tc.assertEqual(preprocess_base_config('ignore_monitor_scale = 0 #? windows = 1 ; mac = 2', 'mac'), 'ignore_monitor_scale = 2')
tc.assertEqual(preprocess_base_config('ignore_monitor_scale = 0 #? windows = 1 ; mac = 2', 'windows'), 'ignore_monitor_scale = 1')
tc.assertEqual(preprocess_base_config('ignore_monitor_scale = 0 #? windows = 1 ; mac = 2', 'linux'), 'ignore_monitor_scale = 0')
tc.assertEqual(preprocess_base_config('ignore_monitor_scale = no #? windows = yes', 'windows'), 'ignore_monitor_scale = yes')
elif args.extras:
do_packaging(packages_dir / 'extras', extras)
else:
Expand Down
5 changes: 0 additions & 5 deletions src/zc/saves.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ save_t::~save_t()
static fs::path get_legacy_save_file_path()
{
std::string save_file_name = zc_get_config("SAVEFILE", "save_filename", "zc.sav");
#ifdef __EMSCRIPTEN__
// There was a bug that causes browser zc.cfg files to use the wrong value for the save file.
if (save_file_name == "zc.sav")
save_file_name = "/local/zc.sav";
#endif
return save_file_name;
}

Expand Down
2 changes: 1 addition & 1 deletion web/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function configureMount() {
}
}

// Mount the persisted files (zc.sav and zc.cfg live here).
// Mount the persisted files (saves folder and zc.cfg live here).
FS.mkdirTree('/local');
if (type === 'fs') {
await setAttachedDir(attachedDirHandle);
Expand Down

0 comments on commit 01e6922

Please sign in to comment.