Added Glitch Room Source code to Gitty
This commit is contained in:
commit
1ac9eb5644
505 files changed
+28504
No files matched your search
@@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=2 format=3]
|
||||
[ext_resource type="Script" path="res://operator/arcade_room_operator.gd" id="1"]
|
||||
[node name="ArcadeRoomOperator" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1")
|
||||
@@ -0,0 +1,67 @@
|
||||
[gd_scene format=3 uid="uid://duvm1qwhoqq2t"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c5k1co6ww5flo" path="res://operator/operator_console.gd" id="1_k8li0"]
|
||||
[ext_resource type="Script" uid="uid://dbe24sbmbh6tt" path="res://core/runtime/room_controller.gd" id="1_vinxr"]
|
||||
[ext_resource type="Resource" uid="uid://8qqlypjp3hd4" path="res://data/project_database.tres" id="2_qhjp7"]
|
||||
[ext_resource type="Resource" uid="uid://dgc35ind56yxm" path="res://data/rooms/arcade_room.tres" id="3_prnev"]
|
||||
[ext_resource type="PackedScene" uid="uid://d0c4psurpl2f2" path="res://editor/workspace/EscapeRoomWorkspace.tscn" id="5_prnev"]
|
||||
|
||||
[node name="OperatorConsole" type="Control" unique_id=1959910901]
|
||||
propagate_maximum_size = true
|
||||
clip_contents = true
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_k8li0")
|
||||
database = ExtResource("2_qhjp7")
|
||||
room = ExtResource("3_prnev")
|
||||
|
||||
[node name="RoomController" type="Node" parent="." unique_id=314194706]
|
||||
script = ExtResource("1_vinxr")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1366109145]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer" unique_id=361139616]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="OperatorBar" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=812304594]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="RuntimeScenarioSelect" type="OptionButton" parent="MarginContainer/VBoxContainer/OperatorBar" unique_id=1671860760]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ValidateRoomButton" type="Button" parent="MarginContainer/VBoxContainer/OperatorBar" unique_id=505623115]
|
||||
layout_mode = 2
|
||||
text = "VALIDATE"
|
||||
|
||||
[node name="PrepRoomButton" type="Button" parent="MarginContainer/VBoxContainer/OperatorBar" unique_id=1689610592]
|
||||
layout_mode = 2
|
||||
text = "PREP"
|
||||
|
||||
[node name="RoomStatusLabel" type="Label" parent="MarginContainer/VBoxContainer/OperatorBar" unique_id=1574831891]
|
||||
layout_mode = 2
|
||||
text = "STATUS"
|
||||
|
||||
[node name="CabinetStatusContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1276724977]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
|
||||
[node name="EditorArea" type="Control" parent="MarginContainer/VBoxContainer" unique_id=851988818]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="EscapeRoomWorkspace" parent="MarginContainer/VBoxContainer/EditorArea" unique_id=1163239148 instance=ExtResource("5_prnev")]
|
||||
layout_mode = 1
|
||||
|
||||
[connection signal="item_selected" from="MarginContainer/VBoxContainer/OperatorBar/RuntimeScenarioSelect" to="." method="_on_runtime_scenario_select_item_selected"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/OperatorBar/ValidateRoomButton" to="." method="_on_validate_room_button_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/OperatorBar/PrepRoomButton" to="." method="_on_prep_room_button_pressed"]
|
||||
@@ -0,0 +1,243 @@
|
||||
[gd_scene format=3 uid="uid://duvm1qwhoqq2t"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c5k1co6ww5flo" path="res://operator/operator_console.gd" id="1_k8li0"]
|
||||
[ext_resource type="Script" uid="uid://dbe24sbmbh6tt" path="res://core/runtime/room_controller.gd" id="1_vinxr"]
|
||||
[ext_resource type="Resource" uid="uid://8qqlypjp3hd4" path="res://data/project_database.tres" id="2_qhjp7"]
|
||||
[ext_resource type="Resource" uid="uid://dgc35ind56yxm" path="res://data/rooms/arcade_room.tres" id="3_prnev"]
|
||||
[ext_resource type="Script" uid="uid://bfb7sad2mjnlf" path="res://core/simulation/room_simulator.gd" id="4_4ar2l"]
|
||||
[ext_resource type="Script" uid="uid://ca320x55f2h3y" path="res://ui/room_layout.gd" id="6_dicmx"]
|
||||
[ext_resource type="PackedScene" uid="uid://c5c0mnwwuqruw" path="res://ui/RoomLayoutItem.tscn" id="7_ncki6"]
|
||||
[ext_resource type="Script" uid="uid://dm5remdyomnc4" path="res://ui/logic_graph.gd" id="8_gu74o"]
|
||||
|
||||
[node name="OperatorConsole" type="Control" unique_id=1959910901]
|
||||
propagate_maximum_size = true
|
||||
clip_contents = true
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_k8li0")
|
||||
database = ExtResource("2_qhjp7")
|
||||
room = ExtResource("3_prnev")
|
||||
|
||||
[node name="RoomController" type="Node" parent="." unique_id=314194706]
|
||||
script = ExtResource("1_vinxr")
|
||||
|
||||
[node name="RoomSimulator" type="Node" parent="." unique_id=1394335779]
|
||||
script = ExtResource("4_4ar2l")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1014582732]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer" unique_id=835801638]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TitleLabel" type="Label" parent="MarginContainer/VBoxContainer" unique_id=535818399]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScenarioBar" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=219831870]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScenarioLabel" type="Label" parent="MarginContainer/VBoxContainer/ScenarioBar" unique_id=1395073146]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScenarioSelect" type="OptionButton" parent="MarginContainer/VBoxContainer/ScenarioBar" unique_id=1960308578]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ActionBar" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=525952292]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="LoadButton" type="Button" parent="MarginContainer/VBoxContainer/ActionBar" unique_id=433362026]
|
||||
layout_mode = 2
|
||||
text = "Load"
|
||||
|
||||
[node name="ValidateButton" type="Button" parent="MarginContainer/VBoxContainer/ActionBar" unique_id=1164666775]
|
||||
layout_mode = 2
|
||||
text = "Validate"
|
||||
|
||||
[node name="PrepButton" type="Button" parent="MarginContainer/VBoxContainer/ActionBar" unique_id=847661533]
|
||||
layout_mode = 2
|
||||
text = "Prep"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="MarginContainer/VBoxContainer" unique_id=1151207993]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="RoomStatusLabel" type="Label" parent="MarginContainer/VBoxContainer" unique_id=745890717]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer/VBoxContainer" unique_id=128786743]
|
||||
custom_minimum_size = Vector2(1920, 200)
|
||||
propagate_maximum_size = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CabinetList" type="VBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer" unique_id=1328206568]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="MarginContainer/VBoxContainer" unique_id=2024560039]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer" unique_id=2017763907]
|
||||
layout_mode = 2
|
||||
text = "ROOM DEVICES"
|
||||
|
||||
[node name="MainViews" type="TabContainer" parent="MarginContainer/VBoxContainer" unique_id=2035710526]
|
||||
propagate_maximum_size = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
current_tab = 1
|
||||
|
||||
[node name="Physical" type="Control" parent="MarginContainer/VBoxContainer/MainViews" unique_id=1709144739]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 0
|
||||
|
||||
[node name="LayoutWorkspace" type="HBoxContainer" parent="MarginContainer/VBoxContainer/MainViews/Physical" unique_id=165485620]
|
||||
propagate_maximum_size = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_bottom = 61.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="RoomLayoutPanel" type="PanelContainer" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace" unique_id=1890208727]
|
||||
custom_minimum_size = Vector2(0, 300)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="RoomLayout" type="Control" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/RoomLayoutPanel" unique_id=1755582596]
|
||||
layout_mode = 2
|
||||
script = ExtResource("6_dicmx")
|
||||
item_scene = ExtResource("7_ncki6")
|
||||
|
||||
[node name="PropertyPanel" type="PanelContainer" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace" unique_id=1130312040]
|
||||
custom_minimum_size = Vector2(300, 0)
|
||||
custom_maximum_size = Vector2(300, -1)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel" unique_id=1503925230]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer" unique_id=1844850543]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PropertiesTitle" type="Label" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=1868518001]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SelectedLabel" type="Label" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=425349153]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=540873004]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="XLabel" type="Label" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=1395648922]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="XSpinBox" type="SpinBox" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=212457245]
|
||||
layout_mode = 2
|
||||
min_value = -2000.0
|
||||
max_value = 5000.0
|
||||
|
||||
[node name="YLabel" type="Label" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=449512311]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="YSpinBox" type="SpinBox" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=539657259]
|
||||
layout_mode = 2
|
||||
min_value = -2000.0
|
||||
max_value = 5000.0
|
||||
|
||||
[node name="RotationLabel" type="Label" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=1558308543]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="RotationSpinBox" type="SpinBox" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=300843311]
|
||||
layout_mode = 2
|
||||
min_value = -360.0
|
||||
max_value = 360.0
|
||||
|
||||
[node name="SnapCheckBox" type="CheckBox" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=83220102]
|
||||
layout_mode = 2
|
||||
button_pressed = true
|
||||
text = "Snap to Grid"
|
||||
|
||||
[node name="GridLabel" type="Label" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=1014679681]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="GridSpinBox" type="SpinBox" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=1237291196]
|
||||
layout_mode = 2
|
||||
min_value = 1.0
|
||||
max_value = 200.0
|
||||
value = 1.0
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=200431526]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="DirtyLabel" type="Label" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=1190553142]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SaveButton" type="Button" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=839924948]
|
||||
layout_mode = 2
|
||||
text = "SAVE ROOM"
|
||||
|
||||
[node name="RevertButton" type="Button" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=1355534065]
|
||||
layout_mode = 2
|
||||
text = "REVERT"
|
||||
|
||||
[node name="ShowConnectionsCheckBox" type="CheckBox" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=309406547]
|
||||
layout_mode = 2
|
||||
button_pressed = true
|
||||
text = "Show Connections"
|
||||
|
||||
[node name="Logic" type="Control" parent="MarginContainer/VBoxContainer/MainViews" unique_id=1771194381]
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 1
|
||||
|
||||
[node name="AutoArrangeButton" type="Button" parent="MarginContainer/VBoxContainer/MainViews/Logic" unique_id=621962605]
|
||||
layout_mode = 0
|
||||
offset_left = 1786.0
|
||||
offset_top = -29.0
|
||||
offset_right = 1917.0
|
||||
offset_bottom = 2.0
|
||||
text = "AUTO ARRANGE"
|
||||
|
||||
[node name="LogicGraph" type="GraphEdit" parent="MarginContainer/VBoxContainer/MainViews/Logic" unique_id=40506474]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
scroll_offset = Vector2(-40, -40)
|
||||
script = ExtResource("8_gu74o")
|
||||
|
||||
[node name="DeviceList" type="VBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1469097889]
|
||||
custom_minimum_size = Vector2(0, 150)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HSeparator3" type="HSeparator" parent="MarginContainer/VBoxContainer" unique_id=1833639349]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ValidationOutput" type="RichTextLabel" parent="MarginContainer/VBoxContainer" unique_id=287181262]
|
||||
custom_minimum_size = Vector2(0, 100)
|
||||
custom_maximum_size = Vector2(-1, 100)
|
||||
layout_mode = 2
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/ActionBar/LoadButton" to="." method="_on_load_button_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/ActionBar/ValidateButton" to="." method="_on_validate_button_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/ActionBar/PrepButton" to="." method="_on_prep_button_pressed"]
|
||||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/XSpinBox" to="." method="_on_x_spinbox_value_changed"]
|
||||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/YSpinBox" to="." method="_on_y_spinbox_value_changed"]
|
||||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/RotationSpinBox" to="." method="_on_rotation_spinbox_value_changed"]
|
||||
[connection signal="toggled" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/SnapCheckBox" to="." method="_on_snap_check_box_toggled"]
|
||||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/GridSpinBox" to="." method="_on_grid_spinbox_value_changed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/SaveButton" to="." method="_on_save_button_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/RevertButton" to="." method="_on_revert_button_pressed"]
|
||||
[connection signal="toggled" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/ShowConnectionsCheckBox" to="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/RoomLayoutPanel/RoomLayout" method="_on_show_connections_check_box_toggled"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/MainViews/Logic/AutoArrangeButton" to="." method="_on_auto_arrange_button_pressed"]
|
||||
@@ -0,0 +1,243 @@
|
||||
[gd_scene format=3 uid="uid://duvm1qwhoqq2t"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c5k1co6ww5flo" path="res://operator/operator_console.gd" id="1_k8li0"]
|
||||
[ext_resource type="Script" uid="uid://dbe24sbmbh6tt" path="res://core/runtime/room_controller.gd" id="1_vinxr"]
|
||||
[ext_resource type="Resource" uid="uid://8qqlypjp3hd4" path="res://data/project_database.tres" id="2_qhjp7"]
|
||||
[ext_resource type="Resource" uid="uid://dgc35ind56yxm" path="res://data/rooms/arcade_room.tres" id="3_prnev"]
|
||||
[ext_resource type="Script" uid="uid://bfb7sad2mjnlf" path="res://core/simulation/room_simulator.gd" id="4_4ar2l"]
|
||||
[ext_resource type="Script" uid="uid://ca320x55f2h3y" path="res://ui/room_layout.gd" id="6_dicmx"]
|
||||
[ext_resource type="PackedScene" uid="uid://c5c0mnwwuqruw" path="res://ui/RoomLayoutItem.tscn" id="7_ncki6"]
|
||||
[ext_resource type="Script" uid="uid://dm5remdyomnc4" path="res://ui/logic_graph.gd" id="8_gu74o"]
|
||||
|
||||
[node name="OperatorConsole" type="Control" unique_id=1959910901]
|
||||
propagate_maximum_size = true
|
||||
clip_contents = true
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_k8li0")
|
||||
database = ExtResource("2_qhjp7")
|
||||
room = ExtResource("3_prnev")
|
||||
|
||||
[node name="RoomController" type="Node" parent="." unique_id=314194706]
|
||||
script = ExtResource("1_vinxr")
|
||||
|
||||
[node name="RoomSimulator" type="Node" parent="." unique_id=1394335779]
|
||||
script = ExtResource("4_4ar2l")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1014582732]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer" unique_id=835801638]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TitleLabel" type="Label" parent="MarginContainer/VBoxContainer" unique_id=535818399]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScenarioBar" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=219831870]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScenarioLabel" type="Label" parent="MarginContainer/VBoxContainer/ScenarioBar" unique_id=1395073146]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScenarioSelect" type="OptionButton" parent="MarginContainer/VBoxContainer/ScenarioBar" unique_id=1960308578]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ActionBar" type="HBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=525952292]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="LoadButton" type="Button" parent="MarginContainer/VBoxContainer/ActionBar" unique_id=433362026]
|
||||
layout_mode = 2
|
||||
text = "Load"
|
||||
|
||||
[node name="ValidateButton" type="Button" parent="MarginContainer/VBoxContainer/ActionBar" unique_id=1164666775]
|
||||
layout_mode = 2
|
||||
text = "Validate"
|
||||
|
||||
[node name="PrepButton" type="Button" parent="MarginContainer/VBoxContainer/ActionBar" unique_id=847661533]
|
||||
layout_mode = 2
|
||||
text = "Prep"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="MarginContainer/VBoxContainer" unique_id=1151207993]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="RoomStatusLabel" type="Label" parent="MarginContainer/VBoxContainer" unique_id=745890717]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer/VBoxContainer" unique_id=128786743]
|
||||
custom_minimum_size = Vector2(1920, 200)
|
||||
propagate_maximum_size = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CabinetList" type="VBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer" unique_id=1328206568]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="MarginContainer/VBoxContainer" unique_id=2024560039]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer" unique_id=2017763907]
|
||||
layout_mode = 2
|
||||
text = "ROOM DEVICES"
|
||||
|
||||
[node name="MainViews" type="TabContainer" parent="MarginContainer/VBoxContainer" unique_id=2035710526]
|
||||
propagate_maximum_size = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
current_tab = 1
|
||||
|
||||
[node name="Physical" type="Control" parent="MarginContainer/VBoxContainer/MainViews" unique_id=1709144739]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 0
|
||||
|
||||
[node name="LayoutWorkspace" type="HBoxContainer" parent="MarginContainer/VBoxContainer/MainViews/Physical" unique_id=165485620]
|
||||
propagate_maximum_size = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_bottom = 61.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="RoomLayoutPanel" type="PanelContainer" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace" unique_id=1890208727]
|
||||
custom_minimum_size = Vector2(0, 300)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="RoomLayout" type="Control" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/RoomLayoutPanel" unique_id=1755582596]
|
||||
layout_mode = 2
|
||||
script = ExtResource("6_dicmx")
|
||||
item_scene = ExtResource("7_ncki6")
|
||||
|
||||
[node name="PropertyPanel" type="PanelContainer" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace" unique_id=1130312040]
|
||||
custom_minimum_size = Vector2(300, 0)
|
||||
custom_maximum_size = Vector2(300, -1)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel" unique_id=1503925230]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer" unique_id=1844850543]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PropertiesTitle" type="Label" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=1868518001]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SelectedLabel" type="Label" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=425349153]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=540873004]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="XLabel" type="Label" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=1395648922]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="XSpinBox" type="SpinBox" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=212457245]
|
||||
layout_mode = 2
|
||||
min_value = -2000.0
|
||||
max_value = 5000.0
|
||||
|
||||
[node name="YLabel" type="Label" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=449512311]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="YSpinBox" type="SpinBox" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=539657259]
|
||||
layout_mode = 2
|
||||
min_value = -2000.0
|
||||
max_value = 5000.0
|
||||
|
||||
[node name="RotationLabel" type="Label" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=1558308543]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="RotationSpinBox" type="SpinBox" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=300843311]
|
||||
layout_mode = 2
|
||||
min_value = -360.0
|
||||
max_value = 360.0
|
||||
|
||||
[node name="SnapCheckBox" type="CheckBox" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=83220102]
|
||||
layout_mode = 2
|
||||
button_pressed = true
|
||||
text = "Snap to Grid"
|
||||
|
||||
[node name="GridLabel" type="Label" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=1014679681]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="GridSpinBox" type="SpinBox" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=1237291196]
|
||||
layout_mode = 2
|
||||
min_value = 1.0
|
||||
max_value = 200.0
|
||||
value = 1.0
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=200431526]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="DirtyLabel" type="Label" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=1190553142]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SaveButton" type="Button" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=839924948]
|
||||
layout_mode = 2
|
||||
text = "SAVE ROOM"
|
||||
|
||||
[node name="RevertButton" type="Button" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=1355534065]
|
||||
layout_mode = 2
|
||||
text = "REVERT"
|
||||
|
||||
[node name="ShowConnectionsCheckBox" type="CheckBox" parent="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer" unique_id=309406547]
|
||||
layout_mode = 2
|
||||
button_pressed = true
|
||||
text = "Show Connections"
|
||||
|
||||
[node name="Logic" type="Control" parent="MarginContainer/VBoxContainer/MainViews" unique_id=1771194381]
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 1
|
||||
|
||||
[node name="AutoArrangeButton" type="Button" parent="MarginContainer/VBoxContainer/MainViews/Logic" unique_id=621962605]
|
||||
layout_mode = 0
|
||||
offset_left = 1786.0
|
||||
offset_top = -29.0
|
||||
offset_right = 1917.0
|
||||
offset_bottom = 2.0
|
||||
text = "AUTO ARRANGE"
|
||||
|
||||
[node name="LogicGraph" type="GraphEdit" parent="MarginContainer/VBoxContainer/MainViews/Logic" unique_id=40506474]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
scroll_offset = Vector2(-40, -40)
|
||||
script = ExtResource("8_gu74o")
|
||||
|
||||
[node name="DeviceList" type="VBoxContainer" parent="MarginContainer/VBoxContainer" unique_id=1469097889]
|
||||
custom_minimum_size = Vector2(0, 150)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HSeparator3" type="HSeparator" parent="MarginContainer/VBoxContainer" unique_id=1833639349]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ValidationOutput" type="RichTextLabel" parent="MarginContainer/VBoxContainer" unique_id=287181262]
|
||||
custom_minimum_size = Vector2(0, 100)
|
||||
custom_maximum_size = Vector2(-1, 100)
|
||||
layout_mode = 2
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/ActionBar/LoadButton" to="." method="_on_load_button_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/ActionBar/ValidateButton" to="." method="_on_validate_button_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/ActionBar/PrepButton" to="." method="_on_prep_button_pressed"]
|
||||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/XSpinBox" to="." method="_on_x_spinbox_value_changed"]
|
||||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/YSpinBox" to="." method="_on_y_spinbox_value_changed"]
|
||||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/RotationSpinBox" to="." method="_on_rotation_spinbox_value_changed"]
|
||||
[connection signal="toggled" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/SnapCheckBox" to="." method="_on_snap_check_box_toggled"]
|
||||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/GridSpinBox" to="." method="_on_grid_spinbox_value_changed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/SaveButton" to="." method="_on_save_button_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/RevertButton" to="." method="_on_revert_button_pressed"]
|
||||
[connection signal="toggled" from="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/PropertyPanel/MarginContainer/VBoxContainer/ShowConnectionsCheckBox" to="MarginContainer/VBoxContainer/MainViews/Physical/LayoutWorkspace/RoomLayoutPanel/RoomLayout" method="_on_show_connections_check_box_toggled"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/MainViews/Logic/AutoArrangeButton" to="." method="_on_auto_arrange_button_pressed"]
|
||||
@@ -0,0 +1,28 @@
|
||||
[gd_scene format=3 uid="uid://duvm1qwhoqq2t"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c5k1co6ww5flo" path="res://operator/operator_console.gd" id="1_k8li0"]
|
||||
[ext_resource type="Script" uid="uid://dbe24sbmbh6tt" path="res://core/runtime/room_controller.gd" id="1_vinxr"]
|
||||
[ext_resource type="Resource" uid="uid://8qqlypjp3hd4" path="res://data/project_database.tres" id="2_qhjp7"]
|
||||
[ext_resource type="Resource" uid="uid://dgc35ind56yxm" path="res://data/rooms/arcade_room.tres" id="3_prnev"]
|
||||
[ext_resource type="PackedScene" uid="uid://d0c4psurpl2f2" path="res://editor/workspace/EscapeRoomWorkspace.tscn" id="5_prnev"]
|
||||
|
||||
[node name="OperatorConsole" type="Control" unique_id=1959910901]
|
||||
propagate_maximum_size = true
|
||||
clip_contents = true
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_k8li0")
|
||||
database = ExtResource("2_qhjp7")
|
||||
room = ExtResource("3_prnev")
|
||||
|
||||
[node name="RoomController" type="Node" parent="." unique_id=314194706]
|
||||
script = ExtResource("1_vinxr")
|
||||
|
||||
[node name="OperatorControls" type="Node" parent="." unique_id=475021737]
|
||||
|
||||
[node name="EscapeRoomWorkspace" parent="." unique_id=1163239148 instance=ExtResource("5_prnev")]
|
||||
layout_mode = 1
|
||||
@@ -0,0 +1,103 @@
|
||||
extends Control
|
||||
var connection: Node
|
||||
var busy := false
|
||||
var status: Label
|
||||
var history: RichTextLabel
|
||||
var prepare: Button
|
||||
var start: Button
|
||||
var reset: Button
|
||||
var message: Label
|
||||
var confirm: ConfirmationDialog
|
||||
|
||||
func _ready() -> void:
|
||||
connection = preload("res://core/network/room_connection.gd").new()
|
||||
add_child(connection)
|
||||
connection.configure("operator")
|
||||
var center := CenterContainer.new()
|
||||
center.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
add_child(center)
|
||||
var column := VBoxContainer.new()
|
||||
column.custom_minimum_size = Vector2(1050, 0)
|
||||
column.add_theme_constant_override("separation", 18)
|
||||
center.add_child(column)
|
||||
var title := Label.new()
|
||||
title.text = "ARCADE ROOM CONTROL"
|
||||
title.add_theme_font_size_override("font_size", 42)
|
||||
column.add_child(title)
|
||||
status = Label.new()
|
||||
status.add_theme_font_size_override("font_size", 25)
|
||||
column.add_child(status)
|
||||
var row := HBoxContainer.new()
|
||||
column.add_child(row)
|
||||
prepare = add_button(row, "Prepare Pac-Man", func(): command("prepare"))
|
||||
start = add_button(row, "Start Game", func(): command("start"))
|
||||
reset = add_button(row, "Reset Cabinet…", func(): confirm.popup_centered())
|
||||
confirm = ConfirmationDialog.new()
|
||||
confirm.dialog_text = "Unload the current game and reset this cabinet's room session?"
|
||||
confirm.confirmed.connect(func(): command("reset"))
|
||||
add_child(confirm)
|
||||
message = Label.new()
|
||||
message.text = "Cabinet 01 quick controls • Open the controller URL in a browser for all cabinets"
|
||||
column.add_child(message)
|
||||
history = RichTextLabel.new()
|
||||
history.custom_minimum_size = Vector2(1050, 380)
|
||||
history.add_theme_font_size_override("normal_font_size", 20)
|
||||
column.add_child(history)
|
||||
var hint := Label.new()
|
||||
hint.text = "Accepted GPIO output does not confirm physical coin delivery.\nClosing this window leaves the room controller running. Escape closes this app."
|
||||
column.add_child(hint)
|
||||
set_buttons(false, false, false)
|
||||
var timer := Timer.new()
|
||||
timer.wait_time = 1.0
|
||||
timer.timeout.connect(refresh)
|
||||
add_child(timer)
|
||||
timer.start()
|
||||
refresh()
|
||||
|
||||
func add_button(parent: Node, text: String, callback: Callable) -> Button:
|
||||
var button := Button.new()
|
||||
button.text = text
|
||||
button.add_theme_font_size_override("font_size", 24)
|
||||
button.pressed.connect(callback)
|
||||
parent.add_child(button)
|
||||
return button
|
||||
|
||||
func set_buttons(can_prepare: bool, can_start: bool, can_reset: bool) -> void:
|
||||
prepare.disabled = not can_prepare
|
||||
start.disabled = not can_start
|
||||
reset.disabled = not can_reset
|
||||
|
||||
func display(state: Dictionary) -> void:
|
||||
if state.has("error"):
|
||||
status.text = "CONTROLLER UNAVAILABLE\n" + str(state.error)
|
||||
set_buttons(false, false, false)
|
||||
return
|
||||
var pending := false
|
||||
for item in state.commands:
|
||||
if item.status == "queued": pending = true
|
||||
var available: bool = state.online and not pending
|
||||
set_buttons(available and state.phase in ["idle", "won", "lost", "needs_prepare"], available and state.phase == "ready", available)
|
||||
status.text = "Cabinet 01: %s | %s\nGame: %s | GPIO mode: %s | Agent: %s\nReward: %s" % ["ONLINE" if state.online else "OFFLINE", str(state.phase).to_upper(), state.get("game", "pacman"), state.gpio, state.version, state.reward]
|
||||
history.text = "EVENT HISTORY\n"
|
||||
for item in state.history:
|
||||
history.text += "%s %s\n" % [Time.get_datetime_string_from_unix_time(int(item.time)).replace("T", " ") + " UTC", item.message]
|
||||
history.scroll_to_line(history.get_line_count())
|
||||
|
||||
func refresh() -> void:
|
||||
if busy: return
|
||||
busy = true
|
||||
var state: Dictionary = await connection.post("/operator/state")
|
||||
busy = false
|
||||
display(state)
|
||||
|
||||
func command(action: String) -> void:
|
||||
if busy: return
|
||||
busy = true
|
||||
set_buttons(false, false, false)
|
||||
var payload := {"action": action, "cabinet": "cabinet_01"}
|
||||
if action == "prepare": payload = {"action": "prepare_scenario", "scenario": "proof_of_concept"}
|
||||
var state: Dictionary = await connection.post("/operator/command", payload)
|
||||
busy = false
|
||||
if state.has("error"): message.text = str(state.error)
|
||||
else: message.text = "Command queued; waiting for cabinet acknowledgement"
|
||||
display(state)
|
||||
@@ -0,0 +1 @@
|
||||
uid://dxiyqt7t5kys3
|
||||
@@ -0,0 +1,355 @@
|
||||
extends Control
|
||||
|
||||
|
||||
@export_group("Project")
|
||||
@export var database: ProjectDatabase
|
||||
@export var room: RoomDefinition
|
||||
|
||||
|
||||
@export_group("Runtime Defaults")
|
||||
@export var default_scenario_id: StringName = &"two_cabinet_test"
|
||||
|
||||
|
||||
@onready var room_controller: RoomController = (
|
||||
$RoomController
|
||||
)
|
||||
|
||||
@onready var editor_workspace: EscapeRoomWorkspace = (
|
||||
$MarginContainer/VBoxContainer/
|
||||
EditorArea/EscapeRoomWorkspace
|
||||
)
|
||||
|
||||
@onready var runtime_scenario_select: OptionButton = (
|
||||
$MarginContainer/VBoxContainer/
|
||||
OperatorBar/RuntimeScenarioSelect
|
||||
)
|
||||
|
||||
@onready var room_status_label: Label = (
|
||||
$MarginContainer/VBoxContainer/
|
||||
OperatorBar/RoomStatusLabel
|
||||
)
|
||||
|
||||
@onready var cabinet_status_container: VBoxContainer = (
|
||||
$MarginContainer/VBoxContainer/
|
||||
CabinetStatusContainer
|
||||
)
|
||||
|
||||
|
||||
var runtime_scenario_ids: Array[StringName] = []
|
||||
var cabinet_status_labels: Dictionary = {}
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if database == null:
|
||||
push_error(
|
||||
"OperatorConsole has no ProjectDatabase assigned."
|
||||
)
|
||||
return
|
||||
|
||||
if room == null:
|
||||
push_error(
|
||||
"OperatorConsole has no RoomDefinition assigned."
|
||||
)
|
||||
return
|
||||
|
||||
room_controller.configure(
|
||||
database,
|
||||
room
|
||||
)
|
||||
|
||||
_connect_room_controller_signals()
|
||||
|
||||
_setup_editor_workspace()
|
||||
|
||||
_populate_runtime_scenarios()
|
||||
|
||||
|
||||
func _connect_room_controller_signals() -> void:
|
||||
room_controller.scenario_loaded.connect(
|
||||
_on_runtime_scenario_loaded
|
||||
)
|
||||
|
||||
room_controller.validation_completed.connect(
|
||||
_on_runtime_validation_completed
|
||||
)
|
||||
|
||||
room_controller.cabinet_status_changed.connect(
|
||||
_on_cabinet_status_changed
|
||||
)
|
||||
|
||||
room_controller.room_status_changed.connect(
|
||||
_on_room_status_changed
|
||||
)
|
||||
|
||||
|
||||
func _setup_editor_workspace() -> void:
|
||||
if editor_workspace == null:
|
||||
return
|
||||
|
||||
if not editor_workspace.configure(
|
||||
database,
|
||||
room
|
||||
):
|
||||
push_error(
|
||||
"Failed to configure EscapeRoomWorkspace."
|
||||
)
|
||||
|
||||
|
||||
func _populate_runtime_scenarios() -> void:
|
||||
runtime_scenario_select.clear()
|
||||
runtime_scenario_ids.clear()
|
||||
|
||||
for scenario in database.scenarios:
|
||||
if scenario == null:
|
||||
continue
|
||||
|
||||
runtime_scenario_select.add_item(
|
||||
scenario.display_name
|
||||
)
|
||||
|
||||
runtime_scenario_ids.append(
|
||||
scenario.scenario_id
|
||||
)
|
||||
|
||||
if runtime_scenario_ids.is_empty():
|
||||
room_status_label.text = (
|
||||
"ROOM STATUS: NO SCENARIOS"
|
||||
)
|
||||
return
|
||||
|
||||
var default_index := 0
|
||||
|
||||
for index in range(
|
||||
runtime_scenario_ids.size()
|
||||
):
|
||||
if (
|
||||
runtime_scenario_ids[index]
|
||||
== default_scenario_id
|
||||
):
|
||||
default_index = index
|
||||
break
|
||||
|
||||
runtime_scenario_select.select(
|
||||
default_index
|
||||
)
|
||||
|
||||
_load_selected_runtime_scenario()
|
||||
|
||||
|
||||
func _load_selected_runtime_scenario() -> void:
|
||||
var index := runtime_scenario_select.selected
|
||||
|
||||
if (
|
||||
index < 0
|
||||
or
|
||||
index >= runtime_scenario_ids.size()
|
||||
):
|
||||
return
|
||||
|
||||
var scenario_id := (
|
||||
runtime_scenario_ids[index]
|
||||
)
|
||||
|
||||
room_controller.load_scenario(
|
||||
scenario_id
|
||||
)
|
||||
|
||||
|
||||
func _on_runtime_scenario_select_item_selected(
|
||||
_index: int
|
||||
) -> void:
|
||||
_load_selected_runtime_scenario()
|
||||
|
||||
|
||||
func _on_validate_room_button_pressed() -> void:
|
||||
room_controller.validate_active_scenario()
|
||||
|
||||
|
||||
func _on_prep_room_button_pressed() -> void:
|
||||
room_controller.prep_room()
|
||||
|
||||
|
||||
func _on_runtime_scenario_loaded(
|
||||
scenario: ScenarioDefinition
|
||||
) -> void:
|
||||
_rebuild_cabinet_status_list(
|
||||
scenario
|
||||
)
|
||||
|
||||
room_status_label.text = (
|
||||
"ROOM STATUS: LOADED — %s v%d"
|
||||
% [
|
||||
scenario.display_name,
|
||||
scenario.version
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
func _rebuild_cabinet_status_list(
|
||||
scenario: ScenarioDefinition
|
||||
) -> void:
|
||||
for child in cabinet_status_container.get_children():
|
||||
child.queue_free()
|
||||
|
||||
cabinet_status_labels.clear()
|
||||
|
||||
for assignment in scenario.assignments:
|
||||
if assignment == null:
|
||||
continue
|
||||
|
||||
_add_cabinet_status_row(
|
||||
assignment
|
||||
)
|
||||
|
||||
|
||||
func _add_cabinet_status_row(
|
||||
assignment: ScenarioAssignment
|
||||
) -> void:
|
||||
var panel := PanelContainer.new()
|
||||
var margin := MarginContainer.new()
|
||||
var row := HBoxContainer.new()
|
||||
var details := VBoxContainer.new()
|
||||
|
||||
var cabinet_label := Label.new()
|
||||
var game_label := Label.new()
|
||||
var variant_label := Label.new()
|
||||
var status_label := Label.new()
|
||||
|
||||
if assignment.cabinet != null:
|
||||
cabinet_label.text = (
|
||||
assignment.cabinet.display_name
|
||||
)
|
||||
else:
|
||||
cabinet_label.text = (
|
||||
"MISSING CABINET"
|
||||
)
|
||||
|
||||
if assignment.game != null:
|
||||
game_label.text = (
|
||||
"Game: %s"
|
||||
% assignment.game.display_name
|
||||
)
|
||||
else:
|
||||
game_label.text = (
|
||||
"Game: MISSING"
|
||||
)
|
||||
|
||||
variant_label.text = (
|
||||
"Variant: %s"
|
||||
% assignment.variant
|
||||
)
|
||||
|
||||
status_label.text = (
|
||||
"NOT PREPARED"
|
||||
)
|
||||
|
||||
status_label.horizontal_alignment = (
|
||||
HORIZONTAL_ALIGNMENT_RIGHT
|
||||
)
|
||||
|
||||
status_label.custom_minimum_size.x = (
|
||||
160.0
|
||||
)
|
||||
|
||||
details.add_child(
|
||||
cabinet_label
|
||||
)
|
||||
|
||||
details.add_child(
|
||||
game_label
|
||||
)
|
||||
|
||||
details.add_child(
|
||||
variant_label
|
||||
)
|
||||
|
||||
var spacer := Control.new()
|
||||
|
||||
spacer.size_flags_horizontal = (
|
||||
Control.SIZE_EXPAND_FILL
|
||||
)
|
||||
|
||||
row.add_child(
|
||||
details
|
||||
)
|
||||
|
||||
row.add_child(
|
||||
spacer
|
||||
)
|
||||
|
||||
row.add_child(
|
||||
status_label
|
||||
)
|
||||
|
||||
margin.add_child(
|
||||
row
|
||||
)
|
||||
|
||||
panel.add_child(
|
||||
margin
|
||||
)
|
||||
|
||||
cabinet_status_container.add_child(
|
||||
panel
|
||||
)
|
||||
|
||||
if assignment.cabinet != null:
|
||||
cabinet_status_labels[
|
||||
assignment.cabinet.cabinet_id
|
||||
] = status_label
|
||||
|
||||
|
||||
func _on_runtime_validation_completed(
|
||||
result: ValidationResult
|
||||
) -> void:
|
||||
if result.is_valid():
|
||||
room_status_label.text = (
|
||||
"ROOM STATUS: %s"
|
||||
% result.get_summary()
|
||||
)
|
||||
else:
|
||||
room_status_label.text = (
|
||||
"ROOM STATUS: INVALID — %s"
|
||||
% result.get_summary()
|
||||
)
|
||||
|
||||
for error in result.errors:
|
||||
print(
|
||||
"[RUNTIME VALIDATION] ERROR: ",
|
||||
error
|
||||
)
|
||||
|
||||
for warning in result.warnings:
|
||||
print(
|
||||
"[RUNTIME VALIDATION] WARNING: ",
|
||||
warning
|
||||
)
|
||||
|
||||
|
||||
func _on_cabinet_status_changed(
|
||||
cabinet_id: StringName,
|
||||
status: StringName
|
||||
) -> void:
|
||||
if not cabinet_status_labels.has(
|
||||
cabinet_id
|
||||
):
|
||||
return
|
||||
|
||||
var label: Label = (
|
||||
cabinet_status_labels[
|
||||
cabinet_id
|
||||
]
|
||||
)
|
||||
|
||||
label.text = String(
|
||||
status
|
||||
)
|
||||
|
||||
|
||||
func _on_room_status_changed(
|
||||
status: StringName
|
||||
) -> void:
|
||||
room_status_label.text = (
|
||||
"ROOM STATUS: %s"
|
||||
% status
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
uid://c5k1co6ww5flo
|
||||
Reference in new issue
Block a user