Use print_debug to, theoretically, only print TTS speech/interrupt status when in debug mode.

And yet it still prints in exported builds not using the debug templates. *sigh*
This commit is contained in:
Nolan Darilek 2019-10-16 08:01:34 -05:00
parent ec99d318d3
commit e233b97fff
2 changed files with 3 additions and 3 deletions

5
TTS.gd
View File

@ -8,10 +8,10 @@ var tts = null
func _ready():
# Only initialize TTS if it's available or if we're in the editor.
if TTS.can_instance() or Engine.editor_hint:
print("Attempting to load TTS.")
print_debug("Attempting to load TTS.")
tts = TTS.new()
else:
print("TTS not available!")
print_debug("TTS not available!")
func set_rate(rate):
if tts != null:
@ -26,6 +26,7 @@ func get_rate():
var rate setget set_rate, get_rate
func speak(text, interrupt := true):
print_debug("%s: %s" % [text, interrupt])
if tts != null:
tts.speak(text, interrupt)

View File

@ -54,7 +54,6 @@ impl TTS {
#[export]
fn speak(&mut self, _owner: Node, message: GodotString, interrupt: bool) {
let message = message.to_string();
println!("{}: {}", message, interrupt);
self.0.speak(message, interrupt).unwrap();
}