Use the pause and settings mockups as panel backdrops
Add UiArt.add_screen_backdrop() to place the reference art behind an opaque panel, then wire the pause overlay and settings screen to it. Pause rows get larger, rounded styles; settings widens to fit its expanded controls. Headless 226/226 verified in a clean HEAD worktree (the realism WIP currently editing materials.gd remains unstaged).
This commit is contained in:
1 parent
4745adeb13
commit
1efa5bc7d9
4 files changed
+70
-13
No files matched your search
@@ -9,6 +9,8 @@ signal restart_requested()
|
||||
signal settings_requested()
|
||||
signal quit_to_menu_requested()
|
||||
|
||||
const UiArt := preload("res://src/game/ui/art.gd")
|
||||
|
||||
var _root: Control = null
|
||||
var _resume_button: Button = null
|
||||
|
||||
@@ -24,11 +26,14 @@ func _build() -> void:
|
||||
_root.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
add_child(_root)
|
||||
|
||||
var bg := ColorRect.new()
|
||||
bg.color = Color(0.02, 0.03, 0.05, 0.82)
|
||||
bg.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
bg.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
_root.add_child(bg)
|
||||
var art := UiArt.new()
|
||||
if not art.add_screen_backdrop(_root, "pause_overlay",
|
||||
Rect2(0.172, 0.097, 0.59, 0.813)):
|
||||
var bg := ColorRect.new()
|
||||
bg.color = Color(0.02, 0.03, 0.05, 0.82)
|
||||
bg.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
bg.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
_root.add_child(bg)
|
||||
|
||||
var center := CenterContainer.new()
|
||||
center.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
@@ -60,7 +65,20 @@ func _add_button(parent: Control, text: String, node_name: String, cb: Callable)
|
||||
var button := Button.new()
|
||||
button.name = node_name
|
||||
button.text = text
|
||||
button.custom_minimum_size = Vector2(320, 44)
|
||||
button.custom_minimum_size = Vector2(380, 52)
|
||||
button.add_theme_font_size_override("font_size", 22)
|
||||
var normal := StyleBoxFlat.new()
|
||||
normal.bg_color = Color(0.115, 0.125, 0.15, 0.96)
|
||||
normal.corner_radius_top_left = 12
|
||||
normal.corner_radius_top_right = 12
|
||||
normal.corner_radius_bottom_left = 12
|
||||
normal.corner_radius_bottom_right = 12
|
||||
var hover := normal.duplicate() as StyleBoxFlat
|
||||
hover.bg_color = Color(0.16, 0.175, 0.21, 0.98)
|
||||
button.add_theme_stylebox_override("normal", normal)
|
||||
button.add_theme_stylebox_override("hover", hover)
|
||||
button.add_theme_stylebox_override("focus", hover)
|
||||
button.add_theme_stylebox_override("pressed", hover)
|
||||
button.pressed.connect(cb)
|
||||
parent.add_child(button)
|
||||
return button
|
||||
|
||||
Reference in new issue
Block a user