diff --git a/functions/presets.sh b/functions/presets.sh index ad591a60..b68cb3df 100644 --- a/functions/presets.sh +++ b/functions/presets.sh @@ -145,10 +145,18 @@ make_preset_changes() { current_state=$(get_setting_value "$rd_conf" "$emulator" "retrodeck" "$preset") if [[ "$current_state" == "true" ]]; then new_state="false" - log d "Toggling off $preset for system: $emulator" + if [[ $emulator == "all" ]]; then + log i "Toggling off $preset for all systems" + else + log i "Toggling off $preset for system: $emulator" + fi else - new_state="true" - log d "Toggling on $preset for system: $emulator" + if [[ $emulator == "all" ]]; then + log i "Toggling on $preset for all systems" + else + new_state="true" + log i "Toggling on $preset for system: $emulator" + fi fi fi diff --git a/retrodeck.sh b/retrodeck.sh index ed07bf20..6b988d12 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -29,6 +29,7 @@ Arguments: --reset-component \t Reset one or more component or emulator configs to the default values --reset-retrodeck \t Starts the initial RetroDECK installer (backup your data first!) --test-upgrade \t Test upgrading RetroDECK to a specific version, developer use only + --set [value] \t Set or toggle a preset. Examples: --set borders, --set borders true, --set borders gba false. --set help for more help Game Launch: [] \t Start a game using the default emulator or\n\t\t\t\t\t\t the one defined in ES-DE for game or system @@ -139,6 +140,31 @@ for i in "$@"; do exit 1 fi ;; + --set*) + preset="$2" + value="$3" + if [ -z "$preset" ]; then + echo "Error: No preset specified. Usage: --set [value], --set help for more help" + exit 1 + fi + if [ "$preset" == "help" ]; then + echo "Used to toggle or set a preset. Available presets are:" + fetch_all_presets + echo "Usage: --set [value]" + echo "Examples:" + echo "Force borders to be true for gba:" + echo " make_preset_changes borders gba true" + echo "Force borders to be true for all supported systems:" + echo " make_preset_changes borders all true" + echo "Toggle gba in preset borders, this will disable the enabled and vice versa:" + echo " make_preset_changes borders gba true" + echo "Toggle all in preset borders:" + echo " make_preset_changes borders all" + exit 0 + fi + make_preset_changes "$preset" "$value" + exit 0 + ;; *) # Assume unknown arguments are game start arguments if [ -f "$i" ]; then