2020-12-20 11:19:44 -05:00
#!/usr/bin/env bash
2020-12-16 17:16:16 -05:00
license( ) {
2022-03-11 12:43:22 -05:00
cat << EOF
2020-12-16 17:16:16 -05:00
■The contents of this file are subject to the Common Public Attribution
License Version 1.0 ( the ■License■) ; you may not use this file except in
compliance with the License. You may obtain a copy of the License at
https://opensource.org/licenses/CPAL-1.0. The License is based on the Mozilla Public License Version
1.1 but Sections 14 and 15 have been added to cover use of software over a
computer network and provide for limited attribution for the Original
Developer. In addition, Exhibit A has been modified to be consistent with
Exhibit B.
Software distributed under the License is distributed on an ■AS IS■ basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is audiogame manager.
The Original Developer is not the Initial Developer and is . If
left blank, the Original Developer is the Initial Developer.
The Initial Developer of the Original Code is Billy "Storm Dragon" Wolfe. All portions of
2024-02-02 17:10:35 -05:00
the code written by Billy Wolfe are Copyright ( c) 2020, 2024. All Rights
2020-12-16 17:16:16 -05:00
Reserved.
Contributor Michael Taboada.
Attribution Copyright Notice: Audiogame manager copyright 2020 Storm Dragon. All rights reserved.
Attribution Phrase ( not exceeding 10 words) : A Stormux project
Attribution URL: https://stormgames.wolfe.casa
Graphic Image as provided in the Covered Code, if any.
Display of Attribution Information is required in Larger
Works which are defined in the CPAL as a work which combines Covered Code
or portions thereof with code not governed by the terms of the CPAL.
EOF
}
2020-08-27 15:42:24 -04:00
2020-09-29 22:07:26 -04:00
# Dialog accessibility
export DIALOGOPTS = '--no-lines --visit-items'
2021-06-30 22:38:21 -04:00
2023-02-06 05:04:26 -05:00
# Alerts, for when user needs to read something.
alert( ) {
play -qnV0 synth 3 pluck D3 pluck A3 pluck D4 pluck F4 pluck A4 delay 0 .1 .2 .3 .4 remix - chorus 0.9 0.9 38 0.75 0.3 0.5 -t
echo
read -rp "Press enter to continue." continue
}
2021-06-30 22:38:21 -04:00
# Check for latest news
check_news( ) {
2023-12-03 00:57:17 -05:00
# For use by update scripts that want to source functions in this file.
2023-12-03 08:16:55 -05:00
[ [ " $agmNoLaunch " = = "true" ] ] && return
2021-07-01 02:09:12 -04:00
trap return INT
2021-06-30 22:38:21 -04:00
# url for news file
local newsFile = "https://stormgames.wolfe.casa/media/agm.ogg"
local newsPath = " ${ configFile %/*.conf } /.news "
2021-07-01 02:09:12 -04:00
local newsTag = " $( curl --connect-timeout 5 -sI " $newsFile " | grep -i '^etag: "' | cut -d '"' -f2) "
2021-07-04 19:30:57 -04:00
if [ [ -z " ${ newsTag } " ] ] ; then
return
fi
2021-06-30 22:38:21 -04:00
local newsOldTag = " $( cat " $newsPath " 2> /dev/null) "
if [ [ " $newsTag " != " $newsOldTag " ] ] ; then
dialog --yes-label 'Play' \
--no-label 'Later' \
--backtitle 'Audiogame Manager News' \
--yesno 'Audiogame manager news is available. Please use left and right arrows to navigate and enter to confirm.' -1 -1 || return
sox -qV0 " $newsFile " -d & > /dev/null
echo -n " $newsTag " > " $newsPath "
fi
}
2024-11-15 18:27:07 -05:00
# Automatic update function
2020-09-20 17:42:42 -04:00
# Automatic update function
update( ) {
2023-09-02 19:11:39 -04:00
if ! [ [ -d ".git" ] ] ; then
return
fi
2022-05-05 20:01:19 -04:00
local url = " $( git ls-remote --get-url) "
2022-12-23 00:54:43 -05:00
if [ [ " $url " = ~ ^ssh://| git@| gitea@ ] ] || [ [ -z " $url " ] ] ; then
2020-09-20 17:42:42 -04:00
return
fi
2022-05-05 20:01:19 -04:00
git remote update & > /dev/null
local upstream = '@{u}'
local home = " $( git rev-parse @) "
local remote = " $( git rev-parse " $upstream " ) "
if [ [ " $home " = = " $remote " ] ] ; then
return
fi
dialog --backtitle "Audiogame Manager" \
--yesno "Updates are available. Would you like to update now?" -1 -1 --stdout || return
2024-11-15 18:20:01 -05:00
{ git pull
git log '@{1}..' --pretty= format:'%an: %s' ; }
2022-05-05 20:01:19 -04:00
exit $?
2020-09-20 17:42:42 -04:00
}
2020-08-27 15:42:24 -04:00
2020-12-11 21:46:50 -05:00
# Function to open urls across OS.
open_url( ) {
if [ [ " $( uname) " = = "Darwin" ] ] ; then
2021-10-24 09:33:50 -04:00
open " ${ * } " 2> /dev/null
2020-12-11 21:46:50 -05:00
else
2021-10-24 09:33:50 -04:00
xdg-open " ${ * } " 2> /dev/null
2022-03-11 12:43:22 -05:00
fi
2020-12-11 21:46:50 -05:00
}
2022-01-01 16:12:22 -05:00
# Create desktop launcher file
desktop_launcher( ) {
2022-01-01 17:27:52 -05:00
local desktopFile = " ${ HOME } /audiogame-manager.desktop "
2022-01-01 16:12:22 -05:00
if [ [ -e " ${ desktopFile } " ] ] ; then
echo " the file ${ desktopFile } exists. Cannot create the launcher. "
exit 1
fi
local dotDesktop
local terminal
# Try to find an accessible terminal
2022-01-01 18:58:04 -05:00
for i in mate-terminal lxterminal terminator gnome-terminal ; do
2022-01-01 16:12:22 -05:00
if command -v $i & > /dev/null ; then
terminal = " $i "
break
fi
done
dotDesktop = ( '[Desktop Entry]'
'Name=Audiogame manager'
'GenericName=Audiogame Manager'
'Comment=Play audio games'
2022-01-03 02:37:35 -05:00
" Exec= ${ terminal } -t \"Audiogame Manager\" -e \"/usr/bin/bash -c 'nohup $( readlink -e " $0 " ) 2> /dev/null'\" "
2022-01-01 16:12:22 -05:00
'Terminal=false'
'Type=Application'
'StartupNotify=false'
2022-01-01 18:50:00 -05:00
'Keywords=game;'
'Categories=Game;'
2022-03-11 12:43:22 -05:00
'Version=1.0' )
2022-01-01 17:27:52 -05:00
for i in " ${ dotDesktop [@] } " ; do
echo " $i " >> " ${ desktopFile } "
done
desktop-file-install --dir " ${ HOME } /.local/share/applications " -m 755 " ${ desktopFile } "
xdg-desktop-icon install ~/.local/share/applications/audiogame-manager.desktop
2022-01-01 16:12:22 -05:00
rm " ${ desktopFile } "
exit 0
}
2020-11-16 16:57:16 -05:00
2020-08-27 15:42:24 -04:00
# Wine configuration section
2020-08-27 17:35:32 -04:00
checklist( ) {
declare -a errorList
2021-05-10 13:38:30 -04:00
declare -a packageList
if [ [ $# -eq 0 ] ] ; then
echo "Checking your system..."
echo
fi
2020-08-27 17:35:32 -04:00
if command -v wine & > /dev/null ; then
2021-05-10 13:38:30 -04:00
[ [ $# -eq 0 ] ] && echo "Wine is installed."
2020-08-27 17:35:32 -04:00
else
errorList += ( "Critical: Wine is not installed. You will not be able to play any games." )
fi
2021-05-10 13:38:30 -04:00
packageList += ( "wine" )
2021-07-01 03:49:03 -04:00
if command -v curl & > /dev/null ; then
[ [ $# -eq 0 ] ] && echo "Curl is installed."
else
errorList += ( "Critical: Curl is not installed. Critical functionality will not work." )
fi
packageList += ( "curl" )
2020-10-27 10:24:52 -04:00
if command -v dialog & > /dev/null ; then
2021-05-10 13:38:30 -04:00
[ [ $# -eq 0 ] ] && echo "Dialog is installed."
2020-10-27 10:24:52 -04:00
else
errorList += ( "Critical: Dialog is not installed. You will not be able to install, launch, or remove any games." )
fi
2021-05-10 13:38:30 -04:00
packageList += ( "dialog" )
2020-10-07 11:14:34 -04:00
for i in 7z cabextract unzip xz ; do
2020-09-04 18:45:45 -04:00
if command -v $i & > /dev/null ; then
2021-05-10 13:38:30 -04:00
[ [ $# -eq 0 ] ] && echo " ${ i ^ } is installed. "
2020-09-04 18:45:45 -04:00
else
2020-10-07 11:14:34 -04:00
errorList += ( " Critical: ${ i ^ } is not installed. You will not be able to install some games or their components. " )
2020-09-04 18:45:45 -04:00
fi
2021-05-10 13:38:30 -04:00
packageList += ( " $i " )
2020-09-04 18:45:45 -04:00
done
2020-11-26 15:31:34 -05:00
if command -v gawk & > /dev/null ; then
2021-05-10 13:38:30 -04:00
[ [ $# -eq 0 ] ] && echo "Gawk is installed."
2020-11-26 15:31:34 -05:00
else
errorList += ( "Warning: gawk is not installed. Game removal with -r will not work." )
fi
2021-05-10 13:38:30 -04:00
packageList += ( "gawk" )
2020-09-02 22:36:48 -04:00
if command -v ocrdesktop & > /dev/null ; then
2021-05-10 13:38:30 -04:00
[ [ $# -eq 0 ] ] && echo "Ocrdesktop is installed."
2020-09-02 22:36:48 -04:00
else
errorList += ( "Warning: ocrdesktop is not installed. It can help if the installer gets stuck to figure out what is happening." )
fi
2021-05-10 13:38:30 -04:00
packageList += ( "ocrdesktop" )
2021-02-15 12:44:16 -05:00
if command -v qjoypad & > /dev/null ; then
2021-05-10 13:38:30 -04:00
[ [ $# -eq 0 ] ] && echo "Qjoypad is installed."
2021-02-15 12:44:16 -05:00
else
errorList += ( "Warning: qjoypad is not installed. Qjoypad allows you to play keyboard only games with a gamepad." )
fi
2021-05-10 13:38:30 -04:00
packageList += ( "qjoypad" )
2021-06-30 21:58:41 -04:00
if command -v sox & > /dev/null ; then
[ [ $# -eq 0 ] ] && echo "Sox is installed."
else
errorList += ( "Warning: Sox is not installed. Audio will not work." )
fi
packageList += ( "sox" )
2022-11-11 16:09:38 -05:00
if command -v trans & > /dev/null ; then
[ [ $# -eq 0 ] ] && echo "Translate-shell is installed."
else
errorList += ( "Warning: translate-shell is not installed. Games that require translation will not be translated." )
fi
packageList += ( "translate-shell" )
2022-12-06 00:19:02 -05:00
if command -v sqlite3 & > /dev/null ; then
[ [ $# -eq 0 ] ] && echo "Sqlite3 is installed."
else
errorList += ( "Warning: sqlite is not installed. Required for games that need to be translated." )
fi
if command -v perl & > /dev/null ; then
[ [ $# -eq 0 ] ] && echo "Perl is installed."
else
errorList += ( "Warning: perl is not installed. Required for games that need to be translated." )
fi
packageList += ( "perl" )
packageList += ( "sqlite" )
2021-04-27 20:32:08 -04:00
if command -v w3m & > /dev/null ; then
2021-05-10 13:38:30 -04:00
[ [ $# -eq 0 ] ] && echo "W3m is installed."
2021-04-27 20:32:08 -04:00
else
errorList += ( "Warning: w3m is not installed. W3m is used to view game documentation." )
fi
2021-05-10 13:38:30 -04:00
packageList += ( "w3m" )
2020-11-16 16:57:16 -05:00
if command -v xclip & > /dev/null ; then
2021-05-10 13:38:30 -04:00
[ [ $# -eq 0 ] ] && echo "Xclip is installed."
2020-11-16 16:57:16 -05:00
else
2020-11-20 12:37:54 -05:00
errorList += ( "Warning: Xclip is not installed. Some games may not speak or register properly." )
2020-11-16 16:57:16 -05:00
fi
2021-05-10 13:38:30 -04:00
packageList += ( "xclip" )
2020-10-08 10:42:47 -04:00
if command -v xdotool & > /dev/null ; then
2021-05-10 13:38:30 -04:00
[ [ $# -eq 0 ] ] && echo "Xdotool is installed."
2020-10-08 10:42:47 -04:00
else
2021-05-03 22:16:24 -04:00
errorList += ( "Warning: Xdotool is not installed. Some installers may not work or may need manual intervention." )
2020-10-08 10:42:47 -04:00
fi
2021-05-10 13:38:30 -04:00
packageList += ( "xdotool" )
2020-08-27 17:35:32 -04:00
# Show the results
2021-05-10 13:38:30 -04:00
if [ [ $# -ne 0 ] ] ; then
for i in " ${ packageList [@] } " ; do
echo " $i "
done | sort
exit 0
fi
2020-08-27 17:35:32 -04:00
if [ [ ${# errorList [@] } -eq 0 ] ] ; then
echo "No problems found, you are good to go."
exit 0
fi
echo "Errors detected, here is a list along with the severity."
echo "Note that errors marked critical mean that you will not be able to install and play games until they are resolved."
for i in " ${ errorList [@] } " ; do
echo " $i "
done
exit 0
}
2020-12-16 23:28:38 -05:00
clear_cache( ) {
local answer
if [ [ ! -d " ${ cache } " ] ] ; then
echo " No cache found at ${ cache } . "
return
fi
while ! [ [ " ${ answer ,, } " = ~ ^yes$| ^no$ ] ] ; do
echo " This will delete all contents of ${ cache } . Are you sure you want to continue? "
echo "Please type yes or no."
echo
read -r answer
done
if [ [ " $answer " = = "no" ] ] ; then
return
fi
# All safety checks done. Delete the cache.
rm -rfv " ${ cache } "
echo "Cache deleted."
}
2020-09-06 14:38:16 -04:00
download( ) {
2024-12-14 15:10:04 -05:00
local source = ( $@ )
for i in " ${ source [@] } " ; do
local dest = " ${ i ##*/ } "
dest = " ${ dest //%20/ } "
dest = " ${ dest #* \? filename = } "
dest = " ${ dest % \? * } "
# Remove the destination file if it is empty.
[ [ -s " ${ cache } / ${ dest } " ] ] || rm -f " ${ cache } / ${ dest } " 2> /dev/null
if [ [ " ${ redownload } " = = "true" ] ] && [ [ -e " ${ cache } / ${ dest } " ] ] ; then
rm -v " ${ cache } / ${ dest } "
fi
# Skip if the item is in cache.
[ [ -e " ${ cache } / ${ dest } " ] ] && continue
{ if ! curl -L4 -C - --retry 10 --output " ${ cache } / ${ dest } " " ${ i } " ; then
echo " Could not download \" $i \"... "
exit 1
fi ; } | dialog --backtitle "Audio Game Manager" \
--progressbox " Downloading \" $dest \" from \" $i \" " -1 -1
local downloadError = 1
case " ${ dest ##*. } " in
"pk3" | "zip" )
unzip -tq " ${ cache } / ${ dest } " | dialog --backtitle "Audio Game Manager" \
--progressbox " Validating ${ dest ##*. } file " -1 -1 --stdout
downloadError = $?
; ;
"7z" )
7z t " ${ cache } / ${ dest } " | dialog --backtitle "Audio Game Manager" \
--progressbox "Validating 7z file" -1 -1 --stdout
downloadError = $?
; ;
"exe" )
# Check if it's a valid Windows executable by looking at the MZ header
if ! hexdump -n 2 -v -e '/1 "%02X"' " ${ cache } / ${ dest } " | grep -q "4D5A" ; then
downloadError = 0
fi
; ;
"wad" )
if [ [ " $( file -b --mime-type " ${ cache } / ${ dest } " ) " != "application/octet-stream" ] ] ; then
downloadError = 0
fi
; ;
*)
# Add HTML check for other file types
if file -b " ${ cache } / ${ dest } " | grep -q "HTML document" ; then
echo " File not found: \" $i \" (HTML document probably 404) "
downloadError = 0
fi
; ;
esac
if [ [ $downloadError -eq 0 ] ] ; then
rm -fv " ${ cache } / ${ dest } "
dialog --backtitle "Audio Game Manager" \
--infobox " Error downloading \" ${ dest } \". Installation cannot continue. " -1 -1 --stdout
alert
exit 1
fi
done
2020-09-06 14:38:16 -04:00
}
2021-06-14 17:13:25 -04:00
get_bottle( ) {
# Handles games that use the same wine bottle
2022-03-11 12:43:22 -05:00
case " ${ game } " in
2022-01-23 17:45:22 -05:00
# Aprone (Jeremy Kaldobsky) games.
"castaways" *) ; &
"castaways-2" *) ; &
"daytona-and-the-book-of-gold" *) ; &
"dog-who-hates-toast" *) ; &
"lunimals" *) ; &
"paw-prints" *) ; &
2024-02-17 01:33:09 -05:00
"penta-path" *) ; &
2022-01-23 17:45:22 -05:00
"preludeamals" *) ; &
"puzzle-divided" *) ; &
2023-08-11 17:57:25 -04:00
"rettou" *) ; &
2022-01-23 17:45:22 -05:00
"revelation" *) ; &
"swamp" *) ; &
2024-02-17 16:34:33 -05:00
"tarot-assistant" *) ; &
2023-05-12 18:23:42 -04:00
"triple-triad" *)
2023-01-23 20:18:36 -05:00
export WINEPREFIX = " ${ HOME } /.local/wine/aprone " ; ;
2021-06-14 17:13:25 -04:00
"bg-" *) export WINEPREFIX = " ${ HOME } /.local/wine/bg " ; ;
2024-08-28 12:47:36 -04:00
# draconis games
"esp-pinball-classic" *) ; &
"esp-pinball-extreme" *) ; &
"esp-pinball-party-pack" *) ; &
"silver-dollar" *) ; &
"monkey-business" *) ; &
"alien-outback" *) ; &
"dyna-man" *) ; &
"change-reaction" *) ; &
"ten-pin-alley" *) export WINEPREFIX = " ${ HOME } /.local/wine/draconis " ; ;
2022-01-03 18:12:17 -05:00
# l-works games group
"duck-hunt" *) ; &
"judgement-day" *) ; &
"lockpick" *) ; &
"pigeon-panic" *) ; &
"super-egg-hunt" *) ; &
"super-liam" *) ; &
"the-great-toy-robbery" *) export WINEPREFIX = " ${ HOME } /.local/wine/l-works " ; ;
2022-03-23 18:39:12 -04:00
# Nyanchan games group
2022-10-04 17:39:36 -04:00
"bokurano-daibouken" *) ; &
2022-03-23 18:39:12 -04:00
"laser-breakout" *) ; &
"marina-break" *) ; &
"mp5" *) ; &
"screaming-strike-2" *) ; &
"world-of-war" *) export WINEPREFIX = " ${ HOME } /.local/wine/nyanchan " ; ;
2021-06-24 20:40:40 -04:00
# Oriol Gomez games group
"bombercats" *) ; &
"copter-mission" *) ; &
"danger-on-the-wheel" *) ; &
"death-on-the-road" *) ; &
"fuck-that-bird" *) ; &
"hammer-of-glory" *) ; &
"insect-therapy" *) ; &
"rhythm-rage" *) ; &
"run-for-your-life" *) ; &
"thief" *) ; &
"villains-from-beyond" *) export WINEPREFIX = " ${ HOME } /.local/wine/oriol-gomez " ; ;
2022-10-15 13:30:53 -04:00
# pbgames group
"dark-destroyer" *) ; &
"PBGames TMP" ) export WINEPREFIX = " $HOME /.local/wine/pbgames " ; ;
2022-01-23 17:45:22 -05:00
# tunmi13 games group
"battle-of-the-hunter" *) ; &
2023-05-24 10:09:14 -04:00
"clashes-of-the-sky" *) ; &
2022-01-23 17:45:22 -05:00
"challenge-of-the-horse" *) export WINEPREFIX = " ${ HOME } /.local/wine/tunmi13 " ; ;
2023-05-24 10:09:14 -04:00
# tunmi13-64bit games group
"battlefield-2d" *) ; &
2023-09-07 17:21:08 -04:00
"haunted-party" *) ; &
"skateboarder-pro" *) export WINEPREFIX = " ${ HOME } /.local/wine/tunmi13-64bit " ; ;
2023-04-05 19:10:55 -04:00
# Dan Z games group
"lost" *) ; &
"maze-craze" *) ; &
2023-04-05 22:41:50 -04:00
"super-deekout" *)
export norh = "true"
export WINEPREFIX = " $HOME /.local/wine/dan-z "
; ;
2021-06-14 17:13:25 -04:00
*) export WINEPREFIX = " ${ HOME } /.local/wine/ ${ game %|* } " ; ;
esac
2023-01-30 23:56:21 -05:00
# Wine version for bottles
2023-02-07 03:46:15 -05:00
if [ [ " $game " = ~ entombed ] ] ; then
install_wine "6.18" "32"
fi
2023-01-30 23:56:21 -05:00
if [ [ " $game " = ~ rs-games ] ] ; then
install_wine "7.0" "32"
fi
2023-02-02 04:11:54 -05:00
if [ [ " $game " = ~ shadow-line ] ] ; then
install_wine "7.7" "32"
fi
2021-06-14 17:13:25 -04:00
}
2021-06-14 06:54:18 -04:00
get_installer( ) {
2021-07-03 21:21:18 -04:00
trap "exit 0" SIGINT
2021-06-14 06:54:18 -04:00
# If the file is in cache nothing else needs to be done.
if [ [ -f " ${ cache } / $1 " ] ] ; then
return
fi
2021-07-01 21:02:36 -04:00
# Create message for dialog.
local message = " Make sure $1 is available in either your Downloads or Desktop directory and press enter to continue. "
if [ [ -n " $2 " ] ] ; then
message += " \n\nThe last good known URL for $game is: "
message += " \n $2 "
fi
if echo " $2 " | xclip -selection clipboard 2> /dev/null ; then
message += "\n\nThe URL has been copied to the clipboard."
fi
dialog --ok-label "Continue" \
--backtitle "Audiogame Manager" \
--msgbox " $message " -1 -1
2021-06-14 06:54:18 -04:00
# Search the Desktop and Downloads directories for the installation file
for i in ~/Downloads ~/Desktop ; do
find $i -type f -name " $1 " -exec cp -v { } " ${ cache } / " \;
done
# If the file is still not available abort.
if [ [ ! -f " ${ cache } / $1 " ] ] ; then
echo " couldn't find $1 . Please download the file and try again. "
exit 1
fi
}
2023-12-02 15:41:25 -05:00
get_steam( ) {
2023-12-02 15:52:52 -05:00
# Arguments: $1 id of item for download, $2 url for game
trap "exit 0" SIGINT
2024-09-09 01:20:56 -04:00
echo "manual intervention required."
2023-12-02 16:20:20 -05:00
alert
2024-09-09 01:20:56 -04:00
dialog --backtitle "Audiogame Manager" \
--yes-label "Continue with Steam" \
--no-label "Install manually" \
--extra-button \
--extra-label "Exit" \
--yesno " To install the game manually, place files in \" ${ WINEPREFIX } /drive_c/Program Files/ ${ game } \" " -1 -1 --stdout
case $? in
0) echo "The next steps will install through steamcmd." ; ;
1)
mkdir -p " ${ WINEPREFIX } /drive_c/Program Files/ ${ game } "
dialog --backtitle "Audiogame Manager" \
--msgbox " Place game files in \" ${ WINEPREFIX } /drive_c/Program Files/ ${ game } \" and press enter to continue. " -1 -1 --stdout
return
; ;
*) exit 0 ; ;
esac
2023-12-02 15:52:52 -05:00
# Check for steamcmd
if ! command -v steamcmd & > /dev/null ; then
dialog --backtitle "Audiogame Manager" \
--infobox "This installer requires steamcmd. Please install steamcmd and try again." -1 -1
exit 1
fi
# Create message for dialog.
local message = " Make sure ${ game } is available in your Steam library and press enter to continue. The URL for ${ game } is $2 "
if echo " $2 " | xclip -selection clipboard 2> /dev/null ; then
message += "\n\nThe URL has been copied to the clipboard."
fi
dialog --ok-label "Continue" \
--backtitle "Audiogame Manager" \
--msgbox " $message " -1 -1
2023-12-02 16:39:06 -05:00
# Get Steam user name.
steamUser = " $( dialog --ok-label "Continue" \
--backtitle "Audiogame Manager" \
--inputbox "Please enter your Steam user name:" -1 -1 --stdout) "
2023-12-02 15:52:52 -05:00
# Download the game
2023-12-02 16:39:06 -05:00
mkdir -p " ${ WINEPREFIX } /drive_c/Program Files/ ${ game } "
2023-12-02 17:53:26 -05:00
steamcmd +@sSteamCmdForcePlatformType windows +force_install_dir " ${ WINEPREFIX } /drive_c/Program Files/ $game " +login " $steamUser " +app_update " $1 " +quit || { dialog --backtitle "Audiogame Manager" \
2023-12-02 15:52:52 -05:00
--infobox "Something went wrong. Please make sure you have a stable internet connection, and if the problem persists, contact audiogame-manager's developers." -1 -1
exit 1; }
2023-12-02 15:41:25 -05:00
}
2020-09-05 00:26:29 -04:00
help( ) {
2020-12-16 17:16:16 -05:00
echo " ${ 0 ##*/ } "
echo "Released under the terms of the Common Public Attribution License Version 1.0"
echo -e "This is a Stormux project: https://stormux.org\n"
2020-09-05 00:26:29 -04:00
echo -e "Usage:\n"
echo "With no arguments, open the game launcher."
for i in " ${ !command[@] } " ; do
2020-12-12 12:10:13 -05:00
echo " - ${ i / : / <parameter> } : ${ command [ ${ i } ] } "
2020-09-05 00:26:29 -04:00
done | sort
2022-03-08 03:05:32 -05:00
echo
echo "Some settings that are often used can be stored in a settings.conf file."
2023-05-01 00:26:22 -04:00
echo "If wanted, place it at the following location:"
echo " ${ configFile %/* } /settings.conf "
2022-03-08 03:05:32 -05:00
echo "The syntax is variable=\"value\""
echo
2024-12-14 15:10:04 -05:00
echo "ipfsGateway=\"https://ipfs.stormux.org\" # Gateway to be used for ipfs downloads."
2022-03-08 03:05:32 -05:00
echo "noCache=\"true\" # Do not keep downloaded items in the cache."
2022-12-23 01:37:27 -05:00
echo "noqjoypad=\"true\" # Do not launch qjoypad."
2022-03-08 03:05:32 -05:00
echo "norh=\"true\" # Do not install RHVoice."
echo "redownload=\"true\" # Redownload sources, do not use the version stored in cache."
2023-05-01 20:10:40 -04:00
echo "voiceName=\"voicename\" # Select the voice to be installed (default Bdl)."
2023-05-01 00:08:22 -04:00
echo "defaultVoice=\"voicename\" # Select the default voice to use for the bottle, e.g. MSMike or RHVoice."
echo "defaultRate=\"Default voice rate for the bottle, default 7, may not work in all games. Values 1-9 or A."
2022-03-08 03:31:05 -05:00
echo "winedebug=\"flag(s)\" # Set wine debug flags, useful for development."
2020-09-05 00:26:29 -04:00
exit 0
}
2021-04-27 20:32:08 -04:00
documentation( ) {
if [ [ " $2 " = = "Become a Patron" ] ] ; then
return
fi
if [ [ " $2 " = = "Donate" ] ] ; then
return
fi
if ! command -v w3m & > /dev/null ; then
echo "This feature of audiogame-manager requires w3m. Please install it before continuing."
2023-08-10 02:08:06 -04:00
exit 1
2021-04-27 20:32:08 -04:00
fi
2021-06-14 17:13:25 -04:00
get_bottle " $1 "
2021-04-27 20:32:08 -04:00
echo "Loading documentation, please wait..."
# Try to find documentation based on common naming conventions.
local gamePath = " $( winepath -u " $2 " 2> /dev/null) "
gamePath = " ${ gamePath %/* } "
2023-08-10 02:08:06 -04:00
local gameDoc = " $( find " $gamePath " -type f -iname 'user_manual.htm*' -or -iname 'user manual.htm*' -or -iname '*user guide.htm*' | head -1) "
2021-05-17 00:35:37 -04:00
# Game name specific docs, add the name to the for loop.
if [ [ -z " $gameDoc " ] ] ; then
2023-03-28 17:02:20 -04:00
for i in "troopanum.txt" "superdeekout.txt" scw.html ; do
2021-05-17 00:35:37 -04:00
gameDoc = " $( find " $gamePath " -type f -iname " $i " -or -iname 'manual.htm' | head -1) "
done
fi
2021-08-09 23:34:11 -04:00
if [ [ -z " $gameDoc " ] ] ; then
gameDoc = " $( find " $gamePath " -type f -path '*/Manual/index.html' | head -1) "
fi
2021-06-14 07:51:30 -04:00
if [ [ -z " $gameDoc " ] ] ; then
2021-06-14 17:56:47 -04:00
gameDoc = " $( find " $gamePath " -type f -iname '[A-Z]*Help.htm' -or -iname '[A-Z]*Help.html' | head -1) "
2021-06-14 07:51:30 -04:00
fi
2021-04-27 20:32:08 -04:00
if [ [ -z " $gameDoc " ] ] ; then
2021-05-01 00:43:08 -04:00
gameDoc = " $( find " $gamePath " -type f -iname 'manual.html' -or -iname 'manual.htm' | head -1) "
2021-04-27 20:32:08 -04:00
fi
2021-04-28 18:08:15 -04:00
if [ [ -z " $gameDoc " ] ] ; then
2021-05-01 00:43:08 -04:00
gameDoc = " $( find " $gamePath " -type f -iname 'en.html' -or -iname 'en.htm' | head -1) "
2021-04-28 18:08:15 -04:00
fi
2021-04-27 20:32:08 -04:00
if [ [ -z " $gameDoc " ] ] ; then
2021-05-01 00:43:08 -04:00
gameDoc = " $( find " $gamePath " -type f -iname 'readme.html' -or -iname 'readme.htm' | head -1) "
2021-04-27 20:32:08 -04:00
fi
if [ [ -z " $gameDoc " ] ] ; then
2021-04-27 21:39:15 -04:00
gameDoc = " $( find " $gamePath " -type f -iname 'manual.txt' | head -1) "
2021-04-27 20:32:08 -04:00
fi
if [ [ -z " $gameDoc " ] ] ; then
2024-02-28 00:40:30 -05:00
gameDoc = " $( find " $gamePath " -type f -iname 'readme.txt' -or -iname 'help.txt' | head -1) "
2021-04-27 20:32:08 -04:00
fi
2021-04-27 20:55:06 -04:00
if [ [ -z " $gameDoc " ] ] ; then
2021-04-27 21:39:15 -04:00
gameDoc = " $( find " $gamePath " -type f -iname '*.url' -exec grep -i 'url=' { } \; | grep -iv 'score' | head -1) "
2021-04-27 20:55:06 -04:00
gameDoc = " ${ gameDoc #*= } "
gameDoc = " ${ gameDoc //[[ : cntrl : ]]/ } "
fi
2021-04-27 20:32:08 -04:00
# Display documentation if available.
if [ [ -n " $gameDoc " ] ] ; then
w3m " $gameDoc "
else
echo "No documentation found."
fi
exit 0
}
2022-03-11 12:43:22 -05:00
2023-01-23 18:08:56 -05:00
install_wine( ) {
# Requires wine version, e.g. 7.7 and architecture, 32|64
if [ [ $# -ne 2 ] ] ; then
exit 1
fi
# Figure out wineInstallationPath
wineInstallationPath = " ${ XDG_DATA_HOME :- $HOME /.local/share } /audiogame-manager/wine_ $2 / $1 "
2024-12-12 22:12:55 -05:00
export wine = " ${ wineInstallationPath } /bin/wine "
2023-01-23 18:08:56 -05:00
# If the path exists, wine should already be installed.
# Just make sure we didn't wind up with a empty directory for some reason
rmdir " ${ wineInstallationPath } " 2> /dev/null
if [ [ -d " ${ wineInstallationPath } " ] ] ; then
return
fi
2023-01-23 20:18:36 -05:00
mkdir -p " ${ wineInstallationPath } " 2> /dev/null
2023-01-23 18:08:56 -05:00
# This probably does not need to be cached, so download to tmp.
installationFile = " $( mktemp) "
local v = $2
v = " ${ v /32/x86 } "
v = " ${ v /64/x64 } " # Probably wrong, so just a place holder.
# If this goes wrong, bail out
set -e
2023-01-26 19:52:00 -05:00
{ curl -L --output " ${ installationFile } " " https://www.playonlinux.com/wine/binaries/phoenicis/upstream-linux-x86/PlayOnLinux-wine- ${ 1 } -upstream-linux- ${ v } .tar.gz "
tar xf " ${ installationFile } " -C " ${ wineInstallationPath } " ; } | dialog --progressbox " Installing $2 bit Wine version $1 . " -1 -1
2023-01-23 18:08:56 -05:00
set +e
}
2023-06-12 11:21:40 -04:00
unix2dos( ) {
if [ [ $# -eq 0 ] ] ; then
echo "Usage: unix2dos file(s)."
exit 1
fi
for file in " ${ @ } " ; do
sed -i 's/$/\r/' " ${ file } "
done
}
2021-10-09 04:16:35 -04:00
winetricks( ) {
2022-02-08 12:57:27 -05:00
# Report used packages to the winetricks maintainer so he knows they are being used.
if ! [ [ -e " ${ XDG_CACHE_HOME :- $HOME /.cache } /winetricks/track_usage " ] ] ; then
2022-02-16 19:18:15 -05:00
mkdir -p " ${ XDG_CACHE_HOME :- $HOME /.cache } /winetricks/ "
2022-02-08 12:57:27 -05:00
echo "1" > " ${ XDG_CACHE_HOME :- $HOME /.cache } /winetricks/track_usage "
fi
2021-10-09 04:16:35 -04:00
# Download or update agm's copy of winetricks
2022-03-01 17:56:46 -05:00
if [ [ ! -e " ${ winetricksPath } /winetricks " ] ] ; then
2021-10-09 04:16:35 -04:00
checkWinetricksUpdate = "true"
download "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks"
2022-03-01 17:56:46 -05:00
mv " ${ cache } /winetricks " " ${ winetricksPath } "
chmod 755 " ${ winetricksPath } /winetricks "
2021-10-09 04:16:35 -04:00
else
if [ [ " $checkWinetricksUpdate " != "true" ] ] ; then
checkWinetricksUpdate = "true"
2022-03-01 17:56:46 -05:00
${ winetricksPath } /winetricks --self-update
2021-10-09 04:16:35 -04:00
fi
fi
# Run the requested winetricks parameters
2024-12-16 18:49:18 -05:00
if command -v FEXLoader & > /dev/null ; then
2024-12-17 05:06:37 -05:00
WINE = "" FEXLoader -- ${ winetricksPath } /winetricks " $@ "
2024-12-16 18:49:18 -05:00
else
${ winetricksPath } /winetricks " $@ "
fi
2021-10-09 04:16:35 -04:00
}
2022-01-21 23:08:59 -05:00
install_rhvoice( ) {
if [ [ -d " $HOME /.local/wine/ ${ bottle } /drive_c/Program Files/Olga Yakovleva/ " ] ] ; then
return
fi
if [ [ " $norh " = = "true" ] ] ; then
2023-05-01 00:08:22 -04:00
# Try to prevent the user from breaking speech
# Also useful for games that do not work with RHVoice
if [ [ " ${ defaultVoice } " = = "RHVoice" ] ] ; then
unset defaultVoice
fi
2022-01-21 23:08:59 -05:00
return
fi
2022-08-22 18:42:58 -04:00
declare -A RHVoice = (
[ alan] = "https://rhvoice.eu-central-1.linodeobjects.com/RHVoice-voice-English-Alan-v4.0.2008.15-setup.exe"
[ bdl] = "https://rhvoice.eu-central-1.linodeobjects.com/RHVoice-voice-English-Bdl-v4.1.2008.15-setup.exe"
[ clb] = "https://rhvoice.eu-central-1.linodeobjects.com/RHVoice-voice-English-Clb-v4.0.2008.15-setup.exe"
2024-12-15 16:14:17 -05:00
[ lyubov] = "https://rhvoice.eu-central-1.linodeobjects.com/RHVoice-voice-English-Lyubov-v4.0.2008.15-setup.exe"
2022-08-22 18:42:58 -04:00
[ slt] = "https://rhvoice.eu-central-1.linodeobjects.com/RHVoice-voice-English-Slt-v4.0.2008.15-setup.exe"
)
voiceName = " ${ voiceName :- bdl } "
voiceName = " ${ voiceName ,, } "
if [ [ " ${ RHVoice [ ${ voiceName } ] } " = = "" ] ] ; then
echo "Invalid RHVoice name specified, defaulting to Bdl."
voiceName = "bdl"
fi
local voiceFile = " ${ RHVoice [ ${ voiceName } ]##*/ } "
download " ${ RHVoice [ ${ voiceName } ] } "
2022-01-21 23:08:59 -05:00
winetricks -q win8
2022-08-22 18:42:58 -04:00
echo " Installing RHVoice ${ voiceName ^ } ... "
2023-01-30 23:56:21 -05:00
${ wine } " ${ cache } / ${ voiceFile } " &
2022-01-21 23:08:59 -05:00
sleep 20
2023-01-30 23:56:21 -05:00
${ wine } server -k
2022-01-21 23:08:59 -05:00
}
2020-08-27 15:42:24 -04:00
install_wine_bottle( ) {
2020-09-21 06:58:47 -04:00
# 32 bit installations work best and are the default here, if you need to override it, do it in the game specific installation steps.
export WINEARCH = " ${ WINEARCH :- win32 } "
2023-01-24 16:04:58 -05:00
# Figure out if we are using a specific version of wine
2023-01-30 23:56:21 -05:00
export wine = " ${ wine :- $( command -v wine) } "
2023-01-24 16:04:58 -05:00
# Set the WINE and WINESERVER environmental variables so winetricks will use the right installation.
2023-01-30 23:56:21 -05:00
export WINE = " ${ wine } "
export WINESERVER = " ${ wine } server "
2021-06-14 17:13:25 -04:00
if [ [ -z " $bottle " ] ] ; then
local bottle = " ${ game ,, } "
bottle = " ${ bottle //[[ : space : ]]/- } "
if [ [ -d " $HOME /.local/wine/ ${ bottle } " ] ] ; then
echo " $HOME /.local/wine/ ${ bottle } exists. Please remove it before running this installer. "
exit 1
fi
2021-02-23 16:14:27 -05:00
fi
2020-08-27 15:42:24 -04:00
export WINEPREFIX = " $HOME /.local/wine/ ${ bottle } "
# Arguments to the function are dependancies to be installed.
2021-02-21 11:53:32 -05:00
# Get location of mono and gecko.
2023-09-02 23:39:39 -04:00
monoPath = " $( find /usr/share/wine/ -maxdepth 1 -type d -name mono 2> /dev/null) "
geckoPath = " $( find /usr/share/wine/ -maxdepth 1 -type d "gecko" 2> /dev/null) "
2021-02-21 11:53:32 -05:00
if [ [ -z " $monoPath " ] ] ; then
download 'http://dl.winehq.org/wine/wine-mono/6.0.0/wine-mono-6.0.0-x86.msi'
monoPath = " ${ cache } /wine-mono-6.0.0-x86.msi "
fi
if [ [ -z " $geckoPath " ] ] ; then
download 'http://dl.winehq.org/wine/wine-gecko/2.40/wine_gecko-2.40-x86.msi'
geckoPath = " ${ cache } /wine_gecko-2.40-x86.msi "
fi
2021-07-04 03:50:01 -04:00
# This is in a brace list to pipe through dialog.
2023-01-26 19:52:00 -05:00
{ echo -n "Using "
${ wine } --version
DISPLAY = "" ${ wine } boot -u
2023-01-30 23:56:21 -05:00
${ wine } msiexec /i z:" $monoPath " /quiet
${ wine } msiexec /i z:" $geckoPath " /quiet
2022-12-22 09:59:42 -05:00
if [ [ " ${ * } " = ~ ( speechsdk| sapi) ] ] ; then
2022-01-21 23:08:59 -05:00
install_rhvoice
2021-07-06 13:53:41 -04:00
fi
2022-08-21 01:39:12 -04:00
if [ [ " ${ WINEARCH } " = = "win64" ] ] ; then
download "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd"
fi
2022-08-20 23:51:12 -04:00
if [ [ " ${ WINEARCH } " = = "win64" ] ] && [ [ ! -f " ${ XDG_DATA_HOME :- $HOME /.local/share } /audiogame-manager/nvda2speechd " ] ] ; then
cp " ${ cache } /nvda2speechd " " ${ XDG_DATA_HOME :- $HOME /.local/share } /audiogame-manager/nvda2speechd "
2022-08-21 00:10:48 -04:00
chmod +x " ${ XDG_DATA_HOME :- $HOME /.local/share } /audiogame-manager/nvda2speechd "
2022-08-20 23:51:12 -04:00
fi
2023-01-02 20:00:31 -05:00
winetricks -q isolate_home $@ ${ winVer :- winxp } ${ winetricksSettings } ; } | dialog --progressbox "Installing wine bottle, please wait..." -1 -1
2023-02-05 15:37:57 -05:00
# make it easy for game scripts to know which version of wine to use.
echo " WINE=\" ${ WINE } \" " > " $HOME /.local/wine/ ${ bottle } /agm.conf "
echo " WINESERVER=\" ${ WINESERVER } \" " >> " $HOME /.local/wine/ ${ bottle } /agm.conf "
2023-05-01 00:08:22 -04:00
# If default voice is set, change it for the bottle
2024-02-15 10:52:59 -05:00
if [ [ ${# defaultVoice } -ge 2 ] ] && [ [ " ${ * } " = ~ ( speechsdk| sapi) ] ] ; then
2023-05-01 00:08:22 -04:00
echo " Setting default voice for bottle \" ${ bottle } \" to \" ${ defaultVoice } \". "
" ${ 0 %/* } /speech/set-voice.sh " -b " ${ bottle } " -r " ${ defaultRate :- 7 } " -v " ${ defaultVoice } "
fi
2020-08-27 15:42:24 -04:00
}
# Install games
game_installer( ) {
2023-02-09 00:14:42 -05:00
export LANG = "en_US.UTF-8"
2024-12-13 05:06:58 -05:00
# Get list of installed games from config file
2024-09-12 16:38:35 -04:00
mapfile -t installedGames < <( sed -e '/^$/d' -e '/^[[:space:]]*#/d' " ${ configFile } " 2> /dev/null | cut -d '|' -f3)
2024-12-13 05:06:58 -05:00
# Create the menu of available games by reading from .install directory
2020-08-27 15:42:24 -04:00
declare -a menuList
2024-12-13 05:06:58 -05:00
# Get all .sh files from .install directory, excluding those starting with # as first line.
mapfile -t sortedGames < <( for f in " ${ 0 %/* } /.install/ " *.sh; do
# Skip if first line starts with #
[ [ $( head -n1 " $f " ) = = "#" * ] ] && continue
echo " ${ f ##*/%.sh } "
done | sort)
for i in " ${ sortedGames [@] } " ; do
local menuItem = " ${ i %.sh } "
menuItem = " ${ menuItem ##*/ } "
# Check if game is already installed
for j in " ${ installedGames [@] } " ; do
2020-08-27 15:42:24 -04:00
if [ [ " $j " = = " $menuItem " ] ] ; then
unset menuItem
2024-12-13 05:06:58 -05:00
break
2020-08-27 15:42:24 -04:00
fi
done
2024-12-13 05:06:58 -05:00
# Add to menu if not installed
2020-08-27 15:42:24 -04:00
if [ [ -n " $menuItem " ] ] ; then
menuList += ( " $menuItem " " $menuItem " )
fi
done
2024-12-13 05:06:58 -05:00
# If all games are installed, exit
2020-08-27 15:42:24 -04:00
if [ [ ${# menuList [@] } -eq 0 ] ] ; then
echo "All games are already installed."
exit 0
fi
2021-02-19 12:58:11 -05:00
menuList += ( "Donate" "Donate" )
2020-09-01 14:39:39 -04:00
menuList += ( "Become a Patron" "Become a Patron" )
2024-12-13 05:06:58 -05:00
# Show game selection dialog
2020-08-27 15:42:24 -04:00
game = " $( dialog --backtitle "Audio Game Installer" \
--clear \
2023-03-30 22:26:02 -04:00
--ok-label "Install" \
2020-08-27 15:42:24 -04:00
--no-tags \
--menu "Please select a game to install" 0 0 0 " ${ menuList [@] } " --stdout) "
2024-12-13 05:06:58 -05:00
[ [ $? -ne 0 ] ] && exit 0
# Handle selection
if [ [ -n " $game " ] ] ; then
case " $game " in
"Donate" )
open_url "https://ko-fi.com/stormux"
exit 0
; ;
"Become a Patron" )
open_url "https://patreon.com/stormux"
exit 0
; ;
*)
# Convert game name to filename format
local installScript = " ${ 0 %/* } /.install/ ${ game } .sh "
# Check if install script exists
if [ [ -f " $installScript " ] ] ; then
# Source and execute the install script
source " $installScript "
else
dialog --backtitle "Audio Game Installer" \
--msgbox " Installation script not found for ${ game } " -1 -1
exit 1
fi
; ;
esac
fi
2020-08-27 15:42:24 -04:00
}
2020-09-04 23:32:26 -04:00
# remove games
game_removal( ) {
2024-12-17 06:15:02 -05:00
if [ [ " $( uname -m) " = = "aarch64" ] ] ; then
export wine = " ${ wine :- /usr/bin/wine } "
else
export wine = " ${ wine :- /usr/bin/wine } "
fi
2024-09-13 01:28:22 -04:00
mapfile -t lines < <( sed -e '/^$/d' -e '/^[[:space:]]*#/d' " ${ configFile } " 2> /dev/null)
2020-09-04 23:32:26 -04:00
if [ [ ${# lines } -eq 0 ] ] ; then
echo "No games found."
exit 0
fi
# Create the menu of installed games
declare -a menuList
for i in " ${ lines [@] } " ; do
2024-09-13 01:28:22 -04:00
IFS = '|' read -ra gameInfo <<< " $i "
menuList += ( " ${ gameInfo [0] } | ${ gameInfo [1] } " " ${ gameInfo [2] } " )
2020-09-04 23:32:26 -04:00
done
2021-02-19 12:58:11 -05:00
menuList += ( "Donate" "Donate" )
2020-09-04 23:32:26 -04:00
menuList += ( "Become a Patron" "Become a Patron" )
2023-03-30 22:26:02 -04:00
local game
game = " $( dialog --backtitle "Audio Game Removal" \
2020-09-04 23:32:26 -04:00
--clear \
2023-03-30 22:26:02 -04:00
--ok-label "Remove" \
2020-09-04 23:32:26 -04:00
--no-tags \
--menu "Please select a game to delete" 0 0 0 " ${ menuList [@] } " --stdout) "
if [ [ ${# game } -gt 0 ] ] ; then
2021-02-19 12:58:11 -05:00
if [ [ " $game " = = "Donate" ] ] ; then
open_url "https://ko-fi.com/stormux"
2020-09-04 23:32:26 -04:00
exit 0
fi
if [ [ " $game " = = "Become a Patron" ] ] ; then
2021-08-22 18:19:00 -04:00
open_url "https://2mb.games/product/2mb-patron/"
2020-09-04 23:32:26 -04:00
exit 0
fi
local winePath = " ${ game #*| } "
2021-07-01 16:22:57 -04:00
export winePath = " ${ winePath % \\ *.exe } "
2020-09-04 23:32:26 -04:00
local wineExec = " ${ game #*| } "
wineExec = " ${ wineExec %|* } "
wineExec = " ${ wineExec ##* \\ } "
2021-06-15 19:07:07 -04:00
# Confirm removal
2021-06-17 15:32:09 -04:00
get_bottle " ${ game %|* } "
2021-06-23 14:04:35 -04:00
# Make sure the game can be handled by remove
if [ [ " ${ HOME } /.local/wine/ ${ game %|* } " = = " ${ WINEPREFIX } " ] ] ; then
read -rp " To remove the wine bottle \" ${ WINEPREFIX ##*/ } \" and all of its contents press enter. To cancel press control+c. " continue
# kill any previous existing wineservers for this prefix in case they didn't shut down properly.
2024-12-13 00:15:08 -05:00
${ wine } server -k
2021-06-23 14:04:35 -04:00
# remove the game
rm -rf " ${ WINEPREFIX } "
else
2021-07-01 16:22:57 -04:00
read -rp " This bottle \" ${ WINEPREFIX ##*/ } \" contains multiple entries, so only the game will be removed. To continue press enter. To cancel press control+c. " continue
rm -rf " $( winepath " ${ winePath } " ) "
2021-06-23 14:04:35 -04:00
fi
2020-09-04 23:32:26 -04:00
# remove the launcher
2021-06-23 14:04:35 -04:00
gawk -i inplace -vLine= " ${ game // \\ / \\ \\ } " '!index($0,Line)' " $configFile "
echo "The selected item has been deleted."
2020-09-04 23:32:26 -04:00
fi
exit 0
}
2020-12-29 06:28:05 -05:00
# kill games that are stuck
kill_game( ) {
2024-12-17 06:15:02 -05:00
if [ [ " $( uname -m) " = = "aarch64" ] ] ; then
export wine = " ${ wine :- /usr/bin/wine } "
else
export wine = " ${ wine :- /usr/bin/wine } "
fi
2020-12-29 06:28:05 -05:00
mapfile -t lines < <( sed '/^$/d' " ${ configFile } " 2> /dev/null)
if [ [ ${# lines } -eq 0 ] ] ; then
echo "No games found."
exit 0
fi
# Create the menu of installed games
declare -a menuList
for i in " ${ lines [@] } " ; do
2024-09-12 14:26:46 -04:00
IFS = '|' read -ra gameInfo <<< " $i "
menuList += ( " ${ gameInfo [0] } | ${ gameInfo [1] } " " ${ gameInfo [2] } " )
2020-12-29 06:28:05 -05:00
done
2021-02-19 12:58:11 -05:00
menuList += ( "Donate" "Donate" )
2020-12-29 06:28:05 -05:00
menuList += ( "Become a Patron" "Become a Patron" )
local game = " $( dialog --backtitle "Audio Game Killer" \
--clear \
2023-03-30 22:26:02 -04:00
--ok-label "Kill" \
2020-12-29 06:28:05 -05:00
--no-tags \
--menu "Please select a game to force stop" 0 0 0 " ${ menuList [@] } " --stdout) "
if [ [ ${# game } -gt 0 ] ] ; then
2021-02-19 12:58:11 -05:00
if [ [ " $game " = = "Donate" ] ] ; then
open_url "https://ko-fi.com/stormux"
2020-12-29 06:28:05 -05:00
exit 0
fi
if [ [ " $game " = = "Become a Patron" ] ] ; then
2021-08-22 18:19:00 -04:00
open_url "https://2mb.games/product/2mb-patron/"
2020-12-29 06:28:05 -05:00
exit 0
fi
local winePath = " ${ game #*| } "
winePath = " ${ winePath % \\ *.exe } "
local wineExec = " ${ game #*| } "
wineExec = " ${ wineExec %|* } "
wineExec = " ${ wineExec ##* \\ } "
# kill the wine server.
2021-06-17 15:32:09 -04:00
get_bottle " ${ game %|* } "
2024-12-13 00:15:08 -05:00
${ wine } server -k
2020-12-29 06:28:05 -05:00
echo "The selected game has been stopped."
fi
exit 0
}
2024-09-12 01:35:58 -04:00
# for games that require custom scripts before launch or custom launch parameters
custom_launch_parameters( ) {
if [ [ " ${ game [0] } " = = "dragon-pong" ] ] ; then
2022-11-15 22:24:23 -05:00
" ${ 0 %/* } /speech/speak_window_title.sh " DragonPong.exe &
pushd " $( winepath " $winePath " ) "
wine " $wineExec "
popd
exit 0
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "executioner's-rage" ] ] ; then
2024-03-21 03:04:00 -04:00
find " ${ WINEPREFIX } /drive_c/Program Files " -type f -name 'nvdaControllerClient64.dll' -exec cp -v " ${ cache } /nvda2speechd64.dll " "{}" \;
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "laser-breakout" ] ] ; then
2023-01-22 16:18:30 -05:00
" ${ 0 %/* } /speech/speak_window_title.sh " play.exe &
2022-08-21 12:22:13 -04:00
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "mist-world" ] ] ; then
2023-02-04 01:29:22 -05:00
" ${ 0 %/* } /speech/speak_window_title.sh " mw.exe &
2024-02-15 10:46:43 -05:00
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "bokurano-daibouken-2" ] ] ; then
2022-12-05 20:07:17 -05:00
" ${ 0 %/* } /speech/clipboard_translator.sh " play.exe bokurano-daibouken2 &
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "bokurano-daibouken" ] ] ; then
2022-12-05 20:07:17 -05:00
" ${ 0 %/* } /speech/clipboard_translator.sh " play.exe bokurano-daibouken &
2022-10-04 23:47:23 -04:00
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = ~ "bokurano-daibouken-3" ] ] ; then
2022-09-26 04:01:33 -04:00
dictPath = " $( winepath " ${ winePath } " ) "
2022-10-06 03:52:02 -04:00
if [ [ -r " ${ cache } /bk3-dict.dat " ] ] && [ [ ! -d " ${ dictPath } /dict " ] ] ; then
2022-09-26 04:01:33 -04:00
cp " ${ cache } /bk3-dict.dat " " ${ dictPath } /dict.dat "
fi
2022-10-06 03:52:02 -04:00
if [ [ -d " ${ dictPath } /dict " ] ] ; then
2022-10-11 13:11:40 -04:00
if [ [ ! -e " ${ dictPath } /data/nvdaControllerClient.dll " ] ] ; then
cp " ${ cache } /nvda2speechd32.dll " " ${ dictPath } /data/nvdaControllerClient.dll "
fi
2022-10-05 18:51:21 -04:00
fi
2022-10-26 06:46:19 -04:00
if [ [ ! -d " ${ dictPath } /dict " ] ] && [ [ ! -r " ${ cache } /bk3-dict.dat " ] ] ; then
2022-10-05 18:51:21 -04:00
find " ${ WINEPREFIX } /drive_c/nyanchangame/bk3 " -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \;
2022-12-06 00:08:07 -05:00
" ${ 0 %/* } /speech/clipboard_translator.sh " play.exe bokurano-daibouken3 &
2022-10-05 18:51:21 -04:00
fi
2022-09-24 15:05:08 -04:00
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "bop-it-emulator" ] ] ; then
2022-10-30 00:32:39 -04:00
" ${ 0 %/* } /speech/speak_window_title.sh " bop.exe &
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "road-to-rage" ] ] ; then
2022-10-06 11:54:24 -04:00
" ${ 0 %/* } /speech/speak_window_title.sh " trtr.exe &
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "sequence-storm" ] ] ; then
2022-11-14 08:07:30 -05:00
" ${ 0 %/* } /speech/clipboard_reader.sh " SequenceStorm &
2021-04-26 23:21:26 -04:00
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "shadow-line" ] ] ; then
2023-01-26 19:52:00 -05:00
find " ${ WINEPREFIX } /drive_c/ " -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \;
2024-09-02 15:36:07 -04:00
" ${ 0 %/* } /speech/clipboard_translator.sh " play_sr.exe shadow-line &
2023-01-26 19:52:00 -05:00
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "sketchbook" ] ] ; then
2023-01-27 12:27:17 -05:00
find " ${ WINEPREFIX } " -type f -name 'nvdaControllerClient32.dll' -exec cp -v " ${ cache } /nvdaControllerClient32.dll " "{}" \;
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "audiodisc" ] ] ; then
2021-04-29 19:00:17 -04:00
wine " $winePath \\ $wineExec "
exit 0
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "audioquake" ] ] ; then
2021-04-26 23:21:26 -04:00
wine " $winePath \\ $wineExec "
exit 0
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "screaming-strike-2" ] ] ; then
2021-06-30 01:34:31 -04:00
pushd " $( winepath " $winePath " ) "
2023-01-30 23:56:21 -05:00
${ wine } " $wineExec "
2021-06-30 01:34:31 -04:00
popd
exit 0
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "warsim" ] ] ; then
2024-09-12 01:49:01 -04:00
pushd " $( winepath " ${ game [1]% \\ * } " ) "
wine " ${ game [1]##* \\ } "
2021-08-08 16:10:16 -04:00
popd
2021-07-23 18:51:44 -04:00
exit 0
fi
2024-09-12 01:35:58 -04:00
if [ [ " ${ game [0] } " = = "interceptor" ] ] ; then
2022-08-17 03:50:45 -04:00
pushd " $( winepath " $winePath " ) "
wine " $wineExec "
popd
exit 0
fi
2020-12-14 09:34:31 -05:00
if [ [ -d " ${ WINEPREFIX } /drive_c/windows/syswow64 " ] ] ; then
2023-02-02 04:42:02 -05:00
# switch to wine64 for 64 bit prefix.
2024-12-16 14:42:25 -05:00
[ [ " ${ wine } " = = "/usr/bin/wine" ] ] && export wine = "/usr/bin/wine64"
2023-04-19 17:57:25 -04:00
fi
2024-09-12 01:35:58 -04:00
}
2024-09-12 14:26:46 -04:00
# Process game launcher flags
process_launcher-flags( ) {
flags = ( " ${ game [@] : 3 } " )
for i in " ${ flags [@] } " ; do
if [ [ " ${ i } " = ~ ^export\ [ a-zA-Z_] [ a-zA-Z0-9_] *= \' ?.*\' ?$ ] ] ; then
eval " ${ i } "
fi
done
}
2024-09-12 01:35:58 -04:00
create_game_array( ) {
# Game array 0 bottle, 1 path, 2 title, 3+ flags
for i in " ${ lines [@] } " ; do
if [ [ " ${ game } " = ~ ^${ i } ] ] ; then
# This is weird. Why do I have to set game to i before making the array?
game = " $i "
IFS = '|' read -ra game <<< " $i "
break
fi
done
}
# launch games that are installed
game_launcher( ) {
# For use by update scripts that want to source functions in this file.
[ [ " $agmNoLaunch " = = "true" ] ] && return
2024-12-16 14:42:25 -05:00
pgrep -u " $USER " nvda2speechd & > /dev/null || {
if [ [ -x ${ XDG_DATA_HOME :- $HOME /.local/share } /audiogame-manager/nvda2speechd ] ] ; then
if command -v FEXLoader & > /dev/null ; then
2024-12-17 05:19:04 -05:00
FEXLoader -- ${ XDG_DATA_HOME :- $HOME /.local/share } /audiogame-manager/nvda2speechd & > /dev/null &
2024-12-16 14:42:25 -05:00
else
2024-12-17 05:19:04 -05:00
${ XDG_DATA_HOME :- $HOME /.local/share } /audiogame-manager/nvda2speechd & > /dev/null &
2024-12-16 14:42:25 -05:00
fi
fi ; }
2024-09-12 01:35:58 -04:00
mapfile -t lines < <( sed -e '/^$/d' -e '/^ *#/d' " ${ configFile } " 2> /dev/null)
if [ [ ${# lines } -eq 0 ] ] ; then
echo "Install some games first."
exit 0
fi
if [ [ $# -eq 0 ] ] ; then
# Create the menu of installed games
declare -a menuList
for i in " ${ lines [@] } " ; do
IFS = '|' read -ra gameInfo <<< " $i "
menuList += ( " ${ gameInfo [0] } | ${ gameInfo [1] } " " ${ gameInfo [2] } " )
done
menuList += ( "Donate" "Donate" )
menuList += ( "Become a Patron" "Become a Patron" )
game = " $( dialog --backtitle "Audio Game Launcher" \
--clear \
--extra-button \
--extra-label "Documentation" \
--ok-label "Launch" \
--no-tags \
--menu "Please select a game to play" 0 0 0 " ${ menuList [@] } " --stdout) "
local menuCode = $?
if [ [ $menuCode -eq 1 ] ] ; then
exit 0
elif [ [ $menuCode -eq 3 ] ] ; then
documentation " $game " " $( echo " $game " | cut -d '|' -f2) "
fi
create_game_array
else
create_game_array
if [ [ -z " $game " ] ] ; then
echo " Game $1 not found. "
exit 1
fi
fi
if [ [ ${# game [@] } -gt 0 ] ] ; then
if [ [ " ${ game [0] } " = = "Donate" ] ] ; then
open_url "https://ko-fi.com/stormux"
exit 0
fi
if [ [ " ${ game [0] } " = = "Become a Patron" ] ] ; then
open_url "https://2mb.games/product/2mb-patron/"
exit 0
fi
get_bottle " ${ game [0] } "
# make sure wine is actually set to something
2024-12-17 06:15:02 -05:00
if [ [ " $( uname -m) " = = "aarch64" ] ] ; then
export wine = " ${ wine :- /usr/bin/wine } "
else
export wine = " ${ wine :- /usr/bin/wine } "
fi
2024-09-12 01:35:58 -04:00
echo -n "launching "
${ wine } --version
# kill any previous existing wineservers for this prefix in case they didn't shut down properly.
${ wine } server -k
# launch the game
if command -v qjoypad & > /dev/null ; then
mkdir -p ~/.qjoypad3
touch " ${ HOME } /.qjoypad3/ ${ game [2] } .lyt "
# A | separated list of games that should not start with qjoypad.
noQjoypadGames = "A Hero's Call"
if [ [ " ${ noqjoypad } " != "true" ] ] && ! [ [ " ${ game [2] } " = ~ ${ noQjoypadGames } ] ] ; then
if pgrep qjoypad & > /dev/null ; then
qjoypad -T " ${ game [2] } " 2> /dev/null
else
qjoypad -T " ${ game [2] } " 2> /dev/null &
fi
fi
fi
2024-09-12 14:26:46 -04:00
process_launcher-flags
2024-09-12 01:35:58 -04:00
custom_launch_parameters
2024-12-15 18:48:40 -05:00
${ wine :- /usr/bin/wine } start /d " ${ game [1]% \\ * } " " ${ game [1]##* \\ } " /realtime
2020-08-27 15:42:24 -04:00
fi
exit 0
}
# main script
#functions
add_launcher( ) {
local launchSettings = " ${ game ,, } "
launchSettings = " ${ launchSettings //[[ : space : ]]/- } | ${ 1 } | ${ game } "
2024-09-12 14:37:51 -04:00
shift
while [ [ $# -gt 0 ] ] ; do
launchSettings += " | $1 "
shift
done
2020-12-16 00:16:01 -05:00
if ! grep -F -q -x " ${ launchSettings } " " ${ configFile } " 2> /dev/null ; then
2020-09-01 14:39:39 -04:00
echo " ${ launchSettings } " >> " ${ configFile } "
2020-09-03 20:21:08 -04:00
sort -o " ${ configFile } " " ${ configFile } "
2020-09-05 12:37:10 -04:00
# Remove .lnk files because they don't work.
find ~/Desktop -type f -iname '*.lnk' -exec bash -c '
for f ; do
mimeType = " $( file -b " $f " ) "
mimeType = " ${ mimeType %%,* } "
if [ [ " $mimeType " = = "MS Windows shortcut" ] ] ; then
rm -v " $f "
fi
done ' _ { } +
2020-09-06 19:20:14 -04:00
if [ [ " ${ noCache } " = = "true" ] ] ; then
rm -f " ${ cache } / ${ 1 ##* \\ } "
fi
2020-08-27 15:42:24 -04:00
fi
}
2024-12-15 21:41:03 -05:00
trap "exit 0" SIGINT
2020-09-20 17:42:42 -04:00
# Check for updates
update
2020-09-06 14:38:16 -04:00
# If display isn't set assume we are launching from console and an X environment is running using display :0
if [ [ -z " $DISPLAY " ] ] ; then
export DISPLAY = ":0"
fi
2020-09-01 14:39:39 -04:00
# Settings file
2022-02-28 07:36:07 -05:00
cache = " ${ XDG_CACHE_HOME :- $HOME /.cache } /audiogame-manager "
2020-09-01 14:39:39 -04:00
configFile = " ${ XDG_CONFIG_HOME :- $HOME /.config } /storm-games/audiogame-manager/games.conf "
2020-09-06 19:20:14 -04:00
mkdir -p " ${ cache } "
2020-09-01 14:39:39 -04:00
mkdir -p " ${ configFile %/* } "
2022-08-25 00:28:18 -04:00
# Create the path for AGM's helper programs.
# Originally this was only winetricks, thus the name, and I'm too lazy to change it now.
winetricksPath = " ${ XDG_DATA_HOME :- $HOME /.local/share } /audiogame-manager "
mkdir -p " ${ winetricksPath } "
2022-03-08 03:31:05 -05:00
# Load any arguments from settings.conf file
if [ [ -r " ${ configFile %/* } /settings.conf " ] ] ; then
source " ${ configFile %/* } /settings.conf "
fi
2022-02-28 07:36:07 -05:00
# Update the cache for older versions of audiogame-manager
if [ [ -d " ${ configFile %/* } /cache " ] ] ; then
{ mv -v " ${ configFile %/* } /cache/ " * " ${ cache } "
rmdir -v " ${ configFile %/* } /cache/ " ; } | dialog \
--backtitle "Audiogame Manager" --progressbox "Updating cache, please wait..." -1 -1
fi
2021-10-09 04:16:35 -04:00
checkWinetricksUpdate = "false"
2020-08-27 15:42:24 -04:00
# Turn off debug messages
2022-03-08 03:31:05 -05:00
export WINEDEBUG = " ${ winedebug :- -all } "
2021-10-05 23:07:23 -04:00
# Compatibility with box86
export BOX86_NOBANNER = 1
2020-08-27 15:42:24 -04:00
# During installation, you can set winVer to the versions available.
# To set winetricks arguments, such as virtual desktop, set the winetricksSettings variable.
# Example: winetricksSettings="vd=1024x768"
2020-09-06 19:20:14 -04:00
# Files are cached unless -N no cache is set.
unset noCache
2020-09-02 22:36:48 -04:00
# Manual installation is not default, make sure it's unset
unset manualInstall
2023-01-23 20:18:36 -05:00
unset version
2024-01-19 11:26:30 -05:00
# ipfs gateway
2024-12-14 15:10:04 -05:00
export ipfsGateway = " ${ ipfsGateway :- https : //ipfs.stormux.org } "
2024-04-23 01:20:13 -04:00
export nvdaControllerClientDll = " ${ ipfsGateway } /ipfs/QmWu7YdSbKMk1Qm5DKvEA5hk1YuAK8wVkwhDf2CsmPkmF1?filename=nvdaControllerClient32.dll "
2020-08-27 15:42:24 -04:00
2022-02-16 18:18:16 -05:00
2024-12-12 19:28:29 -05:00
# Make sure the minimum of curl, sox, wine, and winetricks are installed or fex-emu on aarch64
if [ [ " $( uname -m) " = = "aarch64" ] ] ; then
minimumDependencies = ( "FEXLoader" )
2024-12-12 22:12:55 -05:00
wine = "FEXLoader -- /usr/bin/wine"
2024-12-12 19:28:29 -05:00
else
minimumDependencies = ( "curl" "sox" "wine" )
fi
for i in " ${ minimumDependencies [@] } " ; do
2021-07-01 03:49:03 -04:00
if ! command -v $i & > /dev/null ; then
echo " Please install $i before continuing. "
exit 1
fi
done
2021-06-30 22:38:21 -04:00
# Get latest news if available
2024-04-15 14:33:33 -04:00
check_news
2020-08-27 15:42:24 -04:00
# With no arguments, open the game launcher.
if [ [ $# -eq 0 ] ] ; then
game_launcher
fi
# Array of command line arguments
2020-09-05 00:26:29 -04:00
declare -A command = (
[ c] = "Check your system for necessary components."
2020-12-16 23:28:38 -05:00
[ C] = "Clear the cache. All game installers will be deleted."
2022-01-01 16:12:22 -05:00
[ D] = "Create desktop shortcut. You can launch audiogame-manager from the desktop or applications menu."
2022-03-11 13:08:45 -05:00
[ d] = "Debug mode, wine will be much more verbose when games are installed with this flag."
2020-09-05 00:26:29 -04:00
[ h] = "This help screen."
[ i] = "Install games."
2021-02-23 16:14:27 -05:00
[ I:] = "Noninteractive game installation."
2020-12-29 06:28:05 -05:00
[ k] = "Kill a running game that is stuck."
2020-12-16 17:16:16 -05:00
[ L] = "Display license information."
[ l:] = "Launch given game without interactive audiogame-manager menu specified by its wine bottle."
2020-09-06 19:20:14 -04:00
[ N] = "No cache, delete the installer after it has been extracted."
2022-01-21 23:08:59 -05:00
[ n] = "No RHVoice, do not install RHVoice when the game is installed."
2021-05-10 13:38:30 -04:00
[ P] = "Print a list of packages required by audiogame-manager."
2022-12-23 01:37:27 -05:00
[ q] = "No qjoypad. Does not launch qjoypad if it is detected."
2021-08-08 15:02:06 -04:00
[ R] = "Redownload. Removes old versions of packages from cache before installing."
2020-09-05 00:26:29 -04:00
[ r] = "Remove a game. This will delete all game data."
2023-05-01 00:08:22 -04:00
[ S:] = "Speech rate. Requires -V voice name, the default is 7. Values 0-9 or A."
2022-03-27 03:14:04 -04:00
[ t] = "Total games. Show how many games are currently available."
2023-05-01 20:10:40 -04:00
[ v:] = "Select the voice to be installed, default is Bdl. Options are alan, bdl, clb, or slt."
2023-05-01 00:08:22 -04:00
[ V:] = "Select the default voice for a bottle."
2020-08-27 15:42:24 -04:00
)
2020-09-05 00:26:29 -04:00
# Convert the keys of the associative array to a format usable by getopts
args = " ${ !command[*] } "
args = " ${ args //[[ : space : ]]/ } "
while getopts " ${ args } " i ; do
2020-08-27 15:42:24 -04:00
case " $i " in
2020-08-27 17:35:32 -04:00
c) checklist; ;
2020-12-16 23:28:38 -05:00
C) clear_cache; ;
2022-01-01 16:12:22 -05:00
D) desktop_launcher; ;
2020-12-12 16:14:48 -05:00
d)
unset WINEDEBUG
2022-03-11 13:08:45 -05:00
game_installer
2020-12-12 16:14:48 -05:00
; ;
2020-09-05 00:26:29 -04:00
h) help; ;
2020-08-27 17:35:32 -04:00
i) game_installer; ;
2021-02-23 16:14:27 -05:00
I)
game = " ${ OPTARG } "
break; ;
2020-12-29 06:28:05 -05:00
k) kill_game; ;
2020-12-16 17:16:16 -05:00
L) license; ;
2020-12-12 01:11:43 -05:00
l) game_launcher " ${ OPTARG } " ; ;
2020-09-06 19:26:48 -04:00
N) noCache = "true" ; ;
2022-01-21 23:08:59 -05:00
n) norh = "true" ; ;
2021-05-10 13:38:30 -04:00
P) checklist quiet; ;
2022-12-23 01:37:27 -05:00
q)
noqjoypad = "true"
game_launcher; ;
2021-08-08 15:02:06 -04:00
R) redownload = "true" ; ;
2020-09-04 23:32:26 -04:00
r) game_removal; ;
2023-05-01 00:08:22 -04:00
S) defaultRate = " ${ OPTARG } " ; ;
2022-03-27 03:14:04 -04:00
t)
2024-12-16 04:30:42 -05:00
gameCount = $( find .install -type f -iname "*.sh" | wc -l)
dialog --backtitle "Linux Game Manager" \
--infobox " There are currently ${ gameCount } games available. " -1 -1
2022-03-27 03:14:04 -04:00
exit 0
2024-12-16 04:30:42 -05:00
; ;
2022-08-22 18:42:58 -04:00
v) voiceName = " ${ OPTARG } " ; ;
2023-05-01 00:08:22 -04:00
V) defaultVoice = " ${ OPTARG } " ; ;
2020-08-27 15:42:24 -04:00
esac
done
2024-12-15 21:41:03 -05:00
[ [ ${# game } -lt 1 ] ] && exit 0
2023-12-03 08:16:55 -05:00
[ [ " $agmNoLaunch " != "true" ] ] && winetricks sandbox
2020-08-27 15:42:24 -04:00
2023-12-03 08:16:55 -05:00
[ [ " $agmNoLaunch " != "true" ] ] && exit 0