mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-30 16:01:53 +08:00
feat: 添加暂停面板类名并优化字段显示逻辑
修复TipBox销毁时的动画冲突问题 重构游戏重启逻辑以包含库存保存 移除GameOver面板中的重复库存保存代码 优化UIState中的字段显示控制和提示清除功能
This commit is contained in:
@@ -15,6 +15,8 @@ static var tips: VBoxContainer
|
||||
static var itemsContainer: Control
|
||||
static var energyContainer: Control
|
||||
|
||||
static var showingFields: bool = false
|
||||
|
||||
func _ready():
|
||||
bossbar = $%bossbar
|
||||
panels = $%panels
|
||||
@@ -44,17 +46,22 @@ func _physics_process(_delta):
|
||||
itemsContainer.visible = true
|
||||
energyContainer.visible = true
|
||||
if !fieldsAnimator.is_playing():
|
||||
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 showingFields:
|
||||
if Input.is_action_just_released("showFields") || !(currentPanel is PausePanel):
|
||||
showingFields = false
|
||||
fieldsAnimator.play("hide")
|
||||
else:
|
||||
if Input.is_action_just_pressed("showFields") || currentPanel is PausePanel:
|
||||
showingFields = true
|
||||
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_pressed("pause"):
|
||||
if currentPanel:
|
||||
if currentPanel is MakeFeedPanel:
|
||||
@@ -96,5 +103,10 @@ static func closeCurrentPanel():
|
||||
static func showTip(text: String, messageType: TipBox.MessageType = TipBox.MessageType.INFO):
|
||||
var box = TipBox.create(text, messageType)
|
||||
tips.add_child(box)
|
||||
await box.animator.animation_finished
|
||||
await TickTool.millseconds(500 * len(text))
|
||||
box.destroy()
|
||||
static func clearTips():
|
||||
for child in tips.get_children():
|
||||
if child is TipBox:
|
||||
child.destroy()
|
||||
|
||||
Reference in New Issue
Block a user