1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-05 03:07:12 +08:00

feat: 为角色添加显示名称并完善面板功能

为熊、公鸡、母鸡等角色添加displayName属性
修改FullscreenPanelBase及相关面板以支持参数传递
完善GameOver面板显示凶手信息功能
调整部分角色的节点索引和状态栏位置
This commit is contained in:
2025-09-07 13:39:50 +08:00
parent b186382080
commit 47608ed847
11 changed files with 18 additions and 15 deletions
+1 -1
View File
@@ -260,7 +260,7 @@ func tryDie(by: BulletBase):
EffectController.create(preload("res://components/Effects/DeadBlood.tscn"), texture.global_position).shot()
await die()
if isPlayer() and UIState.player == self:
UIState.setPanel("GameOver")
UIState.setPanel("GameOver", [displayName, by.launcher.displayName])
func tryHeal(count: float):
if inventory[ItemStore.ItemType.APPLE] > 0 and health < fields.get(FieldStore.Entity.MAX_HEALTH):
inventory[ItemStore.ItemType.APPLE] -= 1
+3 -3
View File
@@ -9,8 +9,8 @@ func hidePanel():
await animator.animation_finished
visible = false
afterClose()
func showPanel():
beforeOpen()
func showPanel(args: Array = []):
beforeOpen(args)
visible = true
animator.play("show")
await animator.animation_finished
@@ -19,7 +19,7 @@ func _ready():
visible = false
# 钩子
func beforeOpen():
func beforeOpen(_args: Array = []):
pass
func afterClose():
pass
+2 -2
View File
@@ -64,13 +64,13 @@ func _physics_process(_delta):
if canOpen:
setPanel("Weapon")
static func setPanel(targetName: String = ""):
static func setPanel(targetName: String = "", args: Array = []):
currentPanel = null
for panel in panels.get_children():
if panel is FullscreenPanelBase:
if panel.name == targetName:
currentPanel = panel
panel.showPanel()
panel.showPanel(args)
else:
panel.hidePanel()
static func closeCurrentPanel():