diff --git a/audiogame-manager.sh b/audiogame-manager.sh index b31d6f0..4a504cc 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -422,6 +422,8 @@ help() { echo "norh=\"true\" # Do not install RHVoice." echo "redownload=\"true\" # Redownload sources, do not use the version stored in cache." echo "rhvoice=\"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." echo "winedebug=\"flag(s)\" # Set wine debug flags, useful for development." exit 0 } @@ -537,6 +539,11 @@ install_rhvoice() { return fi if [[ "$norh" == "true" ]]; then + # Try to prevent the user from breaking speech + # Also useful for games that do not work with RHVoice + if [[ "${defaultVoice}" == "RHVoice" ]]; then + unset defaultVoice + fi return fi declare -A RHVoice=( @@ -609,6 +616,11 @@ install_wine_bottle() { # 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" + # If default voice is set, change it for the bottle + if [[ -n "${defaultVoice}" ]]; then + echo "Setting default voice for bottle \"${bottle}\" to \"${defaultVoice}\"." + "${0%/*}/speech/set-voice.sh" -b "${bottle}" -r "${defaultRate:-7}" -v "${defaultVoice}" + fi } @@ -1206,8 +1218,10 @@ declare -A command=( [q]="No qjoypad. Does not launch qjoypad if it is detected." [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." [t]="Total games. Show how many games are currently available." [v:]="Select the voice to be installed, default is Bdl." + [V:]="Select the default voice for a bottle." ) # Convert the keys of the associative array to a format usable by getopts @@ -1238,12 +1252,14 @@ while getopts "${args}" i ; do game_launcher;; R) redownload="true";; r) game_removal;; + S) defaultRate="${OPTARG}";; t) dialog --backtitle "Audiogame Manager" \ --infobox "There are currently ${#gameList[@]} games available." -1 -1 exit 0 ;; v) voiceName="${OPTARG}";; + V) defaultVoice="${OPTARG}";; esac done