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-06 08:32:56 +02:00
1 parent 739d0f7af6
commit 428decf73a
6 files changed
+111 -6

No files matched your search

+7 -1
View File
@@ -109,6 +109,12 @@ func _ready() -> void:
update_hide_for_seconds_enabled()
select_server_button.select(Settings.selected_server)
select_server_button.item_selected.connect(select_server)
visibility_changed.connect(_on_visibility_changed)
# Settings can change outside this window, e.g. winning turns statistics off
func _on_visibility_changed() -> void:
if visible:
add_to_database_button.button_pressed = Settings.add_to_stats
func _input(event: InputEvent) -> void:
if self.visible == true:
@@ -154,7 +160,7 @@ func hide_ticks() -> void:
Settings.hide_ticks = !Settings.hide_ticks
func lower_winning_score() -> void:
Settings.winning_score -= 1
Settings.winning_score = max(Settings.winning_score - 1, 1)
score_label.text = str(Settings.winning_score)
func increase_winning_score() -> void: