Turn statistics back on for a new game and fix low winning scores

Winning turned statistics off and nothing turned them back on, while
the Settings checkbox still showed them as on. Resetting points now
turns them back on if the win turned them off, and the checkbox shows
the current state when Settings is opened.

A winning score of 1 could never be won and with 2 the first point was
not announced as match point, because the first-point check ran first.
The winning score also could not be kept from going below 1.
This commit is contained in:
Sansan committed 2026-10-05 21:12:17 +02:00
1 parent d856e03c32
commit 056ead47be
6 files changed
+111 -6

No files matched your search

+19
View File
@@ -117,3 +117,22 @@ func test_every_player_gets_a_different_id() -> void:
ids[PlayerObject.new("Player %d" % i).id] = true
assert_int(ids.size()).is_equal(100)
func test_winning_score_of_one_is_won_with_first_point() -> void:
Settings.winning_score = 1
monitor_signals(_player, false)
_player.add_point()
await assert_signal(_player).is_emitted("winner_triggerd")
func test_first_point_is_match_point_when_winning_score_is_two() -> void:
Settings.winning_score = 2
monitor_signals(_player, false)
_player.add_point()
await assert_signal(_player).is_emitted("match_point_triggerd")
assert_bool(_player.is_first_point).is_false()