Try a new method of detecting translation dictionary because just copying the file into place means it gets imported every time.

This commit is contained in:
Storm Dragon 2022-10-06 03:52:02 -04:00
parent 43d733343d
commit 2ca3cae57c

View File

@ -784,13 +784,13 @@ game_launcher() {
fi fi
if [[ "$game" =~ bokurano-daibouken-3 ]]; then if [[ "$game" =~ bokurano-daibouken-3 ]]; then
dictPath="$(winepath "${winePath}")" dictPath="$(winepath "${winePath}")"
if [[ -r "${cache}/bk3-dict.dat" ]] && [[ ! -r "${dictPath}/dict.dat" ]]; 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 [[ -r "${dictPath}/dict.dat" ]]; then if [[ -d "${dictPath}/dict" ]]; then
pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd & pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd &
fi fi
if [[ ! -r "${dictPath}/dict.dat" ]]; then if [[ ! -d "${dictPath}/dict" ]]; 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 & "${0%/*}/speech/clipboard_translator.sh" play.exe &
fi fi