53 lines
2.0 KiB
GDScript
53 lines
2.0 KiB
GDScript
extends SceneTree
|
|
|
|
const Main = preload("res://main.gd")
|
|
const Controller = preload("res://campaign/fg2_graybox_controller.gd")
|
|
|
|
const VIEWPORT := Vector2i(844, 390)
|
|
|
|
var failures: Array[String] = []
|
|
|
|
|
|
func _initialize() -> void:
|
|
call_deferred("run_test")
|
|
|
|
|
|
func run_test() -> void:
|
|
root.content_scale_mode = Window.CONTENT_SCALE_MODE_CANVAS_ITEMS
|
|
root.content_scale_aspect = Window.CONTENT_SCALE_ASPECT_EXPAND
|
|
root.content_scale_size = VIEWPORT
|
|
root.size = VIEWPORT
|
|
var game = Main.new()
|
|
game.auto_boot = true
|
|
game.fg2_review_enabled = true
|
|
game.p100_persistence_enabled = false
|
|
root.add_child(game)
|
|
await settle(10)
|
|
expect(is_instance_valid(game.fg2_experience), "FG-2 review feature mounts the campaign controller")
|
|
expect(not game.facade.visible, "legacy facade stays hidden behind the review slice")
|
|
expect(not is_instance_valid(game.p100_experience) and not is_instance_valid(game.p102_experience) and not is_instance_valid(game.p103_experience), "review feature owns exactly one runtime controller")
|
|
expect(game.fg2_experience.screen == Controller.SCREEN_MARKET and int(game.fg2_experience.view.market_index) == 1, "review opens canonical Windglass Market 1")
|
|
expect(not game.fg2_experience.muted and bool(game.fg2_experience.audio_router.snapshot().valid), "review starts the integrated audio candidate unmuted")
|
|
expect(game.fg2_experience.find_child("FG2DepartButton", true, false) != null, "review entry exposes the route commit")
|
|
game.start_p100_experience(false)
|
|
expect(not is_instance_valid(game.p100_experience), "legacy runtime cannot overlap the review feature")
|
|
game.queue_free()
|
|
await settle(60)
|
|
if failures.is_empty():
|
|
print("ABG_FG2_WEB_ENTRY_OK feature=fg2_review market=1 controller=exclusive audio=unmuted route_commit=true legacy_default=preserved")
|
|
quit(0)
|
|
else:
|
|
for failure in failures:
|
|
push_error(failure)
|
|
quit(1)
|
|
|
|
|
|
func settle(frames: int) -> void:
|
|
for _index in range(frames):
|
|
await process_frame
|
|
|
|
|
|
func expect(condition: bool, message: String) -> void:
|
|
if not condition:
|
|
failures.append("FG-2 Web entry: %s" % message)
|