From c7957fb0f86d8f303b82defb2a72620389272ca8 Mon Sep 17 00:00:00 2001 From: cutekibry Date: Sun, 18 Feb 2024 19:17:45 +0800 Subject: [PATCH] =?UTF-8?q?refactor(base=5Flevel.gd):=20=E9=80=82=E9=85=8D?= =?UTF-8?q?=20level=5Fmenu=20=E6=96=B0=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- levels/base_level/base_level.gd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/levels/base_level/base_level.gd b/levels/base_level/base_level.gd index 5bc2eb1..476d320 100644 --- a/levels/base_level/base_level.gd +++ b/levels/base_level/base_level.gd @@ -181,18 +181,18 @@ func _exit_tree(): func _on_back_button_pressed(): var level_menu = LevelMenuScn.instantiate() - level_menu.init(chap_id, -1) get_tree().root.add_child(level_menu) + level_menu.init(chap_id) queue_free() func _on_next_level_button_pressed(): if self.lvl_id == LevelData.get_chapter_level_count(self.chap_id) - 1: var level_menu = LevelMenuScn.instantiate() - level_menu.init(chap_id + 1, -1) get_tree().root.add_child(level_menu) + level_menu.init(chap_id) else: var base_level = BaseLevelScn.instantiate() - base_level.init(chap_id, lvl_id + 1) + base_level.init(chap_id, lvl_id) get_tree().root.add_child(base_level) queue_free()