feat: Implement UIManager for player action, playerboard, and power-up UI, and add initial lobby, main scenes, and PlayerboardManager.

This commit is contained in:
Yogi Wiguna
2026-02-09 11:35:45 +08:00
parent 1048d7e0ca
commit 20e9897481
4 changed files with 128 additions and 32 deletions
+31 -5
View File
@@ -101,8 +101,20 @@ func setup_playerboard_ui():
var adjacent_rect = TextureRect.new()
var ar_tex = load("res://assets/models/pboard/AdjacentRect.tres")
slot.custom_minimum_size = Vector2(36, 36)
slot.texture = item_tex[0]
# 0-based indices corresponding to User's 1-based request: 1,5,6,10,11,15,16,20,21,22,23,24,25
var hidden_slots = [0, 4, 5, 9, 10, 14, 15, 19, 20, 21, 22, 23, 24]
if i in hidden_slots:
slot.modulate = Color(1, 1, 1, 0)
slot.mouse_filter = Control.MOUSE_FILTER_IGNORE
else:
slot.modulate = Color.WHITE
slot.mouse_filter = Control.MOUSE_FILTER_PASS
playerboard_ui.add_child(slot, true)
highlight_rect.texture = hr_tex
@@ -127,7 +139,10 @@ func update_playerboard_ui():
# Center 3x3 slot indices in a 5x5 grid (0-indexed)
# Row 1: 6, 7, 8
# Row 2: 11, 12, 13
# Row 3: 16, 17, 18
# Center 3x3 slot indices in a 5x5 grid (0-indexed)
# Row 1: 6, 7, 8 (Now Storage - but kept in index map for goals[0-2])
# Row 2: 11, 12, 13 (Goals[3-5])
# Row 3: 16, 17, 18 (Goals[6-8])
var center_slots = [6, 7, 8, 11, 12, 13, 16, 17, 18]
var goals = local_player_character.goals if local_player_character.goals else []
@@ -140,13 +155,23 @@ func update_playerboard_ui():
var item = local_player_character.playerboard[i]
# 0-based indices corresponding to User's 1-based request: 1,5,6,10,11,15,16,20,21,22,23,24,25
var hidden_slots = [0, 4, 5, 9, 10, 14, 15, 19, 20, 21, 22, 23, 24]
# Default texture (empty)
slot.texture = item_tex[0]
slot.modulate = Color.WHITE
if i in hidden_slots:
slot.modulate = Color(1, 1, 1, 0)
slot.mouse_filter = Control.MOUSE_FILTER_IGNORE
else:
slot.modulate = Color.WHITE
slot.mouse_filter = Control.MOUSE_FILTER_PASS
# Check if this is a center slot that should show a goal
# BUT only show ghost goals for rows 2 & 3 (indices 11+)
var center_index = center_slots.find(i)
if center_index != -1 and center_index < goals.size():
if center_index != -1 and center_index < goals.size() and i > 8:
var goal_value = goals[center_index]
if item != -1:
@@ -174,8 +199,9 @@ func update_playerboard_ui():
8: slot.texture = item_tex[2]
9: slot.texture = item_tex[3]
10: slot.texture = item_tex[4]
# Non-center slots always full brightness
slot.modulate = Color.WHITE
# Non-center slots always full brightness (UNLESS HIDDEN)
if not (i in hidden_slots):
slot.modulate = Color.WHITE
# Check for new special tile placement to trigger effect
if i < _previous_playerboard_state.size():