mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat: 更新饲料和面板逻辑,添加香蕉饲料,重构UI组件和状态管理
This commit is contained in:
@@ -6,12 +6,29 @@ class_name UIState
|
||||
|
||||
static var player: EntityBase = null
|
||||
static var bossbar: EntityStateBar
|
||||
static var currentPanel: FullscreenPanelBase = null
|
||||
static var panels: Control
|
||||
|
||||
func _ready():
|
||||
bossbar = $"%bossbar"
|
||||
panels = $"%panels"
|
||||
func _process(_delta):
|
||||
bossbar.visible = !!bossbar.entity
|
||||
func _physics_process(_delta):
|
||||
if is_instance_valid(player):
|
||||
baseball.count = player.inventory[ItemStore.ItemType.BASEBALL]
|
||||
basketball.count = player.inventory[ItemStore.ItemType.BASKETBALL]
|
||||
if currentPanel:
|
||||
WorldManager.rootNode.process_mode = Node.PROCESS_MODE_DISABLED
|
||||
else:
|
||||
WorldManager.rootNode.process_mode = Node.PROCESS_MODE_INHERIT
|
||||
|
||||
static func setPanel(targetName: String = ""):
|
||||
currentPanel = null
|
||||
for panel in panels.get_children():
|
||||
if panel is FullscreenPanelBase:
|
||||
if panel.name == targetName:
|
||||
currentPanel = panel
|
||||
panel.showPanel()
|
||||
else:
|
||||
panel.hidePanel()
|
||||
|
||||
Reference in New Issue
Block a user