Fixed bug where tts and rate were not saving to the config file. Fixed bug that did not allow tts to be turned off.
This commit is contained in:
15
tojam
15
tojam
@ -226,10 +226,6 @@ configure_ninjam() {
|
||||
;;
|
||||
"tts")
|
||||
if [[ "${tts}" == "true" ]]; then
|
||||
ttsRate="$(dialog --backtitle "Tojam" \
|
||||
--rangebox "TTS Rate (0-10):" 8 50 0 10 "${ttsRate}" --stdout)"
|
||||
menuCode=$?
|
||||
[[ ${menuCode} -ne 0 ]] && continue
|
||||
tts="$(dialog --yes-label "Enable" \
|
||||
--no-label "Disable" \
|
||||
--yesno "Text-to-Speech is currently enabled at rate ${ttsRate}. Change setting?" -1 -1 --stdout)"
|
||||
@ -237,6 +233,12 @@ configure_ninjam() {
|
||||
[[ ${tts} -eq 255 ]] && continue
|
||||
tts="${tts/0/true}"
|
||||
tts="${tts/1/false}"
|
||||
if [[ "${tts}" == "true" ]]; then
|
||||
ttsRate="$(dialog --backtitle "Tojam" \
|
||||
--rangebox "TTS Rate (0-10):" 8 50 0 10 "${ttsRate}" --stdout)"
|
||||
menuCode=$?
|
||||
[[ ${menuCode} -ne 0 ]] && continue
|
||||
fi
|
||||
else
|
||||
tts="$(dialog --yes-label "Enable" \
|
||||
--no-label "Keep Disabled" \
|
||||
@ -295,7 +297,10 @@ save_files() {
|
||||
|
||||
tts_flags() {
|
||||
if [[ "${tts}" == "true" ]]; then
|
||||
echo "-tts -tts-rate ${ttsRate}"
|
||||
# Check if ninjam client supports TTS flags
|
||||
if $ninjam --help 2>&1 | grep -q "\-tts"; then
|
||||
echo "-tts -tts-rate ${ttsRate}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user