From efbaec77eda0600ed6e5ee1884d746e1611d2786 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Fri, 12 May 2023 14:28:51 -0400 Subject: [PATCH] Improve cheevos login process Fix PCSX2 config path variable Improve Configurator "launch RD after exit" Make jq and yq executable during build Implement RA and sample SNES presets --- .../defaults/retrodeck/presets/SNES_presets.cfg | 5 +++++ emu-configs/defaults/retrodeck/retrodeck.cfg | 2 +- functions.sh | 6 ++++-- global.sh | 11 ++++------- net.retrodeck.retrodeck.yml | 2 ++ rd-submodules/retroarch | 2 +- rd-submodules/shared-modules | 2 +- retrodeck.sh | 1 + tools/configurator.sh | 10 ++++++---- 9 files changed, 25 insertions(+), 16 deletions(-) diff --git a/emu-configs/defaults/retrodeck/presets/SNES_presets.cfg b/emu-configs/defaults/retrodeck/presets/SNES_presets.cfg index 0255c489..698f3728 100644 --- a/emu-configs/defaults/retrodeck/presets/SNES_presets.cfg +++ b/emu-configs/defaults/retrodeck/presets/SNES_presets.cfg @@ -5,3 +5,8 @@ change^cheevos^cheevos_enable^true change^cheevos^cheevos_token^$cheevos_token change^cheevos^cheevos_username^$cheevos_username change^cheevos_hardcore^cheevos_hardcore_mode_enable^true +change^borders^input_overlay^/var/config/retroarch/overlays/borders/pegasus/snes87.cfg +change^borders^input_overlay_aspect_adjust_landscape^0.305000 +change^borders^input_overlay_scale_landscape^1.050000 +change^borders^input_overlay_enable^true +change^widescreen^aspect_ratio_index^24 diff --git a/emu-configs/defaults/retrodeck/retrodeck.cfg b/emu-configs/defaults/retrodeck/retrodeck.cfg index b29e43d7..8da98f31 100644 --- a/emu-configs/defaults/retrodeck/retrodeck.cfg +++ b/emu-configs/defaults/retrodeck/retrodeck.cfg @@ -34,7 +34,7 @@ PCSX2=false RetroArch=false [cheevos_hardcore] -SNES=false +RetroArch=false [borders] SNES=false diff --git a/functions.sh b/functions.sh index c2ad8dbd..5089ba4e 100644 --- a/functions.sh +++ b/functions.sh @@ -2569,8 +2569,10 @@ get_cheevos_token_dialog() { --add-password="Password") IFS='^' read -r cheevos_username cheevos_password < <(printf '%s\n' "$cheevos_info") - cheevos_token=$(curl --silent --data "r=login&u=$cheevos_username&p=$cheevos_password" $RA_API_URL | jq .Token | tr -d '"') - if [[ ! "$cheevos_token" == "null" ]]; then + local cheevos_response=$(curl --silent --data "r=login&u=$cheevos_username&p=$cheevos_password" $RA_API_URL) + local cheevos_success=$(echo $cheevos_response | jq .Success | tr -d '"') + local cheevos_token=$(echo $cheevos_response | jq .Token | tr -d '"') + if [[ "$cheevos_success" == "true" ]]; then echo "$cheevos_username,$cheevos_token" else echo "failed" diff --git a/global.sh b/global.sh index 6215a12f..428e125e 100755 --- a/global.sh +++ b/global.sh @@ -67,13 +67,10 @@ dolphinqtconf="/var/config/dolphin-emu/Qt.ini" # PCSX2 config files -pcsx2conf="/var/config/PCSX2/inis/GS.ini" -pcsx2uiconf="/var/config/PCSX2/inis/PCSX2_ui.ini" -pcsx2vmconf="/var/config/PCSX2/inis/PCSX2_vm.ini" - -# PCSX2-QT config file - -pcsx2qtconf="/var/config/PCSX2/inis/PCSX2.ini" +pcsx2conf="/var/config/PCSX2/inis/PCSX2.ini" +pcsx2gsconf="/var/config/PCSX2/inis/GS.ini" # This file should be deprecated since moving to PCSX2-QT +pcsx2uiconf="/var/config/PCSX2/inis/PCSX2_ui.ini" # This file should be deprecated since moving to PCSX2-QT +pcsx2vmconf="/var/config/PCSX2/inis/PCSX2_vm.ini" # This file should be deprecated since moving to PCSX2-QT # Primehack config files diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index dc737c64..11bed28b 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -189,6 +189,7 @@ modules: buildsystem: simple build-commands: - cp jq-linux64 ${FLATPAK_DEST}/bin/jq + - chmod +x ${FLATPAK_DEST}/bin/jq sources: - type: file url: https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 @@ -198,6 +199,7 @@ modules: buildsystem: simple build-commands: - cp yq_linux_amd64 ${FLATPAK_DEST}/bin/yq + - chmod +x ${FLATPAK_DEST}/bin/yq sources: - type: file url: https://github.com/mikefarah/yq/releases/download/v4.33.3/yq_linux_amd64 diff --git a/rd-submodules/retroarch b/rd-submodules/retroarch index 78786102..0b1cfb79 160000 --- a/rd-submodules/retroarch +++ b/rd-submodules/retroarch @@ -1 +1 @@ -Subproject commit 78786102fc04cf104ef9bf2f0ebcacbdda357ae0 +Subproject commit 0b1cfb79e591e10488a3262d6b38db843c39a409 diff --git a/rd-submodules/shared-modules b/rd-submodules/shared-modules index 50314360..a2441b96 160000 --- a/rd-submodules/shared-modules +++ b/rd-submodules/shared-modules @@ -1 +1 @@ -Subproject commit 50314360ded6fa3b9f0b602513b1164b7a6636ed +Subproject commit a2441b964afefd8cd1cebcdf562c7878670daf42 diff --git a/retrodeck.sh b/retrodeck.sh index 086e5126..b803d12b 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -48,6 +48,7 @@ https://retrodeck.net cli_compress_all_games "$2" ;; --configurator*) + launched_from_cli="true" sh /app/tools/configurator.sh exit ;; diff --git a/tools/configurator.sh b/tools/configurator.sh index d5dddc1f..e5875972 100644 --- a/tools/configurator.sh +++ b/tools/configurator.sh @@ -138,7 +138,8 @@ configurator_welcome_dialog() { ;; "" ) - if [[ $(check_desktop_mode) == "true" ]]; then + if [[ $(check_desktop_mode) == "true" && "$launched_from_cli" == "true" ]]; then + launched_from_cli="false" launch_rd_after_exit=$(configurator_generic_question_dialog "RetroDECK Configurator" "Would you like to launch RetroDECK after closing the Configurator?") fi exit 1 @@ -198,9 +199,10 @@ configurator_global_presets_and_settings_dialog() { ;; "RetroAchievements Login" ) - cheevos_response=$(get_cheevos_token_dialog) - if [[ ! "$cheevos_response" == "failed" ]]; then - IFS=',' read -r cheevos_username cheevos_token < <(printf '%s\n' "$cheevos_response") + 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." + IFS=',' read -r cheevos_username cheevos_token < <(printf '%s\n' "$cheevos_creds") change_preset_dialog "cheevos" else configurator_generic_dialog "RetroDECK Configurator Utility - RetroAchievements" "RetroAchievements login failed, please verify your username and password and try the process again."