feat: implement powerup inventory UI to display and manage player powerups with dynamic button states, levels, and shortcuts.
This commit is contained in:
@@ -96,19 +96,6 @@ func _setup_btn(effect_id: int, btn: Button):
|
|||||||
lvl_lbl.text = "" # Hidden initially
|
lvl_lbl.text = "" # Hidden initially
|
||||||
btn.add_child(lvl_lbl)
|
btn.add_child(lvl_lbl)
|
||||||
|
|
||||||
# Add Cooldown Label
|
|
||||||
if not btn.has_node("CooldownLabel"):
|
|
||||||
var cd_lbl = Label.new()
|
|
||||||
cd_lbl.name = "CooldownLabel"
|
|
||||||
cd_lbl.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
|
||||||
cd_lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
|
||||||
cd_lbl.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
|
||||||
cd_lbl.set_anchors_preset(Control.PRESET_FULL_RECT)
|
|
||||||
cd_lbl.add_theme_font_size_override("font_size", 20)
|
|
||||||
cd_lbl.add_theme_color_override("font_outline_color", Color.BLACK)
|
|
||||||
cd_lbl.add_theme_constant_override("outline_size", 4)
|
|
||||||
cd_lbl.text = ""
|
|
||||||
btn.add_child(cd_lbl)
|
|
||||||
|
|
||||||
# Add Keyboard Shortcut Label
|
# Add Keyboard Shortcut Label
|
||||||
if not btn.has_node("ShortcutLabel"):
|
if not btn.has_node("ShortcutLabel"):
|
||||||
@@ -182,9 +169,6 @@ func _connect_special_manager(special_manager):
|
|||||||
if not special_manager.is_connected("powerup_unlocked", _on_powerup_unlocked):
|
if not special_manager.is_connected("powerup_unlocked", _on_powerup_unlocked):
|
||||||
special_manager.connect("powerup_unlocked", _on_powerup_unlocked)
|
special_manager.connect("powerup_unlocked", _on_powerup_unlocked)
|
||||||
|
|
||||||
if not special_manager.is_connected("cooldown_updated", _on_cooldown_updated):
|
|
||||||
special_manager.connect("cooldown_updated", _on_cooldown_updated)
|
|
||||||
|
|
||||||
if not special_manager.is_connected("inventory_updated", _on_inventory_updated):
|
if not special_manager.is_connected("inventory_updated", _on_inventory_updated):
|
||||||
special_manager.connect("inventory_updated", _on_inventory_updated)
|
special_manager.connect("inventory_updated", _on_inventory_updated)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user