diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-10-10 14:34:26 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-10-10 14:34:26 +0200 |
| commit | 5dad3a445390af6abb1b5e60b390f9aa6649096f (patch) | |
| tree | 57104bf7992901fd7bbb01999b9ae02a9facb92e | |
| parent | f35edbd85b87090b64434a6996e1623ea5e76052 (diff) | |
| download | hurrycurry-5dad3a445390af6abb1b5e60b390f9aa6649096f.tar hurrycurry-5dad3a445390af6abb1b5e60b390f9aa6649096f.tar.bz2 hurrycurry-5dad3a445390af6abb1b5e60b390f9aa6649096f.tar.zst | |
Wait for scene transition when exiting game menu (fix #448)
| -rw-r--r-- | client/gui/menus/game.gd | 2 | ||||
| -rw-r--r-- | client/gui/menus/menu.gd | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/client/gui/menus/game.gd b/client/gui/menus/game.gd index 82eff30c..0060ede7 100644 --- a/client/gui/menus/game.gd +++ b/client/gui/menus/game.gd @@ -66,7 +66,7 @@ func _menu_cover(state): update_mouse_capture() func _menu_exit(): - super() + await super() Input.mouse_mode = Input.MOUSE_MODE_VISIBLE func update_mouse_capture(): diff --git a/client/gui/menus/menu.gd b/client/gui/menus/menu.gd index af13d709..5933f777 100644 --- a/client/gui/menus/menu.gd +++ b/client/gui/menus/menu.gd @@ -89,6 +89,7 @@ func exit(): if transition and transition.fading: push_error("menu exit() called twice") return + if popup != null: await popup.exit() await self._menu_exit() if previous_path != null: replace_menu(previous_path) @@ -105,11 +106,11 @@ func replace_menu(path: String, data_ = null, prev_path = null): # prev_path: St if popup != null: await popup.exit() _disable_recursive(self, true) await _menu_exit() - var new_popup: Menu = load(path).instantiate() - new_popup.data = data_ - if prev_path != null: new_popup.previous_path = prev_path - get_parent().add_child(new_popup) - if parent_menu != null: parent_menu.popup = new_popup + var new_menu: Menu = load(path).instantiate() + new_menu.data = data_ + if prev_path != null: new_menu.previous_path = prev_path + get_parent().add_child(new_menu) + if parent_menu != null: parent_menu.popup = new_menu queue_free() var focus_auto_changed := false |