mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 06:50:07 +01:00
warnings fixed
-id shadowed by function parameter -delta and new_text never used
This commit is contained in:
@@ -27,28 +27,28 @@ func _ready():
|
|||||||
DisplayServer.tts_set_utterance_callback(DisplayServer.TTS_UTTERANCE_BOUNDARY, Callable(self, "_on_utterance_boundary"))
|
DisplayServer.tts_set_utterance_callback(DisplayServer.TTS_UTTERANCE_BOUNDARY, Callable(self, "_on_utterance_boundary"))
|
||||||
set_process(true)
|
set_process(true)
|
||||||
|
|
||||||
func _process(delta):
|
func _process(_delta):
|
||||||
$ButtonPause.button_pressed = DisplayServer.tts_is_paused()
|
$ButtonPause.button_pressed = DisplayServer.tts_is_paused()
|
||||||
if DisplayServer.tts_is_speaking():
|
if DisplayServer.tts_is_speaking():
|
||||||
$ColorRect.color = Color(1, 0, 0)
|
$ColorRect.color = Color(1, 0, 0)
|
||||||
else:
|
else:
|
||||||
$ColorRect.color = Color(1, 1, 1)
|
$ColorRect.color = Color(1, 1, 1)
|
||||||
|
|
||||||
func _on_utterance_boundary(pos, id):
|
func _on_utterance_boundary(pos, ut_id):
|
||||||
$RichTextLabel.text = "[bgcolor=yellow][color=black]" + ut_map[id].substr(0, pos) + "[/color][/bgcolor]" + ut_map[id].substr(pos, -1)
|
$RichTextLabel.text = "[bgcolor=yellow][color=black]" + ut_map[ut_id].substr(0, pos) + "[/color][/bgcolor]" + ut_map[ut_id].substr(pos, -1)
|
||||||
|
|
||||||
func _on_utterance_start(id):
|
func _on_utterance_start(ut_id):
|
||||||
$Log.text += "utterance %d started\n" % [id]
|
$Log.text += "utterance %d started\n" % [ut_id]
|
||||||
|
|
||||||
func _on_utterance_end(id):
|
func _on_utterance_end(ut_id):
|
||||||
$RichTextLabel.text = "[bgcolor=yellow][color=black]" + ut_map[id] + "[/color][/bgcolor]"
|
$RichTextLabel.text = "[bgcolor=yellow][color=black]" + ut_map[ut_id] + "[/color][/bgcolor]"
|
||||||
$Log.text += "utterance %d ended\n" % [id]
|
$Log.text += "utterance %d ended\n" % [ut_id]
|
||||||
ut_map.erase(id)
|
ut_map.erase(ut_id)
|
||||||
|
|
||||||
func _on_utterance_error(id):
|
func _on_utterance_error(ut_id):
|
||||||
$RichTextLabel.text = ""
|
$RichTextLabel.text = ""
|
||||||
$Log.text += "utterance %d canceled/failed\n" % [id]
|
$Log.text += "utterance %d canceled/failed\n" % [ut_id]
|
||||||
ut_map.erase(id)
|
ut_map.erase(ut_id)
|
||||||
|
|
||||||
func _on_ButtonStop_pressed():
|
func _on_ButtonStop_pressed():
|
||||||
DisplayServer.tts_stop()
|
DisplayServer.tts_stop()
|
||||||
@@ -116,7 +116,7 @@ func _on_Button_pressed():
|
|||||||
DisplayServer.tts_speak("Он так свирлеп и дик!", vc[0], 50, 1, 1, id + 1)
|
DisplayServer.tts_speak("Он так свирлеп и дик!", vc[0], 50, 1, 1, id + 1)
|
||||||
id += 2
|
id += 2
|
||||||
|
|
||||||
func _on_LineEditFilterName_text_changed(new_text):
|
func _on_LineEditFilterName_text_changed(_new_text):
|
||||||
$Tree.clear()
|
$Tree.clear()
|
||||||
var root = $Tree.create_item()
|
var root = $Tree.create_item()
|
||||||
for v in vs:
|
for v in vs:
|
||||||
|
|||||||
Reference in New Issue
Block a user