This commit is contained in:
Team3
2026-09-16 20:06:38 +02:00
parent 7c4edaa439
commit a86d737d39
10 changed files with 252 additions and 96 deletions

View File

@@ -144,9 +144,13 @@ func _baue_hud() -> void:
var steuerung := Label.new()
steuerung.text = "J Journal · 1-3 Tempo · Q Kamera · Mausrad Zoom · Esc"
# rechts verankert und nach links wachsend: sonst ragt der Text aus dem Fenster
steuerung.set_anchors_preset(Control.PRESET_TOP_RIGHT)
steuerung.position = Vector2(-260, 16)
steuerung.size = Vector2(240, 24)
steuerung.grow_horizontal = Control.GROW_DIRECTION_BEGIN
steuerung.offset_right = -16
steuerung.offset_left = -520
steuerung.offset_top = 16
steuerung.offset_bottom = 40
steuerung.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
steuerung.add_theme_font_size_override("font_size", 14)
steuerung.add_theme_color_override("font_color", Color(1, 1, 1, 0.4))
@@ -397,7 +401,10 @@ func _baue_wirte() -> void:
_titel.add_theme_color_override("font_color", Color(1, 0.93, 0.75))
_box.add_child(_titel)
_scroll = ScrollContainer.new()
_scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
# nie querscrollen, aber auch nie die Leiste verbreitern: zu breiter Inhalt
# wird abgeschnitten statt aus dem Fenster zu ragen
_scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_SHOW_NEVER
_scroll.clip_contents = true
_scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
_box.add_child(_scroll)
_content = VBoxContainer.new()
@@ -411,6 +418,7 @@ func _baue_wirte() -> void:
_drawer.offset_right = -12
_drawer.offset_top = 56
_drawer.offset_bottom = -(LEISTE_H + 22)
_drawer.clip_contents = true
_drawer.visible = false
_root.add_child(_drawer)
@@ -435,9 +443,20 @@ func _wirt_fuer(kind: String) -> PanelContainer:
return _modal
func _process(_delta: float) -> void:
var _takt := 0.0 # HUD- und Leistentexte alle 0,1 s; der Puls läuft je Bild
func _process(delta: float) -> void:
_takt -= delta
var dran := _takt <= 0.0
if dran:
_takt = 0.1
if not offen:
_hud_aktualisieren()
if dran:
_hud_aktualisieren()
_ablauf_aktualisieren()
else:
_ablauf_pulsen()
return
var wirt := _wirt_fuer(_kind)
var wunsch := _content.get_combined_minimum_size().y
@@ -461,7 +480,21 @@ func _process(_delta: float) -> void:
_karte_host.reset_size()
_karte_host.position = Vector2((vp.x - _karte_host.size.x) * 0.5,
vp.y - LEISTE_H - 22.0 - _karte_host.size.y)
_ablauf_aktualisieren()
if dran:
_ablauf_aktualisieren()
else:
_ablauf_pulsen()
## Nur die laufende Stunde pulsiert -- das darf jedes Bild passieren.
func _ablauf_pulsen() -> void:
var id := Game.active_mission
if id == "" or not _ablauf.visible or not Game.situation_bei(id):
return
var jetzt := int(Game.time_h)
var puls := 0.5 + 0.5 * sin(Time.get_ticks_msec() * 0.008)
var zelle: ColorRect = _zellen[jetzt]
zelle.color = _ablauf_farbe(id, Game.slot_bei_stunde(id, jetzt)).lightened(0.3 + 0.4 * puls)
# ------------------------------------------------------------------ Baukasten
@@ -549,6 +582,9 @@ func _trenner() -> void:
func _zeigen(kind: String, zurueck: Callable = Callable()) -> void:
_kind = kind
_ziel = null
if kind != "akte":
_drawer.remove_theme_stylebox_override("panel")
_titel.remove_theme_color_override("font_color")
var wirt := _wirt_fuer(kind)
if _box.get_parent() != wirt:
if _box.get_parent() != null:
@@ -726,6 +762,7 @@ func akte_panel(human_id: String) -> void:
_akte_text(str(h["problem"]), 15)
_akte_abschnitt("Befund")
var offen_urs := 0
for u in Game.ursachen_von(human_id):
var name: String = str(u)
var stand: String
@@ -736,10 +773,12 @@ func akte_panel(human_id: String) -> void:
stand = "[color=%s]%s · bremst auf %d %%[/color]" % [TINTE_ROT, woher,
int(float(Ursachen.LISTE[name]["faktor"]) * 100.0)]
else:
_akte_text("[color=%s]? noch nichts gefunden — Spuren in der Wohnung, Momente im Tag[/color]" %
TINTE_HELL, 15)
offen_urs += 1
continue
_akte_text("[b]%s[/b] %s" % [Ursachen.LISTE[name]["name"], stand], 15)
if offen_urs > 0:
_akte_text("[color=%s]? %s noch nichts gefunden — Spuren in der Wohnung, Momente im Tag[/color]" %
[TINTE_HELL, "eine Ursache," if offen_urs == 1 else "%d Ursachen," % offen_urs], 15)
var probleme: Array = []
for pr in Game.probleme_von(human_id):
var key := str(pr)
@@ -768,19 +807,17 @@ func akte_panel(human_id: String) -> void:
_scroll_frames = 4
## Ein Blatt Papier im Drawer; alles Weitere der Akte landet darauf.
## Die Leiste selbst wird zum Blatt Papier. Ein Container im Container bricht
## den Text nicht um -- er richtet sich an der längsten Zeile aus und ragt hinaus.
func _papier() -> void:
var p := PanelContainer.new()
var s := _sb(C_PAPIER, 3, Color(0.78, 0.72, 0.6), 1)
s.content_margin_left = 16
s.content_margin_right = 16
s.content_margin_top = 12
var s := _sb(C_PAPIER, 4, Color(0.78, 0.72, 0.6), 1)
s.content_margin_left = 18
s.content_margin_right = 18
s.content_margin_top = 10
s.content_margin_bottom = 14
p.add_theme_stylebox_override("panel", s)
_content.add_child(p)
_blatt = VBoxContainer.new()
_blatt.add_theme_constant_override("separation", 6)
p.add_child(_blatt)
_drawer.add_theme_stylebox_override("panel", s)
_titel.add_theme_color_override("font_color", Color(0.17, 0.15, 0.13))
_blatt = _content
func _akte_text(bb: String, groesse: int = 15) -> RichTextLabel: