From c534e436b41a598de3254059d34013945b376dd8 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Thu, 27 Apr 2023 10:31:32 -0400 Subject: [PATCH] New Duckstation saves/states locations --- functions.sh | 24 ++++++++++++------------ post_update.sh | 9 +++++++++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/functions.sh b/functions.sh index e60d8db0..0555fe69 100644 --- a/functions.sh +++ b/functions.sh @@ -1261,7 +1261,7 @@ prepare_emulator() { mkdir -pv /var/config/retroarch/config/ cp -rf $emuconfigs/retroarch/core-overrides/* /var/config/retroarch/config dir_prep "$borders_folder" "/var/config/retroarch/borders" - cp -rt "/var/config/retroarch/borders/" "/app/retrodeck/emu-configs/retroarch/borders/*" + cp -rt /var/config/retroarch/borders/ /app/retrodeck/emu-configs/retroarch/borders/* set_setting_value "$raconf" "savefile_directory" "$saves_folder" "retroarch" set_setting_value "$raconf" "savestate_directory" "$states_folder" "retroarch" set_setting_value "$raconf" "screenshot_directory" "$screenshots_folder" "retroarch" @@ -1429,27 +1429,27 @@ prepare_emulator() { mkdir -p "$multi_user_data_folder/$SteamAppUser/data/duckstation/" cp -fv $emuconfigs/duckstation/* "$multi_user_data_folder/$SteamAppUser/data/duckstation" set_setting_value "$multi_user_data_folder/$SteamAppUser/data/duckstation/settings.ini" "SearchDirectory" "$bios_folder" "duckstation" "BIOS" - set_setting_value "$multi_user_data_folder/$SteamAppUser/data/duckstation/settings.ini" "Card1Path" "$saves_folder/duckstation/shared_card_1.mcd" "duckstation" "MemoryCards" - set_setting_value "$multi_user_data_folder/$SteamAppUser/data/duckstation/settings.ini" "Card2Path" "$saves_folder/duckstation/shared_card_2.mcd" "duckstation" "MemoryCards" - set_setting_value "$multi_user_data_folder/$SteamAppUser/data/duckstation/settings.ini" "Directory" "$saves_folder/duckstation" "duckstation" "MemoryCards" + set_setting_value "$multi_user_data_folder/$SteamAppUser/data/duckstation/settings.ini" "Card1Path" "$saves_folder/psx/duckstation/memcards/shared_card_1.mcd" "duckstation" "MemoryCards" + set_setting_value "$multi_user_data_folder/$SteamAppUser/data/duckstation/settings.ini" "Card2Path" "$saves_folder/psx/duckstation/memcards/shared_card_2.mcd" "duckstation" "MemoryCards" + set_setting_value "$multi_user_data_folder/$SteamAppUser/data/duckstation/settings.ini" "Directory" "$saves_folder/psx/duckstation/memcards" "duckstation" "MemoryCards" dir_prep "$multi_user_data_folder/$SteamAppUser/config/duckstation" "/var/config/duckstation" else # Single-user actions rm -rf /var/config/duckstation mkdir -p /var/data/duckstation/ cp -fv $emuconfigs/duckstation/* /var/data/duckstation set_setting_value "$duckstationconf" "SearchDirectory" "$bios_folder" "duckstation" "BIOS" - set_setting_value "$duckstationconf" "Card1Path" "$saves_folder/duckstation/shared_card_1.mcd" "duckstation" "MemoryCards" - set_setting_value "$duckstationconf" "Card2Path" "$saves_folder/duckstation/shared_card_2.mcd" "duckstation" "MemoryCards" - set_setting_value "$duckstationconf" "Directory" "$saves_folder/duckstation" "duckstation" "MemoryCards" + set_setting_value "$duckstationconf" "Card1Path" "$saves_folder/psx/duckstation/memcards/shared_card_1.mcd" "duckstation" "MemoryCards" + set_setting_value "$duckstationconf" "Card2Path" "$saves_folder/psx/duckstation/memcards/shared_card_2.mcd" "duckstation" "MemoryCards" + set_setting_value "$duckstationconf" "Directory" "$saves_folder/psx/duckstation/memcards" "duckstation" "MemoryCards" fi - dir_prep "$saves_folder/duckstation" "/var/data/duckstation/memcards" # TODO: This shouldn't be needed anymore, verify - dir_prep "$states_folder/duckstation" "/var/data/duckstation/savestates" # TODO: This shouldn't be needed anymore, verify + dir_prep "$saves_folder/psx/duckstation/memcards" "/var/data/duckstation/memcards" # TODO: This shouldn't be needed anymore, verify + dir_prep "$states_folder/psx/duckstation" "/var/data/duckstation/savestates" fi if [[ "$action" == "postmove" ]]; then # Run only post-move commands set_setting_value "$duckstationconf" "SearchDirectory" "$bios_folder" "duckstation" "BIOS" - set_setting_value "$duckstationconf" "Card1Path" "$saves_folder/duckstation/shared_card_1.mcd" "duckstation" "MemoryCards" - set_setting_value "$duckstationconf" "Card2Path" "$saves_folder/duckstation/shared_card_2.mcd" "duckstation" "MemoryCards" - set_setting_value "$duckstationconf" "Directory" "$saves_folder/duckstation" "duckstation" "MemoryCards" + set_setting_value "$duckstationconf" "Card1Path" "$saves_folder/psx/duckstation/memcards/shared_card_1.mcd" "duckstation" "MemoryCards" + set_setting_value "$duckstationconf" "Card2Path" "$saves_folder/psx/duckstation/memcards/shared_card_2.mcd" "duckstation" "MemoryCards" + set_setting_value "$duckstationconf" "Directory" "$saves_folder/psx/duckstation/memcards" "duckstation" "MemoryCards" fi fi diff --git a/post_update.sh b/post_update.sh index ff8bd0f9..5b833a14 100644 --- a/post_update.sh +++ b/post_update.sh @@ -75,6 +75,7 @@ post_update() { # - Prepackaged DOOM! # - Update RPCS3 vfs file contents. migrate from old location if needed # - Disable ESDE update checks for existing installs + # - Move Duckstation saves and states to new locations # - Offer user option of installing custom controller config mkdir -p "$mods_folder" @@ -115,6 +116,14 @@ post_update() { set_setting_value $es_settings "ApplicationUpdaterFrequency" "never" "es_settings" + mkdir -p "$saves_folder/psx/duckstation/memcards" + mv "$saves_folder/duckstation/*" "$saves_folder/psx/duckstation/memcards/" + rmdir "$saves_folder/duckstation" # File-safe folder cleanup + mkdir -p "$states_folder/psx" + mv -t "$states_folder/psx/" "$states_folder/duckstation" + unlink "/var/data/duckstation/savestates" + dir_prep "$states_folder/psx/duckstation" "/var/data/duckstation/savestates" + configurator_generic_dialog "As part of this update, we are offering a new official RetroDECK controller profile!\nIt is an optional component that helps you get the most out of RetroDECK with a new in-game radial menu for unified hotkeys across emulators.\n\nThe files need to be installed outside of the normal ~/retrodeck folder, so we wanted your permission before proceeding.\nIf you decide to not install the profile now, it can always be done later through the Configurator.\n\nThe files will be installed at the following shared Steam locations:\n\n$HOME/.steam/steam/tenfoot/resource/images/library/controller/binding_icons/\n$HOME/.steam/steam/controller_base/templates/RetroDECK_controller_config.vdf" if [[ $(configurator_generic_question_dialog "RetroDECK Official Controller Profile" "Would you like to install the official RetroDECK controller profile?") == "true" ]]; then rsync -a "/app/retrodeck/binding-icons/" "$HOME/.steam/steam/tenfoot/resource/images/library/controller/binding_icons/"