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

feat(UI): 添加教程开关按钮并优化面板控制逻辑

- 在Starter面板中添加新手教程开关按钮
- 为MakeFeed和SelectInitialFeed面板添加class_name
- 重构UIState中的输入处理逻辑,修复面板切换问题
This commit is contained in:
2026-05-03 16:43:27 +08:00
parent 4d19c61023
commit bc89c93feb
5 changed files with 51 additions and 27 deletions
+29 -27
View File
@@ -43,6 +43,35 @@ func _physics_process(_delta):
bossbar.visible = true
itemsContainer.visible = true
energyContainer.visible = true
if Input.is_action_just_pressed("showFields"):
for i in fields.get_children():
fields.remove_child(i)
for i in player.fields:
if player.fields[i] == EntityBase.TITLE_FLAG:
fields.add_child(QuickUI.graySmallText(i))
else:
fields.add_child(FieldShow.create(i, player.fields[i], false, player, true))
fieldsAnimator.play("show")
if Input.is_action_just_released("showFields"):
fieldsAnimator.play("hide")
if Input.is_action_just_pressed("pause"):
if currentPanel:
if currentPanel is MakeFeedPanel:
currentPanel.skipBtn.pressed.emit()
else:
closeCurrentPanel()
else:
setPanel("Pause")
if Input.is_action_just_pressed("openWeapon"):
var canOpen = true
if currentPanel:
if currentPanel.name == "Weapon":
closeCurrentPanel()
canOpen = false
elif ["MakeFeed", "GameOver"].has(currentPanel.name):
canOpen = false
if canOpen:
setPanel("Weapon")
else:
bossbar.visible = false
itemsContainer.visible = false
@@ -51,33 +80,6 @@ func _physics_process(_delta):
WorldManager.rootNode.process_mode = Node.PROCESS_MODE_DISABLED
else:
WorldManager.rootNode.process_mode = Node.PROCESS_MODE_INHERIT
if Input.is_action_just_pressed("showFields"):
for i in fields.get_children():
fields.remove_child(i)
for i in player.fields:
if player.fields[i] == EntityBase.TITLE_FLAG:
fields.add_child(QuickUI.graySmallText(i))
else:
fields.add_child(FieldShow.create(i, player.fields[i], false, player, true))
fieldsAnimator.play("show")
if Input.is_action_just_released("showFields"):
fieldsAnimator.play("hide")
if Input.is_action_just_pressed("pause"):
if currentPanel:
if currentPanel.name != "MakeFeed":
closeCurrentPanel()
else:
setPanel("Pause")
if Input.is_action_just_pressed("openWeapon"):
var canOpen = true
if currentPanel:
if currentPanel.name == "Weapon":
closeCurrentPanel()
canOpen = false
elif ["MakeFeed", "GameOver"].has(currentPanel.name):
canOpen = false
if canOpen:
setPanel("Weapon")
static func setPanel(targetName: String = "", args: Array = []):
currentPanel = null