UI and other changes
This commit is contained in:
parent
87b5c11fcf
commit
215e24e246
79 changed files with 70023 additions and 2201 deletions
|
|
@ -28,9 +28,8 @@ func run(r: GameTestRunner) -> void:
|
|||
# counts this test tracks across night 1 (it isn't about the Workbench itself)
|
||||
var review := farm.get_node("Hud/ReviewPanel") as ReviewPanel
|
||||
var hud := farm.get_node("Hud/PhaseHud") as PhaseHud
|
||||
var assets := farm.get_node("Hud/AssetHud") as AssetHud
|
||||
assets._process(0.0)
|
||||
r.check(assets.describe() == "Crops 30/30 · Animals 8/8 · Supplies 10", "the asset HUD reads '%s'" % assets.describe())
|
||||
var assets := " · ".join(PauseMenu.asset_counts(sim.campaign.state))
|
||||
r.check(assets == "Crops 30/30 · Animals 8/8 · Supplies 10", "the pause menu's assets read '%s'" % assets)
|
||||
sim.structures.destroyed.connect(func(_id: int, _t: String, _at: Vector3) -> void: _broken.append(1))
|
||||
_morning(r, sim, review, hud)
|
||||
_day(r, sim, player, hud)
|
||||
|
|
@ -47,7 +46,7 @@ func _morning(r: GameTestRunner, sim: FarmSim, review: ReviewPanel, hud: PhaseHu
|
|||
r.check(sim.campaign.state.phase == P.MORNING and review.visible and review._title.text == "The farmers are away",
|
||||
"the first morning shows the review panel with the introduction")
|
||||
hud._process(0.0)
|
||||
r.check(hud.describe() == "Night 1 of %d · Morning" % sim.config.campaign_nights, "the phase HUD reads '%s'" % hud.describe())
|
||||
r.check(hud.describe() == "Day 1 of %d · Morning" % sim.config.campaign_nights, "the phase HUD reads '%s'" % hud.describe())
|
||||
sim.day_night.snap()
|
||||
var day_energy := sim.sun.light_energy
|
||||
r.check(sim.day_night.lantern.light_energy < 0.6 and day_energy > 0.8, "morning light: bright sun, lantern nearly off")
|
||||
|
|
@ -59,7 +58,7 @@ func _day(r: GameTestRunner, sim: FarmSim, player: PlayerCharacter, hud: PhaseHu
|
|||
var c := sim.campaign
|
||||
var s := c.state
|
||||
hud._process(0.0)
|
||||
r.check(hud.describe() == "Night 1 of %d · Day · 3:00 left" % sim.config.campaign_nights, "the phase HUD reads '%s'" % hud.describe())
|
||||
r.check(hud.describe() == "Day 1 of %d · 3:00 until Dusk" % sim.config.campaign_nights, "the phase HUD reads '%s'" % hud.describe())
|
||||
sim.day_night.snap()
|
||||
r.check(is_equal_approx(sim.day_night.lantern.light_energy, 0.0) and sim.sun.light_energy > 1.0, "daylight: full sun, no lantern")
|
||||
# A day's work: gather into the pouch, build, take some damage, patch up.
|
||||
|
|
@ -96,7 +95,7 @@ func _dusk(r: GameTestRunner, sim: FarmSim, hud: PhaseHud) -> void:
|
|||
r.check(w.warning_active() and w.tonight_entries() == [[EnemySystem.TYPE_CROW, LootSystem.Category.CROP]], "dusk warns of what tonight brings: %s" % [w.tonight_entries()])
|
||||
hud._process(0.0)
|
||||
var warning := "Tonight, from every side: crows"
|
||||
r.check(hud._hint.text == warning, "the HUD warns, by target: '%s'" % hud._hint.text.replace("\n", " / "))
|
||||
r.check(hud.hint == warning, "the HUD warns, by target: '%s'" % hud.hint.replace("\n", " / "))
|
||||
var marked := w.get_children().filter(func(n: Node) -> bool: return n is Node3D and (n as Node3D).visible)
|
||||
r.check(marked.is_empty() and sim.alerts.collect().is_empty(), "nothing marks tonight's arrivals on the farm or at the screen edge")
|
||||
r.check(hud._dusk_hint.visible and hud._dusk_hint.text == plan.dusk_hint and hud._banner.text == "Dusk: %s" % plan.title,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue