diff --git a/config/retrodeck/retrodeck.cfg b/config/retrodeck/retrodeck.cfg index d7abe7a1..48843fa5 100644 --- a/config/retrodeck/retrodeck.cfg +++ b/config/retrodeck/retrodeck.cfg @@ -37,6 +37,7 @@ font=1 cheevos_login=false logging_level=info portmaster_reload_esde=true +portmaster_show=true [cheevos] duckstation=false diff --git a/functions/other_functions.sh b/functions/other_functions.sh index 1ddb8eac..6e893469 100644 --- a/functions/other_functions.sh +++ b/functions/other_functions.sh @@ -953,6 +953,16 @@ start_retrodeck() { get_steam_user # get steam user info splash_screen # Check if today has a surprise splashscreen and load it if so ponzu + + log d "Checking if PortMaster should be shown" + if [[ $(get_setting_value "$rd_conf" "portmaster_show" "retrodeck" "options") == "false" ]]; then + log d "Assuring that PortMaster is hidden on ES-DE" + portmaster_show "false" + else + log d "Assuring that PortMaster is shown on ES-DE" + portmaster_show "true" + fi + log i "Starting RetroDECK v$version" es-de } @@ -986,3 +996,17 @@ retroarch_updater(){ # Synchronize border overlays from the RetroDeck configuration directory to the RetroArch overlays directory rsync -rlD --mkpath "/app/retrodeck/config/retroarch/borders/" "/var/config/retroarch/overlays/borders/" && log d "RetroArch overlays and borders updated correctly" } + +portmaster_show(){ + log d "Setting PortMaster visibility in ES-DE" + if [ "$1" = "true" ]; then + log d "\"$roms_folder/portmaster/PortMaster.sh\" is not found, installing it" + install -Dm755 "/var/data/PortMaster/PortMaster.sh" "$roms_folder/portmaster/PortMaster.sh" && log d "PortMaster is correctly showing in ES-DE" + set_setting_value $rd_conf "portmaster_show" "true" retrodeck "options" + elif [ "$1" = "false" ]; then + rm -rf "$roms_folder/portmaster/PortMaster.sh" && log d "PortMaster is correctly hidden in ES-DE" + set_setting_value $rd_conf "portmaster_show" "false" retrodeck "options" + else + log e "\"$1\" is not a valid choice, quitting" + fi +} diff --git a/net.retrodeck.retrodeck.metainfo.xml b/net.retrodeck.retrodeck.metainfo.xml index 3f406719..b41b81b0 100644 --- a/net.retrodeck.retrodeck.metainfo.xml +++ b/net.retrodeck.retrodeck.metainfo.xml @@ -67,6 +67,7 @@ diff --git a/tools/configurator.sh b/tools/configurator.sh index b3ce586c..26baaaae 100755 --- a/tools/configurator.sh +++ b/tools/configurator.sh @@ -67,6 +67,7 @@ source /app/libexec/global.sh # - Install: PS3 firmware # - Install: PS Vita firmware # - RetroDECK: Change Update Setting +# - PortMaster: hide/show # - Troubleshooting # - Backup: RetroDECK Userdata # - Check & Verify: BIOS @@ -590,6 +591,7 @@ configurator_retrodeck_tools_dialog() { "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" + "PortMaster: hide/show" "Hide or show PortMaster in ES-DE" ) if [[ $(get_setting_value "$rd_conf" "kiroi_ponzu" "retrodeck" "options") == "true" ]]; then @@ -712,13 +714,18 @@ configurator_retrodeck_tools_dialog() { configurator_online_update_setting_dialog ;; -"Ponzu - Remove Yuzu" ) - ponzu_remove "yuzu" -;; + "PortMaster: hide/show" ) + log i "Configurator: opening \"$choice\" menu" + configurator_portmaster_toggle_dialog + ;; -"Ponzu - Remove Citra" ) - ponzu_remove "citra" -;; + "Ponzu - Remove Yuzu" ) + ponzu_remove "yuzu" + ;; + + "Ponzu - Remove Citra" ) + ponzu_remove "citra" + ;; "" ) # No selection made or Back button clicked log i "Configurator: going back" @@ -980,6 +987,44 @@ configurator_online_update_setting_dialog() { fi } +configurator_portmaster_toggle_dialog(){ + + if [[ $(get_setting_value "$rd_conf" "portmaster_show" "retrodeck" "options") == "true" ]]; then + rd_zenity --question \ + --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --title "RetroDECK Configurator - PortMaster Visibility" \ + --text="PortMaster is currently visible in ES-DE. Do you want to hide it?\n\nPlease note that the installed games will still be visible." + + if [ $? == 0 ] # User clicked "Yes" + then + portmaster_show "false" + rd_zenity --info \ + --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --title "RetroDECK Configurator - PortMaster Visibility" \ + --text="PortMaster is now hidden in ES-DE.\nPlease refresh your game list or restart RetroDECK to see the changes.\n\nIn order to launch PortMaster, you can access it from:\nConfigurator -> Open Emulator or Component -> PortMaster." + else # User clicked "Cancel" + configurator_retrodeck_tools_dialog + fi + else + rd_zenity --question \ + --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --title "RetroDECK Configurator - PortMaster Visibility" \ + --text="PortMaster is currently hidden in ES-DE. Do you want to show it?" + + if [ $? == 0 ] # User clicked "Yes" + then + portmaster_show "true" + rd_zenity --info \ + --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ + --title "RetroDECK Configurator - PortMaster Visibility" \ + --text="PortMaster is now visible in ES-DE.\nPlease refresh your game list or restart RetroDECK to see the changes." + else # User clicked "Cancel" + configurator_retrodeck_tools_dialog + fi + fi + configurator_retrodeck_tools_dialog +} + configurator_retrodeck_troubleshooting_dialog() { choice=$(rd_zenity --list --title="RetroDECK Configurator Utility - RetroDECK: Troubleshooting" --cancel-label="Back" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \