From 7709ec83d85266dd336f52a98fc7e28350196d6a Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 17 Oct 2026 16:33:09 -0400 Subject: [PATCH] -s flag added to skip dll replacements because the cthulhu plus wine-access setup no longer needs it. --- .includes/help.sh | 1 + README.md | 14 ++++++++++++++ audiogame-manager.sh | 39 ++++++++++++++++++++++++++++++++++----- 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/.includes/help.sh b/.includes/help.sh index 854f9b2..2ea3f5a 100644 --- a/.includes/help.sh +++ b/.includes/help.sh @@ -142,6 +142,7 @@ help() { echo "noqjoypad=\"true\" # Do not launch qjoypad." echo "norh=\"true\" # Do not install RHVoice." echo "redownload=\"true\" # Redownload sources, do not use the version stored in cache." + echo "skipDllReplace=\"true\" # Skip automatic NVDA controller DLL replacement when launching games." echo "voiceName=\"voicename\" # Select the voice to be installed (default Bdl)." 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." diff --git a/README.md b/README.md index a317622..6b80eb5 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,20 @@ Select from a list of games to install. With no arguments, the list of installed games will be displayed. In all the menus, both installer and launcher, use the up and down arrow keys to find the game you want. Press enter on the game to perform the action. For more detailed help, try the -h flag. +Use `./audiogame-manager.sh -s` to open the launcher without automatically +replacing NVDA controller DLLs with the nvda2speechd versions. This also works +with launch options, for example `./audiogame-manager.sh -s -l bottle-name`. +Uppercase `-S` remains the speech-rate option. + +To skip replacement on every launch, add `skipDllReplace="true"` to +`${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-manager/settings.conf`. +Replacement is also skipped when `wine-access.exe` is running under the current +user, regardless of which screen reader started it. Wine Access starts on demand, +so use the flag or setting when it has not started yet. These controls leave +already-replaced DLLs as they are and apply to launch-time changes; individual +game installers and update scripts still install their speech support, including +Tolk DLLs, as before. + ## Language and Keyboard diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 992d194..c36bec9 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -600,12 +600,16 @@ custom_launch_parameters() { if [[ ! -d "${dictPath}/dict" ]]; then cp "${cache}/bk3-dict.dat" "${dictPath}/dict.dat" fi - if [[ -r "${cache}/nvdaControllerClient32.dll" ]]; then - cp "${cache}/nvdaControllerClient32.dll" "${dataDir}/nvdaControllerClient32.dll" + fi + if ! should_skip_dll_replace; then + if [[ -r "${cache}/bk3-dict.dat" ]]; then + if [[ -r "${cache}/nvdaControllerClient32.dll" ]]; then + cp "${cache}/nvdaControllerClient32.dll" "${dataDir}/nvdaControllerClient32.dll" + fi + else + rm -f "${dataDir}/nvdaControllerClient32.dll" + find "${WINEPREFIX}/drive_c/nyanchangame/bk3" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; fi - else - rm -f "${dataDir}/nvdaControllerClient32.dll" - find "${WINEPREFIX}/drive_c/nyanchangame/bk3" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; fi # DLL replacement now handled by update_nvda_dlls() if [[ ! -d "${dictPath}/dict" ]]; then @@ -697,8 +701,17 @@ create_game_array() { done } +should_skip_dll_replace() { + [[ "${skipDllReplace:-false}" == "true" ]] || + pgrep -u "$UID" -x 'wine-access[.]exe' &> /dev/null +} + # Update NVDA controller client DLLs in wine bottles update_nvda_dlls() { + if should_skip_dll_replace; then + log_msg "Skipping NVDA DLL replacement (skipDllReplace enabled or Wine Access running)." + return 0 + fi # Ensure we have the replacement DLLs # shellcheck source=.includes/functions.sh source "${scriptDir}/.includes/functions.sh" @@ -1001,6 +1014,7 @@ declare -A command=( [R]="Redownload. Removes old versions of packages from cache before installing." [r]="Remove a game. This will delete all game data." [S:]="Speech rate. Requires -V voice name, the default is 7. Values 0-9 or A." + [s]="Skip automatic NVDA controller DLL replacement when launching games." [t]="Total games. Show how many games are currently available." [v:]="Select the voice to be installed, default is Bdl. Options are alan, bdl, clb, or slt." [V:]="Select the default voice for a bottle." @@ -1009,6 +1023,15 @@ declare -A command=( # Convert the keys of the associative array to a format usable by getopts args="${!command[*]}" args="${args//[[:space:]]/}" +# Read this modifier before options such as -l dispatch the launcher immediately. +# Use getopts so -s inside another option's argument is not treated as a flag. +savedOptind="$OPTIND" +while getopts ":${args}" i; do + case "$i" in + s) skipDllReplace="true";; + esac +done +OPTIND="$savedOptind" while getopts "${args}" i ; do case "$i" in c) "${scriptDir}/.includes/checkup.sh";; @@ -1051,6 +1074,12 @@ while getopts "${args}" i ; do # shellcheck disable=SC2034 defaultRate="${OPTARG}" ;; + s) + skipDllReplace="true" + if [[ $# -eq 1 ]]; then + game_launcher + fi + ;; t) gameCount=$(find "${scriptDir}/.install" -type f -iname "*.sh" | wc -l) agm_infobox "Linux Game Manager" "Linux Game Manager" "There are currently ${gameCount} games available."