diff --git a/scenes/main/time talker.gd b/scenes/main/time talker.gd index 317215f..3da0f93 100644 --- a/scenes/main/time talker.gd +++ b/scenes/main/time talker.gd @@ -72,6 +72,13 @@ func stop(fadeout: float = 0.0): node_music.stop() node_speech.stop() + # Godot 4 quirk: manual AudioStreamPlayer.stop() does not emit the `finished` + # signal (Godot 3 did), so the all_finished/finished handlers don't run and + # A_finished/B_finished would otherwise stay false from a prior play() — + # leaving is_playing() stuck at true and blocking the next play(). + A_finished = true + B_finished = true + node_speech.volume_db = 0 node_music.volume_db = 0 diff --git a/scripts/constants.gd b/scripts/constants.gd index 53c9f2a..d41eae4 100644 --- a/scripts/constants.gd +++ b/scripts/constants.gd @@ -26,7 +26,12 @@ static func fahrenheit_to_celsius(fahrenheit: float) -> float: return (fahrenheit - 32.0) * 5.0/9.0 static func code_to_weather(code) -> int: - return weather_codes.get(str(code), WEATHER.UNKNOWN) + var key: String + if code is float or code is int: + key = str(int(code)) + else: + key = str(code) + return weather_codes.get(key, WEATHER.UNKNOWN) const weather_color := { WEATHER.CLOUDY: Color('9fdbff'),