Win, lose screen. Game version info. Matador a lot more aggressive/wins easier (tweaks needed). No more score/combo/waves
This commit is contained in:
@@ -6,6 +6,10 @@ extends Control
|
||||
const GAME_SCENE := "res://scene.tscn"
|
||||
const FADE_TIME := 0.6
|
||||
|
||||
# Arena palette: aged gold on dark leather, warm cream on hover.
|
||||
const MENU_GOLD := Color(0.85, 0.66, 0.20)
|
||||
const MENU_CREAM := Color(0.93, 0.88, 0.72)
|
||||
|
||||
## Cape centroid per frame (normalized 0-1), detected from red-pixel centroid.
|
||||
## 34 frames at 24 fps = 1.4167 s loop.
|
||||
const VIDEO_FPS := 24.0
|
||||
@@ -90,10 +94,79 @@ func _ready() -> void:
|
||||
exit_button.pressed.connect(_on_exit_pressed)
|
||||
options_back.pressed.connect(_close_subpanels)
|
||||
credits_back.pressed.connect(_close_subpanels)
|
||||
_apply_theme()
|
||||
_build_version_label()
|
||||
_build_rebind_rows()
|
||||
play_button.grab_focus()
|
||||
|
||||
|
||||
# Version banner in the bottom-right corner so it's clear this is an early build.
|
||||
func _build_version_label() -> void:
|
||||
var lbl := Label.new()
|
||||
lbl.text = GameVersion.full()
|
||||
lbl.add_theme_font_override("font", UiFonts.body())
|
||||
lbl.add_theme_font_size_override("font_size", 16)
|
||||
lbl.add_theme_color_override("font_color", MENU_CREAM)
|
||||
lbl.add_theme_color_override("font_outline_color", Color.BLACK)
|
||||
lbl.add_theme_constant_override("outline_size", 4)
|
||||
lbl.set_anchors_preset(Control.PRESET_BOTTOM_RIGHT)
|
||||
lbl.grow_horizontal = Control.GROW_DIRECTION_BEGIN
|
||||
lbl.grow_vertical = Control.GROW_DIRECTION_BEGIN
|
||||
lbl.offset_right = -16.0
|
||||
lbl.offset_bottom = -12.0
|
||||
lbl.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
add_child(lbl)
|
||||
|
||||
|
||||
# Give the whole menu the Cinzel look and swap the generic translucent boxes for
|
||||
# engraved bronze plaques (dark leather fill, gold border with a heavier bottom
|
||||
# edge for a chiselled-tablet feel).
|
||||
func _apply_theme() -> void:
|
||||
_style_button(play_button, true)
|
||||
for btn: Button in [options_button, credits_button, exit_button, options_back, credits_back]:
|
||||
_style_button(btn, false)
|
||||
for path: String in ["OptionsPanel/VBox/TitleLabel", "CreditsPanel/VBox/TitleLabel"]:
|
||||
var title := get_node_or_null(path) as Label
|
||||
if title != null:
|
||||
title.add_theme_font_override("font", UiFonts.title())
|
||||
title.add_theme_color_override("font_color", MENU_GOLD)
|
||||
for path: String in ["OptionsPanel/VBox/Hint", "CreditsPanel/VBox/Names"]:
|
||||
var lbl := get_node_or_null(path) as Label
|
||||
if lbl != null:
|
||||
lbl.add_theme_font_override("font", UiFonts.body())
|
||||
lbl.add_theme_color_override("font_color", MENU_CREAM)
|
||||
|
||||
|
||||
func _style_button(btn: Button, big: bool) -> void:
|
||||
btn.add_theme_font_override("font", UiFonts.title() if big else UiFonts.body())
|
||||
btn.add_theme_color_override("font_color", MENU_GOLD)
|
||||
btn.add_theme_color_override("font_hover_color", MENU_CREAM)
|
||||
btn.add_theme_color_override("font_focus_color", MENU_CREAM)
|
||||
btn.add_theme_color_override("font_pressed_color", MENU_CREAM)
|
||||
btn.add_theme_color_override("font_outline_color", Color(0, 0, 0, 1))
|
||||
btn.add_theme_constant_override("outline_size", 8 if big else 5)
|
||||
btn.add_theme_stylebox_override("normal", _plaque(false))
|
||||
btn.add_theme_stylebox_override("hover", _plaque(true))
|
||||
btn.add_theme_stylebox_override("pressed", _plaque(true))
|
||||
btn.add_theme_stylebox_override("focus", _plaque(true))
|
||||
|
||||
|
||||
func _plaque(hot: bool) -> StyleBoxFlat:
|
||||
var s := StyleBoxFlat.new()
|
||||
s.bg_color = Color(0.14, 0.09, 0.04, 0.94) if hot else Color(0.07, 0.05, 0.03, 0.82)
|
||||
s.set_border_width_all(2)
|
||||
s.border_width_bottom = 5
|
||||
s.border_color = MENU_CREAM if hot else MENU_GOLD
|
||||
s.set_corner_radius_all(2)
|
||||
s.content_margin_left = 24.0
|
||||
s.content_margin_right = 24.0
|
||||
s.content_margin_top = 8.0
|
||||
s.content_margin_bottom = 10.0
|
||||
s.shadow_color = Color(0.0, 0.0, 0.0, 0.5)
|
||||
s.shadow_size = 6
|
||||
return s
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if not main_panel.visible or video.stream == null:
|
||||
return
|
||||
@@ -117,6 +190,9 @@ func _build_rebind_rows() -> void:
|
||||
var name_label := Label.new()
|
||||
name_label.text = ACTION_LABELS[action]
|
||||
name_label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
name_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
name_label.add_theme_font_override("font", UiFonts.body())
|
||||
name_label.add_theme_color_override("font_color", MENU_CREAM)
|
||||
name_label.add_theme_color_override("font_outline_color", Color.BLACK)
|
||||
name_label.add_theme_constant_override("outline_size", 4)
|
||||
row.add_child(name_label)
|
||||
@@ -124,6 +200,7 @@ func _build_rebind_rows() -> void:
|
||||
var key_button := Button.new()
|
||||
key_button.custom_minimum_size = Vector2(160, 0)
|
||||
key_button.text = Controls.get_key_label(action)
|
||||
_style_button(key_button, false)
|
||||
key_button.pressed.connect(_on_rebind_pressed.bind(action, key_button))
|
||||
row.add_child(key_button)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user