Finished and tested get_setting()

This commit is contained in:
icenine451 2022-10-10 12:46:35 -04:00
parent 11c176c9c6
commit d372bf172c

View file

@ -7,14 +7,21 @@ source /app/libexec/functions.sh # Source global functions
# Config files for emulators with single config files # Config files for emulators with single config files
raconf="/var/config/retroarch/retroarch.cfg"
ra_core_conf="/var/config/retroarch/retroarch-core-options.cfg"
citraconf="/var/config/citra-emu/qt-config.ini" citraconf="/var/config/citra-emu/qt-config.ini"
melondsconf="/var/config/melonDS/melonDS.ini" melondsconf="/var/config/melonDS/melonDS.ini"
rpcs3conf="/var/config/rpcs3/config.yml" rpcs3conf="/var/config/rpcs3/config.yml"
yuzuconf="/var/config/yuzu/qt-config.ini" yuzuconf="/var/config/yuzu/qt-config.ini"
source $rd_conf source $rd_conf
# ES-DE config files
es_settings="/var/config/emulationstation/.emulationstation/es_settings.xml"
# RetroArch config files
raconf="/var/config/retroarch/retroarch.cfg"
ra_core_conf="/var/config/retroarch/retroarch-core-options.cfg"
# Dolphin config files # Dolphin config files
dolphinconf="/var/config/dolphin-emu/Dolphin.ini" dolphinconf="/var/config/dolphin-emu/Dolphin.ini"
@ -113,6 +120,10 @@ case $4 in
"xemu" ) "xemu" )
;; ;;
"emulationstation" )
;;
esac esac
@ -125,47 +136,53 @@ get_setting() {
case $3 in case $3 in
"retrodeck" ) "retrodeck" )
#echo $(grep $2 $1 | grep -o -P "(?<=$2 = \").*(?=\")") echo $(grep "$2" $1 | grep -o -P "(?<=$2=).*")
;;
"retroarch" )
echo $(grep $2 $1 | grep -o -P "(?<=$2 = \").*(?=\")")
;; ;;
"dolphin" ) "retroarch" )
#echo $(grep $2 $1 | grep -o -P "(?<=$2 = \").*(?=\")") echo $(grep "$2" $1 | grep -o -P "(?<=$2 = \").*(?=\")")
;;
"dolphin" ) # Use quotes when passing setting_name, as this config file contains special characters
echo $(grep "$2" $1 | grep -o -P "(?<=$2 = ).*")
;; ;;
"duckstation" ) "duckstation" )
#echo $(grep $2 $1 | grep -o -P "(?<=$2 = \").*(?=\")") echo $(grep "$2" $1 | grep -o -P "(?<=$2 = ).*")
;; ;;
"pcsx2" ) "pcsx2" )
#echo $(grep $2 $1 | grep -o -P "(?<=$2 = \").*(?=\")") echo $(grep "$2" $1 | grep -o -P "(?<=$2 = ).*")
;; ;;
"ppsspp" ) "ppsspp" )
#echo $(grep $2 $1 | grep -o -P "(?<=$2 = \").*(?=\")") echo $(grep "$2" $1 | grep -o -P "(?<=$2 = ).*")
;; ;;
"rpcs3" ) "rpcs3" ) # Use quotes when passing setting_name, as this config file contains special characters and spaces
#echo $(grep $2 $1 | grep -o -P "(?<=$2 = \").*(?=\")") echo $(grep "$2" $1 | grep -o -P "(?<=$2: ).*")
;; ;;
"yuzu" ) "yuzu" ) # Use quotes when passing setting_name, as this config file contains special characters
#echo $(grep $2 $1 | grep -o -P "(?<=$2 = \").*(?=\")") yuzu_setting=$(sed -e 's/\\/\\\\/g' <<< "$2") # Accomodate for backslashes in setting names
echo $(grep "$yuzu_setting" $1 | grep -o -P "(?<=$yuzu_setting=).*")
;; ;;
"citra" ) "citra" ) # Use quotes when passing setting_name, as this config file contains special characters
#echo $(grep $2 $1 | grep -o -P "(?<=$2 = \").*(?=\")") citra_setting=$(sed -e 's/\\/\\\\/g' <<< "$2") # Accomodate for backslashes in setting names
echo $(grep "$citra_setting" $1 | grep -o -P "(?<=$citra_setting=).*")
;; ;;
"melonds" ) "melonds" )
#echo $(grep $2 $1 | grep -o -P "(?<=$2 = \").*(?=\")") echo $(grep "$2" $1 | grep -o -P "(?<=$2=).*")
;; ;;
"xemu" ) "xemu" )
#echo $(grep $2 $1 | grep -o -P "(?<=$2 = \").*(?=\")") echo $(grep "$2" $1 | grep -o -P "(?<=$2 = ).*")
;;
"emulationstation" )
echo $(grep "$2" $1 | grep -o -P "(?<=$2\" value=\").*(?=\")")
;; ;;
esac esac