Add Nintendo Button Layout Configurator menu

Add login timestamp to cheevos login for Duckstation and PCSX2
Add processing dialog to reset all
Change Duckstation config location to /var/config to match new location
Add cheevos required sections to shipped PXSX2 and Duckstation configs
Add cheevos hardcore mode presets for PCSX2 and Duckstation
This commit is contained in:
icenine451 2023-05-13 12:05:50 -04:00
parent 95da78b8e2
commit 4a0bc26084
10 changed files with 59 additions and 23 deletions

View file

@ -446,4 +446,12 @@ PressureModifier = 0.500000
[GameList] [GameList]
RecursivePaths = RETRODECKHOMEDIR/roms/ps2 RecursivePaths = RETRODECKHOMEDIR/roms/ps2
[Achievements]
Enabled = false
ChallengeMode = false
Username =
Token =
LoginTimestamp =

View file

@ -4,3 +4,5 @@ defaults_file^$emuconfigs/duckstation/settings.ini
change^cheevos^Enabled^true^Cheevos change^cheevos^Enabled^true^Cheevos
change^cheevos^Username^$cheevos_username^Cheevos change^cheevos^Username^$cheevos_username^Cheevos
change^cheevos^Token^$cheevos_token^Cheevos change^cheevos^Token^$cheevos_token^Cheevos
change^cheevos^LoginTimestamp^$cheevos_login_timestamp
change^cheevos_hardcore^ChallengeMode^true

View file

@ -4,3 +4,5 @@ defaults_file^$emuconfigs/PCSX2/PCSX2.ini
change^cheevos^Enabled^true^Achievements change^cheevos^Enabled^true^Achievements
change^cheevos^Username^$cheevos_username^Achievements change^cheevos^Username^$cheevos_username^Achievements
change^cheevos^Token^$cheevos_token^Achievements change^cheevos^Token^$cheevos_token^Achievements
change^cheevos^LoginTimestamp^$cheevos_login_timestamp
change^cheevos_hardcore^ChallengeMode^true

View file

@ -34,6 +34,8 @@ PCSX2=false
RetroArch=false RetroArch=false
[cheevos_hardcore] [cheevos_hardcore]
Duckstation=false
PCSX2=false
RetroArch=false RetroArch=false
[borders] [borders]

View file

@ -92,7 +92,7 @@ ShowEnhancements = false
Fullscreen = false Fullscreen = false
VSync = false VSync = false
DisplayAllFrames = false DisplayAllFrames = false
PostProcessChain = PostProcessChain =
MaxFPS = 0.000000 MaxFPS = 0.000000
InternalResolutionScreenshots = false InternalResolutionScreenshots = false
@ -119,9 +119,9 @@ DumpOnBoot = false
[BIOS] [BIOS]
SearchDirectory = RETRODECKHOMEDIR/bios SearchDirectory = RETRODECKHOMEDIR/bios
PathNTSCU = PathNTSCU =
PathNTSCJ = PathNTSCJ =
PathPAL = PathPAL =
PatchTTYEnable = false PatchTTYEnable = false
PatchFastBoot = false PatchFastBoot = false
@ -193,7 +193,7 @@ MultitapMode = Disabled
[Logging] [Logging]
LogLevel = Info LogLevel = Info
LogFilter = LogFilter =
LogToConsole = true LogToConsole = true
LogToDebug = false LogToDebug = false
LogToWindow = false LogToWindow = false
@ -244,10 +244,19 @@ UndoLoadState = Keyboard/Control+9
[Cheevos] [Cheevos]
Enabled = true Enabled = false
TestMode = false TestMode = false
UnofficialTestMode = false UnofficialTestMode = false
UseFirstDiscFromPlaylist = true UseFirstDiscFromPlaylist = true
RichPresence = true
ChallengeMode = false
Leaderboards = true
Notifications = true
SoundEffects = true
PrimedIndicators = true
Username =
Token =
LoginTimestamp =
[UI] [UI]
@ -256,4 +265,4 @@ MainWindowState = AAAA/wAAAAD9AAAAAAAAAyAAAAI9AAAABAAAAAQAAAAIAAAACPwAAAABAAAAAg
[GameList] [GameList]
RecursivePaths = RETRODECKHOMEDIR/roms/psx RecursivePaths = RETRODECKHOMEDIR/roms/psx

View file

@ -190,8 +190,9 @@ get_cheevos_token_dialog() {
local cheevos_response=$(curl --silent --data "r=login&u=$cheevos_username&p=$cheevos_password" $RA_API_URL) 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_success=$(echo $cheevos_response | jq .Success | tr -d '"')
local cheevos_token=$(echo $cheevos_response | jq .Token | tr -d '"') local cheevos_token=$(echo $cheevos_response | jq .Token | tr -d '"')
local cheevos_login_timestamp=$(date +%s)
if [[ "$cheevos_success" == "true" ]]; then if [[ "$cheevos_success" == "true" ]]; then
echo "$cheevos_username,$cheevos_token" echo "$cheevos_username,$cheevos_token,$cheevos_login_timestamp"
else else
echo "failed" echo "failed"
fi fi

View file

@ -50,7 +50,7 @@ incompatible_presets_reference_list="$emuconfigs/defaults/retrodeck/reference_li
cemuconf="/var/config/Cemu/settings.xml" cemuconf="/var/config/Cemu/settings.xml"
citraconf="/var/config/citra-emu/qt-config.ini" citraconf="/var/config/citra-emu/qt-config.ini"
duckstationconf="/var/data/duckstation/settings.ini" duckstationconf="/var/config/duckstation/settings.ini"
melondsconf="/var/config/melonDS/melonDS.ini" melondsconf="/var/config/melonDS/melonDS.ini"
ppssppconf="/var/config/ppsspp/PSP/SYSTEM/ppsspp.ini" ppssppconf="/var/config/ppsspp/PSP/SYSTEM/ppsspp.ini"
ryujinxconf="/var/config/Ryujinx/Config.json" ryujinxconf="/var/config/Ryujinx/Config.json"

View file

@ -95,9 +95,9 @@ post_update() {
deploy_single_patch "$emuconfigs/PCSX2/PCSX2.ini" "/var/config/PCSX2/inis/PCSX2-cheevos-upgrade.patch" "$pcsx2qtconf" deploy_single_patch "$emuconfigs/PCSX2/PCSX2.ini" "/var/config/PCSX2/inis/PCSX2-cheevos-upgrade.patch" "$pcsx2qtconf"
rm -f "/var/config/PCSX2/inis/PCSX2-cheevos-upgrade.patch" rm -f "/var/config/PCSX2/inis/PCSX2-cheevos-upgrade.patch"
mv -f "$duckstationconf" "$duckstationconf.bak" mv -f "$duckstationconf" "$duckstationconf.bak"
generate_single_patch "$emuconfigs/duckstation/settings.ini" "$duckstationconf.bak" "/var/data/duckstation/duckstation-cheevos-upgrade.patch" pcsx2 generate_single_patch "$emuconfigs/duckstation/settings.ini" "$duckstationconf.bak" "/var/config/duckstation/duckstation-cheevos-upgrade.patch" pcsx2
deploy_single_patch "$emuconfigs/duckstation/settings.ini" "/var/data/duckstation/duckstation-cheevos-upgrade.patch" "$duckstationconf" deploy_single_patch "$emuconfigs/duckstation/settings.ini" "/var/config/duckstation/duckstation-cheevos-upgrade.patch" "$duckstationconf"
rm -f "/var/data/duckstation/duckstation-cheevos-upgrade.patch" rm -f "/var/config/duckstation/duckstation-cheevos-upgrade.patch"
mkdir -p "$mods_folder" mkdir -p "$mods_folder"
mkdir -p "$texture_packs_folder" mkdir -p "$texture_packs_folder"
@ -155,7 +155,7 @@ post_update() {
mkdir -p "$states_folder/psx" mkdir -p "$states_folder/psx"
mv -t "$states_folder/psx/" "$states_folder/duckstation" mv -t "$states_folder/psx/" "$states_folder/duckstation"
unlink "/var/data/duckstation/savestates" unlink "/var/data/duckstation/savestates"
dir_prep "$states_folder/psx/duckstation" "/var/data/duckstation/savestates" dir_prep "$states_folder/psx/duckstation" "/var/config/duckstation/savestates"
rm -rf /var/config/retrodeck/tools rm -rf /var/config/retrodeck/tools
rm -rf /var/config/emulationstation/.emulationstation/gamelists/tools/ rm -rf /var/config/emulationstation/.emulationstation/gamelists/tools/

View file

@ -261,22 +261,22 @@ prepare_emulator() {
dir_prep "$multi_user_data_folder/$SteamAppUser/config/duckstation" "/var/config/duckstation" dir_prep "$multi_user_data_folder/$SteamAppUser/config/duckstation" "/var/config/duckstation"
else # Single-user actions else # Single-user actions
rm -rf /var/config/duckstation rm -rf /var/config/duckstation
mkdir -p /var/data/duckstation/ mkdir -p /var/config/duckstation/
cp -fv "$emuconfigs/duckstation/"* /var/data/duckstation cp -fv "$emuconfigs/duckstation/"* /var/config/duckstation
set_setting_value "$duckstationconf" "SearchDirectory" "$bios_folder" "duckstation" "BIOS" set_setting_value "$duckstationconf" "SearchDirectory" "$bios_folder" "duckstation" "BIOS"
set_setting_value "$duckstationconf" "Card1Path" "$saves_folder/psx/duckstation/memcards/shared_card_1.mcd" "duckstation" "MemoryCards" set_setting_value "$duckstationconf" "Card1Path" "$saves_folder/psx/duckstation/memcards/shared_card_1.mcd" "duckstation" "MemoryCards"
set_setting_value "$duckstationconf" "Card2Path" "$saves_folder/psx/duckstation/memcards/shared_card_2.mcd" "duckstation" "MemoryCards" set_setting_value "$duckstationconf" "Card2Path" "$saves_folder/psx/duckstation/memcards/shared_card_2.mcd" "duckstation" "MemoryCards"
set_setting_value "$duckstationconf" "Directory" "$saves_folder/psx/duckstation/memcards" "duckstation" "MemoryCards" set_setting_value "$duckstationconf" "Directory" "$saves_folder/psx/duckstation/memcards" "duckstation" "MemoryCards"
fi fi
dir_prep "$saves_folder/psx/duckstation/memcards" "/var/data/duckstation/memcards" # TODO: This shouldn't be needed anymore, verify dir_prep "$saves_folder/psx/duckstation/memcards" "/var/config/duckstation/memcards" # TODO: This shouldn't be needed anymore, verify
dir_prep "$states_folder/psx/duckstation" "/var/data/duckstation/savestates" # This is hard-coded in Duckstation, always needed dir_prep "$states_folder/psx/duckstation" "/var/config/duckstation/savestates" # This is hard-coded in Duckstation, always needed
fi fi
if [[ "$action" == "postmove" ]]; then # Run only post-move commands if [[ "$action" == "postmove" ]]; then # Run only post-move commands
set_setting_value "$duckstationconf" "SearchDirectory" "$bios_folder" "duckstation" "BIOS" set_setting_value "$duckstationconf" "SearchDirectory" "$bios_folder" "duckstation" "BIOS"
set_setting_value "$duckstationconf" "Card1Path" "$saves_folder/psx/duckstation/memcards/shared_card_1.mcd" "duckstation" "MemoryCards" set_setting_value "$duckstationconf" "Card1Path" "$saves_folder/psx/duckstation/memcards/shared_card_1.mcd" "duckstation" "MemoryCards"
set_setting_value "$duckstationconf" "Card2Path" "$saves_folder/psx/duckstation/memcards/shared_card_2.mcd" "duckstation" "MemoryCards" set_setting_value "$duckstationconf" "Card2Path" "$saves_folder/psx/duckstation/memcards/shared_card_2.mcd" "duckstation" "MemoryCards"
set_setting_value "$duckstationconf" "Directory" "$saves_folder/psx/duckstation/memcards" "duckstation" "MemoryCards" set_setting_value "$duckstationconf" "Directory" "$saves_folder/psx/duckstation/memcards" "duckstation" "MemoryCards"
dir_prep "$states_folder/psx/duckstation" "/var/data/duckstation/savestates" # This is hard-coded in Duckstation, always needed dir_prep "$states_folder/psx/duckstation" "/var/config/duckstation/savestates" # This is hard-coded in Duckstation, always needed
fi fi
fi fi

View file

@ -183,7 +183,8 @@ configurator_global_presets_and_settings_dialog() {
"Enable/Disable Borders" "Enable or disable borders in supported systems" \ "Enable/Disable Borders" "Enable or disable borders in supported systems" \
"Enable/Disable Widescreen" "Enable or disable widescreen in supported systems" \ "Enable/Disable Widescreen" "Enable or disable widescreen in supported systems" \
"RetroAchievements Login" "Log into the RetroAchievements service in supported systems" \ "RetroAchievements Login" "Log into the RetroAchievements service in supported systems" \
"RetroAchievements Hardcore Mode" "Enable RetroAchievements hardcore mode (no cheats, rewind, save states etc.) in supported emulators" ) "RetroAchievements Hardcore Mode" "Enable RetroAchievements hardcore mode (no cheats, rewind, save states etc.) in supported emulators" \
"Nintendo Button Layout" "Enable or disable Nintendo button layout (swapped A/B and X/Y) in supported systems" )
case $choice in case $choice in
@ -201,7 +202,7 @@ configurator_global_presets_and_settings_dialog() {
local cheevos_creds=$(get_cheevos_token_dialog) local cheevos_creds=$(get_cheevos_token_dialog)
if [[ ! "$cheevos_creds" == "failed" ]]; then 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." 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") IFS=',' read -r cheevos_username cheevos_token cheevos_login_timestamp < <(printf '%s\n' "$cheevos_creds")
change_preset_dialog "cheevos" change_preset_dialog "cheevos"
else else
configurator_generic_dialog "RetroDECK Configurator Utility - RetroAchievements" "RetroAchievements login failed, please verify your username and password and try the process again." configurator_generic_dialog "RetroDECK Configurator Utility - RetroAchievements" "RetroAchievements login failed, please verify your username and password and try the process again."
@ -214,6 +215,11 @@ configurator_global_presets_and_settings_dialog() {
configurator_global_presets_and_settings_dialog configurator_global_presets_and_settings_dialog
;; ;;
"Nintendo Button Layout" )
change_preset_dialog "nintendo_button_layout"
configurator_global_presets_and_settings_dialog
;;
"" ) # No selection made or Back button clicked "" ) # No selection made or Back button clicked
configurator_presets_and_settings_dialog configurator_presets_and_settings_dialog
;; ;;
@ -575,7 +581,7 @@ configurator_retrodeck_move_tool_dialog() {
"Move Themes folder" ) "Move Themes folder" )
configurator_move_folder_dialog "themes_folder" configurator_move_folder_dialog "themes_folder"
;; ;;
"Move Screenshots folder" ) "Move Screenshots folder" )
configurator_move_folder_dialog "screenshots_folder" configurator_move_folder_dialog "screenshots_folder"
;; ;;
@ -968,7 +974,13 @@ configurator_reset_dialog() {
"Reset All Emulators" ) "Reset All Emulators" )
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 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
if [[ $(check_network_connectivity) == "true" ]]; then if [[ $(check_network_connectivity) == "true" ]]; then
(
prepare_emulator "reset" "all" prepare_emulator "reset" "all"
) |
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" configurator_process_complete_dialog "resetting all emulators"
else else
configurator_generic_dialog "RetroDeck Configurator - RetroDECK: Reset" "You do not appear to be connected to a network with internet access.\n\nThe all-emulator reset process requires some files from the internet to function properly.\n\nPlease retry this process once a network connection is available." configurator_generic_dialog "RetroDeck Configurator - RetroDECK: Reset" "You do not appear to be connected to a network with internet access.\n\nThe all-emulator reset process requires some files from the internet to function properly.\n\nPlease retry this process once a network connection is available."
@ -1037,7 +1049,7 @@ configurator_version_history_dialog() {
for rd_version in ${version_array[*]}; do 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") all_versions_list=("${all_versions_list[@]}" "RetroDECK $rd_version Changelog" "View the changes specific to version $rd_version")
done done
choice=$(zenity --list --title="RetroDECK Configurator Utility - RetroDECK Version History" --cancel-label="Back" \ choice=$(zenity --list --title="RetroDECK Configurator Utility - RetroDECK Version History" --cancel-label="Back" \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --width=1200 --height=720 \
--column="Choice" --column="Description" \ --column="Choice" --column="Description" \