From 2bbeaf3ee2748fd4163564024b66bb70206f25c5 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Fri, 1 Dec 2023 09:33:17 -0500 Subject: [PATCH] Add Configurator and CLI options to reset ESDE --- functions/prepare_emulator.sh | 2 +- rd-submodules/retroarch | 2 +- rd-submodules/shared-modules | 2 +- retrodeck.sh | 13 +++++++++++++ tools/configurator.sh | 16 ++++++++++++++++ 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/functions/prepare_emulator.sh b/functions/prepare_emulator.sh index 95d3b32f..18118a69 100644 --- a/functions/prepare_emulator.sh +++ b/functions/prepare_emulator.sh @@ -45,9 +45,9 @@ prepare_emulator() { set_setting_value "$es_settings" "ROMDirectory" "$roms_folder" "es_settings" set_setting_value "$es_settings" "MediaDirectory" "$media_folder" "es_settings" set_setting_value "$es_settings" "UserThemeDirectory" "$themes_folder" "es_settings" + dir_prep "$rdhome/gamelists" "/var/config/emulationstation/.emulationstation/gamelists" emulationstation --home /var/config/emulationstation --create-system-dirs update_splashscreens - dir_prep "$rdhome/gamelists" "/var/config/emulationstation/.emulationstation/gamelists" fi if [[ "$action" == "postmove" ]]; then set_setting_value "$es_settings" "ROMDirectory" "$roms_folder" "es_settings" diff --git a/rd-submodules/retroarch b/rd-submodules/retroarch index 9dc43930..0b1cfb79 160000 --- a/rd-submodules/retroarch +++ b/rd-submodules/retroarch @@ -1 +1 @@ -Subproject commit 9dc439300e92338d5b2bc3fc680eedd4fe1d3b0c +Subproject commit 0b1cfb79e591e10488a3262d6b38db843c39a409 diff --git a/rd-submodules/shared-modules b/rd-submodules/shared-modules index 76809270..a2441b96 160000 --- a/rd-submodules/shared-modules +++ b/rd-submodules/shared-modules @@ -1 +1 @@ -Subproject commit 76809270588f87c6c14df96fef2dde9a7bac84f4 +Subproject commit a2441b964afefd8cd1cebcdf562c7878670daf42 diff --git a/retrodeck.sh b/retrodeck.sh index 763229c5..daeb3cc8 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -20,6 +20,7 @@ Arguments: --compress-one Compresses target file to a compatible format --compress-all Compresses all supported games into compatible format. Available formats are \"chd\", \"zip\", \"rvz\" and \"all\". --reset-emulator Reset one or more emulator configs to the default values + --reset-emulationstation Reset EmulationStation DE to default settings --reset-retrodeck Starts the initial RetroDECK installer (backup your data first!) For flatpak run specific options please run: flatpak run -h @@ -73,6 +74,18 @@ https://retrodeck.net exit fi ;; + --reset-emulationstation*) + echo "You are about to reset EmulationStation DE to default settings. Your scraped media, downloaded themes and gamelists will remain untouched." + read -p "Enter 'y' to continue, 'n' to stop: " response + if [[ $response == [yY] ]]; then + prepare_emulator "reset" "emulationstation" "cli" + read -p "The process has been completed, press Enter key to start RetroDECK." + shift # Continue launch after previous command is finished + else + read -p "The process has been cancelled, press Enter key to exit." + exit + fi + ;; --reset-retrodeck*) echo "You are about to reset RetroDECK completely!" read -p "Enter 'y' to continue, 'n' to stop: " response diff --git a/tools/configurator.sh b/tools/configurator.sh index 175a7174..8e8c5740 100644 --- a/tools/configurator.sh +++ b/tools/configurator.sh @@ -77,6 +77,7 @@ source /app/libexec/global.sh # - Reset XEMU # - Reset Yuzu # - Reset All Emulators +# - Reset EmulationStation DE # - Reset RetroDECK # - RetroDECK: About # - RetroDECK Version History @@ -957,6 +958,7 @@ configurator_reset_dialog() { --column="Choice" --column="Action" \ "Reset Specific Emulator" "Reset only one specific emulator to default settings" \ "Reset All Emulators" "Reset all emulators to default settings" \ + "Reset EmulationStation DE" "Reset the ES-DE frontend" \ "Reset RetroDECK" "Reset RetroDECK to default settings" ) case $choice in @@ -1025,6 +1027,20 @@ configurator_reset_dialog() { fi ;; +"Reset EmulationStation DE" ) + if [[ $(configurator_reset_confirmation_dialog "EmulationStation DE" "Are you sure you want to reset EmulationStation DE to default settings?\n\nYour scraped media, downloaded themes and gamelists will not be touched.\n\nThis process cannot be undone.") == "true" ]]; then + zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \ + --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --title "RetroDECK Configurator Utility - Reset EmulationStation DE" \ + --text="You are resetting EmulationStation DE to its default settings.\n\nAfter the process is complete you will need to exit RetroDECK and run it again." + prepare_emulator "reset" "emulationstation" "configurator" + configurator_process_complete_dialog "resetting EmulationStation DE" + else + configurator_generic_dialog "RetroDeck Configurator - EmulationStation DE: Reset" "Reset process cancelled." + configurator_reset_dialog + fi +;; + "Reset RetroDECK" ) if [[ $(configurator_reset_confirmation_dialog "RetroDECK" "Are you sure you want to reset RetroDECK entirely?\n\nThis process cannot be undone.") == "true" ]]; then zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \