UI and other changes

This commit is contained in:
Forrest 2026-10-07 13:41:38 -04:00
parent 87b5c11fcf
commit 215e24e246
79 changed files with 70023 additions and 2201 deletions

View file

@ -1,7 +1,8 @@
class_name ConfirmBox
extends CenterContainer
## A yes / no question over the menus (Main): the message, the confirming button, and Cancel
## (focused, so a stray Enter / A never throws progress away). Escape / B cancels.
## (focused, so a stray Enter / A never throws progress away). Escape / B cancels. Hand-drawn like
## the pause menu it mostly opens from (UiTheme.sketch).
var message: Label
var yes_button: Button
@ -13,11 +14,13 @@ var _on_yes: Callable
func _ready() -> void:
set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
theme = UiTheme.sketch()
var panel := PanelContainer.new()
panel.theme_type_variation = &"SolidPanel" # over the pause menu: none of it shows through
add_child(panel)
var margin := MarginContainer.new()
for side in ["left", "right", "top", "bottom"]:
margin.add_theme_constant_override("margin_" + side, 30)
margin.add_theme_constant_override("margin_" + side, 14)
panel.add_child(margin)
var box := VBoxContainer.new()
box.add_theme_constant_override("separation", 22)
@ -26,7 +29,7 @@ func _ready() -> void:
message.custom_minimum_size = Vector2(560.0, 0.0)
message.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
message.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
message.add_theme_font_size_override("font_size", 24)
message.add_theme_font_size_override("font_size", 30)
box.add_child(message)
var row := HBoxContainer.new()
row.alignment = BoxContainer.ALIGNMENT_CENTER
@ -34,11 +37,13 @@ func _ready() -> void:
box.add_child(row)
yes_button = Button.new()
yes_button.custom_minimum_size = Vector2(240.0, 54.0)
yes_button.add_theme_font_size_override("font_size", 30)
yes_button.pressed.connect(_yes)
row.add_child(yes_button)
no_button = Button.new()
no_button.text = "Cancel"
no_button.custom_minimum_size = Vector2(200.0, 54.0)
no_button.add_theme_font_size_override("font_size", 30)
no_button.pressed.connect(close)
row.add_child(no_button)
visible = false