Add comprehensive UI system with action bar, unit frame, and character sheet

- Created UI system in level/ui/ folder
  - Action bar with 12 ability slots (Attack, Block, Dash, Jump + 8 expansion slots)
  - Unit frame showing player portrait with health bar
  - Character sheet/spellbook (toggle with Tab) displaying stats, weapons, and abilities
  - Tab hint indicator showing how to open character sheet
  - Custom theme with golden borders and dark backgrounds

- UI Components:
  - HUD Manager autoload handles all UI initialization and player connections
  - Ability buttons with cooldown overlay and keybind display
  - Real-time health and cooldown tracking via signals
  - Scrollable character sheet with two-page layout

- Player Integration:
  - Added UI signals: dash_cooldown_updated, attack_cooldown_updated, weapon_equipped_changed
  - Mouse capture system (Escape to toggle, click to recapture)
  - Synced attack cooldown from weapons to player for UI tracking

- Updated level.gd to connect local player to HUD Manager
- Updated CLAUDE.md with git commit guidelines
This commit is contained in:
2025-11-16 22:48:50 +00:00
parent d475c0abf9
commit 15865dd15f
24 changed files with 1386 additions and 58 deletions
+10
View File
@@ -182,6 +182,16 @@ func _add_player(id: int, player_info : Dictionary):
player.nickname.text = nick
# player.rpc("change_nick", nick)
# Set up HUD for local player
if id == multiplayer.get_unique_id():
print("[Level] Setting up HUD for local player")
# Wait a frame to ensure HUD autoload is ready
await get_tree().process_frame
if has_node("/root/HUD"):
get_node("/root/HUD").set_local_player(player)
else:
push_warning("[Level] HUD autoload not found! Make sure to restart Godot to register the new autoload.")
var skin_enum = player_info["skin"]
player.set_player_skin(skin_enum)
# rpc("sync_player_skin", id, skin_enum)