extends CanvasLayer @onready var grid_selector: GridSelector = get_tree().get_first_node_in_group("grid_selector") func _ready() -> void: visible = false func _input(event: InputEvent) -> void: if not visible: return if event.is_action_pressed("left_click"): for button: Button in $PanelContainer/VBoxContainer.get_children(): if button.has_focus(): button.pressed.emit() break if event.is_action_pressed("menu") or event.is_action_pressed("right_click"): visible = false grid_selector.process_mode = Node.PROCESS_MODE_INHERIT func _on_button_pressed() -> void: visible = false var dice_throw_scene = load("res://stage/dice_throw/dice_throw.tscn") var dice_throw = dice_throw_scene.instantiate() get_tree().root.add_child(dice_throw) dice_throw.position -= dice_throw.size * 0.5 dice_throw.throw_finished.connect(func(): dice_throw.queue_free() get_tree().current_scene.process_mode = PROCESS_MODE_INHERIT grid_selector.process_mode = PROCESS_MODE_INHERIT grid_selector.current_state = grid_selector.state_cube_placement ) get_tree().current_scene.process_mode = PROCESS_MODE_DISABLED func _on_button_2_pressed() -> void: visible = false Network.set_current_player(Network.player_order[ (Network.player_order.find(Network.current_player.id) + 1) % Network.player_order.size() ]) grid_selector.process_mode = Node.PROCESS_MODE_INHERIT