mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-04-10 19:15:12 +00:00
FRAMEWORK: added --set cli to set presets
This commit is contained in:
parent
0a024f2b39
commit
d5dde7d2ff
|
@ -145,10 +145,18 @@ make_preset_changes() {
|
||||||
current_state=$(get_setting_value "$rd_conf" "$emulator" "retrodeck" "$preset")
|
current_state=$(get_setting_value "$rd_conf" "$emulator" "retrodeck" "$preset")
|
||||||
if [[ "$current_state" == "true" ]]; then
|
if [[ "$current_state" == "true" ]]; then
|
||||||
new_state="false"
|
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
|
else
|
||||||
new_state="true"
|
if [[ $emulator == "all" ]]; then
|
||||||
log d "Toggling on $preset for system: $emulator"
|
log i "Toggling on $preset for all systems"
|
||||||
|
else
|
||||||
|
new_state="true"
|
||||||
|
log i "Toggling on $preset for system: $emulator"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
26
retrodeck.sh
26
retrodeck.sh
|
@ -29,6 +29,7 @@ Arguments:
|
||||||
--reset-component <component> \t Reset one or more component or emulator configs to the default values
|
--reset-component <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!)
|
--reset-retrodeck \t Starts the initial RetroDECK installer (backup your data first!)
|
||||||
--test-upgrade <version> \t Test upgrading RetroDECK to a specific version, developer use only
|
--test-upgrade <version> \t Test upgrading RetroDECK to a specific version, developer use only
|
||||||
|
--set <preset> [value] \t Set or toggle a preset. Examples: --set borders, --set borders true, --set borders gba false. --set help for more help
|
||||||
|
|
||||||
Game Launch:
|
Game Launch:
|
||||||
[<options>] <game_path> \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
|
[<options>] <game_path> \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
|
exit 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
--set*)
|
||||||
|
preset="$2"
|
||||||
|
value="$3"
|
||||||
|
if [ -z "$preset" ]; then
|
||||||
|
echo "Error: No preset specified. Usage: --set <preset> [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 <preset> [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
|
# Assume unknown arguments are game start arguments
|
||||||
if [ -f "$i" ]; then
|
if [ -f "$i" ]; then
|
||||||
|
|
Loading…
Reference in a new issue