Skip to content

Commit

Permalink
feat(level_menu): 添加选章按钮的切换主题配色功能
Browse files Browse the repository at this point in the history
  • Loading branch information
cutekibry committed Feb 19, 2024
1 parent 9f14b11 commit 091e797
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion levels/chapter_menu/level_menu/level_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ extends Node2D

class_name LevelMenu

# const I_NUMBER = ["I","II","III","VI","V"]

const LevelButtonScn := preload("res://levels/chapter_menu/level_menu/level_button/level_button.tscn")
const BaseLevelScn := preload("res://levels/base_level/base_level.tscn")
Expand Down Expand Up @@ -44,12 +43,14 @@ func _on_button_enter_level(chap_id: int, lvl_id: int) -> void:
func _on_previous_chapter_button_pressed():
self.chapter_id -= 1
$UI/Title.text = LevelData.CHAP_NAMES[chapter_id]["name-en"]
ImageLib.change_theme(ImageLib.COLOR_THEMES[ImageLib.COLOR_THEMES.find(ImageLib.theme_to) - 1], LevelMenuCamera.MOVE_TIME)
$UI/PreviousChapterButton.set_disabled(true)
$UI/NextChapterButton.set_disabled(true)


func _on_next_chapter_button_pressed():
self.chapter_id += 1
ImageLib.change_theme(ImageLib.COLOR_THEMES[ImageLib.COLOR_THEMES.find(ImageLib.theme_to) + 1], LevelMenuCamera.MOVE_TIME)
$UI/Title.text = LevelData.CHAP_NAMES[chapter_id]["name-en"]
$UI/PreviousChapterButton.set_disabled(true)
$UI/NextChapterButton.set_disabled(true)
Expand Down

0 comments on commit 091e797

Please sign in to comment.