- HUD: programmatically builds ImplantPanel with health/mode/time rows, replaces raw MarginContainer/VBoxContainer/Labels - Stance indicator: ImplantPanel with color-coded ImplantDataRow, replaces custom _draw() with hardcoded bg/text - Interaction prompt: applies implant theme StyleBox + colors to existing PanelContainer layout Minimap left as-is — its circular frame is a distinct diegetic element, not rectangular panel chrome. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
43 lines
1.2 KiB
GDScript
43 lines
1.2 KiB
GDScript
extends Control
|
|
|
|
## D-053: Stance indicator — implant-styled badge (D-169).
|
|
## Sprint/Walk/Careful/Crouch. Color-coded for quick read.
|
|
|
|
const STANCE_COLORS := {
|
|
"Sprint": Color("#d45d5d"), # Red — fast, loud, dangerous
|
|
"Walk": Color("#c8d0e0"), # Default — neutral white-blue
|
|
"Careful": Color("#6bc9a6"), # Green — quiet, observant
|
|
"Crouch": Color("#e8c547"), # Amber — very quiet, slow
|
|
}
|
|
|
|
var _current_stance: String = "Walk"
|
|
var _panel: ImplantPanel
|
|
var _row: ImplantDataRow
|
|
|
|
|
|
func _ready() -> void:
|
|
mouse_filter = Control.MOUSE_FILTER_IGNORE
|
|
var theme_res := load("res://ui/implant/default_implant.tres") as ImplantTheme
|
|
|
|
_panel = ImplantPanel.new()
|
|
_panel.name = "StancePanel"
|
|
_panel.theme_resource = theme_res
|
|
_panel.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
|
add_child(_panel)
|
|
|
|
_row = ImplantDataRow.new("Walk", STANCE_COLORS["Walk"])
|
|
_panel.add_component(_row)
|
|
|
|
|
|
func update_from_state() -> void:
|
|
var stance: String = GameState.player_stance
|
|
if stance == _current_stance:
|
|
return
|
|
_current_stance = stance
|
|
var color: Color = STANCE_COLORS.get(stance, Color("#c8d0e0"))
|
|
_row.set_content(stance, color)
|
|
|
|
|
|
func get_current_stance() -> String:
|
|
return _current_stance
|