Clean up redundant nvda2speechd startup and DLL replacement code

This commit is contained in:
Storm Dragon
2025-08-05 02:27:01 -04:00
parent 1b50ac66c1
commit 19f54405bd

View File

@@ -185,9 +185,7 @@ custom_launch_parameters() {
popd popd
exit 0 exit 0
fi fi
if [[ "${game[0]}" == "executioner's-rage" ]]; then # executioner's-rage: DLL replacement now handled by update_nvda_dlls()
find "${WINEPREFIX}/drive_c/Program Files" -type f -name 'nvdaControllerClient64.dll' -exec cp -v "${cache}/nvda2speechd64.dll" "{}" \;
fi
if [[ "${game[0]}" == "laser-breakout" ]]; then if [[ "${game[0]}" == "laser-breakout" ]]; then
"${0%/*}/speech/speak_window_title.sh" play.exe & "${0%/*}/speech/speak_window_title.sh" play.exe &
fi fi
@@ -202,11 +200,7 @@ custom_launch_parameters() {
if [[ -r "${cache}/bk3-dict.dat" ]] && [[ ! -d "${dictPath}/dict" ]]; then if [[ -r "${cache}/bk3-dict.dat" ]] && [[ ! -d "${dictPath}/dict" ]]; then
cp "${cache}/bk3-dict.dat" "${dictPath}/dict.dat" cp "${cache}/bk3-dict.dat" "${dictPath}/dict.dat"
fi fi
if [[ -d "${dictPath}/dict" ]]; then # DLL replacement now handled by update_nvda_dlls()
if [[ ! -e "${dictPath}/data/nvdaControllerClient.dll" ]]; then
cp "${cache}/nvda2speechd32.dll" "${dictPath}/data/nvdaControllerClient.dll"
fi
fi
if [[ ! -d "${dictPath}/dict" ]] && [[ ! -r "${cache}/bk3-dict.dat" ]]; then if [[ ! -d "${dictPath}/dict" ]] && [[ ! -r "${cache}/bk3-dict.dat" ]]; then
find "${WINEPREFIX}/drive_c/nyanchangame/bk3" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; find "${WINEPREFIX}/drive_c/nyanchangame/bk3" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \;
"${0%/*}/speech/clipboard_translator.sh" play.exe bokurano-daibouken3 & "${0%/*}/speech/clipboard_translator.sh" play.exe bokurano-daibouken3 &
@@ -225,9 +219,7 @@ custom_launch_parameters() {
#find "${WINEPREFIX}/drive_c/" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \; #find "${WINEPREFIX}/drive_c/" -type f -name 'nvdaControllerClient.dll' -exec rm -v "{}" \;
#"${0%/*}/speech/clipboard_translator.sh" play_sr.exe shadow-line & #"${0%/*}/speech/clipboard_translator.sh" play_sr.exe shadow-line &
#fi #fi
if [[ "${game[0]}" == "sketchbook" ]]; then # sketchbook: DLL replacement now handled by update_nvda_dlls()
find "${WINEPREFIX}" -type f -name 'nvdaControllerClient32.dll' -exec cp -v "${cache}/nvdaControllerClient32.dll" "{}" \;
fi
if [[ "${game[0]}" == "audiodisc" ]]; then if [[ "${game[0]}" == "audiodisc" ]]; then
wine "$winePath\\$wineExec" wine "$winePath\\$wineExec"
exit 0 exit 0
@@ -469,15 +461,7 @@ unset version
export ipfsGateway="${ipfsGateway:-https://ipfs.stormux.org}" export ipfsGateway="${ipfsGateway:-https://ipfs.stormux.org}"
export nvdaControllerClientDll="${ipfsGateway}/ipfs/QmWu7YdSbKMk1Qm5DKvEA5hk1YuAK8wVkwhDf2CsmPkmF1?filename=nvdaControllerClient32.dll" export nvdaControllerClientDll="${ipfsGateway}/ipfs/QmWu7YdSbKMk1Qm5DKvEA5hk1YuAK8wVkwhDf2CsmPkmF1?filename=nvdaControllerClient32.dll"
# Start nvda2speechd server # nvda2speechd server startup is now handled in game_launcher()
pgrep -u "$USER" nvda2speechd &> /dev/null || {
if [[ ! -f "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd" ]]; then
download "https://github.com/RastislavKish/nvda2speechd/releases/download/v0.1/nvda2speechd"
cp "${cache}/nvda2speechd" "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd"
chmod +x "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd"
fi
"${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd" ;
}
# Source helper functions # Source helper functions