A little more progress on refactor.

This commit is contained in:
Storm Dragon
2025-06-10 01:54:56 -04:00
parent e3df3c4485
commit da065e5835
5 changed files with 22 additions and 18 deletions

View File

@ -267,7 +267,7 @@ custom_launch_parameters() {
}
# Process game launcher flags
process_launcher-flags() {
process_launcher_flags() {
flags=("${game[@]:3}")
for i in "${flags[@]}" ; do
if [[ "${i}" =~ ^export\ [a-zA-Z_][a-zA-Z0-9_]*=\'?.*\'?$ ]]; then
@ -375,7 +375,7 @@ game_launcher() {
fi
fi
fi
process_launcher-flags
process_launcher_flags
custom_launch_parameters
${wine:-/usr/bin/wine} start /d "${game[1]%\\*}" "${game[1]##*\\}" /realtime
fi
@ -486,7 +486,7 @@ while getopts "${args}" i ; do
h) help;;
i) game_installer;;
I)
game="${OPTARG}"
export game="${OPTARG}"
break;;
k) kill_game;;
L) license;;
@ -501,7 +501,7 @@ while getopts "${args}" i ; do
r) game_removal;;
S) defaultRate="${OPTARG}";;
t)
gameCount=$(find .install -type f -iname "*.sh" | wc -l)
gameCount=$(find ".install" -type f -iname "*.sh" | wc -l)
dialog --backtitle "Linux Game Manager" \
--infobox "There are currently ${gameCount} games available." -1 -1
exit 0
@ -511,7 +511,17 @@ while getopts "${args}" i ; do
esac
done
# If agmNoLaunch is set, exit (script is being sourced)
[[ "$agmNoLaunch" == "true" ]] && exit 0
# If no game specified, exit
[[ ${#game} -lt 1 ]] && exit 0
[[ "$agmNoLaunch" != "true" ]] && exit 0
# Install the specified game noninteractively
if [[ -f ".install/${game}.sh" ]]; then
export LANG="en_US.UTF-8"
. ".install/${game}.sh"
else
echo "Error: Game '${game}' not found in .install directory"
exit 1
fi