Refactor game mode scoring and win conditions

* Add overridable hooks for sunk/reaped ball handling and turn behavior.
* Implement default scoring and game-over messaging across game modes.
* Add pretty game mode names for win-condition messages.
* Update Free Ball, Last Ball, and Snooker modes to return win-condition messages.
* Move the reset button lookup to the scene root for multiplayer setup.
* Move camera controller scene to shared base UI. Move parts of it to new game_data UI node.
* Add commented test state generation for end-state testing.
This commit is contained in:
2026-08-14 03:38:04 -05:00
parent 034ba45859
commit ed6f243b93
16 changed files with 298 additions and 125 deletions

View File

@@ -0,0 +1,65 @@
[gd_scene load_steps=3 format=3 uid="uid://w3vh1gj6t2k2"]
[ext_resource type="Script" uid="uid://bpf107mmjiswh" path="res://scenes/ui_controls/camera/camera_controller.gd" id="1_mvpa7"]
[sub_resource type="LabelSettings" id="LabelSettings_mvpa7"]
font_size = 24
[node name="camera_controller" type="Control"]
layout_mode = 3
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -68.0
offset_bottom = -68.0
grow_horizontal = 2
grow_vertical = 0
script = ExtResource("1_mvpa7")
[node name="margin_container" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 69.0
grow_horizontal = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 5
theme_override_constants/margin_right = 10
[node name="vbox" type="VBoxContainer" parent="margin_container"]
layout_mode = 2
[node name="hbox" type="HBoxContainer" parent="margin_container/vbox"]
layout_mode = 2
size_flags_vertical = 3
[node name="hbox2" type="HBoxContainer" parent="margin_container/vbox/hbox"]
layout_mode = 2
size_flags_horizontal = 10
[node name="prev_bttn" type="Button" parent="margin_container/vbox/hbox/hbox2"]
z_index = 1
layout_mode = 2
focus_mode = 0
mouse_default_cursor_shape = 2
text = "<Prev>"
flat = true
[node name="label" type="Label" parent="margin_container/vbox/hbox/hbox2"]
layout_mode = 2
text = " Camera "
label_settings = SubResource("LabelSettings_mvpa7")
horizontal_alignment = 1
vertical_alignment = 1
[node name="next_bttn" type="Button" parent="margin_container/vbox/hbox/hbox2"]
z_index = 1
layout_mode = 2
focus_mode = 0
mouse_default_cursor_shape = 2
text = "<Next>"
flat = true
[connection signal="pressed" from="margin_container/vbox/hbox/hbox2/prev_bttn" to="." method="_on_prev_bttn_pressed"]
[connection signal="pressed" from="margin_container/vbox/hbox/hbox2/next_bttn" to="." method="_on_next_bttn_pressed"]