update
This commit is contained in:
@@ -891,6 +891,39 @@ func test_akte() -> void:
|
||||
p(text.contains("noch keine") and text.contains("noch nichts gefunden"),
|
||||
"Ohne Spuren und Beobachtungen ist der Befund leer")
|
||||
p(_knopf_da("Hinfahren"), "Ein Knopf bringt einen vor die Tür")
|
||||
await get_tree().process_frame
|
||||
await get_tree().process_frame
|
||||
var breit := 0.0
|
||||
for c in _alle_kinder(ui()._content):
|
||||
if c is Control:
|
||||
breit = maxf(breit, (c as Control).size.x)
|
||||
p(ui()._drawer.size.x <= UI.DRAWER_BREITE + 1.0 and breit <= ui()._content.size.x + 1.0,
|
||||
"Nichts ragt aus der Leiste (Leiste %.0f, breitestes Element %.0f)" % [ui()._drawer.size.x, breit])
|
||||
ui().journal_panel("techniken")
|
||||
p(not ui()._drawer.has_theme_stylebox_override("panel"), "Andere Seiten sind wieder dunkel")
|
||||
# keine Seite der Leiste darf breiter sein als die Leiste -- und die Leiste nicht als das Fenster
|
||||
var zu_breit: Array = []
|
||||
for seite in ["techniken", "missionen"]:
|
||||
ui().journal_panel(seite)
|
||||
await get_tree().process_frame
|
||||
var mind := ui()._content.get_combined_minimum_size().x
|
||||
if mind > UI.DRAWER_BREITE - 30.0 or ui()._drawer.size.x > UI.DRAWER_BREITE + 1.0:
|
||||
zu_breit.append("%s (%.0f)" % [seite, mind])
|
||||
ui().akte_panel(id)
|
||||
await get_tree().process_frame
|
||||
if ui()._content.get_combined_minimum_size().x > UI.DRAWER_BREITE - 30.0 \
|
||||
or ui()._drawer.size.x > UI.DRAWER_BREITE + 1.0:
|
||||
zu_breit.append("akte (%.0f)" % ui()._content.get_combined_minimum_size().x)
|
||||
p(zu_breit.is_empty(), "Journal und Akte bleiben in der Leistenbreite%s" %
|
||||
("" if zu_breit.is_empty() else " — zu breit: " + ", ".join(zu_breit)))
|
||||
var rand: float = ui()._drawer.position.x + ui()._drawer.size.x
|
||||
p(rand <= ui()._root.size.x, "Die Leiste endet im Fenster (%.0f von %.0f)" % [rand, ui()._root.size.x])
|
||||
var hinweis_rechts := 0.0
|
||||
for c in ui()._root.get_children():
|
||||
if c is Label and (c as Label).text.begins_with("J Journal"):
|
||||
hinweis_rechts = (c as Control).position.x + (c as Control).size.x
|
||||
p(hinweis_rechts > 0.0 and hinweis_rechts <= ui()._root.size.x,
|
||||
"Der Steuerungshinweis endet im Fenster (%.0f von %.0f)" % [hinweis_rechts, ui()._root.size.x])
|
||||
var u := str((h["ursachen"] as Array)[0])
|
||||
Game.spur_lesen(id, u)
|
||||
ui().akte_panel(id)
|
||||
@@ -1286,34 +1319,64 @@ func test_kamera_und_etagen() -> void:
|
||||
p(zuhause and absf(oben.global_position.y) < 0.3,
|
||||
"Nachts liegt %s zu Hause, ebenerdig (y = %.1f)" % [oben.data["name"], oben.global_position.y])
|
||||
|
||||
# Schnitt: drinnen verschwinden Dach und die Wände zur Kamera
|
||||
# Schnitt wie bei den Sims: drinnen verschwindet das Dach, alle Wände werden Stümpfe
|
||||
var bau: Dictionary = {}
|
||||
for b in welt()._bauten:
|
||||
if (b["c"] as Vector3).distance_to(c) < 0.1:
|
||||
bau = b
|
||||
p(not bau.is_empty() and (bau["teile"] as Array).size() == 1 and (bau["waende"] as Array).size() >= 4,
|
||||
p(not bau.is_empty() and (bau["teile"] as Array).size() >= 1 and (bau["waende"] as Array).size() >= 4,
|
||||
"Sein Haus steht mit Dach und Wänden da")
|
||||
sp.global_position = c + Vector3(0, 0.3, 0)
|
||||
sp.velocity = Vector3.ZERO
|
||||
sp.yaw = Player.CAM_YAW
|
||||
await get_tree().physics_frame
|
||||
welt()._process(0.05)
|
||||
var wand_weg := 0
|
||||
var stuempfe := 0
|
||||
var hoch := 0
|
||||
for w in bau["waende"]:
|
||||
if not (w as Node3D).visible:
|
||||
wand_weg += 1
|
||||
var bm := (w as MeshInstance3D).mesh as BoxMesh
|
||||
if (w as Node3D).visible and bm.size.y <= Prims.STUMPF + 0.01:
|
||||
stuempfe += 1
|
||||
elif (w as Node3D).visible:
|
||||
hoch += 1
|
||||
p(not (bau["teile"][0] as Node3D).visible, "Steht der Geist im Haus, verschwindet das Dach")
|
||||
p(wand_weg >= 2 and wand_weg < (bau["waende"] as Array).size(),
|
||||
"Die Wände zur Kamera hin sind weg, die hinteren bleiben (%d von %d Teile)" %
|
||||
[wand_weg, (bau["waende"] as Array).size()])
|
||||
p(stuempfe >= 4 and hoch == 0,
|
||||
"Alle Wände sind kniehohe Stümpfe, keine bleibt hoch, nichts wird durchsichtig (%d Stümpfe)" % stuempfe)
|
||||
var durchsichtig := 0
|
||||
for b in welt()._bauten:
|
||||
for mi in Prims._meshes_von(b):
|
||||
if (mi as GeometryInstance3D).transparency > 0.0:
|
||||
durchsichtig += 1
|
||||
p(durchsichtig == 0, "Kein Bau ist durchsichtig")
|
||||
# nichts über Kniehöhe verdeckt drinnen den Blick von oben: kein Band, keine Decke
|
||||
var hoch_sichtbar: Array = []
|
||||
var knoten: Array = (bau["teile"] as Array).duplicate()
|
||||
knoten.append(bau["raum"])
|
||||
for k in knoten:
|
||||
for mi in (k as Node).find_children("*", "MeshInstance3D", true, false):
|
||||
var m := mi as MeshInstance3D
|
||||
if not m.is_visible_in_tree():
|
||||
continue
|
||||
var kasten := m.get_aabb()
|
||||
var kante: float = m.global_position.y + kasten.end.y * m.scale.y
|
||||
var ist_wand := (bau["waende"] as Array).has(m)
|
||||
if kante > 1.9 and not ist_wand:
|
||||
hoch_sichtbar.append("%s (bis %.1f m)" % [m.name, kante])
|
||||
p(hoch_sichtbar.is_empty(), "Drinnen verdeckt nichts über Kniehöhe die Sicht%s" %
|
||||
("" if hoch_sichtbar.is_empty() else " — " + ", ".join(hoch_sichtbar)))
|
||||
sp.global_position = c + Vector3(float(g[0]) + 4.0, 0.3, 0)
|
||||
await get_tree().physics_frame
|
||||
welt()._process(0.05)
|
||||
var alles := (bau["teile"][0] as Node3D).visible
|
||||
for w in bau["waende"]:
|
||||
if not (w as Node3D).visible:
|
||||
alles = false
|
||||
p(alles, "Draußen steht das Haus wieder ganz")
|
||||
var bm := (w as MeshInstance3D).mesh as BoxMesh
|
||||
if not (w as Node3D).visible or bm.size.y <= Prims.STUMPF + 0.01:
|
||||
alles = false # der Türsturz ist niedrig, aber kein Stumpf
|
||||
p(alles, "Draußen steht das Haus wieder ganz, Wände in voller Höhe")
|
||||
var hoechster_bau := 0.0
|
||||
for b in welt()._bauten:
|
||||
hoechster_bau = maxf(hoechster_bau, float(b["hoch"]))
|
||||
p(hoechster_bau <= 3.5, "Kein Bau ist höher als ein Erdgeschoss (%.1f m)" % hoechster_bau)
|
||||
|
||||
# Klick auf einen Menschen
|
||||
sp.global_position = oben.global_position + Vector3(2.0, 1.4, 2.0)
|
||||
|
||||
Reference in New Issue
Block a user