diff options
Diffstat (limited to 'client/menu/menu.gd')
-rw-r--r-- | client/menu/menu.gd | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/client/menu/menu.gd b/client/menu/menu.gd index 2c539bd9..c0d0fce6 100644 --- a/client/menu/menu.gd +++ b/client/menu/menu.gd @@ -59,7 +59,9 @@ func replace_menu(path: String): print("Replace menu: ", path) if popup != null: await popup.exit() await menu_anim_exit() - get_parent().add_child(load(path).instantiate()) + var new_popup = load(path).instantiate() + get_parent().add_child(new_popup) + if parent_menu != null: parent_menu.popup = new_popup queue_free() var focus_auto_changed := false @@ -86,7 +88,8 @@ func update_parent_menu(node: Node): if node is Menu: parent_menu = node elif node.get_parent() != null: update_parent_menu(node.get_parent()) -#func _input(_event): - #if Input.is_action_just_pressed("ui_cancel"): - #Sound.play_click() - #exit() +func _input(_event): + if popup != null: return + if Input.is_action_just_pressed("ui_cancel"): + Sound.play_click() + exit() |