mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 23:41:54 +08:00
refactor(UI): 优化字段显示逻辑和命名
将字段显示逻辑重构为独立的rebuildFields方法 简化字段名称使其更直观 移除不必要的输入条件检查
This commit is contained in:
@@ -47,12 +47,11 @@ func _physics_process(_delta):
|
||||
energyContainer.visible = true
|
||||
if !fieldsAnimator.is_playing():
|
||||
if showingFields:
|
||||
if Input.is_action_just_released("showFields") || !(currentPanel is PausePanel):
|
||||
if Input.is_action_just_pressed("showFields"):
|
||||
hideFields()
|
||||
else:
|
||||
if Input.is_action_just_pressed("showFields") || currentPanel is PausePanel:
|
||||
if Input.is_action_just_pressed("showFields"):
|
||||
showFields()
|
||||
|
||||
if Input.is_action_just_pressed("pause"):
|
||||
if currentPanel:
|
||||
if currentPanel is MakeFeedPanel:
|
||||
@@ -103,8 +102,7 @@ static func clearTips():
|
||||
if child is TipBox:
|
||||
child.destroy()
|
||||
|
||||
static func showFields():
|
||||
showingFields = true
|
||||
static func rebuildFields():
|
||||
for i in fields.get_children():
|
||||
fields.remove_child(i)
|
||||
for i in player.fields:
|
||||
@@ -112,6 +110,9 @@ static func showFields():
|
||||
fields.add_child(QuickUI.graySmallText(i))
|
||||
else:
|
||||
fields.add_child(FieldShow.create(i, player.fields[i], false, player, true))
|
||||
static func showFields():
|
||||
showingFields = true
|
||||
rebuildFields()
|
||||
fieldsAnimator.play("show")
|
||||
static func hideFields():
|
||||
showingFields = false
|
||||
|
||||
Reference in New Issue
Block a user