Skip to content

Commit

Permalink
refactor(base_level.gd): 适配 level_menu 新方法
Browse files Browse the repository at this point in the history
  • Loading branch information
cutekibry committed Feb 18, 2024
1 parent 41de333 commit c7957fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions levels/base_level/base_level.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit c7957fb

Please sign in to comment.