feat: Add new GUI assets, a MeshLibrary defining various gridmap tiles, a UI manager script, and the main scene.
This commit is contained in:
@@ -3,7 +3,7 @@ extends Node
|
||||
# UIManager - Handles all UI setup and updates
|
||||
|
||||
const item_tex = [
|
||||
preload("res://assets/textures/player_board_and_blue_print/tile_null.tres"),
|
||||
preload("res://assets/textures/player_board_and_blue_print/tiles_slot.png"),
|
||||
preload("res://assets/textures/player_board_and_blue_print/tile_heart.tres"),
|
||||
preload("res://assets/textures/player_board_and_blue_print/tile_diamond.tres"),
|
||||
preload("res://assets/textures/player_board_and_blue_print/tile_star.tres"),
|
||||
@@ -33,7 +33,9 @@ func initialize(player_node):
|
||||
powerup_inventory_ui = player_node.get_node_or_null("PowerUpInventoryUI")
|
||||
|
||||
# Get node references from main scene
|
||||
playerboard_ui = player_node.get_node("PlayerboardUI")
|
||||
playerboard_ui = player_node.get_node_or_null("PlayerBoardUI/PlayerboardUI")
|
||||
if not playerboard_ui:
|
||||
playerboard_ui = player_node.get_node_or_null("PlayerboardUI")
|
||||
|
||||
# Connect PlayerName label (Level/XP/Name UI)
|
||||
player_name_label = player_node.get_node_or_null("PlayerName")
|
||||
@@ -55,6 +57,9 @@ func set_local_player(player):
|
||||
|
||||
|
||||
func setup_playerboard_ui():
|
||||
if not playerboard_ui:
|
||||
push_warning("playerboard_ui node is missing!")
|
||||
return
|
||||
for child in playerboard_ui.get_children():
|
||||
child.queue_free()
|
||||
|
||||
@@ -104,7 +109,7 @@ func setup_playerboard_ui():
|
||||
slot.get_child(2).hide()
|
||||
|
||||
func update_playerboard_ui():
|
||||
if not local_player_character:
|
||||
if not local_player_character or not playerboard_ui:
|
||||
return
|
||||
|
||||
# Center 3x3 slot indices in a 5x5 grid (0-indexed)
|
||||
|
||||
Reference in New Issue
Block a user