From a96e6940ad32e44415a6709b1df33592130d5abb Mon Sep 17 00:00:00 2001 From: XargonWan Date: Fri, 9 Aug 2024 16:42:31 +0900 Subject: [PATCH] FEATURES: migrated pretty system names --- .../retrodeck/reference_lists/features.json | 6 +++++ .../reference_lists/pretty_system_names.cfg | 23 ------------------- .../reference_lists/supported_emulators.cfg | 15 ------------ functions/global.sh | 2 +- functions/other_functions.sh | 14 ++++++----- 5 files changed, 15 insertions(+), 45 deletions(-) delete mode 100644 config/retrodeck/reference_lists/pretty_system_names.cfg delete mode 100644 config/retrodeck/reference_lists/supported_emulators.cfg diff --git a/config/retrodeck/reference_lists/features.json b/config/retrodeck/reference_lists/features.json index f071eb2a..8c32825c 100644 --- a/config/retrodeck/reference_lists/features.json +++ b/config/retrodeck/reference_lists/features.json @@ -271,6 +271,9 @@ "dreamcast": { "name": "Sega Dreamcast" }, + "dc": { + "name": "Sega Dreamcast" + }, "easyrpg": { "name": "EasyRPG Game Engine" }, @@ -310,6 +313,9 @@ "gamegear": { "name": "Sega Game Gear" }, + "gg": { + "name": "Sega Game Gear" + }, "gb": { "name": "Nintendo Game Boy" }, diff --git a/config/retrodeck/reference_lists/pretty_system_names.cfg b/config/retrodeck/reference_lists/pretty_system_names.cfg deleted file mode 100644 index 309b38fa..00000000 --- a/config/retrodeck/reference_lists/pretty_system_names.cfg +++ /dev/null @@ -1,23 +0,0 @@ -cemu^Cemu (Nintendo Wii U Standalone Emulator) -citra^Citra (Nintendo 3DS Standalone Emulator, via Ponzu) -dolphin^Dolphin (Nintendo GameCube / Wii Standalone Emulator) -duckstation^Duckstation (Sony Playstation Standalone Emulator) -gb^Nintendo GameBoy -gba^Nintendo GameBoy Advance -gbc^Nintendo GameBoy Color -genesis^Sega Genesis/Master System -gg^Sega GameGear -mame^MAME (Multi-Arcade Machine Standalone Emulator) -melonds^MelonDS (Nintendo DS Standalone Emulator) -n64^Nintendo 64 -pcsx2^PCSX2 (Sony Playstation 2 Standalone Emulator) -ppsspp^PPSSPP (Sony PSP Standalone Emulator) -primehack^Primehack (Metroid Prime Standalone Emulator) -psx_ra^Sony Playstation (RetroArch Core) -retroarch^RetroArch (Multi-emulator Frontend) -rpcs3^RPCS3 (Sony Playstation 3 Standalone Emulator) -ryujinx^Ryujinx (Nintendo Switch Standalone Emulator) -snes^Nintendo Super Nintendo -vita3k^Vita3K (Sony PSVita Standalone Emulator) -xemu^XEMU (Microsoft Xbox Standalone Emulator) -yuzu^Yuzu (Nintendo Switch Standalone Emulator, via Ponzu) diff --git a/config/retrodeck/reference_lists/supported_emulators.cfg b/config/retrodeck/reference_lists/supported_emulators.cfg deleted file mode 100644 index 17f51083..00000000 --- a/config/retrodeck/reference_lists/supported_emulators.cfg +++ /dev/null @@ -1,15 +0,0 @@ -cemu^/app/bin/Cemu-wrapper -citra^/var/data/ponzu/Citra/bin/citra-qt -dolphin^/app/bin/dolphin-emu -duckstation^/app/bin/duckstation-qt -mame^/app/bin/mame -melonds^/app/bin/melonds -pcsx2^/app/bin/pcsx2-qt -ppsspp^/app/bin/PPSSPPSDL -primehack^/app/bin/primehack-wrapper -retroarch^/app/bin/retroarch -rpcs3^/app/bin/rpcs3 -ryujinx^/app/bin/Ryujinx.sh -vita3k^/app/bin/Vita3K -xemu^/app/bin/xemu -yuzu^/var/data/ponzu/Yuzu/bin/yuzu diff --git a/functions/global.sh b/functions/global.sh index 932e4822..a9e9d093 100644 --- a/functions/global.sh +++ b/functions/global.sh @@ -34,6 +34,7 @@ finit_options_list="$config/retrodeck/reference_lists/finit_options_list.cfg" splashscreen_dir="/var/config/ES-DE/resources/graphics/extra_splashes" # The default location of extra splash screens current_splash_file="/var/config/ES-DE/resources/graphics/splash.svg" # The active splash file that will be shown on boot default_splash_file="/var/config/ES-DE/resources/graphics/splash-orig.svg" # The default RetroDECK splash screen +# TODO: instead of this maybe we can iterate the features.json multi_user_emulator_config_dirs="$config/retrodeck/reference_lists/multi_user_emulator_config_dirs.cfg" # A list of emulator config folders that can be safely linked/unlinked entirely in multi-user mode rd_es_themes="/app/share/es-de/themes" # The directory where themes packaged with RetroDECK are stored lockfile="/var/config/retrodeck/.lock" # Where the lockfile is located @@ -49,7 +50,6 @@ rd_appdata="/app/share/appdata/net.retrodeck.retrodeck.appdata.xml" rpcs3_firmware="http://dus01.ps3.update.playstation.net/update/ps3/image/us/2023_0228_05fe32f5dc8c78acbcd84d36ee7fdc5b/PS3UPDAT.PUP" RA_API_URL="https://retroachievements.org/dorequest.php" # API URL for RetroAchievements.org presets_dir="$config/retrodeck/presets" # Repository for all system preset config files -pretty_system_names_reference_list="$config/retrodeck/reference_lists/pretty_system_names.cfg" # An internal translation list for turning internal names (eg. gbc) to "pretty" names (Nintendo GameBoy Color) git_organization_name="RetroDECK" # The name of the organization in our git repository such as GitHub cooker_repository_name="Cooker" # The name of the cooker repository under RetroDECK organization features="$config/retrodeck/reference_lists/features.json" # A file where all the RetroDECK and component capabilities are kept for querying diff --git a/functions/other_functions.sh b/functions/other_functions.sh index 5b169f29..d84ad230 100644 --- a/functions/other_functions.sh +++ b/functions/other_functions.sh @@ -322,16 +322,18 @@ backup_retrodeck_userdata() { make_name_pretty() { # This function will take an internal system name (like "gbc") and return a pretty version for user display ("Nintendo GameBoy Color") + # If the name is nout found it only returns the short name such as "gbc" # USAGE: make_name_pretty "system name" - local system=$(grep "$1^" "$pretty_system_names_reference_list") - if [[ ! -z "$system" ]]; then - IFS='^' read -r internal_name pretty_name < <(echo "$system") - else - pretty_name="$1" - fi + + local system_name="$1" + + # Use jq to parse the JSON and find the pretty name + local pretty_name=$(jq -r --arg name "$system_name" '.system[$name].name // $name' "$features") + echo "$pretty_name" } + finit_browse() { # Function for choosing data directory location during first/forced init path_selected=false