Fixes kalulu speeches when missing audiostream
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,17 @@
|
||||
[remap]
|
||||
|
||||
importer="csv_translation"
|
||||
type="Translation"
|
||||
uid="uid://dh6pc6oshep4t"
|
||||
|
||||
[deps]
|
||||
|
||||
files=["res://language_resources/word_list.PHON.translation", "res://language_resources/word_list.GPMATCH.translation"]
|
||||
|
||||
source_file="res://language_resources/word_list.csv"
|
||||
dest_files=["res://language_resources/word_list.PHON.translation", "res://language_resources/word_list.GPMATCH.translation"]
|
||||
|
||||
[params]
|
||||
|
||||
compress=true
|
||||
delimiter=0
|
||||
@@ -10,6 +10,10 @@ var isSpeaking : bool = false :
|
||||
set(value):
|
||||
isSpeaking = value
|
||||
elapsedTime = 0
|
||||
if isSpeaking:
|
||||
sprite.play("Tc_Talk1")
|
||||
else:
|
||||
sprite.play("Tc_Idle1")
|
||||
var elapsedTime : float = 0.0
|
||||
|
||||
|
||||
@@ -30,16 +34,17 @@ func _process(delta):
|
||||
start_speech()
|
||||
|
||||
func _play_speech(speech : AudioStream):
|
||||
if not speech:
|
||||
push_warning("Speech not found")
|
||||
isSpeaking = false
|
||||
return
|
||||
|
||||
isSpeaking = true
|
||||
|
||||
sprite.play("Tc_Talk1")
|
||||
speech_player.stream = speech
|
||||
speech_player.play()
|
||||
|
||||
await speech_player.finished
|
||||
|
||||
sprite.play("Tc_Idle1")
|
||||
|
||||
isSpeaking = false
|
||||
|
||||
|
||||
|
||||
@@ -23,11 +23,13 @@ func play_kalulu_speech(speech: AudioStream) -> void:
|
||||
kalulu_sprite.play("Show")
|
||||
await kalulu_sprite.animation_finished
|
||||
|
||||
kalulu_sprite.play("Talk1")
|
||||
audio_player.stream = speech
|
||||
audio_player.play()
|
||||
|
||||
await audio_player.finished
|
||||
if speech:
|
||||
kalulu_sprite.play("Talk1")
|
||||
audio_player.stream = speech
|
||||
audio_player.play()
|
||||
await audio_player.finished
|
||||
else:
|
||||
push_warning("Speech not found")
|
||||
|
||||
audio_player.stream = hide_sound
|
||||
audio_player.play()
|
||||
|
||||
@@ -163,7 +163,10 @@ func get_distractors_for_grapheme(grapheme: String, lesson_nb: int) -> Array:
|
||||
return db.query_result
|
||||
|
||||
func get_audio_stream_for_path(path: String) -> AudioStream:
|
||||
return load(base_path + language + "/" + path)
|
||||
var full_path : String = base_path.path_join(language).path_join(path)
|
||||
if not FileAccess.file_exists(full_path):
|
||||
return null
|
||||
return load(full_path)
|
||||
|
||||
func get_min_lesson_for_gp_id(gp_id: int) -> int:
|
||||
db.query_with_bindings("SELECT Lessons.LessonNb as i FROM Lessons
|
||||
|
||||
Reference in New Issue
Block a user