mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-04 10:47:13 +08:00
feat(UI): 添加技能图标显示功能
在UI中添加技能图标容器,并为每个武器创建对应的技能图标 初始化武器冷却计时器,修复武器冷却时间未设置的问题
This commit is contained in:
@@ -111,6 +111,10 @@ func _ready():
|
||||
else:
|
||||
UIState.energyPercent.setCurrent(newEnergy)
|
||||
)
|
||||
for i in weapons:
|
||||
var icon: SkillIcon = preload("res://components/Abstracts/SkillIconBase.tscn").instantiate()
|
||||
icon.weapon = i
|
||||
UIState.skillIconContainer.add_child(icon)
|
||||
else:
|
||||
currentFocusedBoss = get_tree().get_nodes_in_group("players")[0]
|
||||
applyLevel()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
extends PanelContainer
|
||||
class_name SkillIcon
|
||||
|
||||
@export var weapon: Weapon = null;
|
||||
|
||||
|
||||
@@ -13,12 +13,14 @@ static var currentPanel: FullscreenPanelBase = null
|
||||
static var panels: Control
|
||||
static var energyPercent: ColorBar
|
||||
static var itemCollect: VBoxContainer
|
||||
static var skillIconContainer: VBoxContainer
|
||||
|
||||
func _ready():
|
||||
bossbar = $"%bossbar"
|
||||
panels = $"%panels"
|
||||
energyPercent = $"%percent"
|
||||
itemCollect = $"%itemCollect"
|
||||
skillIconContainer = $"%skillContainer"
|
||||
func _process(_delta):
|
||||
bossbar.visible = !!bossbar.entity
|
||||
func _physics_process(_delta):
|
||||
|
||||
@@ -27,16 +27,17 @@ class_name Weapon
|
||||
@onready var updateButton: Button = $"%updateBtn"
|
||||
@onready var sounds: Node2D = $"%sounds"
|
||||
|
||||
var cooldownTimer = CooldownTimer.new()
|
||||
var cooldownTimer: CooldownTimer = null
|
||||
var originalStore: Dictionary = {}
|
||||
|
||||
func _ready():
|
||||
cooldownTimer = CooldownTimer.new()
|
||||
cooldownTimer.cooldown = cooldown
|
||||
originalStore = store
|
||||
updateButton.pressed.connect(
|
||||
func():
|
||||
apply(UIState.player)
|
||||
)
|
||||
cooldownTimer.cooldown = cooldown
|
||||
for i in sounds.get_children():
|
||||
i.process_mode = ProcessMode.PROCESS_MODE_ALWAYS
|
||||
rebuildInfo()
|
||||
|
||||
Reference in New Issue
Block a user