1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat(UI): 添加初始增益选择面板功能

实现初始增益选择面板的创建和显示逻辑,包括:
- 新增SelectInitialFeed面板场景和脚本
- 修改CompilingTip面板结束后跳转到选择面板
- 在ComponentManager中添加面板管理功能
- 优化UIState的面板加载和切换逻辑
This commit is contained in:
2026-01-30 11:44:42 +08:00
parent 2db1f7ac26
commit 0e4d6e6fe3
8 changed files with 56 additions and 42 deletions
+2 -1
View File
@@ -9,4 +9,5 @@ func afterOpen(_args: Array = []):
(effect.sounds.get_node("spawn") as AudioStreamPlayer2D).volume_db = - INF
effect.shot()
await TickTool.millseconds(3000)
UIState.closeCurrentPanel()
await TickTool.frame()
UIState.setPanel("SelectInitialFeed")
@@ -0,0 +1,11 @@
@tool
extends FullscreenPanelBase
@onready var initialFeedSelection: HBoxContainer = $%initialFeedSelection
func beforeOpen(_args: Array = []):
for feed in initialFeedSelection.get_children():
feed.queue_free()
for feed in ComponentManager.feeds:
var card = feed.instantiate() as Feed
initialFeedSelection.add_child(card)
@@ -0,0 +1 @@
uid://d02nijqx4oagh
+7
View File
@@ -23,6 +23,11 @@ func _ready():
items = $%items
fields = $%fields
fieldsAnimator = $%fieldsAnimator
await get_tree().process_frame
for panel in ComponentManager.panels:
panel = ComponentManager.getPanel(panel).instantiate() as FullscreenPanelBase
panel.hide()
panels.add_child(panel)
setPanel("Starter")
func _process(_delta):
bossbar.visible = !!bossbar.entity
@@ -72,6 +77,8 @@ static func setPanel(targetName: String = "", args: Array = []):
panel.showPanel(args)
else:
panel.hidePanel()
if !currentPanel:
print("没有叫%s的面板" % targetName)
static func closeCurrentPanel():
setPanel()
static func showTip(text: String, messageType: TipBox.MessageType = TipBox.MessageType.INFO):
@@ -9,6 +9,7 @@ static var summons = {}
static var effects = {}
static var feeds = []
static var obstacles = {}
static var panels = {}
static var uiComponents = {}
static var themes = {}
static var fieldTextures = {}
@@ -29,6 +30,8 @@ static func init():
feeds.append(load(i))
for i in DirTool.listdir("res://components/Obstacles"):
obstacles[DirTool.getBasenameWithoutExtension(i)] = load(i)
for i in DirTool.listdir("res://components/Scenes/FullscreenPanels"):
panels[DirTool.getBasenameWithoutExtension(i)] = load(i)
for i in DirTool.listdir("res://components/UI"):
uiComponents[DirTool.getBasenameWithoutExtension(i)] = load(i)
for i in DirTool.listdir("res://themes"):
@@ -53,6 +56,8 @@ static func getFeed(i: int) -> PackedScene:
return null
static func getObstacle(t: String) -> PackedScene:
return MathTool.priority(obstacles.get(t, false), load("res://components/Obstacles/%s.tscn" % t))
static func getPanel(t: String) -> PackedScene:
return MathTool.priority(panels.get(t, false), load("res://components/Scenes/FullscreenPanels/%s.tscn" % t))
static func getUIComponent(t: String) -> PackedScene:
return MathTool.priority(uiComponents.get(t, false), load("res://components/UI/%s.tscn" % t))
static func getTheme(t: String) -> Theme: