From 74b2c0f596cf8436b533db19995ca57cff436668 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Sat, 9 Mar 2024 14:37:42 +0100 Subject: [PATCH] PONZU: added removal function --- functions/functions.sh | 24 ++++++++++++++++++++++ tools/configurator.sh | 45 ++++++++++++++++++++++++++++++++---------- 2 files changed, 59 insertions(+), 10 deletions(-) diff --git a/functions/functions.sh b/functions/functions.sh index cc005049..ea480070 100644 --- a/functions/functions.sh +++ b/functions/functions.sh @@ -725,6 +725,30 @@ ponzu() { rm -rf "$rdhome/ponzu" } +ponzu_remove(){ + + # Call me with yuzu or citra and I will remove them + + if [[ "$1" == "citra" ]]; then + if [[ $(configurator_generic_question_dialog "Ponzu - Remove Citra" "Do you really want to remove Citra binaries?\n\nYour games and saves will not be deleted.") == "true" ]]; then + log i "Ponzu: removing Citra" + rm -rf "/var/data/ponzu/Citra" + set_setting_value $rd_conf "akai_ponzu" "false" retrodeck "options" + configurator_generic_dialog "Ponzu - Remove Citra" "Done, Citra is now removed from RetroDECK" + fi + elif [[ "$1" == "yuzu" ]]; then + if [[ $(configurator_generic_question_dialog "Ponzu - Remove Yuzu" "Do you really want to remove Yuzu binaries?\n\nYour games and saves will not be deleted.") == "true" ]]; then + log i "Ponzu: removing Yuzu" + rm -rf "/var/data/ponzu/Yuzu" + set_setting_value $rd_conf "kiroi_ponzu" "false" retrodeck "options" + configurator_generic_dialog "Ponzu - Remove Yuzu" "Done, Yuzu is now removed from RetroDECK" + fi + else + log e "Ponzu: \"$1\" is not a vaild choice for removal, quitting" + fi + configurator_retrodeck_tools_dialog +} + # TODO: this function is not yet used branch_selector() { log d "Fetch branches from GitHub API excluding \"main\"" diff --git a/tools/configurator.sh b/tools/configurator.sh index f4874ee8..c2b8f6eb 100644 --- a/tools/configurator.sh +++ b/tools/configurator.sh @@ -550,15 +550,27 @@ configurator_open_emulator_dialog() { } configurator_retrodeck_tools_dialog() { + + 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" + "Install: RetroDECK SD Controller Profile" "Install the custom RetroDECK controller layout for the Steam Deck" + "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 + choice=$(zenity --list --title="RetroDECK Configurator Utility - RetroDECK: Tools" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Action" \ - "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" \ - "Install: RetroDECK SD Controller Profile" "Install the custom RetroDECK controller layout for the Steam Deck" \ - "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" ) + "${choices[@]}") case $choice in @@ -625,6 +637,14 @@ configurator_retrodeck_tools_dialog() { configurator_online_update_setting_dialog ;; +"Ponzu - Remove Yuzu" ) + ponzu_remove "yuzu" +;; + +"Ponzu - Remove Citra" ) + ponzu_remove "citra" +;; + "" ) # No selection made or Back button clicked log i "Configurator: going back" configurator_welcome_dialog @@ -1059,13 +1079,18 @@ configurator_check_multifile_game_structure() { } configurator_reset_dialog() { + + local choices=( + "Reset Specific Emulator" "Reset only one specific emulator or engine to default settings" + "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" + ) + choice=$(zenity --list --title="RetroDECK Configurator Utility - RetroDECK: Reset" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --column="Choice" --column="Action" \ - "Reset Specific Emulator" "Reset only one specific emulator or engine to default settings" \ - "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" ) + "${choices[@]}") local emulator_list=( "RetroArch" "Reset the multi-emulator frontend RetroArch to default settings"