Create a file, agm.conf, in new bottles that contains the path to wine and wineserver. This will make it possible for game helper scripts to work without breaking bottles that require different versions.
This commit is contained in:
parent
6712a9a234
commit
5e1ca7ce7f
@ -589,6 +589,9 @@ install_wine_bottle() {
|
||||
chmod +x "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd"
|
||||
fi
|
||||
winetricks -q isolate_home $@ ${winVer:-winxp} ${winetricksSettings}; } | dialog --progressbox "Installing wine bottle, please wait..." -1 -1
|
||||
# make it easy for game scripts to know which version of wine to use.
|
||||
echo "WINE=\"${WINE}\"" > "$HOME/.local/wine/${bottle}/agm.conf"
|
||||
echo "WINESERVER=\"${WINESERVER}\"" >> "$HOME/.local/wine/${bottle}/agm.conf"
|
||||
}
|
||||
|
||||
|
||||
|
@ -77,6 +77,14 @@ if [[ -z "${WINEPREFIX}" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Get wine version if available
|
||||
if [[ -r "${WINEPREFIX}/agm.conf" ]]; then
|
||||
source "${WINEPREFIX}/agm.conf"
|
||||
export WINE
|
||||
export WINESERVER
|
||||
fi
|
||||
wine="${WINE:-$(command -v wine)}"
|
||||
|
||||
msgbox() {
|
||||
# Returns: None
|
||||
# Shows the provided message on the screen with an ok button.
|
||||
@ -124,7 +132,7 @@ menulist() {
|
||||
|
||||
restore_voice() {
|
||||
if [[ $doRestore -eq 0 ]]; then
|
||||
wineserver -k # If we don't do this it's likely wine will overwrite our reverted change or even clobber the registry key entirely
|
||||
${wine}server -k # If we don't do this it's likely wine will overwrite our reverted change or even clobber the registry key entirely
|
||||
$sed -i -E -e 's/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\(SOFTWARE|Software)\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Token(Enum|)s\\\\[^"]+"/"DefaultTokenId"="'"${oldVoice//\\/\\\\}"'"/g' "${WINEPREFIX}/user.reg"
|
||||
fi
|
||||
}
|
||||
@ -142,7 +150,7 @@ set_voice() {
|
||||
RHVoiceName="${RHVoiceName##*/}"
|
||||
fullVoice="${voiceListFullName[$counter]}"
|
||||
fullVoice="${fullVoice/RHVoice/RHVoice\\\\${RHVoiceName}}"
|
||||
wineserver -k # If we don't do this it's likely wine will overwrite our reverted change or even clobber the registry key entirely
|
||||
${wine}server -k # If we don't do this it's likely wine will overwrite our reverted change or even clobber the registry key entirely
|
||||
# Remove any existing rate change for voices
|
||||
$sed -i '/"DefaultTTSRate"=dword:/d' "${WINEPREFIX}/user.reg"
|
||||
$sed -i -E -e 's/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\(SOFTWARE|Software)\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Token(Enum|)s\\\\[^"]+"/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\'"${fullVoice//\\/\\\\}"'"\n"DefaultTTSRate"=dword:0000000'${2:-7}'/g' "${WINEPREFIX}/user.reg"
|
||||
@ -161,14 +169,14 @@ test_voice() {
|
||||
RHVoiceName="${RHVoiceName##*/}"
|
||||
fullVoice="${voiceListFullName[$counter]}"
|
||||
fullVoice="${fullVoice/RHVoice/RHVoice\\\\${RHVoiceName}}"
|
||||
wineserver -k # If we don't do this it's likely wine will overwrite our reverted change or even clobber the registry key entirely
|
||||
${wine}server -k # If we don't do this it's likely wine will overwrite our reverted change or even clobber the registry key entirely
|
||||
$sed -i -E -e 's/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\(SOFTWARE|Software)\\\\(Wow6432Node\\\\|)Microsoft\\\\Speech\\\\Voices\\\\Token(Enum|)s\\\\[^"]+"/"DefaultTokenId"="HKEY_LOCAL_MACHINE\\\\'"${fullVoice//\\/\\\\}"'"/g' "${WINEPREFIX}/user.reg"
|
||||
cat << "EOF" > "${bottle}/drive_c/windows/temp/speak.vbs"
|
||||
dim speechobject
|
||||
set speechobject=createobject("sapi.spvoice")
|
||||
speechobject.speak "This is a test of your chosen voice. It contains multiple sentences and punctuation, and is designed to give a full representation of this voices qualities."
|
||||
EOF
|
||||
wine cscript "c:\windows\temp\speak.vbs"
|
||||
${wine} cscript "c:\windows\temp\speak.vbs"
|
||||
}
|
||||
|
||||
# Handle voice restore, but only if voice changed
|
||||
@ -181,7 +189,7 @@ dim speechobject
|
||||
set speechobject=createobject("sapi.spvoice")
|
||||
speechobject.speak ""
|
||||
EOF
|
||||
wine cscript "c:\windows\temp\speak.vbs"
|
||||
${wine} cscript "c:\windows\temp\speak.vbs"
|
||||
|
||||
# Create an array of available voices.
|
||||
ifs="$IFS"
|
||||
|
Loading…
Reference in New Issue
Block a user