diff --git a/emu-configs/defaults/dolphin/Dolphin.ini b/emu-configs/defaults/dolphin/Dolphin.ini index db74b4ea..78748c52 100644 --- a/emu-configs/defaults/dolphin/Dolphin.ini +++ b/emu-configs/defaults/dolphin/Dolphin.ini @@ -43,13 +43,13 @@ Enabled = False [DSP] EnableJIT = False [GBA] -BIOS = /home/deck/.var/app/org.DolphinEmu.dolphin-emu/data/dolphin-emu/GBA/gba_bios.bin +BIOS = Rom1 = Rom2 = Rom3 = Rom4 = SavesInRomPath = False -SavesPath = /home/deck/.var/app/org.DolphinEmu.dolphin-emu/data/dolphin-emu/GBA/Saves/ +SavesPath = Threads = True [Input] BackgroundInput = False diff --git a/emu-configs/defaults/dolphin/GBA.ini b/emu-configs/defaults/dolphin/GBA.ini new file mode 100644 index 00000000..1956cf71 --- /dev/null +++ b/emu-configs/defaults/dolphin/GBA.ini @@ -0,0 +1,18 @@ +[GBA1] +Device = XInput2/0/Virtual core pointer +Buttons/B = `Z` +Buttons/A = `X` +Buttons/L = `Q` +Buttons/R = `W` +Buttons/SELECT = `Backspace` +Buttons/START = `Return` +D-Pad/Up = `T` +D-Pad/Down = `G` +D-Pad/Left = `F` +D-Pad/Right = `H` +[GBA2] +Device = XInput2/0/Virtual core pointer +[GBA3] +Device = XInput2/0/Virtual core pointer +[GBA4] +Device = XInput2/0/Virtual core pointer \ No newline at end of file diff --git a/emu-configs/defaults/duckstation/settings.ini b/emu-configs/defaults/duckstation/settings.ini index e6bff72f..3f181da1 100644 --- a/emu-configs/defaults/duckstation/settings.ini +++ b/emu-configs/defaults/duckstation/settings.ini @@ -44,7 +44,7 @@ FastmemMode = MMap [GPU] Renderer = OpenGL -Adapter = +Adapter = ResolutionScale = 1 Multisamples = 1 UseDebugDevice = false @@ -114,7 +114,7 @@ SeekSpeedup = 1 [Audio] Backend = Cubeb -Driver = +Driver = StretchMode = TimeStretch BufferMS = 50 OutputLatencyMS = 20 @@ -166,7 +166,7 @@ PrimedIndicators = true [Logging] LogLevel = Info -LogFilter = +LogFilter = LogToConsole = true LogToDebug = false LogToWindow = false @@ -207,6 +207,10 @@ Shaders = shaders Textures = textures +[UI] +MainWindowGeometry = AdnQywADAAAAAAGWAAAAeQAABLUAAAM0AAABlgAAAHkAAAS1AAADNAAAAAAAAAAABk0AAAGWAAAAeQAABLUAAAM0 + + [InputSources] SDL = true SDLControllerEnhancedMode = false @@ -280,4 +284,4 @@ OpenPauseMenu = Keyboard/Escape LoadSelectedSaveState = Keyboard/F1 SaveSelectedSaveState = Keyboard/F2 SelectPreviousSaveStateSlot = Keyboard/F3 -SelectNextSaveStateSlot = Keyboard/F4 +SelectNextSaveStateSlot = Keyboard/F4 \ No newline at end of file diff --git a/emu-configs/dolphin/Dolphin.ini b/emu-configs/dolphin/Dolphin.ini index 59737d0f..bfa1e7c2 100644 --- a/emu-configs/dolphin/Dolphin.ini +++ b/emu-configs/dolphin/Dolphin.ini @@ -25,10 +25,10 @@ Fullscreen = True DisableScreenSaver = True [GBA] BIOS = ~/retrodeck/bios -Rom1 = -Rom2 = -Rom3 = -Rom4 = +Rom1 = +Rom2 = +Rom3 = +Rom4 = SavesInRomPath = False SavesPath = ~/retrodeck/saves/gba Threads = True diff --git a/functions.sh b/functions.sh index 6bc9ea68..e4b3d651 100644 --- a/functions.sh +++ b/functions.sh @@ -43,7 +43,7 @@ verify_space() { # USAGE: verify_space $source_dir $dest_dir # Function returns "true" if there is enough space, "false" if there is not - source_size=$(du -sk /home/deck/retrodeck | awk '{print $1}') + source_size=$(du -sk $1 | awk '{print $1}') source_size=$((source_size+(source_size/10))) # Add 10% to source size for safety dest_avail=$(df -k --output=avail $2 | tail -1) @@ -143,6 +143,59 @@ get_setting_name() { # Function for getting the setting name from a full setting line from a config file # USAGE: get_setting_name $setting_line $system (needed as different systems use different config file syntax) + case $2 in + + "retrodeck" ) + echo "$1" | grep -o -P ".*(?=\=)" + ;; + + "retroarch" ) + echo "$1" | grep -o -P ".*(?= \= )" + ;; + + "dolphin" ) # Use quotes when passing setting_name, as this config file contains special characters + echo "$1" | grep -o -P ".*(?= \= )" + ;; + + "duckstation" ) + echo "$1" | grep -o -P ".*(?= \= )" + ;; + + "pcsx2" ) + echo "$1" | grep -o -P ".*(?= \= )" + ;; + + "ppsspp" ) # Use quotes when passing setting_name, as this config file contains spaces + echo "$1" | grep -o -P ".*(?= \= )" + ;; + + "rpcs3" ) # Use quotes when passing setting_name, as this config file contains special characters and spaces + echo "$1" | grep -o -P ".*(?=:)" + ;; + + "yuzu" ) # Use quotes when passing setting_name, as this config file contains special characters + yuzu_setting=$(sed -e 's%\\%\\\\%g' <<< "$2") # Accomodate for backslashes in setting names + echo '$yuzu_setting' | grep -o -P ".*(?=\=)" | sed -e 's%\\\\%\\%g' + ;; + + "citra" ) # Use quotes when passing setting_name, as this config file contains special characters + citra_setting=$(sed -e 's%\\%\\\\%g' <<< "$1") # Accomodate for backslashes in setting names + echo '$citra_setting' | grep -o -P ".*(?=\=)" | sed -e 's%\\\\%\\%g' + ;; + + "melonds" ) + echo "$1" | grep -o -P ".*(?=\=)" + ;; + + "xemu" ) + echo "$1" | grep -o -P ".*(?= \= )" + ;; + + "emulationstation" ) + echo '$1' | grep -o -P "(?<=name\=\").*(?=\" value)" + ;; + +esac } get_setting_value() { @@ -205,11 +258,129 @@ esac } disable_setting() { + # This function will add a '#' to the beginning of a defined setting line, disabling it. + # USAGE: disable_setting $setting_file $setting_name $system + case $3 in + + "retrodeck" ) + sed -i "s%^$2=%#$2=%" $1 + ;; + + "retroarch" ) + sed -i "s%^$2 = %#$2 = %" $1 + ;; + + "dolphin" ) + sed -i "s%^$2 = %#$2 = %" $1 + ;; + + "duckstation" ) + sed -i "s%^$2 = %#$2 = %" $1 + ;; + + "pcsx2" ) + sed -i "s%^$2 = %#$2 = %" $1 + ;; + + "ppsspp" ) + sed -i "s%^$2 = %#$2 = %" $1 + ;; + + "rpcs3" ) # This does not currently work for settings with a $ in them + sed -i "s%^$2: %#$2: %" $1 + ;; + + "yuzu" ) + yuzu_setting=$(sed -e 's%\\%\\\\%g' <<< "$2") # Acommodate backslashes in setting name + sed -i "s%^$yuzu_setting=%#$yuzu_setting=%" $1 + ;; + + "citra" ) + citra_setting=$(sed -e 's%\\%\\\\%g' <<< "$2") # Acommodate backslashes in setting name + sed -i "s%^$citra_setting=%#$citra_setting=%" $1 + ;; + + "melonds" ) + sed -i "s%^$2=%#$2=%" $1 + ;; + + "xemu" ) + sed -i "s%^$2 = %#$2 = %" $1 + ;; + +esac } enable_setting() { + # This function will remove a '#' to the beginning of a defined setting line, enabling it. + # USAGE: enable_setting $setting_file $setting_name $system + case $3 in + + "retrodeck" ) + sed -i "s%^#$2=%$2=%" $1 + ;; + + "retroarch" ) + sed -i "s%^#$2 = %$2 = %" $1 + ;; + + "dolphin" ) + sed -i "s%^#$2 = %$2 = %" $1 + ;; + + "duckstation" ) + sed -i "s%^#$2 = %$2 = %" $1 + ;; + + "pcsx2" ) + sed -i "s%^#$2 = %$2 = %" $1 + ;; + + "ppsspp" ) + sed -i "s%^#$2 = %$2 = %" $1 + ;; + + "rpcs3" ) # This does not currently work for settings with a $ in them + sed -i "s%^#$2: %$2: %" $1 + ;; + + "yuzu" ) + yuzu_setting=$(sed -e 's%\\%\\\\%g' <<< "$2") # Acommodate backslashes in setting name + sed -i "s%^#$yuzu_setting=%$yuzu_setting=%" $1 + ;; + + "citra" ) + citra_setting=$(sed -e 's%\\%\\\\%g' <<< "$2") # Acommodate backslashes in setting name + sed -i "s%^#$citra_setting=%$citra_setting=%" $1 + ;; + + "melonds" ) + sed -i "s%^#$2=%$2=%" $1 + ;; + + "xemu" ) + sed -i "s%^#$2 = %$2 = %" $1 + ;; + +esac +} + +disable_file() { + # This function adds the suffix ".disabled" to the end of a file to prevent it from being used entirely. + # USAGE: disable_file $file_name + # NOTE: $filename can be a defined variable from global.sh or must have the full path to the file + + mv $(realpath $1) $(realpath $1).disabled +} + +enable_file() { + # This function removes the suffix ".disabled" to the end of a file to allow it to be used. + # USAGE: enable_file $file_name + # NOTE: $filename can be a defined variable from global.sh or must have the full path to the file and should not have ".disabled" as a suffix + + mv $(realpath $1.disabled) $(realpath $(echo $1 | sed -e 's/\.disabled//')) } conf_write() { diff --git a/global.sh b/global.sh index 9ea10aee..d0689825 100755 --- a/global.sh +++ b/global.sh @@ -11,6 +11,36 @@ lockfile="/var/config/retrodeck/.lock" # where the lockfile default_sd="/run/media/mmcblk0p1" # Steam Deck SD default path hard_version="$(cat '/app/retrodeck/version')" # hardcoded version (in the readonly filesystem) +# Config files for emulators with single config files + +citraconf="/var/config/citra-emu/qt-config.ini" +melondsconf="/var/config/melonDS/melonDS.ini" +rpcs3conf="/var/config/rpcs3/config.yml" +yuzuconf="/var/config/yuzu/qt-config.ini" + +# ES-DE config files + +es_settings="/var/config/emulationstation/.emulationstation/es_settings.xml" + +# RetroArch config files + +raconf="/var/config/retroarch/retroarch.cfg" +ra_core_conf="/var/config/retroarch/retroarch-core-options.cfg" + +# Dolphin config files + +dolphinconf="/var/config/dolphin-emu/Dolphin.ini" +dolphingcpadconf="/var/config/dolphin-emu/GCPadNew.ini" +dolphingfxconf="/var/config/dolphin-emu/GFX.ini" +dolphinhkconf="/var/config/dolphin-emu/Hotkeys.ini" +dolphinqtconf="/var/config/dolphin-emu/Qt.ini" + +# PCSX2 config files + +pcsx2conf="/var/config/PCSX2/inis/GS.ini" +pcsx2uiconf="/var/config/PCSX2/inis/PCSX2_ui.ini" +pcsx2vmconf="/var/config/PCSX2/inis/PCSX2_vm.ini" + # If there is no config file I initalize the file with the the default values if [ ! -f "$rd_conf" ] then diff --git a/tools/configurator.sh b/tools/configurator.sh index 0a6aab18..c9a455ab 100644 --- a/tools/configurator.sh +++ b/tools/configurator.sh @@ -8,36 +8,6 @@ source /app/libexec/global.sh # uncomment for flatpak testing source /app/libexec/functions.sh # uncomment for flatpak testing -# Config files for emulators with single config files - -citraconf="/var/config/citra-emu/qt-config.ini" -melondsconf="/var/config/melonDS/melonDS.ini" -rpcs3conf="/var/config/rpcs3/config.yml" -yuzuconf="/var/config/yuzu/qt-config.ini" - -# ES-DE config files - -es_settings="/var/config/emulationstation/.emulationstation/es_settings.xml" - -# RetroArch config files - -raconf="/var/config/retroarch/retroarch.cfg" -ra_core_conf="/var/config/retroarch/retroarch-core-options.cfg" - -# Dolphin config files - -dolphinconf="/var/config/dolphin-emu/Dolphin.ini" -dolphingcpadconf="/var/config/dolphin-emu/GCPadNew.ini" -dolphingfxconf="/var/config/dolphin-emu/GFX.ini" -dolphinhkconf="/var/config/dolphin-emu/Hotkeys.ini" -dolphinqtconf="/var/config/dolphin-emu/Qt.ini" - -# PCSX2 config files - -pcsx2conf="/var/config/PCSX2/inis/GS.ini" -pcsx2uiconf="/var/config/PCSX2/inis/PCSX2_ui.ini" -pcsx2vmconf="/var/config/PCSX2/inis/PCSX2_vm.ini" - # DIALOG SECTION # Configurator Option Tree @@ -47,6 +17,7 @@ pcsx2vmconf="/var/config/PCSX2/inis/PCSX2_vm.ini" # - Migrate ROM directory # - Migrate BIOS directory # - Migrate downloaded_media +# - Migrate everything # - Change Emulator Options # - RetroArch # - Change Rewind Setting @@ -79,170 +50,27 @@ pcsx2vmconf="/var/config/PCSX2/inis/PCSX2_vm.ini" # DIALOG TREE FUNCTIONS configurator_reset_dialog() { - choice=$(zenity --list --title="RetroDECK Configurator Utility - Reset Options" --cancel-label="Back" \ + choice=$(zenity --list --title="RetroDECK Configurator Utility - Reset Options" --cancel-label="Back" \ + --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --column="Choice" --column="Action" \ + "Reset RetroArch" "Reset RetroArch to default settings" \ + "Reset Specific Standalone" "Reset only one specific standalone emulator to default settings" \ + "Reset All Standalones" "Reset all standalone emulators to default settings" \ + "Reset Tools" "Reset Tools menu entries" \ + "Reset All" "Reset RetroDECK to default settings" ) + + case $choice in + + "Reset RetroArch" ) + debug_dialog "ra_init" + configurator_process_complete_dialog "resetting RetroArch" + ;; + + "Reset Specific Standalone" ) + emulator_to_reset=$(zenity --list \ + --title "RetroDECK Configurator Utility - Reset Specific Standalone Emulator" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ - --column="Choice" --column="Action" \ - "Reset RetroArch" "Reset RetroArch to default settings" \ - "Reset Specific Standalone" "Reset only one specific standalone emulator to default settings" \ - "Reset All Standalones" "Reset all standalone emulators to default settings" \ - "Reset Tools" "Reset Tools menu entries" \ - "Reset All" "Reset RetroDECK to default settings" ) - - case $choice in - - "Reset RetroArch" ) - debug_dialog "ra_init" - configurator_process_complete_dialog "resetting RetroArch" - ;; - - "Reset Specific Standalone" ) - emulator_to_reset=$(zenity --list \ - --title "RetroDECK Configurator Utility - Reset Specific Standalone Emulator" --cancel-label="Back" \ - --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ - --text="Which emulator do you want to reset to default?" \ - --hide-header \ - --column=emulator \ - "RetroArch" \ - "Citra" \ - "Dolphin" \ - "Duckstation" \ - "MelonDS" \ - "PCSX2" \ - "PPSSPP" \ - "RPCS3" \ - "XEMU" \ - "Yuzu") - - case $emulator_to_reset in - - "RetroArch" ) - debug_dialog "ra_init" - configurator_process_complete_dialog "resetting $emulator_to_reset" - ;; - - "Citra" ) - debug_dialog "citra_init" - configurator_process_complete_dialog "resetting $emulator_to_reset" - ;; - - "Dolphin" ) - debug_dialog "dolphin_init" - configurator_process_complete_dialog "resetting $emulator_to_reset" - ;; - - "Duckstation" ) - debug_dialog "duckstation_init" - configurator_process_complete_dialog "resetting $emulator_to_reset" - ;; - - "MelonDS" ) - debug_dialog "melonds_init" - configurator_process_complete_dialog "resetting $emulator_to_reset" - ;; - - "PCSX2" ) - debug_dialog "pcsx2_init" - configurator_process_complete_dialog "resetting $emulator_to_reset" - ;; - - "PPSSPP" ) - debug_dialog "ppssppsdl_init" - configurator_process_complete_dialog "resetting $emulator_to_reset" - ;; - - "RPCS3" ) - debug_dialog "rpcs3_init" - configurator_process_complete_dialog "resetting $emulator_to_reset" - ;; - - "XEMU" ) - debug_dialog "xemu_init" - configurator_process_complete_dialog "resetting $emulator_to_reset" - ;; - - "Yuzu" ) - debug_dialog "yuzu_init" - configurator_process_complete_dialog "resetting $emulator_to_reset" - ;; - - "" ) # No selection made or Back button clicked - configurator_reset_dialog - ;; - - esac - ;; - - "Reset All Standalones" ) - debug_dialog "standalones_init" - configurator_process_complete_dialog "resetting standalone emulators" - ;; - - "Reset Tools" ) - debug_dialog "tools_init" - configurator_process_complete_dialog "resetting the tools menu" - ;; - - "Reset All" ) - 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 RetroDECK" \ - --text="You are resetting RetroDECK to its default state.\n\nAfter the process is complete you will need to exit RetroDECK and run it again." - debug_dialog "rm -f "$lockfile"" - configurator_process_complete_dialog "resetting RetroDECK" - ;; - - "" ) # No selection made or Back button clicked - configurator_welcome_dialog - ;; - - esac -} - -configurator_retroachivement_dialog() { - login=$(zenity --forms --title="RetroDECK Configurator Utility - RetroAchievements Login" --cancel-label="Back" \ - --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ - --text="Enter your RetroAchievements Account details.\n\nBe aware that this tool cannot verify your login details.\nFor registration and more info visit\nhttps://retroachievements.org/\n" \ - --separator="=SEP=" \ - --add-entry="Username" \ - --add-password="Password") - - if [ $? == 1 ] # Cancel button clicked - then - configurator_welcome_dialog - fi - - arrIN=(${login//=SEP=/ }) - user=${arrIN[0]} - pass=${arrIN[1]} - - #set_setting_value $raconf cheevos_enable true retroarch - #set_setting_value $raconf cheevos_username $user retroarch - #set_setting_value $raconf cheevos_password $pass retroarch - - debug_dialog "set_setting_value $raconf cheevos_enable true retroarch\n\nset_setting_value $raconf cheevos_username $user retroarch\n\nset_setting_value $raconf cheevos_password $pass retroarch" - - configurator_process_complete_dialog "logging in to RetroAchievements" -} - -configurator_update_dialog() { - configurator_generic_dialog "This feature is not available yet" - configurator_welcome_dialog -} - -configurator_power_user_changes_dialog() { - zenity --title "RetroDECK Configurator Utility - Power User Options" --question --no-wrap --cancel-label="Back" \ - --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ - --text="Making manual changes to an emulators configuration may create serious issues,\nand some settings may be overwitten during RetroDECK updates.\n\nplease continue only if you know what you're doing.\n\nDo you want to continue?" - - if [ $? == 1 ] # Cancel button clicked - then - configurator_options_dialog - fi - - emulator=$(zenity --list \ - --title "RetroDECK Configurator Utility - Power User Options" --cancel-label="Back" \ - --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ - --text="Which emulator do you want to configure?" \ + --text="Which emulator do you want to reset to default?" \ --hide-header \ --column=emulator \ "RetroArch" \ @@ -250,378 +78,576 @@ configurator_power_user_changes_dialog() { "Dolphin" \ "Duckstation" \ "MelonDS" \ - "PCSX2-QT" \ - "PCSX2-Legacy" \ + "PCSX2" \ "PPSSPP" \ "RPCS3" \ "XEMU" \ "Yuzu") - case $emulator in + case $emulator_to_reset in "RetroArch" ) - retroarch - ;; + debug_dialog "ra_init" + configurator_process_complete_dialog "resetting $emulator_to_reset" + ;; "Citra" ) - citra-qt - ;; + debug_dialog "citra_init" + configurator_process_complete_dialog "resetting $emulator_to_reset" + ;; "Dolphin" ) - dolphin-emu - ;; + debug_dialog "dolphin_init" + configurator_process_complete_dialog "resetting $emulator_to_reset" + ;; "Duckstation" ) - duckstation-qt - ;; + debug_dialog "duckstation_init" + configurator_process_complete_dialog "resetting $emulator_to_reset" + ;; "MelonDS" ) - melonDS - ;; + debug_dialog "melonds_init" + configurator_process_complete_dialog "resetting $emulator_to_reset" + ;; - "PCSX2-QT" ) - pcsx2-qt - ;; - - "PCSX2-Legacy" ) - pcsx2 - ;; + "PCSX2" ) + debug_dialog "pcsx2_init" + configurator_process_complete_dialog "resetting $emulator_to_reset" + ;; "PPSSPP" ) - PPSSPPSDL - ;; + debug_dialog "ppssppsdl_init" + configurator_process_complete_dialog "resetting $emulator_to_reset" + ;; "RPCS3" ) - rpcs3 - ;; + debug_dialog "rpcs3_init" + configurator_process_complete_dialog "resetting $emulator_to_reset" + ;; "XEMU" ) - xemu - ;; + debug_dialog "xemu_init" + configurator_process_complete_dialog "resetting $emulator_to_reset" + ;; "Yuzu" ) - yuzu - ;; + debug_dialog "yuzu_init" + configurator_process_complete_dialog "resetting $emulator_to_reset" + ;; "" ) # No selection made or Back button clicked - configurator_options_dialog - ;; + configurator_reset_dialog + ;; esac + ;; + +"Reset All Standalones" ) + debug_dialog "standalones_init" + configurator_process_complete_dialog "resetting standalone emulators" +;; + +"Reset Tools" ) + debug_dialog "tools_init" + configurator_process_complete_dialog "resetting the tools menu" +;; + +"Reset All" ) + 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 RetroDECK" \ + --text="You are resetting RetroDECK to its default state.\n\nAfter the process is complete you will need to exit RetroDECK and run it again." + debug_dialog "rm -f "$lockfile"" + configurator_process_complete_dialog "resetting RetroDECK" +;; + +"" ) # No selection made or Back button clicked + configurator_welcome_dialog +;; + + esac +} + +configurator_retroachivement_dialog() { + login=$(zenity --forms --title="RetroDECK Configurator Utility - RetroAchievements Login" --cancel-label="Back" \ + --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --text="Enter your RetroAchievements Account details.\n\nBe aware that this tool cannot verify your login details.\nFor registration and more info visit\nhttps://retroachievements.org/\n" \ + --separator="=SEP=" \ + --add-entry="Username" \ + --add-password="Password") + + if [ $? == 1 ] # Cancel button clicked + then + configurator_welcome_dialog + fi + + arrIN=(${login//=SEP=/ }) + user=${arrIN[0]} + pass=${arrIN[1]} + + #set_setting_value $raconf cheevos_enable true retroarch + #set_setting_value $raconf cheevos_username $user retroarch + #set_setting_value $raconf cheevos_password $pass retroarch + + debug_dialog "set_setting_value $raconf cheevos_enable true retroarch\n\nset_setting_value $raconf cheevos_username $user retroarch\n\nset_setting_value $raconf cheevos_password $pass retroarch" + + configurator_process_complete_dialog "logging in to RetroAchievements" +} + +configurator_update_dialog() { + configurator_generic_dialog "This feature is not available yet" + configurator_welcome_dialog +} + +configurator_power_user_changes_dialog() { + zenity --title "RetroDECK Configurator Utility - Power User Options" --question --no-wrap --cancel-label="Back" \ + --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --text="Making manual changes to an emulators configuration may create serious issues,\nand some settings may be overwitten during RetroDECK updates.\n\nplease continue only if you know what you're doing.\n\nDo you want to continue?" + + if [ $? == 1 ] # Cancel button clicked + then + configurator_options_dialog + fi + + emulator=$(zenity --list \ + --title "RetroDECK Configurator Utility - Power User Options" --cancel-label="Back" \ + --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --text="Which emulator do you want to configure?" \ + --hide-header \ + --column=emulator \ + "RetroArch" \ + "Citra" \ + "Dolphin" \ + "Duckstation" \ + "MelonDS" \ + "PCSX2-QT" \ + "PCSX2-Legacy" \ + "PPSSPP" \ + "RPCS3" \ + "XEMU" \ + "Yuzu") + + case $emulator in + + "RetroArch" ) + retroarch + ;; + + "Citra" ) + citra-qt + ;; + + "Dolphin" ) + dolphin-emu + ;; + + "Duckstation" ) + duckstation-qt + ;; + + "MelonDS" ) + melonDS + ;; + + "PCSX2-QT" ) + pcsx2-qt + ;; + + "PCSX2-Legacy" ) + pcsx2 + ;; + + "PPSSPP" ) + PPSSPPSDL + ;; + + "RPCS3" ) + rpcs3 + ;; + + "XEMU" ) + xemu + ;; + + "Yuzu" ) + yuzu + ;; + + "" ) # No selection made or Back button clicked + configurator_options_dialog + ;; + + esac } configurator_retroarch_rewind_dialog() { - if [[ $(get_setting_value $raconf rewind_enable retroarch) == "true" ]]; then - zenity --question \ - --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ - --title "RetroDECK Configurator - Rewind" \ - --text="Rewind is currently enabled. Do you want to disable it?." + if [[ $(get_setting_value $raconf rewind_enable retroarch) == "true" ]]; then + zenity --question \ + --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --title "RetroDECK Configurator - Rewind" \ + --text="Rewind is currently enabled. Do you want to disable it?." - if [ $? == 0 ] - then - debug_dialog "set_setting_value $raconf rewind_enable true retroarch" - configurator_process_complete_dialog "enabling Rewind" - else - configurator_options_dialog - fi + if [ $? == 0 ] + then + debug_dialog "set_setting_value $raconf rewind_enable true retroarch" + configurator_process_complete_dialog "enabling Rewind" else - zenity --question \ - --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ - --title "RetroDECK Configurator - Rewind" \ - --text="Rewind is currently disabled, do you want to enable it?\n\nNOTE:\nThis may impact performance expecially on the latest systems." - - if [ $? == 0 ] - then - debug_dialog "set_setting_value $raconf rewind_enable false retroarch" - configurator_process_complete_dialog "disabling Rewind" - else - configurator_options_dialog - fi + configurator_options_dialog fi + else + zenity --question \ + --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --title "RetroDECK Configurator - Rewind" \ + --text="Rewind is currently disabled, do you want to enable it?\n\nNOTE:\nThis may impact performance expecially on the latest systems." + + if [ $? == 0 ] + then + debug_dialog "set_setting_value $raconf rewind_enable false retroarch" + configurator_process_complete_dialog "disabling Rewind" + else + configurator_options_dialog + fi + fi } configurator_retroarch_options_dialog() { - choice=$(zenity --list --title="RetroDECK Configurator Utility - RetroArch Options" --cancel-label="Back" \ - --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ - --column="Choice" --column="Action" \ - "Change Rewind Setting" "Enable or disable the Rewind function in RetroArch" ) + choice=$(zenity --list --title="RetroDECK Configurator Utility - RetroArch Options" --cancel-label="Back" \ + --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --column="Choice" --column="Action" \ + "Change Rewind Setting" "Enable or disable the Rewind function in RetroArch" ) - case $choice in + case $choice in - "Change Rewind Setting" ) - configurator_retroarch_rewind_dialog - ;; + "Change Rewind Setting" ) + configurator_retroarch_rewind_dialog + ;; - "" ) # No selection made or Back button clicked - configurator_options_dialog - ;; + "" ) # No selection made or Back button clicked + configurator_options_dialog + ;; - esac + esac } configurator_options_dialog() { - choice=$(zenity --list --title="RetroDECK Configurator Utility - Change Options" --cancel-label="Back" \ - --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ - --column="Choice" --column="Action" \ - "Change RetroArch Settings" "Change settings specific to RetroArch" \ - "Power User Changes" "Make changes directly in an emulator" ) + choice=$(zenity --list --title="RetroDECK Configurator Utility - Change Options" --cancel-label="Back" \ + --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --column="Choice" --column="Action" \ + "Change RetroArch Settings" "Change settings specific to RetroArch" \ + "Power User Changes" "Make changes directly in an emulator" ) - case $choice in + case $choice in - "Change RetroArch Settings" ) - configurator_retroarch_options_dialog - ;; + "Change RetroArch Settings" ) + configurator_retroarch_options_dialog + ;; - "Power User Changes" ) - configurator_power_user_changes_dialog - ;; + "Power User Changes" ) + configurator_power_user_changes_dialog + ;; - "" ) # No selection made or Back button clicked - configurator_welcome_dialog - ;; + "" ) # No selection made or Back button clicked + configurator_welcome_dialog + ;; - esac + esac } configurator_move_dialog() { - choice=$(zenity --list --title="RetroDECK Configurator Utility - Move Directories" --cancel-label="Back" \ - --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ - --column="Choice" --column="Action" \ - "Move ROMs" "Move your ROMs directory to a new location" \ - "Move BIOS" "Move your BIOS directory to a new location" \ - "Move Downloaded Media" "Move your downloaded media directory to a new location" \ - "Move Everything" "Move the entire RetroDECK user directory to a new location" ) + choice=$(zenity --list --title="RetroDECK Configurator Utility - Move Directories" --cancel-label="Back" \ + --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --column="Choice" --column="Action" \ + "Move ROMs" "Move your ROMs directory to a new location" \ + "Move BIOS" "Move your BIOS directory to a new location" \ + "Move Downloaded Media" "Move your downloaded media directory to a new location" \ + "Move Everything" "Move the entire RetroDECK user directory to a new location" ) - case $choice in + case $choice in - "Move ROMs" ) - if [[ -d $roms_folder ]]; then - configurator_generic_dialog "The current ROMs folder was found at $roms_folder.\n\nPlease select the location you would like to move it." - destination=$(configurator_destination_choice_dialog "ROMs" "Please choose a destination for the ROMs folder.") - case $destination in - "Back" ) - configurator_move_dialog - ;; - "Internal Storage" ) - if [[ $roms_folder == "$rdhome/roms" ]]; then - configurator_generic_dialog "The ROMs folder is already at that location, please pick a new one." - configurator_move_dialog - else - configurator_generic_dialog "Moving ROMs folder to $destination" - move $roms_folder "$rdhome/roms" - roms_folder="$rdhome/roms" - debug_dialog "dir_prep $roms_folder "/var/config/emulationstation/ROMs"" - debug_dialog "conf_write" - configurator_process_complete_dialog "moving the ROMs directory to internal storage" - fi - ;; - "SD Card" ) - if [[ $roms_folder == "$sdcard/retrodeck/roms" ]]; then - configurator_generic_dialog "The ROMs folder is already at that location, please pick a new one." - configurator_move_dialog - else - configurator_generic_dialog "Moving ROMs folder to $destination" - move $roms_folder "$sdcard/retrodeck/roms" - roms_folder="$sdcard/retrodeck/roms" - debug_dialog "dir_prep $roms_folder "/var/config/emulationstation/ROMs"" - debug_dialog "conf_write" - configurator_process_complete_dialog "moving the ROMs directory to SD card" - fi - ;; - "Custom Location" ) - configurator_generic_dialog "Please select the custom location to move the ROMs folder to." - destination=$(browse "ROMs directory destination") - if [[ $destination == $roms_folder ]]; then - configurator_generic_dialog "The ROMs folder is already at that location, please pick a new one." - configurator_move_dialog - else - configurator_generic_dialog "Moving ROMs folder from $roms_folder\n\nto $destination.\n\nClick OK to continue." - move $roms_folder $destination - roms_folder=$destination - debug_dialog "dir_prep $roms_folder "/var/config/emulationstation/ROMs"" - debug_dialog "conf_write" - configurator_process_complete_dialog "moving the ROMs directory to $destination" - fi - ;; - esac + "Move ROMs" ) + if [[ -d $roms_folder ]]; then + configurator_generic_dialog "The current ROMs folder was found at $roms_folder.\n\nPlease select the location you would like to move it." + destination=$(configurator_destination_choice_dialog "ROMs" "Please choose a destination for the ROMs folder.") + case $destination in + "Back" ) + configurator_move_dialog + ;; + "Internal Storage" ) + if [[ $roms_folder == "$rdhome/roms" ]]; then + configurator_generic_dialog "The ROMs folder is already at that location, please pick a new one." + configurator_move_dialog else - configurator_generic_dialog "The ROMs folder was not found at the configured location.\n\nThis may have happened if the folder was moved manually.\n\nPlease select the current location of the ROMs folder." - roms_folder=$(browse "ROMs directory location") - conf_write - configurator_generic_dialog "ROMs folder now configured at $roms_folder. Please start the moving process again." - configurator_move_dialog + configurator_generic_dialog "Moving ROMs folder to $destination" + debug_dialog "move $roms_folder "$rdhome/roms"" + roms_folder="$rdhome/roms" + debug_dialog "dir_prep $roms_folder "/var/config/emulationstation/ROMs"" + debug_dialog "conf_write" + configurator_process_complete_dialog "moving the ROMs directory to internal storage" fi - ;; - - "Move BIOS" ) - if [[ -d $bios_folder ]]; then - configurator_generic_dialog "The current BIOS folder was found at $bios_folder.\n\nPlease select the location you would like to move it." - destination=$(configurator_destination_choice_dialog "BIOS" "Please choose a destination for the BIOS folder.") - case $destination in - "Back" ) - configurator_move_dialog - ;; - "Internal Storage" ) - if [[ $bios_folder == "$rdhome/bios" ]]; then - configurator_generic_dialog "The BIOS folder is already at that location, please pick a new one." - configurator_move_dialog - else - configurator_generic_dialog "Moving BIOS folder to $destination" - move $bios_folder "$rdhome/bios" - bios_folder="$rdhome/bios" - debug_dialog "dir_prep $bios_folder "$rdhome/bios"" - debug_dialog "conf_write" - configurator_process_complete_dialog "moving the BIOS directory to internal storage" - fi - ;; - "SD Card" ) - if [[ $bios_folder == "$sdcard/retrodeck/bios" ]]; then - configurator_generic_dialog "The BIOS folder is already at that location, please pick a new one." - configurator_move_dialog - else - configurator_generic_dialog "Moving BIOS folder to $destination" - move $bios_folder "$sdcard/retrodeck/bios" - bios_folder="$sdcard/retrodeck/bios" - debug_dialog "dir_prep $bios_folder "$rdhome/bios"" - debug_dialog "conf_write" - configurator_process_complete_dialog "moving the BIOS directory to SD card" - fi - ;; - "Custom Location" ) - configurator_generic_dialog "Please select the custom location to move the BIOS folder to." - destination=$(browse "BIOS directory destination") - if [[ $destination == $bios_folder ]]; then - configurator_generic_dialog "The BIOS folder is already at that location, please pick a new one." - configurator_move_dialog - else - configurator_generic_dialog "Moving BIOS folder from $bios_folder\n\nto $destination.\n\nClick OK to continue." - move $bios_folder $destination - bios_folder=$destination - debug_dialog "dir_prep $bios_folder "$rdhome/bios"" - debug_dialog "conf_write" - configurator_process_complete_dialog "moving the BIOS directory to $destination" - fi - ;; - esac + ;; + "SD Card" ) + if [[ $roms_folder == "$sdcard/retrodeck/roms" ]]; then + configurator_generic_dialog "The ROMs folder is already at that location, please pick a new one." + configurator_move_dialog else - configurator_generic_dialog "The BIOS folder was not found at the configured location.\n\nThis may have happened if the folder was moved manually.\n\nPlease select the current location of the BIOS folder." - bios_folder=$(browse "BIOS directory location") - conf_write - configurator_generic_dialog "BIOS folder now configured at $bios_folder. Please start the moving process again." - configurator_move_dialog + configurator_generic_dialog "Moving ROMs folder to $destination" + debug_dialog "move $roms_folder "$sdcard/retrodeck/roms"" + debug_dialog "ln -svf $roms_folder $rdhome/roms" # Link back to "default" location for standalone compatibilty + roms_folder="$sdcard/retrodeck/roms" + debug_dialog "dir_prep $roms_folder "/var/config/emulationstation/ROMs"" + debug_dialog "conf_write" + configurator_process_complete_dialog "moving the ROMs directory to SD card" fi - ;; - - "Move Downloaded Media" ) - if [[ -d $media_folder ]]; then - configurator_generic_dialog "The current media folder was found at $media_folder.\n\nPlease select the location you would like to move it." - destination=$(configurator_destination_choice_dialog "Media" "Please choose a destination for the Media folder.") - case $destination in - "Back" ) - configurator_move_dialog - ;; - "Internal Storage" ) - if [[ $media_folder == "$rdhome/downloaded_media" ]]; then - configurator_generic_dialog "The media folder is already at that location, please pick a new one." - configurator_move_dialog - else - configurator_generic_dialog "Moving media folder to $destination" - move $media_folder "$rdhome/downloaded_media" - media_folder="$rdhome/downloaded_media" - debug_dialog "dir_prep $media_folder "$rdhome/downloaded_media"" - debug_dialog "conf_write" - configurator_process_complete_dialog "moving the media directory to internal storage" - fi - ;; - "SD Card" ) - if [[ $media_folder == "$sdcard/retrodeck/downloaded_media" ]]; then - configurator_generic_dialog "The media folder is already at that location, please pick a new one." - configurator_move_dialog - else - configurator_generic_dialog "Moving media folder to $destination" - move $media_folder "$sdcard/retrodeck/downloaded_media" - media_folder="$sdcard/retrodeck/downloaded_media" - debug_dialog "dir_prep $media_folder "$rdhome/downloaded_media"" - debug_dialog "conf_write" - configurator_process_complete_dialog "moving the media directory to SD card" - fi - ;; - "Custom Location" ) - configurator_generic_dialog "Please select the custom location to move the media folder to." - destination=$(browse "Media directory destination") - if [[ $destination == $media_folder ]]; then - configurator_generic_dialog "The media folder is already at that location, please pick a new one." - configurator_move_dialog - else - configurator_generic_dialog "Moving media folder from $media_folder\n\nto $destination.\n\nClick OK to continue." - move $media_folder $destination - media_folder=$destination - debug_dialog "dir_prep $media_folder "$rdhome/downloaded_media"" - debug_dialog "conf_write" - configurator_process_complete_dialog "moving the media directory to $destination" - fi - ;; - esac + ;; + "Custom Location" ) + configurator_generic_dialog "Please select the custom location to move the ROMs folder to." + destination=$(browse "ROMs directory destination") + if [[ $destination == $roms_folder ]]; then + configurator_generic_dialog "The ROMs folder is already at that location, please pick a new one." + configurator_move_dialog else - configurator_generic_dialog "The media folder was not found at the configured location.\n\nThis may have happened if the folder was moved manually.\n\nPlease select the current location of the media folder." - media_folder=$(browse "Media directory location") - conf_write - configurator_generic_dialog "Media folder now configured at $media_folder. Please start the moving process again." - configurator_move_dialog + configurator_generic_dialog "Moving ROMs folder from $roms_folder\n\nto $destination.\n\nClick OK to continue." + debug_dialog "move $roms_folder $destination" + debug_dialog "ln -svf $roms_folder $rdhome/roms" # Link back to "default" location for standalone compatibilty + roms_folder=$destination + debug_dialog "dir_prep $roms_folder "/var/config/emulationstation/ROMs"" + debug_dialog "conf_write" + configurator_process_complete_dialog "moving the ROMs directory to $destination" fi - ;; + ;; + esac + else + configurator_generic_dialog "The ROMs folder was not found at the configured location.\n\nThis may have happened if the folder was moved manually.\n\nPlease select the current location of the ROMs folder." + roms_folder=$(browse "ROMs directory location") + conf_write + configurator_generic_dialog "ROMs folder now configured at $roms_folder. Please start the moving process again." + configurator_move_dialog + fi + ;; - "" ) # No selection made or Back button clicked - configurator_welcome_dialog - ;; + "Move BIOS" ) + if [[ -d $bios_folder ]]; then + configurator_generic_dialog "The current BIOS folder was found at $bios_folder.\n\nPlease select the location you would like to move it." + destination=$(configurator_destination_choice_dialog "BIOS" "Please choose a destination for the BIOS folder.") + case $destination in + "Back" ) + configurator_move_dialog + ;; + "Internal Storage" ) + if [[ $bios_folder == "$rdhome/bios" ]]; then + configurator_generic_dialog "The BIOS folder is already at that location, please pick a new one." + configurator_move_dialog + else + configurator_generic_dialog "Moving BIOS folder to $destination" + move $bios_folder "$rdhome/bios" + bios_folder="$rdhome/bios" + debug_dialog "dir_prep $bios_folder "$rdhome/bios"" + debug_dialog "conf_write" + configurator_process_complete_dialog "moving the BIOS directory to internal storage" + fi + ;; + "SD Card" ) + if [[ $bios_folder == "$sdcard/retrodeck/bios" ]]; then + configurator_generic_dialog "The BIOS folder is already at that location, please pick a new one." + configurator_move_dialog + else + configurator_generic_dialog "Moving BIOS folder to $destination" + move $bios_folder "$sdcard/retrodeck/bios" + bios_folder="$sdcard/retrodeck/bios" + debug_dialog "dir_prep $bios_folder "$rdhome/bios"" + debug_dialog "conf_write" + configurator_process_complete_dialog "moving the BIOS directory to SD card" + fi + ;; + "Custom Location" ) + configurator_generic_dialog "Please select the custom location to move the BIOS folder to." + destination=$(browse "BIOS directory destination") + if [[ $destination == $bios_folder ]]; then + configurator_generic_dialog "The BIOS folder is already at that location, please pick a new one." + configurator_move_dialog + else + configurator_generic_dialog "Moving BIOS folder from $bios_folder\n\nto $destination.\n\nClick OK to continue." + move $bios_folder $destination + bios_folder=$destination + debug_dialog "dir_prep $bios_folder "$rdhome/bios"" + debug_dialog "conf_write" + configurator_process_complete_dialog "moving the BIOS directory to $destination" + fi + ;; + esac + else + configurator_generic_dialog "The BIOS folder was not found at the configured location.\n\nThis may have happened if the folder was moved manually.\n\nPlease select the current location of the BIOS folder." + bios_folder=$(browse "BIOS directory location") + conf_write + configurator_generic_dialog "BIOS folder now configured at $bios_folder. Please start the moving process again." + configurator_move_dialog + fi + ;; - esac + "Move Downloaded Media" ) + if [[ -d $media_folder ]]; then + configurator_generic_dialog "The current media folder was found at $media_folder.\n\nPlease select the location you would like to move it." + destination=$(configurator_destination_choice_dialog "Media" "Please choose a destination for the Media folder.") + case $destination in + "Back" ) + configurator_move_dialog + ;; + "Internal Storage" ) + if [[ $media_folder == "$rdhome/downloaded_media" ]]; then + configurator_generic_dialog "The media folder is already at that location, please pick a new one." + configurator_move_dialog + else + configurator_generic_dialog "Moving media folder to $destination" + debug_dialog "move $media_folder "$rdhome/downloaded_media"" + media_folder="$rdhome/downloaded_media" + debug_dialog "dir_prep $media_folder "/var/config/emulationstation/.emulationstation/downloaded_media"" + debug_dialog "conf_write" + configurator_process_complete_dialog "moving the media directory to internal storage" + fi + ;; + "SD Card" ) + if [[ $media_folder == "$sdcard/retrodeck/downloaded_media" ]]; then + configurator_generic_dialog "The media folder is already at that location, please pick a new one." + configurator_move_dialog + else + configurator_generic_dialog "Moving media folder to $destination" + debug_dialog "move $media_folder "$sdcard/retrodeck/downloaded_media"" + media_folder="$sdcard/retrodeck/downloaded_media" + debug_dialog "dir_prep $media_folder "/var/config/emulationstation/.emulationstation/downloaded_media"" + debug_dialog "conf_write" + configurator_process_complete_dialog "moving the media directory to SD card" + fi + ;; + "Custom Location" ) + configurator_generic_dialog "Please select the custom location to move the media folder to." + destination=$(browse "Media directory destination") + if [[ $destination == $media_folder ]]; then + configurator_generic_dialog "The media folder is already at that location, please pick a new one." + configurator_move_dialog + else + configurator_generic_dialog "Moving media folder from $media_folder\n\nto $destination.\n\nClick OK to continue." + debug_dialog "move $media_folder $destination" + media_folder=$destination + debug_dialog "dir_prep $media_folder "/var/config/emulationstation/.emulationstation/downloaded_media"" + debug_dialog "conf_write" + configurator_process_complete_dialog "moving the media directory to $destination" + fi + ;; + esac + else + configurator_generic_dialog "The media folder was not found at the configured location.\n\nThis may have happened if the folder was moved manually.\n\nPlease select the current location of the media folder." + media_folder=$(browse "Media directory location") + conf_write + configurator_generic_dialog "Media folder now configured at $media_folder. Please start the moving process again." + configurator_move_dialog + fi + ;; + + "Move Everything" ) + if [[ -d $rdhome ]]; then + configurator_generic_dialog "This option will move the RetroDECK data folder (ROMs, saves, BIOS etc.) to a new location.\n\nPlease choose where to move the RetroDECK data folder." + destination=$(configurator_destination_choice_dialog "RetroDECK Data" "Please choose a destination for the RetroDECK data folder.") + case $destination in + "Back" ) + configurator_move_dialog + ;; + "Internal Storage" ) + if [[ ! -L /home/deck/retrodeck && -d /home/deck/retrodeck ]]; then + configurator_generic_dialog "The RetroDECK data folder is already at that location, please pick a new one." + configurator_move_dialog + else + configurator_generic_dialog "Moving RetroDECK data folder to $destination" + debug_dialog "unlink /home/deck/retrodeck" # Remove symlink for $rdhome + debug_dialog "move $sdcard/retrodeck "/home/deck/"" + debug_dialog "roms_folder="$rdhome/roms"" + debug_dialog "dir_prep $roms_folder "/var/config/emulationstation/ROMs"" + debug_dialog "conf_write" + configurator_process_complete_dialog "moving the RetroDECK data directory to internal storage" + fi + ;; + "SD Card" ) + if [[ -L $rdhome && -d $sdcard/retrodeck ]]; then + configurator_generic_dialog "The RetroDECK data folder is already at that location, please pick a new one." + configurator_move_dialog + else + if [[ ! -w $sdcard ]]; then + configurator_generic_dialog "The SD card was found but is not writable\nThis can happen with cards formatted on PC or for other reasons.\nPlease format the SD card through the Steam Deck's Game Mode and try the moving process again." + configurator_welcome_dialog + else + configurator_generic_dialog "Moving RetroDECK data folder to $destination" + if [[ -L $rdhome/roms ]]; then # Check for ROMs symlink user may have created + debug dialog "unlink $rdhome/roms" + fi + debug_dialog "dir_prep "$sdcard/retrodeck" $rdhome" + debug_dialog "roms_folder="$sdcard/retrodeck/roms"" + debug_dialog "dir_prep $roms_folder "/var/config/emulationstation/ROMs"" + debug_dialog "conf_write" + configurator_process_complete_dialog "moving the RetroDECK data directory to SD card" + fi + fi + ;; + esac + else + configurator_generic_dialog "The RetroDECK data folder was not found at the expected location.\n\nThis may have happened if the folder was moved manually.\n\nPlease select the current location of the RetroDECK data folder." + debug_dialog "rdhome=$(browse "RetroDECK directory location")" + debug_dialog "conf_write" + configurator_generic_dialog "RetroDECK data folder now configured at $rdhome. Please start the moving process again." + configurator_move_dialog + fi + ;; + + "" ) # No selection made or Back button clicked + configurator_welcome_dialog + ;; + + esac } configurator_welcome_dialog() { - # Clear the variables - source= - destination= - action= - setting= - setting_value= + # Clear the variables + source= + destination= + action= + setting= + setting_value= - choice=$(zenity --list --title="RetroDECK Configurator Utility" --cancel-label="Quit" \ - --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ - --column="Choice" --column="Action" \ - "Move Files" "Move files between internal/SD card or to custom locations" \ - "Change Options" "Adjust how RetroDECK behaves" \ - "Update" "Update parts of RetroDECK" \ - "RetroAchivements" "Log in to RetroAchievements" \ - "Reset" "Reset parts of RetroDECK" ) + choice=$(zenity --list --title="RetroDECK Configurator Utility" --cancel-label="Quit" \ + --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --column="Choice" --column="Action" \ + "Move Files" "Move files between internal/SD card or to custom locations" \ + "Change Options" "Adjust how RetroDECK behaves" \ + "Update" "Update parts of RetroDECK" \ + "RetroAchivements" "Log in to RetroAchievements" \ + "Reset" "Reset parts of RetroDECK" ) - case $choice in + case $choice in - "Move Files" ) - configurator_move_dialog - ;; + "Move Files" ) + configurator_move_dialog + ;; - "Change Options" ) - configurator_options_dialog - ;; + "Change Options" ) + configurator_options_dialog + ;; - "Update" ) - configurator_update_dialog - ;; + "Update" ) + configurator_update_dialog + ;; - "RetroAchivements" ) - configurator_retroachivement_dialog - ;; + "RetroAchivements" ) + configurator_retroachivement_dialog + ;; - "Reset" ) - configurator_reset_dialog - ;; + "Reset" ) + configurator_reset_dialog + ;; - "Quit" ) - exit 0 - ;; + "Quit" ) + exit 0 + ;; - esac + esac } # START THE CONFIGURATOR