Added -l option to launch games without going through the menu.

This commit is contained in:
Storm Dragon 2020-12-12 01:11:43 -05:00
parent 858211865d
commit bd2763ee54

View File

@ -282,17 +282,26 @@ game_launcher() {
echo "Install some games first."
exit 0
fi
# Create the menu of installed games
declare -a menuList
for i in "${lines[@]}" ; do
menuList+=("${i%|*}" "${i##*|}")
done
menuList+=("Make a One Time Donation" "Make a One Time Donation")
menuList+=("Become a Patron" "Become a Patron")
local game="$(dialog --backtitle "Audio Game Launcher" \
--clear \
--no-tags \
--menu "Please select a game to play" 0 0 0 "${menuList[@]}" --stdout)"
if [[ $# -eq 0 ]]; then
# Create the menu of installed games
declare -a menuList
for i in "${lines[@]}" ; do
menuList+=("${i%|*}" "${i##*|}")
done
menuList+=("Make a One Time Donation" "Make a One Time Donation")
menuList+=("Become a Patron" "Become a Patron")
local game="$(dialog --backtitle "Audio Game Launcher" \
--clear \
--no-tags \
--menu "Please select a game to play" 0 0 0 "${menuList[@]}" --stdout)"
else
local game="$(grep "^${1}|" "${configFile}")"
game="${game%|*}"
if [[ -z "$game" ]]; then
echo "Game $1 not found."
exit 1
fi
fi
if [[ ${#game} -gt 0 ]]; then
if [[ "$game" == "Make a One Time Donation" ]]; then
open_url "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=stormdragon2976@gmail.com&lc=US&item_name=Donation+to+Storm+Games&no_note=0&cn=&currency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"
@ -455,7 +464,7 @@ declare -A command=(
[c]="Check your system for necessary components."
[h]="This help screen."
[i]="Install games."
[m]="Manually handle install screens instead of using xdotools."
[l:]="launch given game without interactive audiogame-manager menu specified by its wine bottle."
[N]="No cache, delete the installer after it has been extracted."
[r]="Remove a game. This will delete all game data."
)
@ -468,7 +477,7 @@ while getopts "${args}" i ; do
c) checklist;;
h) help;;
i) game_installer;;
m) manualInstall="true";;
l) game_launcher "${OPTARG}";;
N) noCache="true";;
r) game_removal;;
esac