diff --git a/.install/Beatstar Pro.sh b/.install/Beatstar Pro.sh index d3c3805..d59ce2d 100644 --- a/.install/Beatstar Pro.sh +++ b/.install/Beatstar Pro.sh @@ -1,4 +1,4 @@ -# +#// download "https://oriolgomez.com/games/beat_windows.zip" # Sapi is broken on win64 for now, and this game doesn't support nvda it seems. export WINEARCH=win64 diff --git a/.install/Blades of Glory.sh b/.install/Blades of Glory.sh index e339092..b9ab202 100644 --- a/.install/Blades of Glory.sh +++ b/.install/Blades of Glory.sh @@ -1,4 +1,4 @@ -#Disable +#//Disable download "https://nibblenerds.com/static/blades_of_glory.zip" install_wine_bottle install_with_progress unzip "Extracting game files..." -d "$WINEPREFIX/drive_c/Program Files/Blades of Glory" "${cache}/blades_of_glory.zip" diff --git a/.install/Breed Memorial.sh b/.install/Breed Memorial.sh index b219e51..fa1342b 100644 --- a/.install/Breed Memorial.sh +++ b/.install/Breed Memorial.sh @@ -1,4 +1,4 @@ -# +#// download "https://hirotaka2014.sakura.ne.jp/mh0406/game/breed_memorial.zip" "${nvdaControllerClient32Dll}" export winVer="win7" install_wine_bottle cjkfonts diff --git a/.install/Constant Battle.sh b/.install/Constant Battle.sh index 6794595..1e61d75 100644 --- a/.install/Constant Battle.sh +++ b/.install/Constant Battle.sh @@ -1,4 +1,4 @@ -# +#// export winVer="win7" download "https://renovagames.com/bc/BC-Setup.exe" install_wine_bottle cjkfonts diff --git a/.install/Dark Destroyer.sh b/.install/Dark Destroyer.sh index ee372c1..90bedcc 100644 --- a/.install/Dark Destroyer.sh +++ b/.install/Dark Destroyer.sh @@ -1,4 +1,4 @@ -# +#// # No custom bottle needed - use standard wine path based on architecture download "https://www.agarchive.net/games/pb/Dark-Destroyer-Setup.exe" install_wine_bottle ie6 diff --git a/.install/Dragon Pong.sh b/.install/Dragon Pong.sh index 901a26d..fd80b4e 100644 --- a/.install/Dragon Pong.sh +++ b/.install/Dragon Pong.sh @@ -1,4 +1,4 @@ -# +#// export winVer="win7" install_wine_bottle download "https://www.iamtalon.me/games/dragonpong.zip" diff --git a/.install/Entombed.sh b/.install/Entombed.sh index 286ca26..eb87e87 100644 --- a/.install/Entombed.sh +++ b/.install/Entombed.sh @@ -1,4 +1,4 @@ -# Borken, candidate for removal +#// Borken, candidate for removal export WINEARCH="win64" # Migrated to wine64 with WINETRICKS_FORCE=1 - complex .NET dependencies, test carefully download "http://blind-games.com/newentombed/EntombedSetup.exe" "https://download.microsoft.com/download/E/C/1/EC1B2340-67A0-4B87-85F0-74D987A27160/SSCERuntime-ENU.exe" "https://stormgames.wolfe.casa/downloads/Entombed.exe.config" "https://stormgames.wolfe.casa/downloads/mfplat.dll" export winVer="win7" diff --git a/.install/Eurofly.sh b/.install/Eurofly.sh index 94b08e7..cf8976c 100644 --- a/.install/Eurofly.sh +++ b/.install/Eurofly.sh @@ -1,4 +1,4 @@ -# +#// export winVer="win7" export winetricksSettings="vd=1024x768" download "https://www.stefankiss.sk/files/eurofly2/Launcher_1.2.zip" "https://www.stefankiss.sk/files/eurofly2/Eurofly_2_ful_setup.exe" diff --git a/.install/Executioner's Rage.sh b/.install/Executioner's Rage.sh index 5fec7af..2907da5 100644 --- a/.install/Executioner's Rage.sh +++ b/.install/Executioner's Rage.sh @@ -1,8 +1,9 @@ -download "https://dl.tweesecake.app/rage/rage1.5.0.zip" +gameVersion=2.4.1 +download "https://dl.tweesecake.app/rage/rage${gameVersion}.zip" export WINEARCH=win64 export winVer="win10" install_wine_bottle -install_with_progress unzip "Extracting game files..." -d "$WINEPREFIX/drive_c/Program Files/" "${cache}/rage1.5.0.zip" +install_with_progress unzip "Extracting game files..." -d "$WINEPREFIX/drive_c/Program Files/" "${cache}/rage${gameVersion}.zip" add_launcher "c:\Program Files\rage\rage.exe" url="https://techcake.games/games/executioners-rage/" echo "Before you can login, you need to create an account at:" diff --git a/.install/Fartman.sh b/.install/Fartman.sh index f8a5f06..b2d6bd4 100644 --- a/.install/Fartman.sh +++ b/.install/Fartman.sh @@ -1,4 +1,4 @@ -# +#// download "http://www.agarchive.net/games/bpc/fartman.exe" install_wine_bottle dx8vb vb6run wine "${cache}/fartman.exe" /silent diff --git a/.install/Marina Break.sh b/.install/Marina Break.sh index 6d06459..58cf4f0 100644 --- a/.install/Marina Break.sh +++ b/.install/Marina Break.sh @@ -1,4 +1,4 @@ -# +#// # Uses standard wine path based on architecture (win32/win64) export winVer="win7" install_wine_bottle diff --git a/.install/MudSplat English.sh b/.install/MudSplat English.sh index e472e8a..62161fc 100644 --- a/.install/MudSplat English.sh +++ b/.install/MudSplat English.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#//!/bin/bash case "${game}" in "MudSplat English") a="a" diff --git a/.install/Psycho Strike.sh b/.install/Psycho Strike.sh index cf02aaf..0667c60 100644 --- a/.install/Psycho Strike.sh +++ b/.install/Psycho Strike.sh @@ -1,4 +1,4 @@ -# +#// download "http://www.vgstorm.com/psycho_strike_installer.exe" install_wine_bottle wine "${cache}/psycho_strike_installer.exe" /silent diff --git a/.install/Sammy Center.sh b/.install/Sammy Center.sh index 3498368..c28183a 100644 --- a/.install/Sammy Center.sh +++ b/.install/Sammy Center.sh @@ -1,4 +1,4 @@ -# +#// export winVer="win7" download "http://www.samtupy.com/games/SCSetup.exe" "${nvdaControllerClient32Dll}" install_wine_bottle diff --git a/.install/Shadow Line.sh b/.install/Shadow Line.sh index 5558dbf..d95fe9a 100644 --- a/.install/Shadow Line.sh +++ b/.install/Shadow Line.sh @@ -1,4 +1,4 @@ -#Disable since it's not working +#//Disable since it's not working download "https://www.mm-galabo.com/sr/Download_files_srfv/shadowrine_fullvoice3.171.exe" "https://raw.githubusercontent.com/LordLuceus/sr-english-localization/master/language_en.dat" export WINEARCH="win64" # Migrated to wine64 with WINETRICKS_FORCE=1 export winVer="win8" diff --git a/.install/The Gate.sh b/.install/The Gate.sh index 66849ab..b83f2f0 100644 --- a/.install/The Gate.sh +++ b/.install/The Gate.sh @@ -1,4 +1,4 @@ -# +#// export winVer="win7" download "http://www.vgstorm.com/the_gate_installer.exe" install_wine_bottle diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 8521805..e1187eb 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -18,6 +18,9 @@ nvda2speechdStarted="false" customLaunchHandled="false" cthulhuTitleReaderEnabled="false" cthulhuTitleReaderTried="false" +takeFocusWorkaroundActive="false" +takeFocusRestoreMode="none" +takeFocusRestoreValue="" log_msg() { local logFile="${scriptDir}/game.log" @@ -139,9 +142,104 @@ kill_nvda2speechd_listener() { } cleanup_and_exit() { + restore_executioners_rage_focus_workaround stop_nvda2speechd } +set_use_take_focus_value() { + local takeFocusValue="${1^^}" + if [[ "$takeFocusValue" != "Y" ]] && [[ "$takeFocusValue" != "N" ]]; then + return 1 + fi + wine reg add "HKCU\\Software\\Wine\\X11 Driver" /v UseTakeFocus /t REG_SZ /d "$takeFocusValue" /f &> /dev/null +} + +unset_use_take_focus_value() { + wine reg delete "HKCU\\Software\\Wine\\X11 Driver" /v UseTakeFocus /f &> /dev/null +} + +capture_use_take_focus_state() { + local queryOutput="" + local currentValue="" + takeFocusRestoreMode="none" + takeFocusRestoreValue="" + + if ! wine reg query "HKCU\\Software\\Wine" &> /dev/null; then + takeFocusRestoreMode="unknown" + return 1 + fi + + queryOutput="$(wine reg query "HKCU\\Software\\Wine\\X11 Driver" /v UseTakeFocus 2>/dev/null || true)" + if [[ "$queryOutput" == *"UseTakeFocus"* ]]; then + currentValue="$(awk '/UseTakeFocus/ {print toupper($NF); exit}' <<< "$queryOutput")" + if [[ "$currentValue" == "Y" ]] || [[ "$currentValue" == "N" ]]; then + takeFocusRestoreMode="value" + takeFocusRestoreValue="$currentValue" + return 0 + fi + takeFocusRestoreMode="unknown" + return 1 + fi + + takeFocusRestoreMode="delete" + return 0 +} + +apply_executioners_rage_focus_workaround() { + if [[ "${game[2]}" != "Executioner's Rage" ]]; then + return + fi + + takeFocusWorkaroundActive="false" + if ! capture_use_take_focus_state; then + log_msg "Could not capture current UseTakeFocus state before launching Executioner's Rage." + fi + + if set_use_take_focus_value "Y"; then + takeFocusWorkaroundActive="true" + log_msg "Enabled UseTakeFocus=Y before launching Executioner's Rage." + else + log_msg "Failed to enable UseTakeFocus=Y for Executioner's Rage." + fi +} + +restore_executioners_rage_focus_workaround() { + if [[ "$takeFocusWorkaroundActive" != "true" ]]; then + return + fi + + if [[ "${game[2]}" != "Executioner's Rage" ]]; then + takeFocusWorkaroundActive="false" + takeFocusRestoreMode="none" + takeFocusRestoreValue="" + return + fi + + case "$takeFocusRestoreMode" in + value) + if set_use_take_focus_value "$takeFocusRestoreValue"; then + log_msg "Restored UseTakeFocus=${takeFocusRestoreValue} after closing Executioner's Rage." + else + log_msg "Failed to restore UseTakeFocus=${takeFocusRestoreValue} after closing Executioner's Rage." + fi + ;; + delete) + if unset_use_take_focus_value; then + log_msg "Removed UseTakeFocus override after closing Executioner's Rage." + else + log_msg "Failed to remove UseTakeFocus override after closing Executioner's Rage." + fi + ;; + *) + log_msg "Skipping UseTakeFocus restore after closing Executioner's Rage because prior state was unknown." + ;; + esac + + takeFocusWorkaroundActive="false" + takeFocusRestoreMode="none" + takeFocusRestoreValue="" +} + # Check and manage wine32 installation check_wine32() { local wine32Dir="${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/wine32" @@ -268,10 +366,10 @@ game_installer() { mapfile -t installedGames < <(sed -e '/^$/d' -e '/^[[:space:]]*#/d' "${configFile}" 2> /dev/null | cut -d '|' -f3) # Create the menu of available games by reading from .install directory declare -a menuList - # Get all .sh files from .install directory, excluding those starting with # as first line. + # Get all .sh files from .install directory, excluding those starting with #// as first line. mapfile -t sortedGames < <(for f in "${scriptDir}/.install/"*.sh; do - # Skip if first line starts with # - [[ $(head -n1 "$f") == "#"* ]] && continue + # Skip if first line starts with #// + [[ $(head -n1 "$f") == "#//"* ]] && continue echo "${f##*/%.sh}" done | sort) for i in "${sortedGames[@]}"; do @@ -715,9 +813,11 @@ game_launcher() { fi fi process_launcher_flags + apply_executioners_rage_focus_workaround customLaunchHandled="false" custom_launch_parameters if [[ "$customLaunchHandled" == "true" ]]; then + restore_executioners_rage_focus_workaround exit 0 fi start_nvda2speechd @@ -731,6 +831,7 @@ game_launcher() { wine "${game[1]##*\\}" fi popd > /dev/null || exit 1 + restore_executioners_rage_focus_workaround fi exit 0 }