Add Table handles meals served before order taken

This commit is contained in:
JonShard
2026-07-30 11:29:28 +02:00
parent e9a7786cab
commit 19207e7f72
2 changed files with 17 additions and 3 deletions
+5 -2
View File
@@ -100,11 +100,14 @@ primary_duration = 35.0
[node name="Hob" parent="." unique_id=1687971542 instance=ExtResource("4_ctden")] [node name="Hob" parent="." unique_id=1687971542 instance=ExtResource("4_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.35077858, 0.50655985, -1.2833805) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.35077858, 0.50655985, -1.2833805)
[node name="Hob2" parent="." unique_id=1368146287 instance=ExtResource("4_ctden")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.24922144, 0.50655985, -1.2833805)
[node name="Sink" parent="." unique_id=2055277359 instance=ExtResource("13_o1b3t")] [node name="Sink" parent="." unique_id=2055277359 instance=ExtResource("13_o1b3t")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.24685252, 0.51461196, -1.2828919) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.84685254, 0.51461196, -1.2828919)
[node name="DirtStation" parent="." unique_id=160842153 instance=ExtResource("14_irf4n")] [node name="DirtStation" parent="." unique_id=160842153 instance=ExtResource("14_irf4n")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.7978771, 0.50655985, -1.2598276) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.3978771, 0.50655985, -1.2598276)
[node name="Counter" parent="." unique_id=1487893288 instance=ExtResource("15_di04w")] [node name="Counter" parent="." unique_id=1487893288 instance=ExtResource("15_di04w")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.94890714, 0.5115015, -1.3041471) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.94890714, 0.5115015, -1.3041471)
+12 -1
View File
@@ -104,6 +104,9 @@ func _get_plate_from_item(_item: Node) -> PlateController:
func _absorb_item_if_correct(_item: Node) -> void: func _absorb_item_if_correct(_item: Node) -> void:
if not _item:
return
# Get plate controller in childer of _item (hopefully a plate XRpickable) # Get plate controller in childer of _item (hopefully a plate XRpickable)
var plate_controller = _get_plate_from_item(_item) var plate_controller = _get_plate_from_item(_item)
if not plate_controller: if not plate_controller:
@@ -174,26 +177,34 @@ func _setState(newState: TableState) -> void:
_state_time = 5.0 _state_time = 5.0
_state_duration = 5.0 _state_duration = 5.0
customers.visible = false customers.visible = false
_state = newState
TableState.THINKING: TableState.THINKING:
_state_time = thinking_duration _state_time = thinking_duration
_state_duration = thinking_duration # Can't be done in _set_state(), will set duration inside timer _state_duration = thinking_duration # Can't be done in _set_state(), will set duration inside timer
_state = newState
TableState.ORDERING: TableState.ORDERING:
_state_time = ordering_duration _state_time = ordering_duration
_state_duration = ordering_duration _state_duration = ordering_duration
_state = newState
TableState.WAITING_PRIMARY: TableState.WAITING_PRIMARY:
_state_time = primary_duration _state_time = primary_duration
_state_duration = primary_duration _state_duration = primary_duration
_state = newState
# Absorm meals that were already in the table when the state starts
for zone in snap_zones:
_absorb_item_if_correct(zone.picked_up_object)
TableState.WAITING_FRIEND: TableState.WAITING_FRIEND:
_state_time = friend_duration _state_time = friend_duration
_state_duration = friend_duration _state_duration = friend_duration
_state = newState
TableState.EATING: TableState.EATING:
_state_time = eating_duration _state_time = eating_duration
_state_duration = eating_duration _state_duration = eating_duration
_set_snap_zones_enabled(false) _set_snap_zones_enabled(false)
_state = newState _state = newState
# When state timer is finished, do this stuff before moving to next state # When state timer is finished, do this stuff before moving to next state
func _state_end(oldState: TableState): func _state_end(oldState: TableState):
print("Table State END : ", TableState.keys()[oldState]) print("Table State END : ", TableState.keys()[oldState])