Add new sections to retrodeck.cfg

This commit is contained in:
icenine451 2023-04-05 14:21:50 -04:00
parent 695e4f1521
commit cca6828b0f
6 changed files with 30 additions and 23 deletions

View file

@ -1,6 +1,6 @@
uuddlrlrstart^set_setting_value $rd_conf developer_options true retrodeck
uuddlrlrstart^set_setting_value $rd_conf developer_options true retrodeck options
uuddlrlrstart^echo Visit the Configurator to behold your new-found powers.
uuddlrlrstart^echo But beware, with great power comes great responsibility...
gameovermangameover^set_setting_value $rd_conf developer_options false retrodeck
gameovermangameover^set_setting_value $rd_conf developer_options false retrodeck options
gameovermangameover^echo You have relinquished your powers in the name of saftey.
gameovermangameover^echo This was a wise choice.

View file

@ -1,3 +1,4 @@
[paths]
version=
rdhome=/home/deck/retrodeck
roms_folder=/home/deck/retrodeck/roms
@ -12,6 +13,7 @@ mods_folder=/home/deck/retrodeck/mods
texture_packs_folder=/home/deck/retrodeck/texture_packs
sdcard=/run/media/mmcblk0p1
[options]
power_user_warning=true
desktop_mode_warning=true
update_check=false

View file

@ -310,7 +310,7 @@ desktop_mode_warning() {
if [[ $choice == "No" ]]; then
exit 1
elif [[ $choice == "Never show this again" ]]; then
set_setting_value $rd_conf "desktop_mode_warning" "false" retrodeck # Store desktop mode warning variable for future checks
set_setting_value $rd_conf "desktop_mode_warning" "false" retrodeck "options" # Store desktop mode warning variable for future checks
fi
fi
fi
@ -735,7 +735,7 @@ check_for_version_update() {
rc=$? # Capture return code, as "Yes" button has no text value
if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked
if [[ $choice == "Ignore this version" ]]; then
set_setting_value $rd_conf "update_ignore" "$online_version" retrodeck # Store version to ignore for future checks
set_setting_value $rd_conf "update_ignore" "$online_version" retrodeck "options" # Store version to ignore for future checks
fi
else # User clicked "Yes"
configurator_generic_dialog "The update process may take several minutes.\n\nAfter the update is complete, RetroDECK will close. When you run it again you will be using the latest version."
@ -750,7 +750,7 @@ check_for_version_update() {
rc=$? # Capture return code, as "Yes" button has no text value
if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked
if [[ $choice == "Ignore this version" ]]; then
set_setting_value $rd_conf "update_ignore" "$online_version" retrodeck # Store version to ignore for future checks.
set_setting_value $rd_conf "update_ignore" "$online_version" retrodeck "options" # Store version to ignore for future checks.
fi
else # User clicked "Yes"
configurator_generic_dialog "The update process may take several minutes.\n\nAfter the update is complete, RetroDECK will close. When you run it again you will be using the latest version."
@ -819,10 +819,10 @@ multi_user_set_default_dialog() {
rc=$? # Capture return code, as "Yes" button has no text value
if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked
if [[ $choice == "No and don't ask again" ]]; then
set_setting_value $rd_conf "ask_default_user" "false" retrodeck
set_setting_value $rd_conf "ask_default_user" "false" retrodeck "options"
fi
else # User clicked "Yes"
set_setting_value $rd_conf "default_user" "$chosen_user" retrodeck
set_setting_value $rd_conf "default_user" "$chosen_user" retrodeck "options"
fi
}
@ -858,7 +858,7 @@ multi_user_enable_multi_user_mode() {
rm -rf "$multi_user_data_folder/$SteamAppUser" # Remove stale data after backup
fi
fi
set_setting_value $rd_conf "multi_user_mode" "true" retrodeck
set_setting_value $rd_conf "multi_user_mode" "true" retrodeck "options"
multi_user_determine_current_user
if [[ -d "$multi_user_data_folder/$SteamAppUser" ]]; then
configurator_process_complete_dialog "enabling multi-user support"
@ -884,7 +884,7 @@ multi_user_disable_multi_user_mode() {
if [[ ! -z "$single_user" ]]; then # Single user was selected
multi_user_return_to_single_user "$single_user"
set_setting_value $rd_conf "multi_user_mode" "false" retrodeck
set_setting_value $rd_conf "multi_user_mode" "false" retrodeck "options"
configurator_process_complete_dialog "disabling multi-user support"
else
configurator_generic_dialog "No single user was selected, please try the process again."
@ -893,13 +893,13 @@ multi_user_disable_multi_user_mode() {
else
single_user=$(ls -1 "$multi_user_data_folder")
multi_user_return_to_single_user "$single_user"
set_setting_value $rd_conf "multi_user_mode" "false" retrodeck
set_setting_value $rd_conf "multi_user_mode" "false" retrodeck "options"
configurator_process_complete_dialog "disabling multi-user support"
fi
}
multi_user_determine_current_user() {
if [[ $(get_setting_value $rd_conf "multi_user_mode" retrodeck) == "true" ]]; then # If multi-user environment is enabled in rd_conf
if [[ $(get_setting_value $rd_conf "multi_user_mode" retrodeck "options") == "true" ]]; then # If multi-user environment is enabled in rd_conf
if [[ -d "$multi_user_data_folder" ]]; then
if [[ ! -z $SteamAppUser ]]; then # If running in Game Mode and this variable exists
if [[ -z $(ls -1 "$multi_user_data_folder" | grep "$SteamAppUser") ]]; then
@ -944,11 +944,11 @@ multi_user_determine_current_user() {
multi_user_setup_new_user
else # But dialog box was blank
configurator_generic_dialog "No username was entered, so multi-user data folder cannot be created.\n\nDisabling multi-user mode, please try the process again."
set_setting_value $rd_conf "multi_user_mode" "false" retrodeck
set_setting_value $rd_conf "multi_user_mode" "false" retrodeck "options"
fi
else # User clicked "Cancel"
configurator_generic_dialog "Cancelling multi-user mode activation."
set_setting_value $rd_conf "multi_user_mode" "false" retrodeck
set_setting_value $rd_conf "multi_user_mode" "false" retrodeck "options"
fi
fi
fi

View file

@ -102,7 +102,7 @@ then
cp $rd_defaults $rd_conf # Load default settings
set_setting_value $rd_conf "version" "$version" retrodeck # Set current version for new installs
set_setting_value $rd_conf "sdcard" "$default_sd" retrodeck # Set SD card location if default path has changed
set_setting_value $rd_conf "sdcard" "$default_sd" retrodeck "paths" # Set SD card location if default path has changed
echo "Setting config file permissions"
chmod +rw $rd_conf

View file

@ -65,6 +65,7 @@ post_update() {
# In version 0.7.0b, the following changes were made that required config file updates/reset or other changes to the filesystem:
# - New ~/retrodeck/mods and ~/retrodeck/texture_packs directories are added and symlinked to multiple different emulators (where supported)
# - Expose ES-DE gamelists folder to user at ~/retrodeck/gamelists
# - Add new sections [paths] and [options] headers to retrodeck.cfg
mkdir -p "$mods_folder"
mkdir -p "$texture_packs_folder"
@ -77,6 +78,10 @@ post_update() {
dir_prep "$mods_folder/Yuzu" "/var/data/yuzu/load"
dir_prep "$rdhome/gamelists" "/var/config/emulationstation/.emulationstation/gamelists"
sed -i '/version=.*/G' $rd_conf
sed -i '3i [paths]' $rd_conf
sed -i '/^power_user=.*/i [options]' $rd_conf
fi
# The following commands are run every time.

View file

@ -285,7 +285,7 @@ configurator_power_user_warning_dialog() {
if [[ $choice == "No" ]]; then
configurator_welcome_dialog
elif [[ $choice == "Never show this again" ]]; then
set_setting_value $rd_conf "power_user_warning" "false" retrodeck # Store desktop mode warning variable for future checks
set_setting_value $rd_conf "power_user_warning" "false" retrodeck "options" # Store desktop mode warning variable for future checks
source $rd_conf
configurator_power_user_changes_dialog
fi
@ -867,7 +867,7 @@ configurator_move_dialog() {
case $destination in
"Back" )
configurator_move_dialog
configurator_tools_and_troubleshooting_dialog
;;
"Internal Storage" )
@ -1016,7 +1016,7 @@ configurator_move_dialog() {
}
configurator_online_update_setting_dialog() {
if [[ $(get_setting_value $rd_conf "update_check" retrodeck) == "true" ]]; then
if [[ $(get_setting_value $rd_conf "update_check" retrodeck "options") == "true" ]]; then
zenity --question \
--no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator - RetroDECK Online Update Check" \
@ -1024,7 +1024,7 @@ configurator_online_update_setting_dialog() {
if [ $? == 0 ] # User clicked "Yes"
then
set_setting_value $rd_conf "update_check" "false" retrodeck
set_setting_value $rd_conf "update_check" "false" retrodeck "options"
else # User clicked "Cancel"
configurator_developer_dialog
fi
@ -1036,7 +1036,7 @@ configurator_online_update_setting_dialog() {
if [ $? == 0 ] # User clicked "Yes"
then
set_setting_value $rd_conf "update_check" "true" retrodeck
set_setting_value $rd_conf "update_check" "true" retrodeck "options"
else # User clicked "Cancel"
configurator_developer_dialog
fi
@ -1044,7 +1044,7 @@ configurator_online_update_setting_dialog() {
}
configurator_online_update_channel_dialog() {
if [[ $(get_setting_value $rd_conf "update_repo" retrodeck) == "RetroDECK" ]]; then
if [[ $(get_setting_value $rd_conf "update_repo" retrodeck "options") == "RetroDECK" ]]; then
zenity --question \
--no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator - RetroDECK Change Update Branch" \
@ -1052,7 +1052,7 @@ configurator_online_update_channel_dialog() {
if [ $? == 0 ] # User clicked "Yes"
then
set_setting_value $rd_conf "update_repo" "RetroDECK-cooker" retrodeck
set_setting_value $rd_conf "update_repo" "RetroDECK-cooker" retrodeck "options"
else # User clicked "Cancel"
configurator_developer_dialog
fi
@ -1064,7 +1064,7 @@ configurator_online_update_channel_dialog() {
if [ $? == 0 ] # User clicked "Yes"
then
set_setting_value $rd_conf "update_repo" "RetroDECK" retrodeck
set_setting_value $rd_conf "update_repo" "RetroDECK" retrodeck "options"
else # User clicked "Cancel"
configurator_developer_dialog
fi
@ -1072,7 +1072,7 @@ configurator_online_update_channel_dialog() {
}
configurator_retrodeck_multiuser_dialog() {
if [[ $(get_setting_value $rd_conf "multi_user_mode" retrodeck) == "true" ]]; then
if [[ $(get_setting_value $rd_conf "multi_user_mode" retrodeck "options") == "true" ]]; then
zenity --question \
--no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK Configurator - RetroDECK Multi-user Support" \