Files
room_glitch/tools/room_controller/export_catalog.gd
T
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

40 lines
2.6 KiB
GDScript

extends SceneTree
## Export designer resources to the controller's deployment catalog.
func _initialize() -> void:
call_deferred("run")
func run() -> void:
var database: ProjectDatabase = load("res://data/project_database.tres")
var room: RoomDefinition = load("res://data/rooms/arcade_room.tres")
var catalog := {"version": 1, "games": {}, "cabinets": {}, "scenarios": {}, "layout": {"boundary": [], "walls": [], "devices": []}}
for game in database.games:
catalog.games[str(game.game_id)] = {"name": game.display_name, "requirements": Array(game.required_capabilities), "alternatives": Array(game.control_alternatives)}
for cabinet in database.cabinets:
var actions: Array = []
if cabinet.hardware_config != null:
for action in cabinet.hardware_config.actions: actions.append(str(action.action_id))
var placement := room.get_cabinet_placement(cabinet.cabinet_id)
catalog.cabinets[str(cabinet.cabinet_id)] = {"name": cabinet.display_name, "capabilities": Array(cabinet.capabilities), "actions": actions, "position": [placement.position.x, placement.position.y] if placement else null}
catalog.cabinets[str(cabinet.cabinet_id)]["devices"] = cabinet.pcb_config.feedback_devices() if cabinet.pcb_config else []
for scenario in database.scenarios:
var assignments: Array = []
for assignment in scenario.assignments:
if assignment.cabinet == null or assignment.game == null: continue
var mappings := {}
for mapping in assignment.event_mappings:
if not mappings.has(str(mapping.game_event)): mappings[str(mapping.game_event)] = []
mappings[str(mapping.game_event)].append_array(Array(mapping.hardware_actions))
assignments.append({"cabinet": str(assignment.cabinet.cabinet_id), "game": str(assignment.game.game_id), "variant": str(assignment.variant), "activate_after_win": str(assignment.activate_after_win), "game_config": assignment.game_config, "mappings": mappings})
catalog.scenarios[str(scenario.scenario_id)] = {"name": scenario.display_name, "assignments": assignments}
for point in room.boundary_points: catalog.layout.boundary.append([point.x, point.y])
for wall in room.walls: catalog.layout.walls.append([[wall.start.x, wall.start.y], [wall.end.x, wall.end.y]])
for device in room.devices:
catalog.layout.devices.append({"id": str(device.device_id), "name": device.display_name, "position": [device.position.x, device.position.y]})
var file := FileAccess.open("res://tools/room_controller/catalog.json", FileAccess.WRITE)
if file == null:
push_error("Cannot write controller catalog")
quit(1)
return
file.store_string(JSON.stringify(catalog, "\t"))
print("Exported controller catalog from editor resources")
quit()