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:
Storm Dragon
2025-07-08 19:30:54 -04:00
parent 5a457b4dd0
commit 864b03b6e0

13
tojam
View File

@ -226,10 +226,6 @@ configure_ninjam() {
;; ;;
"tts") "tts")
if [[ "${tts}" == "true" ]]; then 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" \ tts="$(dialog --yes-label "Enable" \
--no-label "Disable" \ --no-label "Disable" \
--yesno "Text-to-Speech is currently enabled at rate ${ttsRate}. Change setting?" -1 -1 --stdout)" --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} -eq 255 ]] && continue
tts="${tts/0/true}" tts="${tts/0/true}"
tts="${tts/1/false}" 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 else
tts="$(dialog --yes-label "Enable" \ tts="$(dialog --yes-label "Enable" \
--no-label "Keep Disabled" \ --no-label "Keep Disabled" \
@ -295,8 +297,11 @@ save_files() {
tts_flags() { tts_flags() {
if [[ "${tts}" == "true" ]]; then if [[ "${tts}" == "true" ]]; then
# Check if ninjam client supports TTS flags
if $ninjam --help 2>&1 | grep -q "\-tts"; then
echo "-tts -tts-rate ${ttsRate}" echo "-tts -tts-rate ${ttsRate}"
fi fi
fi
} }