Add one log row at a time and pad log times

The log rebuilt every row each time a point was given or taken. It now
adds just the new row, and shows times as 09:05:03 instead of 9:5:3.
This commit is contained in:
Sansan committed 2026-10-06 08:32:56 +02:00
1 parent 428decf73a
commit 14c166614d
2 files changed
+24 -13

No files matched your search

+14
View File
@@ -226,3 +226,17 @@ func test_show_answer_before_first_song_does_not_reveal_next_song() -> void:
assert_str((_window.get_node("VBoxContainer/SoundtrackLabel") as Label).text) \
.is_equal("????????")
func test_log_adds_one_row_per_point_with_padded_time() -> void:
var log_box: VBoxContainer = _window.get_node("%Log").get_node("%LogVBoxContainer")
var crono: PlayerObject = _add_player("Crono")
await _play_first_song()
crono.add_point()
crono.minus_point()
assert_int(log_box.get_child_count()).is_equal(2)
var time_pattern: RegEx = RegEx.create_from_string("^\\d\\d:\\d\\d:\\d\\d Crono got a point$")
assert_object(time_pattern.search((log_box.get_child(0) as Label).text)).is_not_null()
assert_str((log_box.get_child(1) as Label).text).ends_with("Crono lost a point")