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

@ -9,7 +9,8 @@ extends CenterContainer
## (shop "shed": weapons and other purchasable items) opens with interact at the shed's counter by
## day (Interactions). Buy with a click, or the arrows / d-pad and Enter / A. Close it with Close,
## Escape / B, interact again, by walking off, or at nightfall. The scarecrow stands still and
## can't shoot while either is open.
## can't shoot while either is open. Hand-drawn like the HUD's pouch panel (UiTheme.sketch): the
## title over a pen rule, the tracks' names dim like the pouch's column headings, a slot per row.
## A purchase's result text. Nothing shows it on screen since #23 (the rows say what's missing);
## tests listen to it.
@ -49,20 +50,20 @@ func setup(p_campaign: CampaignController, p_structures: StructureSystem, p_play
track = String(u.get("track", ""))
var head := Label.new()
head.text = track
head.add_theme_font_size_override("font_size", 20)
head.add_theme_color_override("font_color", Color(0.75, 0.85, 0.75))
head.add_theme_font_size_override("font_size", 24)
head.add_theme_color_override("font_color", Sketch.DIM)
box.add_child(head)
var b := Button.new()
b.alignment = HORIZONTAL_ALIGNMENT_LEFT
b.custom_minimum_size = Vector2(720.0, 44.0)
b.add_theme_font_size_override("font_size", 20)
b.custom_minimum_size = Vector2(860.0, 46.0)
b.add_theme_font_size_override("font_size", 25)
b.pressed.connect(func() -> void: _buy(id))
box.add_child(b)
_rows[id] = b
_close = Button.new()
_close.text = "Close"
_close.custom_minimum_size = Vector2(200.0, 48.0)
_close.add_theme_font_size_override("font_size", 22)
_close.add_theme_font_size_override("font_size", 28)
_close.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
_close.pressed.connect(close)
box.add_child(_close)
@ -70,22 +71,23 @@ func setup(p_campaign: CampaignController, p_structures: StructureSystem, p_play
func _ready() -> void:
set_anchors_preset(Control.PRESET_FULL_RECT)
theme = UiTheme.sketch()
var panel := PanelContainer.new()
panel.name = "Panel"
panel.add_theme_stylebox_override("panel", ReviewPanel.backing())
add_child(panel)
var margin := MarginContainer.new()
margin.name = "Margin"
for side in ["left", "right", "top", "bottom"]:
margin.add_theme_constant_override("margin_" + side, 24)
margin.add_theme_constant_override("margin_" + side, 8)
panel.add_child(margin)
var box := VBoxContainer.new()
box.name = "Box"
box.add_theme_constant_override("separation", 6)
margin.add_child(box)
_title = Label.new()
_title.add_theme_font_size_override("font_size", 32)
_title.add_theme_font_size_override("font_size", 36)
box.add_child(_title)
box.add_child(HSeparator.new())
visible = false
mouse_filter = Control.MOUSE_FILTER_IGNORE