FRAMEWORK: finalized support for adding RetroDECK to Steam with offline assets

This commit is contained in:
XargonWan 2025-02-10 15:31:42 +09:00
parent af87ffa8e9
commit bd1f4d6817
6 changed files with 34 additions and 13 deletions

View file

@ -1,4 +1,5 @@
{
"title": "RetroDECK",
"target": "flatpak run net.retrodeck.retrodeck"
"target": "flatpak run net.retrodeck.retrodeck",
"startIn": ""
}

View file

@ -42,7 +42,7 @@ fi
# Copying files to the installation
sudo cp -vfr "res/binding_icons" "$app/retrodeck/binding_icons"
sudo cp -vfr "res/steam_grid" "$app/retrodeck/steam_grid"
sudo cp -vfr "res/steam_grid" "$app/retrodeck"
sudo cp -vfr "config/"** "$app/retrodeck/config/"
sudo cp -vfr "tools" "$app"
sudo cp -vfr "retrodeck.sh" "$app/bin/"

View file

@ -521,14 +521,7 @@ finit() {
--title "RetroDECK Finishing Initialization" \
--text="RetroDECK is finishing the initial setup process, please wait."
rd_zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" \
--text="Do you want to add RetroDECK to Steam?"
if [ $? == 0 ]; then
steam-rom-manager enable --names "RetroDECK Launcher"
steam-rom-manager add
rd_zenity --info --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --text="RetroDECK has been added to Steam."
fi
add_retrodeck_to_steam
create_lock
# Inform the user where to put the ROMs and BIOS files
@ -1078,3 +1071,24 @@ open_component(){
echo "Please ensure the name is correctly spelled (case sensitive) and quoted if it contains spaces."
fi
}
add_retrodeck_to_steam(){
log i "Adding RetroDECK to Steam"
rd_zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" \
--text="Do you want to add RetroDECK to Steam?"
if [ $? == 0 ]; then
(
steam-rom-manager enable --names "RetroDECK Launcher"
steam-rom-manager add
) |
rd_zenity --progress --no-cancel --pulsate --auto-close \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "Adding RetroDECK to Steam" \
--text="Please wait while RetroDECK is being added to Steam...\n\n"
rd_zenity --info --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --text="RetroDECK has been added to Steam.\n\nPlease close and reopen Steam to see the changes."
fi
log i "RetroDECK has been added to Steam"
}

View file

@ -125,7 +125,7 @@ prepare_component() {
local srm_userdata="/var/config/steam-rom-manager/userData"
create_dir -d "$srm_userdata"
cp -fv "$config/steam-rom-manager/"*.json "$srm_userdata"
cp -fv "$config/steam-rom-manager/manifests" "$srm_userdata"
cp -fvr "$config/steam-rom-manager/manifests" "$srm_userdata"
log i "Updating steamDirectory and romDirectory lines in $srm_userdata/userSettings.json"
jq '.environmentVariables.steamDirectory = "'$HOME'/.steam/steam"' "$srm_userdata/userSettings.json" > "$srm_userdata/tmp.json" && mv -f "$srm_userdata/tmp.json" "$srm_userdata/userSettings.json"

View file

@ -100,7 +100,7 @@ add_to_steam() {
remove_from_steam
else
log d "Updating game list"
steam-rom-manager enable --names "RetroDECK"
steam-rom-manager enable --names "RetroDECK Steam Sync"
steam-rom-manager add
fi
}
@ -111,10 +111,11 @@ remove_from_steam() {
log d "Creating dummy game"
cat "" > "$steamsync_folder/CUL0.sh"
log d "Cleaning the shortcut"
steam-rom-manager enable --names "RetroDECK"
steam-rom-manager enable --names "RetroDECK Steam Sync"
steam-rom-manager disable --names "RetroDECK Launcher"
steam-rom-manager remove
log d "Removing dummy game"
rm "$steamsync_folder/CUL0.sh"
steam-rom-manager enable --names "RetroDECK Launcher"
steam-rom-manager disable --names "RetroDECK Steam Sync"
}

View file

@ -62,6 +62,7 @@ source /app/libexec/global.sh
# - Install: PS3 firmware
# - Install: PS Vita firmware
# - Update Notification
# - Add RetroDECK to Steam
# - Verify Multi-file Structure
# - Ponzu - Remove Yuzu
# - Ponzu - Remove Citra
@ -415,6 +416,7 @@ configurator_retrodeck_tools_dialog() {
"Install: PS3 Firmware" "Download and Install: Playstation 3 firmware for the RPCS3 emulator."
"Install: PS Vita Firmware" "Download and Install: PlayStation Vita firmware for the Vita3K emulator."
"Update Notification" "Enable / Disable: Notifications for new RetroDECK versions."
"Add RetroDECK to Steam" "Add RetroDECK shortcut to Steam. Steam restart required."
"Verify Multi-file Structure" "Verify the proper structure of multi-file or multi-disc games."
)
@ -508,6 +510,9 @@ configurator_retrodeck_tools_dialog() {
configurator_update_notify_dialog
;;
"Add RetroDECK to Steam" )
add_retrodeck_to_steam
"Verify Multi-file Structure" )
log i "Configurator: opening \"$choice\" menu"
configurator_check_multifile_game_structure