From da065e5835a31c311e77493369996da26feb57c2 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 10 Jun 2025 01:54:56 -0400 Subject: [PATCH] A little more progress on refactor. --- .includes/bottle.sh | 7 ++++--- .includes/update.sh | 6 ------ .install/BG Word Jumble.sh | 2 +- .install/Bounce Bounce.sh | 3 +-- audiogame-manager.sh | 22 ++++++++++++++++------ 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/.includes/bottle.sh b/.includes/bottle.sh index cc7b8e6..e418b5c 100644 --- a/.includes/bottle.sh +++ b/.includes/bottle.sh @@ -111,9 +111,10 @@ install_wine_bottle() { # Set the WINE and WINESERVER environmental variables so winetricks will use the right installation. export WINE="${wine}" export WINESERVER="${wine}server" - # Installation paths are based on WINEARCH unless bottle is set. - if [[ ${#bottle} -gt 0 ]]; then - local bottle="${game,,}" + # Installation paths are based on WINEARCH unless game is set for custom bottle. + local bottle="" + if [[ ${#game} -gt 0 ]]; then + 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." diff --git a/.includes/update.sh b/.includes/update.sh index 4ae1bf6..fda540b 100644 --- a/.includes/update.sh +++ b/.includes/update.sh @@ -44,9 +44,3 @@ fi git log '@{1}..' --pretty=format:'%an: %s' | tac; } exit $? } -# Get latest news if available -check_news -# With no arguments, open the game launcher. -if [[ $# -eq 0 ]]; then - game_launcher -fi diff --git a/.install/BG Word Jumble.sh b/.install/BG Word Jumble.sh index 6d051a3..dfca585 100644 --- a/.install/BG Word Jumble.sh +++ b/.install/BG Word Jumble.sh @@ -1,5 +1,5 @@ export WINEARCH="win32" download "${ipfsGateway}/ipfs/QmYQWZZifzKJSuVRCC1SabwRmEDz95GdFvbzRvsBMmTt6e?filename=BWJ32Setup10.exe" install_wine_bottle speechsdk -wine "${cache}/BWJ32Setup10.wineExec" /silent +wine "${cache}/BWJ32Setup10.exe" /silent add_launcher "c:\Program Files\Games\WordJumbleB\WordJumbleB.exe" diff --git a/.install/Bounce Bounce.sh b/.install/Bounce Bounce.sh index 01ab3e3..43f6b7c 100644 --- a/.install/Bounce Bounce.sh +++ b/.install/Bounce Bounce.sh @@ -1,7 +1,6 @@ +export WINEARCH=win64 get_installer "bounce_bounce.rar" "https://kavyapriya.itch.io/bounce-bounce" download "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd64.dll" -export winVer="win7" -export WINEARCH=win64 install_wine_bottle unrar x "${cache}/bounce_bounce.rar" -op"$WINEPREFIX/drive_c/Program Files" find "${WINEPREFIX}/drive_c/Program Files/bounce_bounce" -type f -name 'nvdaControllerClient64.dll' -exec cp -v "${cache}/nvda2speechd64.dll" "{}" \; diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 0274ff8..c919ca5 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -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