2022-10-04 16:21:46 +00:00
#!/bin/bash
2022-10-07 17:46:48 +00:00
# VARIABLES SECTION
2023-03-08 18:35:24 +00:00
source /app/libexec/global.sh
2022-10-07 17:46:48 +00:00
# DIALOG SECTION
2022-10-04 16:21:46 +00:00
# Configurator Option Tree
# Welcome
2023-05-10 16:26:40 +00:00
# - Presets & Settings
# - Global: Presets & Settings
2023-05-22 16:07:37 +00:00
# - Widescreen: Enable/Disable
# - Ask-To-Exit: Enable/Disable
2024-02-27 17:33:31 +00:00
# - Quick Resume: Enable/Disable
2023-05-22 16:07:37 +00:00
# - RetroAchievements: Login
# - RetroAchievements: Logout
# - RetroAchievements: Hardcore Mode
2024-02-27 17:34:39 +00:00
# - Rewind: Enable/Disable
# - Swap A/B and X/Y Buttons: Enable/Disable
2023-05-10 16:26:40 +00:00
# - RetroArch: Presets & Settings
2023-05-22 16:07:37 +00:00
# - Borders: Enable/Disable
2023-05-10 16:26:40 +00:00
# - Wii & GameCube: Presets & Settings
# - Dolphin Textures: Universal Dynamic Input
# - Primehack Textures: Universal Dynamic Input
# - Open Emulator (Behind one-time power user warning dialog)
# - RetroArch
# - Cemu
2024-03-08 17:21:43 +00:00
# - Citra
2023-05-10 16:26:40 +00:00
# - Dolphin
# - Duckstation
2023-10-13 08:21:24 +00:00
# - MAME
2023-05-10 16:26:40 +00:00
# - MelonDS
# - PCSX2
# - PPSSPP
# - Primehack
# - RPCS3
2023-09-27 13:13:50 +00:00
# - Ryujinx
2023-10-09 07:54:44 +00:00
# - Vita3K
2023-05-10 16:26:40 +00:00
# - XEMU
2024-03-08 17:21:43 +00:00
# - Yuzu
2023-05-22 16:07:37 +00:00
# - Tools
# - Tool: Move Folders
2023-05-10 16:26:40 +00:00
# - Move all of RetroDECK
# - Move ROMs folder
# - Move BIOS folder
# - Move Downloaded Media folder
# - Move Saves folder
# - Move States folder
# - Move Themes folder
# - Move Screenshots folder
# - Move Mods folder
# - Move Texture Packs folder
2023-05-22 16:07:37 +00:00
# - Tool: Compress Games
2023-05-10 16:26:40 +00:00
# - Compress Single Game
# - Compress Multiple Games - CHD
# - Compress Multiple Games - ZIP
# - Compress Multiple Games - RVZ
# - Compress Multiple Games - All Formats
# - Compress All Games
2024-03-18 12:47:14 +00:00
# - Install: RetroDECK Controller Layouts
2023-05-10 16:26:40 +00:00
# - Install: PS3 firmware
2024-02-23 18:14:39 +00:00
# - Install: PS Vita firmware
2023-06-02 13:52:29 +00:00
# - RetroDECK: Change Update Setting
2023-05-22 16:07:37 +00:00
# - Troubleshooting
2023-05-10 16:26:40 +00:00
# - Backup: RetroDECK Userdata
# - Check & Verify: BIOS
2024-02-27 21:31:25 +00:00
# - Check & Verify: BIOS - Expert Mode
2023-05-10 16:26:40 +00:00
# - Check & Verify: Multi-file structure
# - RetroDECK: Reset
2024-03-13 07:54:54 +00:00
# - Reset Emulator or Engine
2023-03-08 18:35:24 +00:00
# - Reset RetroArch
2023-04-11 12:12:04 +00:00
# - Reset Cemu
2024-03-08 17:21:43 +00:00
# - Reset Citra
2022-10-12 20:06:17 +00:00
# - Reset Dolphin
2022-12-31 16:37:12 +00:00
# - Reset Duckstation
2023-11-23 15:11:55 +00:00
# - Reset GZDoom
2024-02-16 18:10:34 +00:00
# - Reset MAME
2022-10-12 20:06:17 +00:00
# - Reset MelonDS
2022-12-31 16:37:12 +00:00
# - Reset PCSX2
# - Reset PPSSPP
# - Reset Primehack
2022-10-12 20:06:17 +00:00
# - Reset RPCS3
2023-09-27 13:13:50 +00:00
# - Reset Ryujinx
2023-12-11 15:30:35 +00:00
# - Reset Vita3k
2022-10-12 20:06:17 +00:00
# - Reset XEMU
2024-03-08 17:21:43 +00:00
# - Reset Yuzu
2023-05-10 16:26:40 +00:00
# - Reset All Emulators
2023-12-01 14:33:17 +00:00
# - Reset EmulationStation DE
2023-05-10 16:26:40 +00:00
# - Reset RetroDECK
2023-05-11 14:17:55 +00:00
# - RetroDECK: About
2023-05-10 16:26:40 +00:00
# - RetroDECK Version History
2023-05-08 18:24:41 +00:00
# - Full changelog
# - Version-specific changelogs
2023-05-10 16:26:40 +00:00
# - RetroDECK Credits
2023-09-28 13:29:33 +00:00
# - Add to Steam
2023-05-08 18:24:41 +00:00
# - Developer Options (Hidden)
# - Change Multi-user mode
# - Change Update channel
# - Browse the wiki
2023-05-18 14:23:05 +00:00
# - USB Import tool
# - Install: RetroDECK Starter Pack
2022-10-04 16:21:46 +00:00
2022-10-12 20:06:17 +00:00
# DIALOG TREE FUNCTIONS
2022-10-04 16:21:46 +00:00
2023-05-10 16:26:40 +00:00
configurator_welcome_dialog( ) {
2024-01-05 10:00:00 +00:00
log i "Configurator: opening welcome dialog"
2023-05-10 16:26:40 +00:00
if [ [ $developer_options = = "true" ] ] ; then
2024-03-12 19:01:47 +00:00
welcome_menu_options = ( "Presets & Settings" "Here you will find various presets, tweaks and settings to customize your RetroDECK experience" \
"Open Emulator" "Launch and configure each emulator's settings (for advanced users)" \
2023-05-11 14:17:55 +00:00
"RetroDECK: Tools" "Compress games, move RetroDECK and install optional features" \
2024-03-12 19:01:47 +00:00
"RetroDECK: Troubleshooting" "Backup data, perform BIOS / multi-disc file checks and emulator resets" \
2023-05-11 14:17:55 +00:00
"RetroDECK: About" "Show additional information about RetroDECK" \
2024-03-12 19:01:47 +00:00
"Sync with Steam" "Sync all favorited games with Steam" \
2023-05-10 16:26:40 +00:00
"Developer Options" "Welcome to the DANGER ZONE" )
2022-11-22 03:07:53 +00:00
else
2023-05-10 16:26:40 +00:00
welcome_menu_options = ( "Presets & Settings" "Here you find various presets, tweaks and settings to customize your RetroDECK experience" \
"Open Emulator" "Launch and configure each emulators settings (for advanced users)" \
2023-05-11 14:17:55 +00:00
"RetroDECK: Tools" "Compress games, move RetroDECK and install optional features" \
"RetroDECK: Troubleshooting" "Backup data, perform BIOS / multi-disc file checks checks and emulator resets" \
2024-03-29 07:35:09 +00:00
"RetroDECK: About" "Show additional information about RetroDECK" )
2023-03-13 14:09:01 +00:00
fi
2023-03-08 18:35:24 +00:00
2023-05-10 16:26:40 +00:00
choice = $( zenity --list --title= "RetroDECK Configurator Utility" --cancel-label= "Quit" \
2023-03-13 14:09:01 +00:00
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
2023-05-10 16:26:40 +00:00
--column= "Choice" --column= "Action" \
" ${ welcome_menu_options [@] } " )
2023-03-13 14:09:01 +00:00
2023-05-10 16:26:40 +00:00
case $choice in
2023-03-13 14:09:01 +00:00
2023-05-10 16:26:40 +00:00
"Presets & Settings" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_presets_and_settings_dialog
2023-03-13 14:09:01 +00:00
; ;
2022-10-26 16:51:46 +00:00
2023-05-10 16:26:40 +00:00
"Open Emulator" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_power_user_warning_dialog
2023-04-11 12:12:04 +00:00
; ;
2023-05-11 14:17:55 +00:00
"RetroDECK: Tools" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_retrodeck_tools_dialog
2023-03-13 14:09:01 +00:00
; ;
2022-10-26 16:51:46 +00:00
2023-05-11 14:17:55 +00:00
"RetroDECK: Troubleshooting" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_retrodeck_troubleshooting_dialog
2023-03-13 14:09:01 +00:00
; ;
2022-10-26 16:51:46 +00:00
2023-05-11 14:17:55 +00:00
"RetroDECK: About" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_about_retrodeck_dialog
2023-03-13 14:09:01 +00:00
; ;
2022-10-26 16:51:46 +00:00
2023-10-09 20:24:41 +00:00
"Sync with Steam" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-09-28 13:29:33 +00:00
configurator_add_steam
; ;
2023-05-10 16:26:40 +00:00
"Developer Options" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_generic_dialog "RetroDECK Configurator - Developer Options" "The following features and options are potentially VERY DANGEROUS for your RetroDECK install!\n\nThey should be considered the bleeding-edge of upcoming RetroDECK features, and never used when you have important saves/states/roms that are not backed up!\n\nYOU HAVE BEEN WARNED!"
configurator_developer_dialog
2023-03-13 14:09:01 +00:00
; ;
2022-10-26 16:51:46 +00:00
2023-05-11 14:17:55 +00:00
"" )
2024-01-05 10:00:00 +00:00
log i "Configurator: closing"
2023-05-11 14:17:55 +00:00
exit 1
; ;
2023-05-10 16:26:40 +00:00
esac
}
2022-10-26 16:51:46 +00:00
2023-05-10 16:26:40 +00:00
configurator_presets_and_settings_dialog( ) {
choice = $( zenity --list --title= "RetroDECK Configurator Utility - Presets & Settings" --cancel-label= "Back" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--column= "Choice" --column= "Action" \
"Global: Presets & Settings" "Here you find presets and settings that that span over multiple emulators" \
"RetroArch: Presets & Settings" "Here you find presets and settings for RetroArch and its cores" \
"Wii & GameCube: Presets & Settings" "Here you find presets and settings for Dolphin and Primehack" )
2022-10-26 16:51:46 +00:00
2023-05-10 16:26:40 +00:00
case $choice in
2022-12-31 16:37:12 +00:00
2023-05-10 16:26:40 +00:00
"Global: Presets & Settings" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_global_presets_and_settings_dialog
2023-03-13 14:09:01 +00:00
; ;
2022-10-26 16:51:46 +00:00
2023-05-10 16:26:40 +00:00
"RetroArch: Presets & Settings" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_retroarch_presets_and_settings_dialog
2023-03-13 14:09:01 +00:00
; ;
2022-10-26 16:51:46 +00:00
2023-05-10 16:26:40 +00:00
"Wii & GameCube: Presets & Settings" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_wii_and_gamecube_presets_and_settings_dialog
2023-03-13 14:09:01 +00:00
; ;
2022-10-26 16:51:46 +00:00
2023-03-13 14:09:01 +00:00
"" ) # No selection made or Back button clicked
2024-01-05 10:00:00 +00:00
log i "Configurator: going back"
2023-03-13 14:09:01 +00:00
configurator_welcome_dialog
; ;
2022-11-22 03:07:53 +00:00
2023-03-13 14:09:01 +00:00
esac
2022-10-04 16:21:46 +00:00
}
2023-05-10 16:26:40 +00:00
configurator_global_presets_and_settings_dialog( ) {
choice = $( zenity --list --title= "RetroDECK Configurator Utility - Global: Presets & Settings" --cancel-label= "Back" \
2023-05-08 18:24:41 +00:00
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--column= "Choice" --column= "Action" \
2023-05-22 16:15:46 +00:00
"Widescreen: Enable/Disable" "Enable or disable widescreen in supported systems" \
2024-03-12 19:01:47 +00:00
"Ask-to-Exit: Enable/Disable" "Enable or disable emulators confirming attempts to quit in supported systems" \
2024-02-27 17:33:31 +00:00
"Quick Resume: Enable/Disable" "Enable or disable save state auto-save/load in supported systems" \
2023-05-22 16:07:37 +00:00
"RetroAchievements: Login" "Log into the RetroAchievements service in supported systems" \
"RetroAchievements: Logout" "Disable RetroAchievements service in ALL supported systems" \
2024-02-27 15:00:27 +00:00
"RetroAchievements: Hardcore Mode" "Enable RetroAchievements hardcore mode (no cheats, rewind, save states etc.) in supported systems" \
2024-02-27 17:34:39 +00:00
"Rewind: Enable/Disable" "Enable or disable the rewind function in supported systems" \
"Swap A/B and X/Y Buttons: Enable/Disable" "Enable or disable a swapped A/B and X/Y button layout in supported systems" )
2023-05-08 18:24:41 +00:00
case $choice in
2023-05-22 16:15:46 +00:00
"Widescreen: Enable/Disable" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-08 18:24:41 +00:00
change_preset_dialog "widescreen"
2023-05-10 16:26:40 +00:00
configurator_global_presets_and_settings_dialog
2023-05-08 18:24:41 +00:00
; ;
2023-05-22 16:15:46 +00:00
"Ask-to-Exit: Enable/Disable" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-18 15:38:20 +00:00
change_preset_dialog "ask_to_exit"
configurator_global_presets_and_settings_dialog
; ;
2024-02-27 17:33:31 +00:00
"Quick Resume: Enable/Disable" )
change_preset_dialog "quick_resume"
configurator_global_presets_and_settings_dialog
; ;
2023-05-22 16:07:37 +00:00
"RetroAchievements: Login" )
2023-05-12 18:28:51 +00:00
local cheevos_creds = $( get_cheevos_token_dialog)
if [ [ ! " $cheevos_creds " = = "failed" ] ] ; then
configurator_generic_dialog "RetroDECK Configurator Utility - RetroAchievements" "RetroAchievements login successful, please select systems you would like to enable achievements for in the next dialog."
2023-05-13 16:05:50 +00:00
IFS = ',' read -r cheevos_username cheevos_token cheevos_login_timestamp < <( printf '%s\n' " $cheevos_creds " )
2023-05-10 16:26:40 +00:00
change_preset_dialog "cheevos"
2023-05-08 18:24:41 +00:00
else
2023-05-10 16:26:40 +00:00
configurator_generic_dialog "RetroDECK Configurator Utility - RetroAchievements" "RetroAchievements login failed, please verify your username and password and try the process again."
2023-05-08 18:24:41 +00:00
fi
2023-05-10 16:26:40 +00:00
configurator_global_presets_and_settings_dialog
2023-05-08 18:24:41 +00:00
; ;
2023-05-22 16:07:37 +00:00
"RetroAchievements: Logout" ) # This is a workaround to allow disabling cheevos without having to enter login credentials
2023-05-18 14:23:05 +00:00
local cheevos_emulators = $( sed -n '/\[cheevos\]/, /\[/{ /\[cheevos\]/! { /\[/! p } }' $rd_conf | sed '/^$/d' )
2023-05-23 20:16:54 +00:00
for setting_line in $cheevos_emulators ; do
emulator = $( get_setting_name " $setting_line " "retrodeck" )
2023-05-18 14:23:05 +00:00
set_setting_value " $rdconf " " $emulator " "false" "retrodeck" "cheevos"
build_preset_config " $emulator " "cheevos"
done
configurator_generic_dialog "RetroDECK Configurator Utility - RetroAchievements" "RetroAchievements has been disabled in all supported systems."
2023-05-15 15:56:01 +00:00
configurator_global_presets_and_settings_dialog
; ;
2023-05-22 16:07:37 +00:00
"RetroAchievements: Hardcore Mode" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-08 18:24:41 +00:00
change_preset_dialog "cheevos_hardcore"
2023-05-10 16:26:40 +00:00
configurator_global_presets_and_settings_dialog
2023-05-08 18:24:41 +00:00
; ;
2024-03-27 12:53:48 +00:00
"Rewind: Enable/Disable" )
log i " Configurator: opening \" $choice \" menu "
change_preset_dialog "rewind"
configurator_global_presets_and_settings_dialog
; ;
2024-02-27 17:34:39 +00:00
"Swap A/B and X/Y Buttons: Enable/Disable" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2024-02-28 14:24:39 +00:00
2024-01-29 15:46:27 +00:00
change_preset_dialog "abxy_button_swap"
2023-05-13 16:05:50 +00:00
configurator_global_presets_and_settings_dialog
; ;
2023-05-08 18:24:41 +00:00
"" ) # No selection made or Back button clicked
2024-01-05 10:00:00 +00:00
log i "Configurator: going back"
2023-05-10 16:26:40 +00:00
configurator_presets_and_settings_dialog
; ;
esac
}
configurator_retroarch_presets_and_settings_dialog( ) {
choice = $( zenity --list --title= "RetroDECK Configurator Utility - RetroArch: Presets & Settings" --cancel-label= "Back" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--column= "Choice" --column= "Action" \
2024-02-27 15:00:27 +00:00
"Borders: Enable/Disable" "Enable or disable borders in supported systems" )
2023-05-10 16:26:40 +00:00
case $choice in
2023-05-22 16:07:37 +00:00
"Borders: Enable/Disable" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-16 15:18:13 +00:00
change_preset_dialog "borders"
configurator_retroarch_presets_and_settings_dialog
; ;
2023-05-10 16:26:40 +00:00
"" ) # No selection made or Back button clicked
2024-01-05 10:00:00 +00:00
log i "Configurator: going back"
2023-05-10 16:26:40 +00:00
configurator_presets_and_settings_dialog
2023-05-08 18:24:41 +00:00
; ;
esac
}
2023-05-11 14:17:55 +00:00
configurator_wii_and_gamecube_presets_and_settings_dialog( ) {
2023-05-10 16:26:40 +00:00
choice = $( zenity --list --title= "RetroDECK Configurator Utility - Wii & GameCube: Presets & Settings" --cancel-label= "Back" \
2023-01-05 16:56:40 +00:00
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
2022-10-26 16:51:46 +00:00
--column= "Choice" --column= "Action" \
2023-05-10 16:26:40 +00:00
"Dolphin Textures: Universal Dynamic Input" "Enable/Disable Venomalia's Universal Dynamic Input Textures for Dolphin" \
"Primehack Textures: Universal Dynamic Input" "Enable/Disable: Venomalia's Universal Dynamic Input Textures for Primehack" )
2022-10-07 20:28:36 +00:00
2022-10-26 16:51:46 +00:00
case $choice in
2022-10-07 20:28:36 +00:00
2023-05-10 16:26:40 +00:00
"Dolphin Textures: Universal Dynamic Input" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_dolphin_input_textures_dialog
2022-10-26 16:51:46 +00:00
; ;
2022-10-12 20:06:17 +00:00
2023-05-10 16:26:40 +00:00
"Primehack Textures: Universal Dynamic Input" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_primehack_input_textures_dialog
2023-04-21 15:46:20 +00:00
; ;
"" ) # No selection made or Back button clicked
2024-01-05 10:00:00 +00:00
log i "Configurator: going back"
2023-05-10 16:26:40 +00:00
configurator_presets_and_settings_dialog
2023-04-21 15:46:20 +00:00
; ;
esac
}
configurator_dolphin_input_textures_dialog( ) {
if [ [ -d "/var/data/dolphin-emu/Load/DynamicInputTextures" ] ] ; then
zenity --question \
--no-wrap --window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
2023-05-10 16:26:40 +00:00
--title "RetroDECK Configurator - Dolphin Textures: Universal Dynamic Input" \
2024-03-12 19:01:47 +00:00
--text= "Custom input textures are currently enabled. Do you want to disable them?"
2023-04-21 15:46:20 +00:00
if [ $? = = 0 ]
then
2023-05-25 14:05:54 +00:00
# set_setting_value $dolphingfxconf "HiresTextures" "False" dolphin # TODO: Break out a preset for texture packs so this can be enabled and disabled independently.
2023-04-21 15:46:20 +00:00
rm -rf "/var/data/dolphin-emu/Load/DynamicInputTextures"
configurator_process_complete_dialog "disabling Dolphin custom input textures"
else
2023-05-11 14:17:55 +00:00
configurator_wii_and_gamecube_presets_and_settings_dialog
2023-04-21 15:46:20 +00:00
fi
else
zenity --question \
--no-wrap --window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
2023-05-10 16:26:40 +00:00
--title "RetroDECK Configurator - Dolphin Textures: Universal Dynamic Input" \
2024-03-12 19:01:47 +00:00
--text= "Custom input textures are currently disabled. Do you want to enable them?\n\nThis process may take several minutes to complete."
2023-04-21 15:46:20 +00:00
if [ $? = = 0 ]
then
set_setting_value $dolphingfxconf "HiresTextures" "True" dolphin
(
mkdir "/var/data/dolphin-emu/Load/DynamicInputTextures"
2023-06-27 14:53:34 +00:00
rsync -rlD --mkpath "/app/retrodeck/extras/DynamicInputTextures/" "/var/data/dolphin-emu/Load/DynamicInputTextures/"
2023-04-21 15:46:20 +00:00
) |
zenity --icon-name= net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator Utility - Dolphin Custom Input Textures Install"
configurator_process_complete_dialog "enabling Dolphin custom input textures"
else
2023-05-11 14:17:55 +00:00
configurator_wii_and_gamecube_presets_and_settings_dialog
2023-04-21 15:46:20 +00:00
fi
fi
}
2023-05-01 19:32:22 +00:00
configurator_primehack_input_textures_dialog( ) {
if [ [ -d "/var/data/primehack/Load/DynamicInputTextures" ] ] ; then
zenity --question \
--no-wrap --window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator - Dolphin Custom Input Textures" \
2024-03-12 19:01:47 +00:00
--text= "Custom input textures are currently enabled. Do you want to disable them?"
2023-05-01 19:32:22 +00:00
if [ $? = = 0 ]
then
2023-05-25 14:05:54 +00:00
# set_setting_value $primehackgfxconf "HiresTextures" "False" primehack # TODO: Break out a preset for texture packs so this can be enabled and disabled independently.
2023-05-01 19:32:22 +00:00
rm -rf "/var/data/primehack/Load/DynamicInputTextures"
configurator_process_complete_dialog "disabling Primehack custom input textures"
else
2023-05-11 14:17:55 +00:00
configurator_wii_and_gamecube_presets_and_settings_dialog
2023-05-01 19:32:22 +00:00
fi
else
zenity --question \
--no-wrap --window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator - Primehack Custom Input Textures" \
2024-03-12 19:01:47 +00:00
--text= "Custom input textures are currently disabled. Do you want to enable them?\n\nThis process may take several minutes to complete."
2023-05-01 19:32:22 +00:00
if [ $? = = 0 ]
then
set_setting_value $primehackgfxconf "HiresTextures" "True" primehack
(
mkdir "/var/data/primehack/Load/DynamicInputTextures"
2023-06-27 14:53:34 +00:00
rsync -rlD --mkpath "/app/retrodeck/extras/DynamicInputTextures/" "/var/data/primehack/Load/DynamicInputTextures/"
2023-05-01 19:32:22 +00:00
) |
zenity --icon-name= net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator Utility - Primehack Custom Input Textures Install"
configurator_process_complete_dialog "enabling Primehack custom input textures"
else
2023-05-11 14:17:55 +00:00
configurator_wii_and_gamecube_presets_and_settings_dialog
2023-05-01 19:32:22 +00:00
fi
fi
}
2023-05-10 16:26:40 +00:00
configurator_power_user_warning_dialog( ) {
if [ [ $power_user_warning = = "true" ] ] ; then
choice = $( zenity --icon-name= net.retrodeck.retrodeck --info --no-wrap --ok-label= "Yes" --extra-button= "No" --extra-button= "Never show this again" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Power User Warning" \
2024-03-12 19:01:47 +00:00
--text= "Making manual changes to an emulator's configuration may create serious issues,\nand some settings may be overwitten during RetroDECK updates or when using presets.\n\nSome standalone emulator functions may not work properly outside of Desktop mode.\n\nPlease continue only if you know what you're doing.\n\nDo you want to continue?" )
2023-05-10 16:26:40 +00:00
fi
rc = $? # Capture return code, as "Yes" button has no text value
if [ [ $rc = = "0" ] ] ; then # If user clicked "Yes"
configurator_open_emulator_dialog
else # If any button other than "Yes" was clicked
if [ [ $choice = = "No" ] ] ; then
configurator_welcome_dialog
elif [ [ $choice = = "Never show this again" ] ] ; then
set_setting_value $rd_conf "power_user_warning" "false" retrodeck "options" # Store power user warning variable for future checks
configurator_open_emulator_dialog
2023-03-07 15:06:08 +00:00
fi
fi
}
2023-05-10 16:26:40 +00:00
configurator_open_emulator_dialog( ) {
2024-03-08 17:21:43 +00:00
local emulator_list = (
"RetroArch" "Open the multi-emulator frontend RetroArch"
"Cemu" "Open the Wii U emulator CEMU"
"Dolphin" "Open the Wii & GC emulator Dolphin"
"Duckstation" "Open the PSX emulator Duckstation"
"MAME" "Open the Multiple Arcade Machine Emulator emulator MAME"
"MelonDS" "Open the NDS emulator MelonDS"
"PCSX2" "Open the PS2 emulator PSXC2"
"PPSSPP" "Open the PSP emulator PPSSPP"
"Primehack" "Open the Metroid Prime emulator Primehack"
"RPCS3" "Open the PS3 emulator RPCS3"
"Ryujinx" "Open the Switch emulator Ryujinx"
"Vita3K" "Open the PSVita emulator Vita3K"
"XEMU" "Open the Xbox emulator XEMU"
)
# Check if any ponzu is true before adding Yuzu or Citra to the list
2024-03-09 08:32:45 +00:00
if [ [ $( get_setting_value " $rd_conf " "kiroi_ponzu" "retrodeck" "options" ) = = "true" ] ] ; then
2024-03-08 17:21:43 +00:00
emulator_list += ( "Yuzu" "Open the Switch emulator Yuzu" )
fi
2024-03-09 08:32:45 +00:00
if [ [ $( get_setting_value " $rd_conf " "akai_ponzu" "retrodeck" "options" ) = = "true" ] ] ; then
2024-03-08 17:21:43 +00:00
emulator_list += ( "Citra" "Open the 3DS emulator Citra" )
fi
2023-05-10 16:26:40 +00:00
emulator = $( zenity --list \
--title "RetroDECK Configurator Utility - Open Emulator" --cancel-label= "Back" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--text= "Which emulator do you want to launch?" \
--hide-header \
--column= "Emulator" --column= "Action" \
2024-03-08 17:21:43 +00:00
" ${ emulator_list [@] } " )
2023-05-10 16:26:40 +00:00
case $emulator in
"RetroArch" )
2024-01-05 10:00:00 +00:00
log i " Configurator: \" $emulator \" "
2023-05-10 16:26:40 +00:00
retroarch
; ;
"Cemu" )
2024-01-05 10:00:00 +00:00
log i " Configurator: \" $emulator \" "
2023-05-10 16:26:40 +00:00
Cemu-wrapper
; ;
2024-03-08 17:21:43 +00:00
"Citra" )
log i " Configurator: \" $emulator \" "
2024-03-08 20:22:15 +00:00
/var/data/ponzu/Citra/bin/citra-qt
2024-03-08 17:21:43 +00:00
; ;
2023-05-10 16:26:40 +00:00
"Dolphin" )
2024-01-05 10:00:00 +00:00
log i " Configurator: \" $emulator \" "
2023-05-10 16:26:40 +00:00
dolphin-emu
; ;
"Duckstation" )
2024-01-05 10:00:00 +00:00
log i " Configurator: \" $emulator \" "
2023-05-10 16:26:40 +00:00
duckstation-qt
; ;
2023-10-13 08:21:24 +00:00
"MAME" )
2024-01-05 10:00:00 +00:00
log i " Configurator: \" $emulator \" "
2024-03-20 20:13:01 +00:00
mame -inipath /var/config/mame/ini
2023-10-13 08:21:24 +00:00
; ;
2023-05-10 16:26:40 +00:00
"MelonDS" )
2024-01-05 10:00:00 +00:00
log i " Configurator: \" $emulator \" "
2023-05-10 16:26:40 +00:00
melonDS
; ;
"PCSX2" )
2024-01-05 10:00:00 +00:00
log i " Configurator: \" $emulator \" "
2023-05-10 16:26:40 +00:00
pcsx2-qt
; ;
"PPSSPP" )
2024-01-05 10:00:00 +00:00
log i " Configurator: \" $emulator \" "
2023-05-10 16:26:40 +00:00
PPSSPPSDL
; ;
"Primehack" )
2024-01-05 10:00:00 +00:00
log i " Configurator: \" $emulator \" "
2023-05-10 16:26:40 +00:00
primehack-wrapper
; ;
"RPCS3" )
2024-01-05 10:00:00 +00:00
log i " Configurator: \" $emulator \" "
2023-05-10 16:26:40 +00:00
rpcs3
; ;
2023-09-27 13:13:50 +00:00
"Ryujinx" )
2024-01-05 10:00:00 +00:00
log i " Configurator: \" $emulator \" "
2024-04-08 01:59:51 +00:00
Ryujinx.sh
2023-09-27 13:13:50 +00:00
; ;
2023-10-09 07:54:44 +00:00
"Vita3K" )
2024-01-05 10:00:00 +00:00
log i " Configurator: \" $emulator \" "
2023-10-09 07:54:44 +00:00
Vita3K
; ;
2023-05-10 16:26:40 +00:00
"XEMU" )
2024-01-05 10:00:00 +00:00
log i " Configurator: \" $emulator \" "
2023-05-10 16:26:40 +00:00
xemu
; ;
2024-03-08 17:21:43 +00:00
"Yuzu" )
log i " Configurator: \" $emulator \" "
2024-03-09 08:32:45 +00:00
/var/data/ponzu/Yuzu/bin/yuzu
2024-03-08 17:21:43 +00:00
; ;
2023-05-10 16:26:40 +00:00
"" ) # No selection made or Back button clicked
2024-01-05 10:00:00 +00:00
log i "Configurator: going back"
2023-05-10 16:26:40 +00:00
configurator_welcome_dialog
; ;
esac
2023-05-10 20:42:12 +00:00
configurator_open_emulator_dialog
2023-05-10 16:26:40 +00:00
}
configurator_retrodeck_tools_dialog( ) {
2024-03-09 13:37:42 +00:00
local choices = (
"Tool: Move Folders" "Move RetroDECK folders between internal/SD card or to a custom location"
"Tool: Compress Games" "Compress games for systems that support it"
2024-03-18 12:47:14 +00:00
"Install: RetroDECK Controller Layouts" "Install the custom RetroDECK controller layouts on Steam"
2024-03-09 13:37:42 +00:00
"Install: PS3 Firmware" "Download and install PS3 firmware for use with the RPCS3 emulator"
"Install: PS Vita Firmware" "Download and install PS Vita firmware for use with the Vita3K emulator"
"RetroDECK: Change Update Setting" "Enable or disable online checks for new versions of RetroDECK"
)
if [ [ $( get_setting_value " $rd_conf " "kiroi_ponzu" "retrodeck" "options" ) = = "true" ] ] ; then
choices += ( "Ponzu - Remove Yuzu" "Run Ponzu to remove Yuzu from RetroDECK. Configurations and saves will be mantained." )
fi
if [ [ $( get_setting_value " $rd_conf " "akai_ponzu" "retrodeck" "options" ) = = "true" ] ] ; then
choices += ( "Ponzu - Remove Citra" "Run Ponzu to remove Citra from RetroDECK. Configurations and saves will be mantained." )
fi
2023-05-11 14:17:55 +00:00
choice = $( zenity --list --title= "RetroDECK Configurator Utility - RetroDECK: Tools" --cancel-label= "Back" \
2023-05-10 16:26:40 +00:00
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--column= "Choice" --column= "Action" \
2024-03-09 13:37:42 +00:00
" ${ choices [@] } " )
2023-05-10 16:26:40 +00:00
case $choice in
2023-05-22 16:07:37 +00:00
"Tool: Move Folders" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_retrodeck_move_tool_dialog
; ;
2023-05-22 16:07:37 +00:00
"Tool: Compress Games" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_generic_dialog "RetroDECK Configurator - Compression Tool" "Depending on your library and compression choices, the process can sometimes take a long time.\nPlease be patient once it is started!"
configurator_compression_tool_dialog
; ;
2024-03-18 12:47:14 +00:00
"Install: RetroDECK Controller Layouts" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-10-10 13:29:50 +00:00
configurator_generic_dialog "RetroDECK Configurator - Install: RetroDECK Controller Profile" " We are now 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.\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 "
2023-05-10 16:26:40 +00:00
if [ [ $( configurator_generic_question_dialog "Install: RetroDECK Controller Profile" "Would you like to install the official RetroDECK controller profile?" ) = = "true" ] ] ; then
install_retrodeck_controller_profile
configurator_generic_dialog "RetroDECK Configurator - Install: RetroDECK Controller Profile" "The RetroDECK controller profile install is complete.\nSee the Wiki for more details on how to use it to its fullest potential!"
fi
configurator_retrodeck_tools_dialog
; ;
"Install: PS3 Firmware" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
if [ [ $( check_network_connectivity) = = "true" ] ] ; then
configurator_generic_dialog "RetroDECK Configurator - Install: PS3 firmware" "This tool will download firmware required by RPCS3 to emulate PS3 games.\n\nThe process will take several minutes, and the emulator will launch to finish the installation.\nPlease close RPCS3 manually once the installation is complete."
(
update_rpcs3_firmware
) |
2024-05-07 07:58:31 +00:00
zenity --progress --no-cancel --pulsate --auto-close \
2023-05-10 16:26:40 +00:00
--icon-name= net.retrodeck.retrodeck \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title= "Downloading PS3 Firmware" \
2024-04-21 13:33:43 +00:00
--width= 400 --height= 200 \
2024-05-07 07:58:31 +00:00
--text= " Dowloading and installing PS3 Firmware, please be patient.\n\n<span foreground=' $purple ' size='larger'><b>NOTICE - If the process is taking too long:</b></span>\n\nSome windows might be running in the background that could require your attention: pop-ups from emulators or the upgrade itself that needs user input to continue.\n\n "
2023-05-10 16:26:40 +00:00
else
configurator_generic_dialog "RetroDECK Configurator - Install: PS3 Firmware" "You do not appear to currently have Internet access, which is required by this tool. Please try again when network access has been restored."
configurator_retrodeck_tools_dialog
fi
; ;
2024-02-23 18:14:39 +00:00
"Install: PS Vita Firmware" )
if [ [ $( check_network_connectivity) = = "true" ] ] ; then
configurator_generic_dialog "RetroDECK Configurator - Install: PS Vita firmware" "This tool will download firmware required by Vita3K to emulate PS Vita games.\n\nThe process will take several minutes, and the emulator will launch to finish the installation.\nPlease close Vita3K manually once the installation is complete."
(
update_vita3k_firmware
) |
zenity --progress --pulsate \
--icon-name= net.retrodeck.retrodeck \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title= "Downloading PS Vita Firmware" \
--no-cancel \
--auto-close
else
configurator_generic_dialog "RetroDECK Configurator - Install: PS Vita Firmware" "You do not appear to currently have Internet access, which is required by this tool. Please try again when network access has been restored."
configurator_retrodeck_tools_dialog
fi
; ;
2023-06-13 18:41:16 +00:00
"RetroDECK: Change Update Setting" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-06-02 13:52:29 +00:00
configurator_online_update_setting_dialog
; ;
2024-03-09 13:37:42 +00:00
"Ponzu - Remove Yuzu" )
ponzu_remove "yuzu"
; ;
"Ponzu - Remove Citra" )
ponzu_remove "citra"
; ;
2023-05-10 16:26:40 +00:00
"" ) # No selection made or Back button clicked
2024-01-05 10:00:00 +00:00
log i "Configurator: going back"
2023-05-10 16:26:40 +00:00
configurator_welcome_dialog
; ;
esac
}
configurator_retrodeck_move_tool_dialog( ) {
choice = $( zenity --list --title= "RetroDECK Configurator Utility - RetroDECK: Move Tool" --cancel-label= "Back" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--column= "Choice" --column= "Action" \
"Move all of RetroDECK" "Move the entire retrodeck folder to a new location" \
"Move ROMs folder" "Move only the ROMs folder to a new location" \
"Move BIOS folder" "Move only the BIOS folder to a new location" \
"Move Downloaded Media folder" "Move only the Downloaded Media folder to a new location" \
"Move Saves folder" "Move only the Saves folder to a new location" \
"Move States folder" "Move only the States folder to a new location" \
"Move Themes folder" "Move only the Themes folder to a new location" \
"Move Screenshots folder" "Move only the Screenshots folder to a new location" \
"Move Mods folder" "Move only the Mods folder to a new location" \
"Move Texture Packs folder" "Move only the Texture Packs folder to a new location" )
case $choice in
"Move all of RetroDECK" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_move_folder_dialog "rdhome"
; ;
"Move ROMs folder" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_move_folder_dialog "roms_folder"
; ;
"Move BIOS folder" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_move_folder_dialog "bios_folder"
; ;
"Move Downloaded Media folder" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_move_folder_dialog "media_folder"
; ;
"Move Saves folder" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_move_folder_dialog "saves_folder"
; ;
"Move States folder" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_move_folder_dialog "states_folder"
; ;
"Move Themes folder" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_move_folder_dialog "themes_folder"
; ;
2023-05-13 16:05:50 +00:00
2023-05-10 16:26:40 +00:00
"Move Screenshots folder" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_move_folder_dialog "screenshots_folder"
; ;
"Move Mods folder" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_move_folder_dialog "mods_folder"
; ;
"Move Texture Packs folder" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_move_folder_dialog "texture_packs_folder"
; ;
esac
configurator_retrodeck_tools_dialog
}
configurator_compression_tool_dialog( ) {
choice = $( zenity --list --title= "RetroDECK Configurator Utility - RetroDECK: Compression Tool" --cancel-label= "Back" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--column= "Choice" --column= "Action" \
"Compress Single Game" "Compress a single game into a compatible format" \
"Compress Multiple Games - CHD" "Compress one or more games compatible with the CHD format" \
"Compress Multiple Games - ZIP" "Compress one or more games compatible with the ZIP format" \
"Compress Multiple Games - RVZ" "Compress one or more games compatible with the RVZ format" \
"Compress Multiple Games - All Formats" "Compress one or more games compatible with any format" \
"Compress All Games" "Compress all games into compatible formats" )
case $choice in
"Compress Single Game" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_compress_single_game_dialog
; ;
"Compress Multiple Games - CHD" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_compress_multiple_games_dialog "chd"
; ;
"Compress Multiple Games - ZIP" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_compress_multiple_games_dialog "zip"
; ;
"Compress Multiple Games - RVZ" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_compress_multiple_games_dialog "rvz"
; ;
"Compress Multiple Games - All Formats" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_compress_multiple_games_dialog "all"
; ;
"Compress All Games" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_compress_multiple_games_dialog "everything"
; ;
"" ) # No selection made or Back button clicked
2024-01-05 10:00:00 +00:00
log i "Configurator: going back"
2023-05-10 16:26:40 +00:00
configurator_retrodeck_tools_dialog
; ;
esac
}
configurator_compress_single_game_dialog( ) {
local file = $( file_browse "Game to compress" )
if [ [ ! -z " $file " ] ] ; then
2024-02-22 19:49:08 +00:00
local system = $( echo " $file " | grep -oE " $roms_folder /[^/]+ " | grep -oE " [^/]+ $" )
2023-05-10 16:26:40 +00:00
local compatible_compression_format = $( find_compatible_compression_format " $file " )
if [ [ ! $compatible_compression_format = = "none" ] ] ; then
local post_compression_cleanup = $( configurator_compression_cleanup_dialog)
(
2024-04-08 13:34:21 +00:00
echo " # Compressing $( basename " $file " ) to $compatible_compression_format format " # This updates the Zenity dialog
log i " Compressing $( basename " $file " ) to $compatible_compression_format format "
2024-02-22 19:49:08 +00:00
compress_game " $compatible_compression_format " " $file " " $system "
if [ [ $post_compression_cleanup = = "true" ] ] ; then # Remove file(s) if requested
2024-04-02 13:53:35 +00:00
if [ [ -f " ${ file %.* } . $compatible_compression_format " ] ] ; then
2024-04-08 13:34:21 +00:00
log i "Performing post-compression file cleanup"
2024-04-02 13:53:35 +00:00
if [ [ " $file " = = *".cue" ] ] ; then
local cue_bin_files = $( grep -o -P " (?<=FILE \").*(?=\".* $) " " $file " )
local file_path = $( dirname " $( realpath " $file " ) " )
while IFS = read -r line
do
2024-04-08 13:34:21 +00:00
log i " Removing file $file_path / $line "
2024-04-02 13:53:35 +00:00
rm -f " $file_path / $line "
done < <( printf '%s\n' " $cue_bin_files " )
2024-04-08 13:34:21 +00:00
log i " Removing file $( realpath $file ) "
2024-04-02 13:53:35 +00:00
rm -f $( realpath " $file " )
else
2024-04-08 13:34:21 +00:00
log i " Removing file $( realpath $file ) "
2024-04-02 13:53:35 +00:00
rm -f " $( realpath " $file " ) "
fi
2024-02-22 19:49:08 +00:00
else
2024-04-08 13:34:21 +00:00
log i " Compressed file ${ file %.* } . $compatible_compression_format not found, skipping original file deletion "
2024-04-02 13:53:35 +00:00
configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" "A compressed version of the file was not found, skipping deletion."
2023-05-10 16:26:40 +00:00
fi
fi
) |
zenity --icon-name= net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator Utility - Compression in Progress"
2024-04-02 13:53:35 +00:00
configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" "The compression process is complete."
2023-05-10 16:26:40 +00:00
configurator_compression_tool_dialog
else
2024-03-12 19:01:47 +00:00
configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" "The selected file does not have any compatible compression formats."
2023-05-10 16:26:40 +00:00
configurator_compression_tool_dialog
fi
else
configurator_compression_tool_dialog
fi
}
configurator_compress_multiple_games_dialog( ) {
# This dialog will display any games it finds to be compressable, from the systems listed under each compression type in compression_targets.cfg
2023-03-29 19:51:27 +00:00
2023-03-15 21:19:04 +00:00
local compressable_games_list = ( )
2023-03-14 19:43:28 +00:00
local all_compressable_games = ( )
2023-03-29 19:51:27 +00:00
local games_to_compress = ( )
2023-05-10 16:26:40 +00:00
local target_selection = " $1 "
2023-03-29 19:51:27 +00:00
2023-05-10 16:26:40 +00:00
if [ [ " $1 " = = "everything" ] ] ; then
2023-03-29 19:51:27 +00:00
local compression_format = "all"
2023-05-10 16:26:40 +00:00
else
local compression_format = " $1 "
2023-03-29 19:51:27 +00:00
fi
if [ [ $compression_format = = "all" ] ] ; then
local compressable_systems_list = $( cat $compression_targets | sed '/^$/d' | sed '/^\[/d' )
else
local compressable_systems_list = $( sed -n '/\[' " $compression_format " '\]/, /\[/{ /\[' " $compression_format " '\]/! { /\[/! p } }' $compression_targets | sed '/^$/d' )
fi
2023-03-14 19:43:28 +00:00
while IFS = read -r system # Find and validate all games that are able to be compressed with this compression type
do
2023-03-29 19:51:27 +00:00
compression_candidates = $( find " $roms_folder / $system " -type f -not -iname "*.txt" )
if [ [ ! -z $compression_candidates ] ] ; then
while IFS = read -r game
do
local compatible_compression_format = $( find_compatible_compression_format " $game " )
if [ [ $compression_format = = "chd" ] ] ; then
if [ [ $compatible_compression_format = = "chd" ] ] ; then
all_compressable_games = ( " ${ all_compressable_games [@] } " " $game " )
compressable_games_list = ( " ${ compressable_games_list [@] } " "false" " ${ game # $roms_folder } " " $game " )
fi
elif [ [ $compression_format = = "zip" ] ] ; then
if [ [ $compatible_compression_format = = "zip" ] ] ; then
all_compressable_games = ( " ${ all_compressable_games [@] } " " $game " )
compressable_games_list = ( " ${ compressable_games_list [@] } " "false" " ${ game # $roms_folder } " " $game " )
fi
elif [ [ $compression_format = = "rvz" ] ] ; then
if [ [ $compatible_compression_format = = "rvz" ] ] ; then
all_compressable_games = ( " ${ all_compressable_games [@] } " " $game " )
compressable_games_list = ( " ${ compressable_games_list [@] } " "false" " ${ game # $roms_folder } " " $game " )
fi
elif [ [ $compression_format = = "all" ] ] ; then
if [ [ ! $compatible_compression_format = = "none" ] ] ; then
all_compressable_games = ( " ${ all_compressable_games [@] } " " $game " )
compressable_games_list = ( " ${ compressable_games_list [@] } " "false" " ${ game # $roms_folder } " " $game " )
fi
fi
done < <( printf '%s\n' " $compression_candidates " )
2023-03-14 19:43:28 +00:00
fi
done < <( printf '%s\n' " $compressable_systems_list " )
2023-05-10 16:26:40 +00:00
if [ [ ! " $target_selection " = = "everything" ] ] ; then # If the user chose to not auto-compress everything
choice = $( zenity \
--list --width= 1200 --height= 720 --title "RetroDECK Configurator - RetroDECK: Compression Tool" \
--checklist --hide-column= 3 --ok-label= "Compress Selected" --extra-button= "Compress All" \
--separator= "," --print-column= 3 \
--text= "Choose which games to compress:" \
--column "Compress?" \
--column "Game" \
--column "Game Full Path" \
" ${ compressable_games_list [@] } " )
local rc = $?
if [ [ $rc = = "0" && ! -z $choice ] ] ; then # User clicked "Compress Selected" with at least one game selected
IFS = "," read -ra games_to_compress <<< " $choice "
local total_games_to_compress = ${# games_to_compress [@] }
local games_left_to_compress = $total_games_to_compress
elif [ [ ! -z $choice ] ] ; then # User clicked "Compress All"
games_to_compress = ( " ${ all_compressable_games [@] } " )
local total_games_to_compress = ${# all_compressable_games [@] }
local games_left_to_compress = $total_games_to_compress
fi
else # The user chose to auto-compress everything
2023-03-29 19:51:27 +00:00
games_to_compress = ( " ${ all_compressable_games [@] } " )
fi
if [ [ ! $( echo " ${# games_to_compress [@] } " ) = = "0" ] ] ; then
local post_compression_cleanup = $( configurator_compression_cleanup_dialog)
2023-03-15 21:19:04 +00:00
(
for file in " ${ games_to_compress [@] } " ; do
2024-02-22 19:49:08 +00:00
local system = $( echo " $file " | grep -oE " $roms_folder /[^/]+ " | grep -oE " [^/]+ $" )
2023-03-29 19:51:27 +00:00
local compression_format = $( find_compatible_compression_format " $file " )
echo " # Compressing $( basename " $file " ) into $compression_format format " # Update Zenity dialog text
2024-04-08 13:34:21 +00:00
log i " Compressing $( basename " $file " ) into $compression_format format "
2023-03-29 19:51:27 +00:00
progress = $(( 100 - ( ( 100 / " $total_games_to_compress " ) * " $games_left_to_compress " )) )
echo $progress
games_left_to_compress = $(( games_left_to_compress-1))
2024-04-08 13:34:21 +00:00
log i " Games left to compress: $games_left_to_compress "
2024-02-22 19:49:08 +00:00
compress_game " $compression_format " " $file " " $system "
2023-03-15 21:19:04 +00:00
if [ [ $post_compression_cleanup = = "true" ] ] ; then # Remove file(s) if requested
2024-04-02 13:53:35 +00:00
if [ [ -f " ${ file %.* } . $compatible_compression_format " ] ] ; then
if [ [ " $file " = = *".cue" ] ] ; then
local cue_bin_files = $( grep -o -P " (?<=FILE \").*(?=\".* $) " " $file " )
local file_path = $( dirname " $( realpath " $file " ) " )
while IFS = read -r line
do
2024-04-08 13:34:21 +00:00
log i " Removing file $file_path / $line "
2024-04-02 13:53:35 +00:00
rm -f " $file_path / $line "
done < <( printf '%s\n' " $cue_bin_files " )
2024-04-08 13:34:21 +00:00
log i " Removing file $( realpath $file ) "
2024-04-02 13:53:35 +00:00
rm -f $( realpath " $file " )
else
2024-04-08 13:34:21 +00:00
log i " Removing file $( realpath $file ) "
2024-04-02 13:53:35 +00:00
rm -f " $( realpath " $file " ) "
fi
2023-03-15 21:19:04 +00:00
else
2024-04-08 13:34:21 +00:00
log i " Compressed file ${ file %.* } . $compatible_compression_format not found, skipping original file deletion "
2024-04-02 13:53:35 +00:00
configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" " Compression of $( basename $file ) failed, skipping deletion. "
2023-03-15 21:19:04 +00:00
fi
fi
2023-03-14 19:43:28 +00:00
done
2023-03-15 21:19:04 +00:00
) |
2023-03-29 19:51:27 +00:00
zenity --icon-name= net.retrodeck.retrodeck --progress --no-cancel --auto-close \
2023-03-15 21:19:04 +00:00
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator Utility - Compression in Progress"
2023-05-10 16:26:40 +00:00
configurator_generic_dialog "RetroDECK Configurator - RetroDECK: Compression Tool" "The compression process is complete!"
configurator_compression_tool_dialog
2023-03-29 19:51:27 +00:00
else
2023-05-10 16:26:40 +00:00
configurator_compression_tool_dialog
2023-03-14 19:43:28 +00:00
fi
}
2023-03-15 21:19:04 +00:00
configurator_compression_cleanup_dialog( ) {
zenity --icon-name= net.retrodeck.retrodeck --question --no-wrap --cancel-label= "No" --ok-label= "Yes" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
2023-05-10 16:26:40 +00:00
--title "RetroDECK Configurator - RetroDECK: Compression Tool" \
2024-04-02 13:53:35 +00:00
--text= "Do you want to remove old files after they are compressed?\n\nClicking \"No\" will leave all files behind which will need to be cleaned up manually and may result in game duplicates showing in the RetroDECK library.\n\nPlease make sure you have a backup of your ROMs before using automatic cleanup!"
2023-03-15 21:19:04 +00:00
local rc = $? # Capture return code, as "Yes" button has no text value
if [ [ $rc = = "0" ] ] ; then # If user clicked "Yes"
echo "true"
else # If "No" was clicked
echo "false"
fi
}
2023-06-02 13:52:29 +00:00
configurator_online_update_setting_dialog( ) {
if [ [ $( get_setting_value $rd_conf "update_check" retrodeck "options" ) = = "true" ] ] ; then
zenity --question \
--no-wrap --window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator - RetroDECK Online Update Check" \
--text= "Online update checks for RetroDECK are currently enabled.\n\nDo you want to disable them?"
if [ $? = = 0 ] # User clicked "Yes"
then
set_setting_value $rd_conf "update_check" "false" retrodeck "options"
else # User clicked "Cancel"
configurator_retrodeck_tools_dialog
fi
else
zenity --question \
--no-wrap --window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator - RetroDECK Online Update Check" \
--text= "Online update checks for RetroDECK are currently disabled.\n\nDo you want to enable them?"
if [ $? = = 0 ] # User clicked "Yes"
then
set_setting_value $rd_conf "update_check" "true" retrodeck "options"
else # User clicked "Cancel"
configurator_retrodeck_tools_dialog
fi
fi
}
2023-05-10 16:26:40 +00:00
configurator_retrodeck_troubleshooting_dialog( ) {
2023-05-11 14:17:55 +00:00
choice = $( zenity --list --title= "RetroDECK Configurator Utility - RetroDECK: Troubleshooting" --cancel-label= "Back" \
2023-03-15 21:19:04 +00:00
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--column= "Choice" --column= "Action" \
2023-05-10 16:26:40 +00:00
"Backup: RetroDECK Userdata" "Compress and backup important RetroDECK user data folders" \
"Check & Verify: BIOS Files" "Show information about common BIOS files" \
2024-02-27 21:31:25 +00:00
"Check & Verify: BIOS Files - Expert Mode" "Show information about common BIOS files, with additional information useful for troubleshooting" \
2023-05-10 16:26:40 +00:00
"Check & Verify: Multi-file structure" "Verify the proper structure of multi-file or multi-disc games" \
"RetroDECK: Reset" "Reset specific parts or all of RetroDECK" )
2023-03-15 21:19:04 +00:00
case $choice in
2023-05-10 16:26:40 +00:00
"Backup: RetroDECK Userdata" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_generic_dialog "RetroDECK Configurator - Backup: RetroDECK Userdata" "This tool will compress important RetroDECK userdata (basically everything except the ROMs folder) into a zip file.\n\nThis process can take several minutes, and the resulting zip file can be found in the ~/retrodeck/backups folder."
(
backup_retrodeck_userdata
) |
zenity --icon-name= net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator Utility - Backup in Progress" \
--text= "Backing up RetroDECK userdata, please wait..."
2023-08-17 17:38:18 +00:00
if [ [ -f " $backups_folder / $( date +"%0m%0d" ) _retrodeck_userdata.zip " ] ] ; then
2023-05-10 16:26:40 +00:00
configurator_generic_dialog "RetroDECK Configurator - Backup: RetroDECK Userdata" "The backup process is now complete."
else
configurator_generic_dialog "RetroDECK Configurator - Backup: RetroDECK Userdata" "The backup process could not be completed,\nplease check the logs folder for more information."
fi
configurator_retrodeck_troubleshooting_dialog
2023-03-29 19:51:27 +00:00
; ;
2023-05-10 16:26:40 +00:00
"Check & Verify: BIOS Files" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_check_bios_files
2023-03-29 19:51:27 +00:00
; ;
2024-02-27 21:31:25 +00:00
"Check & Verify: BIOS Files - Expert Mode" )
configurator_check_bios_files_expert_mode
; ;
2023-05-10 16:26:40 +00:00
"Check & Verify: Multi-file structure" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_check_multifile_game_structure
2023-03-29 19:51:27 +00:00
; ;
2023-05-10 16:26:40 +00:00
"RetroDECK: Reset" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_reset_dialog
2023-03-29 19:51:27 +00:00
; ;
2023-03-12 18:21:30 +00:00
2023-03-15 21:19:04 +00:00
"" ) # No selection made or Back button clicked
2024-01-05 10:00:00 +00:00
log i "Configurator: going back"
2023-03-15 21:19:04 +00:00
configurator_welcome_dialog
; ;
esac
2023-03-07 15:06:08 +00:00
}
2023-05-05 15:18:37 +00:00
configurator_check_bios_files( ) {
2024-03-12 19:01:47 +00:00
configurator_generic_dialog "RetroDECK Configurator - Check & Verify: BIOS Files" "This check will look for BIOS files that RetroDECK has identified as working.\n\nNot all BIOS files are required for games to work, please check the BIOS description for more information on its purpose.\n\nBIOS files not known to this tool could still function.\n\nSome more advanced emulators such as Ryujinx will have additional methods to verify that the BIOS files are in working order."
2023-03-08 22:08:57 +00:00
bios_checked_list = ( )
2024-02-27 21:31:25 +00:00
check_bios_files "basic"
zenity --list --title= "RetroDECK Configurator Utility - Check & Verify: BIOS Files" --cancel-label= "Back" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--column "BIOS File Name" \
--column "System" \
--column "BIOS File Found" \
--column "BIOS Hash Match" \
--column "BIOS File Description" \
" ${ bios_checked_list [@] } "
configurator_retrodeck_troubleshooting_dialog
}
configurator_check_bios_files_expert_mode( ) {
2024-03-12 19:01:47 +00:00
configurator_generic_dialog "RetroDECK Configurator - Check & Verify: BIOS Files - Expert Mode" "This check will look for BIOS files that RetroDECK has identified as working.\n\nNot all BIOS files are required for games to work, please check the BIOS description for more information on its purpose.\n\nBIOS files not known to this tool could still function.\n\nSome more advanced emulators such as Ryujinx will have additional methods to verify that the BIOS files are in working order."
2024-02-27 21:31:25 +00:00
bios_checked_list = ( )
check_bios_files "expert"
2023-03-08 22:08:57 +00:00
2023-05-10 16:26:40 +00:00
zenity --list --title= "RetroDECK Configurator Utility - Check & Verify: BIOS Files" --cancel-label= "Back" \
2023-03-08 22:08:57 +00:00
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--column "BIOS File Name" \
--column "System" \
--column "BIOS File Found" \
--column "BIOS Hash Match" \
--column "BIOS File Description" \
2024-02-27 21:31:25 +00:00
--column "BIOS File Subdirectory" \
--column "BIOS File Hash" \
2023-03-08 22:08:57 +00:00
" ${ bios_checked_list [@] } "
2023-05-10 16:26:40 +00:00
configurator_retrodeck_troubleshooting_dialog
2023-03-08 22:08:57 +00:00
}
2023-05-10 16:26:40 +00:00
configurator_check_multifile_game_structure( ) {
local folder_games = ( $( find $roms_folder -maxdepth 2 -mindepth 2 -type d ! -name "*.m3u" ! -name "*.ps3" ) )
if [ [ ${# folder_games [@] } -gt 1 ] ] ; then
echo " $( find $roms_folder -maxdepth 2 -mindepth 2 -type d ! -name "*.m3u" ! -name "*.ps3" ) " > $logs_folder /multi_file_games_" $( date +"%Y_%m_%d_%I_%M_%p" ) .log "
zenity --icon-name= net.retrodeck.retrodeck --info --no-wrap \
2023-04-04 20:49:30 +00:00
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
2023-05-10 16:26:40 +00:00
--title "RetroDECK Configurator - Check & Verify: Multi-file structure" \
2024-01-04 07:25:59 +00:00
--text= " The following games were found to have the incorrect folder structure:\n\n $( find $roms_folder -maxdepth 2 -mindepth 2 -type d ! -name "*.m3u" ! -name "*.ps3" ) \n\nIncorrect folder structure can result in failure to launch games or saves being in the incorrect location.\n\nPlease see the RetroDECK wiki for more details!\n\nYou can find this list of games in ~/retrodeck/logs "
2023-04-04 20:49:30 +00:00
else
2023-05-10 16:26:40 +00:00
configurator_generic_dialog "RetroDECK Configurator - Check & Verify: Multi-file structure" "No incorrect multi-file game folder structures found."
2023-04-04 20:49:30 +00:00
fi
2023-05-10 16:26:40 +00:00
configurator_retrodeck_troubleshooting_dialog
2023-04-04 20:49:30 +00:00
}
2023-05-10 16:26:40 +00:00
configurator_reset_dialog( ) {
2024-03-09 13:37:42 +00:00
local choices = (
2024-03-13 07:54:54 +00:00
"Reset Emulator or Engine" "Reset only one specific emulator or engine to default settings"
2024-03-09 13:37:42 +00:00
"Reset RetroDECK Component" "Reset a single component, components are parts of RetroDECK that are not emulators"
"Reset All Emulators and Components" "Reset all emulators and components to default settings"
"Reset RetroDECK" "Reset RetroDECK to default settings"
)
2023-05-10 16:26:40 +00:00
choice = $( zenity --list --title= "RetroDECK Configurator Utility - RetroDECK: Reset" --cancel-label= "Back" \
2023-03-07 19:55:24 +00:00
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--column= "Choice" --column= "Action" \
2024-03-09 13:37:42 +00:00
" ${ choices [@] } " )
2023-03-07 15:06:08 +00:00
2024-03-08 17:21:43 +00:00
local emulator_list = (
"RetroArch" "Reset the multi-emulator frontend RetroArch to default settings"
"Cemu" "Reset the Wii U emulator Cemu to default settings"
"Dolphin" "Reset the Wii/GameCube emulator Dolphin to default settings"
"Duckstation" "Reset the PSX emulator Duckstation to default settings"
"GZDoom" "Reset the GZDoom Doom engine to default settings"
"MAME" "Reset the Multiple Arcade Machine Emulator (MAME) to default settings"
"MelonDS" "Reset the NDS emulator MelonDS to default settings"
"PCSX2" "Reset the PS2 emulator PCSX2 to default settings"
"PPSSPP" "Reset the PSP emulator PPSSPP to default settings"
"Primehack" "Reset the Metroid Prime emulator Primehack to default settings"
"RPCS3" "Reset the PS3 emulator RPCS3 to default settings"
"Ryujinx" "Reset the Switch emulator Ryujinx to default settings"
"Vita3k" "Reset the PS Vita emulator Vita3k to default settings"
"XEMU" "Reset the XBOX emulator XEMU to default settings"
)
# Check if any ponzu is true before adding Yuzu or Citra to the list
2024-03-09 08:32:45 +00:00
if [ [ $( get_setting_value " $rd_conf " "kiroi_ponzu" "retrodeck" "options" ) = = "true" ] ] ; then
2024-03-08 17:21:43 +00:00
emulator_list += ( "Yuzu" "Reset the Switch emulator Yuzu" )
fi
2024-03-09 08:32:45 +00:00
if [ [ $( get_setting_value " $rd_conf " "akai_ponzu" "retrodeck" "options" ) = = "true" ] ] ; then
2024-03-08 17:21:43 +00:00
emulator_list += ( "Citra" "Reset the 3DS emulator Citra" )
fi
2023-03-07 19:55:24 +00:00
case $choice in
2023-03-07 15:06:08 +00:00
2024-03-13 07:54:54 +00:00
"Reset Emulator or Engine" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2024-01-24 15:24:30 +00:00
component_to_reset = $( zenity --list \
2023-05-10 16:26:40 +00:00
--title "RetroDECK Configurator Utility - Reset Specific Standalone Emulator" --cancel-label= "Back" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
2024-01-24 15:28:05 +00:00
--text= "Which emulator or engine do you want to reset to default?" \
2023-05-10 16:26:40 +00:00
--column= "Emulator" --column= "Action" \
2024-03-08 17:21:43 +00:00
" ${ emulator_list [@] } " )
2024-01-24 15:28:05 +00:00
2024-01-24 15:24:30 +00:00
case $component_to_reset in
2023-03-07 19:55:24 +00:00
2023-12-11 15:30:35 +00:00
"RetroArch" | "Vita3k" | "XEMU" ) # Emulators that require network access
if [ [ $( check_network_connectivity) = = "true" ] ] ; then
2024-01-24 15:24:30 +00:00
if [ [ $( configurator_reset_confirmation_dialog " $component_to_reset " " Are you sure you want to reset the $component_to_reset emulator to default settings?\n\nThis process cannot be undone. " ) = = "true" ] ] ; then
prepare_component "reset" " $component_to_reset " "configurator"
configurator_process_complete_dialog " resetting $component_to_reset "
2023-12-11 15:30:35 +00:00
else
configurator_generic_dialog "RetroDeck Configurator - RetroDECK: Reset" "Reset process cancelled."
configurator_reset_dialog
fi
2023-05-10 16:26:40 +00:00
else
2023-12-11 15:30:35 +00:00
configurator_generic_dialog "RetroDeck Configurator - RetroDECK: Reset" "Resetting this emulator requires active network access.\nPlease try again when you are connected to an Internet-capable network.\n\nReset process cancelled."
2023-05-10 16:26:40 +00:00
configurator_reset_dialog
fi
; ;
2024-03-19 08:21:18 +00:00
"Cemu" | "Citra" | "Dolphin" | "Duckstation" | "GZDoom" | "Yuzu" | "MelonDS" | "MAME" | "PCSX2" | "PPSSPP" | "Primehack" | "RPCS3" | "Ryujinx" )
2024-01-24 15:24:30 +00:00
if [ [ $( configurator_reset_confirmation_dialog " $component_to_reset " " Are you sure you want to reset the $component_to_reset emulator to default settings?\n\nThis process cannot be undone. " ) = = "true" ] ] ; then
prepare_component "reset" " $component_to_reset " "configurator"
configurator_process_complete_dialog " resetting $component_to_reset "
else
configurator_generic_dialog "RetroDeck Configurator - RetroDECK: Reset" "Reset process cancelled."
configurator_reset_dialog
fi
; ;
"" ) # No selection made or Back button clicked
configurator_reset_dialog
; ;
esac
; ;
"Reset RetroDECK Component" )
component_to_reset = $( zenity --list \
--title "RetroDECK Configurator Utility - Reset Specific RetroDECK Component" --cancel-label= "Back" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
2024-03-12 19:01:47 +00:00
--text= "Which component do you want to reset to default settings?" \
2024-01-24 15:24:30 +00:00
--column= "Component" --column= "Action" \
2024-02-26 12:50:47 +00:00
"BoilR" "Reset BoilR that manages the sync and scraping toward Steam library" \
2024-01-24 15:24:30 +00:00
"ES-DE" "Reset the ES-DE frontend" \ )
2024-01-24 15:28:05 +00:00
# TODO: "GyroDSU" "Reset the gyroscope manager GyroDSU"
2024-01-24 15:24:30 +00:00
case $component_to_reset in
2024-01-24 15:28:05 +00:00
"BoilR" | "ES-DE" ) # TODO: GyroDSU
2024-01-24 15:24:30 +00:00
if [ [ $( configurator_reset_confirmation_dialog " $component_to_reset " " Are you sure you want to reset $component_to_reset to default settings?\n\nThis process cannot be undone. " ) = = "true" ] ] ; then
prepare_component "reset" " $component_to_reset " "configurator"
configurator_process_complete_dialog " resetting $component_to_reset "
2023-05-10 16:26:40 +00:00
else
configurator_generic_dialog "RetroDeck Configurator - RetroDECK: Reset" "Reset process cancelled."
configurator_reset_dialog
fi
; ;
"" ) # No selection made or Back button clicked
configurator_reset_dialog
; ;
2023-03-08 22:08:57 +00:00
2023-05-10 16:26:40 +00:00
esac
2023-03-16 20:56:24 +00:00
; ;
2024-03-19 08:18:08 +00:00
"Reset All Emulators and Components" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-12-11 15:30:35 +00:00
if [ [ $( check_network_connectivity) = = "true" ] ] ; then
if [ [ $( configurator_reset_confirmation_dialog "all emulators" "Are you sure you want to reset all emulators to default settings?\n\nThis process cannot be undone." ) = = "true" ] ] ; then
(
2024-01-16 08:14:27 +00:00
prepare_component "reset" "all"
2023-12-11 15:30:35 +00:00
) |
zenity --icon-name= net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Finishing Initialization" \
--text= "RetroDECK is finishing the reset process, please wait."
configurator_process_complete_dialog "resetting all emulators"
else
configurator_generic_dialog "RetroDeck Configurator - RetroDECK: Reset" "Reset process cancelled."
configurator_reset_dialog
fi
2023-05-10 16:26:40 +00:00
else
2023-12-11 15:30:35 +00:00
configurator_generic_dialog "RetroDeck Configurator - RetroDECK: Reset" "Resetting all emulators requires active network access.\nPlease try again when you are connected to an Internet-capable network.\n\nReset process cancelled."
2023-05-10 16:26:40 +00:00
configurator_reset_dialog
fi
; ;
2023-04-04 20:49:30 +00:00
2023-05-10 16:26:40 +00:00
"Reset RetroDECK" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
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 \
--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, where you will go through the initial setup process."
rm -f " $lockfile "
rm -f " $rd_conf "
configurator_process_complete_dialog "resetting RetroDECK"
else
configurator_generic_dialog "RetroDeck Configurator - RetroDECK: Reset" "Reset process cancelled."
configurator_reset_dialog
fi
; ;
"" ) # No selection made or Back button clicked
configurator_retrodeck_troubleshooting_dialog
; ;
esac
}
configurator_about_retrodeck_dialog( ) {
2023-05-11 14:17:55 +00:00
choice = $( zenity --list --title= "RetroDECK Configurator Utility - RetroDECK: About" --cancel-label= "Back" \
2023-05-10 16:26:40 +00:00
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--column= "Choice" --column= "Description" \
"Version History" "View the version changelogs for RetroDECK" \
"Credits" "View the contribution credits for RetroDECK" )
2023-04-28 13:12:32 +00:00
2023-05-10 16:26:40 +00:00
case $choice in
"Version History" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_version_history_dialog
2023-04-26 15:11:32 +00:00
; ;
2023-05-10 16:26:40 +00:00
"Credits" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
zenity --icon-name= net.retrodeck.retrodeck --text-info --width= 1200 --height= 720 \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Credits" \
--filename= " $emuconfigs /defaults/retrodeck/reference_lists/retrodeck_credits.txt "
2023-05-10 21:02:19 +00:00
configurator_about_retrodeck_dialog
2023-04-18 18:00:42 +00:00
; ;
2023-03-07 19:55:24 +00:00
"" ) # No selection made or Back button clicked
2024-01-05 10:00:00 +00:00
log i "Configurator: going back"
2023-03-07 19:55:24 +00:00
configurator_welcome_dialog
; ;
esac
2023-03-07 15:06:08 +00:00
}
2023-09-28 13:29:33 +00:00
configurator_add_steam( ) {
2024-02-18 09:48:04 +00:00
if [ [ $( get_setting_value $rd_conf "steam_sync" retrodeck "options" ) = = "true" ] ] ; then
zenity --question \
--no-wrap --window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator - RetroDECK Steam Syncronization" \
2024-03-12 19:01:47 +00:00
--text= "Steam syncronization is currently enabled. Do you want to disable it?\n\nThe already added shortcut will not be removed.\n"
2024-02-18 09:48:04 +00:00
if [ $? = = 0 ] # User clicked "Yes"
then
disable_steam_sync
else # User clicked "Cancel"
configurator_welcome_dialog
fi
else
zenity --question \
--no-wrap --window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator - RetroDECK Steam Syncronization" \
2024-03-12 19:01:47 +00:00
--text= "Steam syncronization is currently disabled. Do you want to enable it?\n\nAll the games marked as favorites will be syncronized with Steam thanks to BoilR.\nRemember to restart Steam each time to see the changes.\n"
2024-02-18 09:48:04 +00:00
if [ $? = = 0 ]
then
enable_steam_sync
else
configurator_welcome_dialog
fi
fi
}
enable_steam_sync( ) {
set_setting_value $rd_conf "steam_sync" "true" retrodeck "options"
zenity --icon-name= net.retrodeck.retrodeck --info --no-wrap --ok-label= "OK" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator - RetroDECK Steam Syncronization" \
--text= "Steam syncronization enabled, restart RetroDECK to get effect."
configurator_welcome_dialog
}
disable_steam_sync( ) {
set_setting_value $rd_conf "steam_sync" "false" retrodeck "options"
touch /tmp/retrodeck_steam_sync_exit
configurator_welcome_dialog
2023-09-28 13:29:33 +00:00
}
2023-05-10 16:26:40 +00:00
configurator_version_history_dialog( ) {
2023-05-16 16:29:36 +00:00
local version_array = ( $( xml sel -t -v '//component/releases/release/@version' -n $rd_appdata ) )
2023-05-10 16:26:40 +00:00
local all_versions_list = ( )
for rd_version in ${ version_array [*] } ; do
all_versions_list = ( " ${ all_versions_list [@] } " " RetroDECK $rd_version Changelog " " View the changes specific to version $rd_version " )
done
2023-05-13 16:05:50 +00:00
2023-05-10 16:26:40 +00:00
choice = $( zenity --list --title= "RetroDECK Configurator Utility - RetroDECK Version History" --cancel-label= "Back" \
2023-04-25 14:59:57 +00:00
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
2023-05-10 16:26:40 +00:00
--column= "Choice" --column= "Description" \
"Full RetroDECK Changelog" "View the list of all changes that have ever been made to RetroDECK" \
" ${ all_versions_list [@] } " )
2022-11-20 21:09:13 +00:00
2023-04-25 14:59:57 +00:00
case $choice in
2022-11-20 21:09:13 +00:00
2023-05-10 16:26:40 +00:00
"Full RetroDECK Changelog" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
changelog_dialog "all"
2023-04-25 14:59:57 +00:00
; ;
2022-11-20 21:09:13 +00:00
2023-05-10 16:26:40 +00:00
"RetroDECK" *"Changelog" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
local version = $( echo " $choice " | sed 's/^RetroDECK \(.*\) Changelog$/\1/' )
changelog_dialog " $version "
2023-04-25 14:59:57 +00:00
; ;
2022-11-21 19:02:19 +00:00
2023-05-10 16:26:40 +00:00
esac
2022-11-21 19:02:19 +00:00
2023-05-10 16:26:40 +00:00
configurator_about_retrodeck_dialog
}
2022-11-20 21:09:13 +00:00
2023-05-10 16:26:40 +00:00
configurator_developer_dialog( ) {
choice = $( zenity --list --title= "RetroDECK Configurator Utility - Developer Options" --cancel-label= "Back" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--column= "Choice" --column= "Description" \
"Change Multi-user mode" "Enable or disable multi-user support" \
"Change Update Channel" "Change between normal and cooker builds" \
2023-05-15 18:43:31 +00:00
"Browse the Wiki" "Browse the RetroDECK wiki online" \
2023-05-18 14:23:05 +00:00
"USB Import" "Prepare a USB device for ROMs or import an existing collection" \
"Install RetroDECK Starter Pack" "Install the optional RetroDECK starter pack" )
2023-01-10 16:41:09 +00:00
2023-05-10 16:26:40 +00:00
case $choice in
2022-11-20 21:09:13 +00:00
2023-05-10 16:26:40 +00:00
"Change Multi-user mode" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_retrodeck_multiuser_dialog
2023-04-25 14:59:57 +00:00
; ;
2023-05-10 16:26:40 +00:00
"Change Update Channel" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
configurator_online_update_channel_dialog
2023-04-25 14:59:57 +00:00
; ;
2022-11-20 21:09:13 +00:00
2023-05-10 16:26:40 +00:00
"Browse the Wiki" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-10 16:26:40 +00:00
xdg-open "https://github.com/XargonWan/RetroDECK/wiki"
2023-05-19 13:21:32 +00:00
configurator_developer_dialog
2023-04-25 14:59:57 +00:00
; ;
2023-01-10 16:41:09 +00:00
2023-05-15 18:43:31 +00:00
"USB Import" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-15 18:43:31 +00:00
configurator_usb_import_dialog
; ;
2023-05-18 14:23:05 +00:00
"Install RetroDECK Starter Pack" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-18 14:23:05 +00:00
if [ [ $( configurator_generic_question_dialog "Install: RetroDECK Starter Pack" "The RetroDECK creators have put together a collection of classic retro games you might enjoy!\n\nWould you like to have them automatically added to your library?" ) = = "true" ] ] ; then
install_retrodeck_starterpack
fi
configurator_developer_dialog
; ;
2023-05-10 16:26:40 +00:00
"" ) # No selection made or Back button clicked
2024-01-05 10:00:00 +00:00
log i "Configurator: going back"
2023-05-10 16:26:40 +00:00
configurator_welcome_dialog
; ;
2023-04-25 14:59:57 +00:00
esac
2022-10-07 17:46:48 +00:00
}
2023-05-10 16:26:40 +00:00
configurator_retrodeck_multiuser_dialog( ) {
if [ [ $( get_setting_value $rd_conf "multi_user_mode" retrodeck "options" ) = = "true" ] ] ; then
2023-03-27 19:52:58 +00:00
zenity --question \
--no-wrap --window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
2023-05-10 16:26:40 +00:00
--title "RetroDECK Configurator - RetroDECK Multi-user Support" \
2024-03-12 19:01:47 +00:00
--text= "Multi-user support is currently enabled. Do you want to disable it?\n\nIf there is more than one user configured,\nyou will be given a choice of which to use as the single RetroDECK user.\n\nThis user's files will be moved to the default locations.\n\nOther users' files will remain in the mutli-user-data folder.\n"
2023-03-27 19:52:58 +00:00
if [ $? = = 0 ] # User clicked "Yes"
then
2023-05-10 16:26:40 +00:00
multi_user_disable_multi_user_mode
2023-03-27 19:52:58 +00:00
else # User clicked "Cancel"
configurator_developer_dialog
fi
else
zenity --question \
--no-wrap --window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
2023-05-10 16:26:40 +00:00
--title "RetroDECK Configurator - RetroDECK Multi-user support" \
2024-03-12 19:01:47 +00:00
--text= "Multi-user support is currently disabled. Do you want to enable it?\n\nThe current user's saves and states will be backed up and then moved to the \"retrodeck/multi-user-data\" folder.\nAdditional users will automatically be stored in their own folder here as they are added."
2023-03-27 19:52:58 +00:00
2023-05-10 16:26:40 +00:00
if [ $? = = 0 ]
2023-03-27 19:52:58 +00:00
then
2023-05-10 16:26:40 +00:00
multi_user_enable_multi_user_mode
else
2023-03-27 19:52:58 +00:00
configurator_developer_dialog
fi
fi
}
2023-03-30 14:04:11 +00:00
configurator_online_update_channel_dialog( ) {
2023-04-05 18:21:50 +00:00
if [ [ $( get_setting_value $rd_conf "update_repo" retrodeck "options" ) = = "RetroDECK" ] ] ; then
2023-03-27 19:52:58 +00:00
zenity --question \
--no-wrap --window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator - RetroDECK Change Update Branch" \
--text= "You are currently on the production branch of RetroDECK updates. Would you like to switch to the cooker branch?\n\nAfter installing a cooker build, you may need to remove the \"stable\" branch install of RetroDECK to avoid overlap."
if [ $? = = 0 ] # User clicked "Yes"
then
2023-04-05 18:21:50 +00:00
set_setting_value $rd_conf "update_repo" "RetroDECK-cooker" retrodeck "options"
2023-03-27 19:52:58 +00:00
else # User clicked "Cancel"
configurator_developer_dialog
fi
else
zenity --question \
--no-wrap --window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator - RetroDECK Change Update Branch" \
2023-03-30 14:04:11 +00:00
--text= "You are currently on the cooker branch of RetroDECK updates. Would you like to switch to the production branch?\n\nAfter installing a production build, you may need to remove the \"cooker\" branch install of RetroDECK to avoid overlap."
2023-03-27 19:52:58 +00:00
if [ $? = = 0 ] # User clicked "Yes"
then
2023-04-05 18:21:50 +00:00
set_setting_value $rd_conf "update_repo" "RetroDECK" retrodeck "options"
2023-03-27 19:52:58 +00:00
else # User clicked "Cancel"
configurator_developer_dialog
fi
fi
}
2023-05-15 18:43:31 +00:00
configurator_usb_import_dialog( ) {
choice = $( zenity --list --title= "RetroDECK Configurator Utility - Developer Options" --cancel-label= "Back" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--column= "Choice" --column= "Description" \
"Prepare USB device" "Create ROM folders on a selected USB device" \
"Import from USB" "Import collection from a previously prepared device" )
case $choice in
"Prepare USB device" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-15 18:43:31 +00:00
external_devices = ( )
while read -r size device_path; do
device_name = $( basename " $device_path " )
external_devices = ( " ${ external_devices [@] } " " $device_name " " $size " " $device_path " )
done < <( df --output= size,target | grep media | grep -v $default_sd | awk '{$1=$1;print}' )
if [ [ " ${# external_devices [@] } " -gt 0 ] ] ; then
choice = $( zenity --list --title= "RetroDECK Configurator Utility - USB Migration Tool" --cancel-label= "Back" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--hide-column= 3 --print-column= 3 \
--column "Device Name" \
--column "Device Size" \
--column "path" \
" ${ external_devices [@] } " )
if [ [ ! -z " $choice " ] ] ; then
2024-02-21 09:00:52 +00:00
es-de --home " $choice " --create-system-dirs
2024-02-19 15:21:43 +00:00
rm -rf " $choice /ES-DE " # Cleanup unnecessary folder
2023-05-15 18:43:31 +00:00
fi
else
configurator_generic_dialog "RetroDeck Configurator - USB Import" "There were no USB devices found."
fi
configurator_usb_import_dialog
; ;
"Import from USB" )
2024-01-05 10:00:00 +00:00
log i " Configurator: opening \" $choice \" menu "
2023-05-15 18:43:31 +00:00
external_devices = ( )
while read -r size device_path; do
if [ [ -d " $device_path /ROMs " ] ] ; then
device_name = $( basename " $device_path " )
external_devices = ( " ${ external_devices [@] } " " $device_name " " $size " " $device_path " )
fi
done < <( df --output= size,target | grep media | grep -v $default_sd | awk '{$1=$1;print}' )
if [ [ " ${# external_devices [@] } " -gt 0 ] ] ; then
choice = $( zenity --list --title= "RetroDECK Configurator Utility - USB Migration Tool" --cancel-label= "Back" \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width= 1200 --height= 720 \
--hide-column= 3 --print-column= 3 \
--column "Device Name" \
--column "Device Size" \
--column "path" \
" ${ external_devices [@] } " )
if [ [ ! -z " $choice " ] ] ; then
2023-05-16 14:21:23 +00:00
if [ [ $( verify_space " $choice /ROMs " " $roms_folder " ) = = "false" ] ] ; then
2023-05-15 18:43:31 +00:00
if [ [ $( configurator_generic_question_dialog "RetroDECK Configurator Utility - USB Migration Tool" "You MAY not have enough free space to import this ROM library.\n\nThis utility only imports new additions from the USB device, so if there are a lot of the same ROMs in both locations you are likely going to be fine\nbut we are not able to verify how much data will be transferred before it happens.\n\nIf you are unsure, please verify your available free space before continuing.\n\nDo you want to continue now?" ) = = "true" ] ] ; then
(
rsync -a --mkpath " $choice /ROMs/ " * " $roms_folder "
) |
zenity --icon-name= net.retrodeck.retrodeck --progress --no-cancel --auto-close \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator Utility - USB Import In Progress"
configurator_generic_dialog "RetroDECK Configurator - USB Migration Tool" "The import process is complete!"
fi
else
(
rsync -a --mkpath " $choice /ROMs/ " * " $roms_folder "
) |
zenity --icon-name= net.retrodeck.retrodeck --progress --no-cancel --auto-close \
--window-icon= "/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator Utility - USB Import In Progress"
configurator_generic_dialog "RetroDECK Configurator - USB Migration Tool" "The import process is complete!"
fi
fi
else
configurator_generic_dialog "RetroDeck Configurator - USB Import" "There were no USB devices found with an importable folder."
fi
configurator_usb_import_dialog
; ;
"" ) # No selection made or Back button clicked
2024-01-05 10:00:00 +00:00
log i "Configurator: going back"
2023-05-15 18:43:31 +00:00
configurator_developer_dialog
; ;
esac
}
2022-10-07 17:46:48 +00:00
# START THE CONFIGURATOR
2022-10-04 16:21:46 +00:00
2023-04-14 13:10:52 +00:00
configurator_welcome_dialog