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,7 @@
class_name CoopHud
extends Control
## The co-op part of the HUD (Main adds it to the farm's HUD layer):
## * the partner panel, above your own health: their name in their color (P1 gold, P2 blue),
## * the partner panel, under your own portrait and health: their name in their color (P1 gold, P2 blue),
## their health pips, what they're doing (down until morning, patching, gathering, fear
## ready), a speaker mark while their voice comes through, and the ping; plus your
## microphone (on / muted, [M])
@ -9,7 +9,7 @@ extends Control
## * the lobby's status while hosting with nobody in yet ("Waiting for a friend to join ...")
## Both scarecrows also wear name tags (PlayerCharacter.set_tag).
const PANEL := Rect2(22.0, -318.0, 336.0, 104.0) # from the bottom left
const PANEL := Rect2(22.0, 150.0, 336.0, 104.0) # from the top left
const PIP := Vector2(14.0, 9.0)
const ARROW_MARGIN := 60.0
@ -69,7 +69,7 @@ func _process(delta: float) -> void:
_arrow_label.visible = false
if other == null:
return
var base := Vector2(PANEL.position.x, size.y + PANEL.position.y)
var base := PANEL.position
_name.text = other.label()
_name.add_theme_color_override("font_color", other.color())
_name.position = base + Vector2(14.0, 6.0)
@ -129,9 +129,9 @@ func _draw() -> void:
if session == null or not session.is_active() or sim == null or sim.partner == null:
return
var other := sim.avatars[0] if session.is_client() else sim.partner
var base := Vector2(PANEL.position.x, size.y + PANEL.position.y)
draw_rect(Rect2(base, PANEL.size), Color(0.0, 0.0, 0.0, 0.45))
draw_rect(Rect2(base, Vector2(5.0, PANEL.size.y)), other.color())
var base := PANEL.position
Sketch.box(self, Rect2(base, PANEL.size), Sketch.WASH, Color(0, 0, 0, 0), 0.0, 601.0)
Sketch.line(self, base + Vector2(3.0, 4.0), base + Vector2(3.0, PANEL.size.y - 4.0), other.color(), 5.0, 602.0)
var hp := other.kit.hp()
var top := other.kit.max_hp()
for i in top:
@ -162,9 +162,7 @@ func _measure_ping() -> void:
func _label(font_size: int) -> Label:
var l := Label.new()
l.add_theme_font_size_override("font_size", font_size)
l.add_theme_color_override("font_outline_color", Color.BLACK)
l.add_theme_constant_override("outline_size", 6)
Sketch.style(l, font_size + 2, Sketch.TEXT, 6)
l.mouse_filter = Control.MOUSE_FILTER_IGNORE
l.visible = false
add_child(l)