Files
Jeff Luke c1b2195834 Expand Glitch operations hub, cabinet authoring, deployment, and RFID support
Operator hub
- Introduce Escape Gallery branding and Glitch: the Dark Machine room views
- Add cabinet illustrations, Pac-Man marquee/gameplay artwork, and waiting states
- Add device feedback panels with RFID readings, input/output states, and stale status
- Add logged operator hardware interventions with request deduplication

Room and cabinet authoring
- Add a visual custom-PCB connection editor with per-cabinet device inventory
- Support device IDs, bindings, wiring notes, input polarity, and validation
- Add physical-room label/dimension toggles and editable doorway annotations
- Preserve doorway changes through undo, save, and revert
- Expand cabinet profiles, room layout, and Glitch scenario resources

Scenarios and gameplay
- Add per-assignment game configuration and runtime feature validation
- Add timed test wins and Frogger individual-home objectives
- Add the three-cabinet timed/score/Frogger test scenario
- Add Cabinet 1 Pac-Man RFID credits, credit sound, and CREDIT 0/1 display
- Require physical Start after an accepted scan and prevent duplicate credits

Pi hardware and deployment
- Add GPIO feedback sampling and a separate multiplexed RFID helper
- Validate reader pin ownership and input/output conflicts
- Add SSH cabinet startup and Pi desktop-session service support
- Add master packaging, site setup, SSH enrollment, and staged cabinet releases
- Verify deployment manifests and support explicit activation/status/log commands

Documentation and verification
- Consolidate the root README around the current architecture and setup workflow
- Add the complete master/Pi/RFID export and deployment walkthrough
- Document network isolation, credentials, card identification, and rollback
- Add PCB, room-editor, feedback, credit, deployment, and controller tests
- Isolate protocol tests from designer-edited cabinet configurations

Known limitations
- RFID helper compilation and physical Pi commissioning remain unverified
- Fleet provisioning does not yet configure RFID-only installations completely
- Broader Pac-Man tests retain a ghost-capture assertion failure
- Staged exports must be rebuilt and checked before deploying runtime 2.3
2026-10-17 14:53:54 -07:00

65 lines
2.7 KiB
GDScript

extends SceneTree
var failures := 0
func check(value: bool, message: String) -> void:
if not value:
failures += 1
push_error(message)
func _initialize() -> void:
run.call_deferred()
func run() -> void:
var room := RoomDefinition.new()
var wall := RoomWallDefinition.new()
wall.wall_id = &"wall"
wall.end = Vector2(4, 0)
var door := RoomWallDefinition.new()
door.wall_id = &"door"
door.start = Vector2(1, 0)
door.end = Vector2(2, 0)
door.is_doorway = true
room.walls.assign([wall, door])
var path := "user://room_door_test.tres"
check(ResourceSaver.save(room, path) == OK, "Initial room save")
room.take_over_path(path)
var session := RoomEditSession.new()
session.begin(room)
session.working_room.get_wall(&"door").swing_reversed = true
session.mark_dirty()
check(session.is_dirty, "Door swing participates in dirty tracking")
check(not door.swing_reversed, "Source isolated from edits")
check(session.save(), "Save room")
var loaded := ResourceLoader.load(path, "", ResourceLoader.CACHE_MODE_IGNORE) as RoomDefinition
check(loaded.get_wall(&"door").is_doorway and loaded.get_wall(&"door").swing_reversed, "Door save/reload")
session.working_room.get_wall(&"door").is_doorway = false
session.mark_dirty()
check(session.is_dirty, "Door type participates in dirty tracking")
session.revert()
check(session.working_room.get_wall(&"door").is_doorway, "Revert restores doorway")
DirAccess.remove_absolute(path)
room.walls.assign([wall, door])
var layout := RoomLayout.new()
layout.item_scene = load("res://ui/RoomLayoutItem.tscn")
root.add_child(layout)
var device := RoomDeviceDefinition.new()
device.device_id = &"lamp"
device.display_name = "Reward lamp"
room.devices.append(device)
layout.configure(room, null)
var ranges := layout._wall_solid_ranges(wall)
check(ranges == [Vector2(0, 0.25), Vector2(0.5, 1)], "Door cuts wall opening")
door.start = Vector2(2, 0)
door.end = Vector2(1, 0)
check(layout._wall_solid_ranges(wall) == ranges, "Reversed doorway endpoints")
check(layout._find_wall_at_screen_position(layout.world_to_screen(Vector2(1.5, 0))) == door, "Door selected ahead of underlying wall")
layout.set_labels_visible(false)
check(not layout.item_nodes[&"lamp"].title_label.visible, "Hide item label")
layout.configure(room, null)
check(not layout.item_nodes[&"lamp"].title_label.visible, "Label preference survives rebuild")
layout.set_labels_visible(true)
check(layout.item_nodes[&"lamp"].title_label.visible, "Restore item label")
layout.set_dimensions_visible(false)
check(not layout.show_dimensions, "Dimension visibility")
layout.queue_free()
await process_frame
print("Room editor tests: ", "PASS" if failures == 0 else "FAIL")
quit(failures)