From a589e20725e171fc1e3f17da37afd3b1a418a585 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 4 Sep 2024 22:21:06 +0900 Subject: [PATCH] Revert "SET_SETTING_VALUE: edited to use initool" This reverts commit b56916c2b0bf16305b2b8f22d08871390884351c. --- functions/framework.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/functions/framework.sh b/functions/framework.sh index de5f0fe3..08e736f3 100644 --- a/functions/framework.sh +++ b/functions/framework.sh @@ -12,9 +12,15 @@ set_setting_value() { case $4 in - "retrodeck" | "melonds" | "yuzu" | "citra" | "libretro_scummvm" | "ini" ) - initool set "$1" $current_section_name $setting_name_to_change $setting_value_to_change > "$1.new" && mv -f "$1.new" "$1" - conf_read + "retrodeck" | "melonds" | "yuzu" | "citra" | "libretro_scummvm" ) + if [[ -z $current_section_name ]]; then + sed -i 's^\^'"$setting_name_to_change"'=.*^'"$setting_name_to_change"'='"$setting_value_to_change"'^' "$1" + else + sed -i '\^\['"$current_section_name"'\]^,\^\^'"$setting_name_to_change"'=^s^\^'"$setting_name_to_change"'=.*^'"$setting_name_to_change"'='"$setting_value_to_change"'^' "$1" + fi + if [[ "$4" == "retrodeck" && ("$current_section_name" == "" || "$current_section_name" == "paths" || "$current_section_name" == "options") ]]; then # If a RetroDECK setting is being changed, also write it to memory for immediate use + declare -g "$setting_name_to_change=$setting_value_to_change" + fi ;; "retroarch" )