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,6 +282,7 @@ game_launcher() {
echo "Install some games first." echo "Install some games first."
exit 0 exit 0
fi fi
if [[ $# -eq 0 ]]; then
# Create the menu of installed games # Create the menu of installed games
declare -a menuList declare -a menuList
for i in "${lines[@]}" ; do for i in "${lines[@]}" ; do
@ -293,6 +294,14 @@ game_launcher() {
--clear \ --clear \
--no-tags \ --no-tags \
--menu "Please select a game to play" 0 0 0 "${menuList[@]}" --stdout)" --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} -gt 0 ]]; then
if [[ "$game" == "Make a One Time Donation" ]]; 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" 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." [c]="Check your system for necessary components."
[h]="This help screen." [h]="This help screen."
[i]="Install games." [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." [N]="No cache, delete the installer after it has been extracted."
[r]="Remove a game. This will delete all game data." [r]="Remove a game. This will delete all game data."
) )
@ -468,7 +477,7 @@ while getopts "${args}" i ; do
c) checklist;; c) checklist;;
h) help;; h) help;;
i) game_installer;; i) game_installer;;
m) manualInstall="true";; l) game_launcher "${OPTARG}";;
N) noCache="true";; N) noCache="true";;
r) game_removal;; r) game_removal;;
esac esac