Skip to content

Commit

Permalink
Add support for user directories
Browse files Browse the repository at this point in the history
This commits separates the C3 data files from the user files, such as configurations, savegames, maps and custom scenario stuff.

Upon first launch with this build, the game will ask whether the user wants to specify a directory and will also, in some cases recommend one.

Base options are:
- Default (the current way, everything is thrown into the Caesar 3 directory)
- Default, with subdirectories - user files are still stored in Caesar 3, but in their own subdirectories
- Recommended - a platform-specific recommendation. Depending on the system, there may not be a recommendation)
- Custom - a user specified directory. depending on the system, this may not be available

The game will also check if the provided directory is writeable and warn the user if it isn't.

When changing the user directory, the user will be asked if he wants to copy their files to the new location and whether to overwrite files that already exist on the new location.

Because this is a big change, there may be some bugs left. I tested most of the stuff, but I may have missed something.
  • Loading branch information
crudelios committed May 15, 2024
1 parent 4700e58 commit e92dacd
Show file tree
Hide file tree
Showing 53 changed files with 9,546 additions and 1,337 deletions.
2 changes: 1 addition & 1 deletion .ci_scripts/setup_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ case "$BUILD_TARGET" in
"switch")
# You can obtain a recent devkitA64 image from https://hub.docker.com/repository/docker/devkitpro/devkita64/general
# As for Vita above, make sure that it compiles correctly and runs on a Switch prior to pushing the change
docker run -d --name switchdev --workdir /build/git -v "${PWD}:/build/git" devkitpro/devkita64:20231108 tail -f /dev/null
docker run -d --name switchdev --workdir /build/git -v "${PWD}:/build/git" devkitpro/devkita64:20240324 tail -f /dev/null
;;
"android")
# Decrypt the key files
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ set(PLATFORM_FILES
${PROJECT_SOURCE_DIR}/src/platform/screen.c
${PROJECT_SOURCE_DIR}/src/platform/sound_device.c
${PROJECT_SOURCE_DIR}/src/platform/touch.c
${PROJECT_SOURCE_DIR}/src/platform/user_path.c
${PROJECT_SOURCE_DIR}/src/platform/version.c
${PROJECT_SOURCE_DIR}/src/platform/virtual_keyboard.c
)
Expand Down Expand Up @@ -654,6 +655,7 @@ set(WINDOW_FILES
${PROJECT_SOURCE_DIR}/src/window/text_input.c
${PROJECT_SOURCE_DIR}/src/window/trade_opened.c
${PROJECT_SOURCE_DIR}/src/window/trade_prices.c
${PROJECT_SOURCE_DIR}/src/window/user_path_setup.c
${PROJECT_SOURCE_DIR}/src/window/victory_dialog.c
${PROJECT_SOURCE_DIR}/src/window/video.c
)
Expand Down
Loading

0 comments on commit e92dacd

Please sign in to comment.