feat: Implement tile scarcity model for tile generation and power-up inventory UI for player interaction.
This commit is contained in:
@@ -29,7 +29,10 @@ func _ready():
|
||||
# We use 0, 1, 2, 3 to match SpecialTilesManager.SpecialEffect enum
|
||||
_setup_btn(0, container.get_node_or_null("SpeedBtn"))
|
||||
_setup_btn(1, container.get_node_or_null("FreezeAreaBtn"))
|
||||
_setup_btn(2, container.get_node_or_null("WallBtn"))
|
||||
var wall_btn = container.get_node_or_null("WallBtn")
|
||||
_setup_btn(2, wall_btn)
|
||||
if wall_btn and LobbyManager.game_mode == "Stop n Go":
|
||||
wall_btn.visible = false # Hide Wall Power-up only in Stop n Go
|
||||
_setup_btn(3, container.get_node_or_null("GhostBtn"))
|
||||
|
||||
print("[PowerUpUI] UI Initialization Complete. Mapped %d buttons." % icon_containers.size())
|
||||
@@ -103,16 +106,20 @@ func _setup_btn(effect_id: int, btn: Button):
|
||||
sc_lbl.add_theme_color_override("font_color", Color(0.9, 0.9, 0.9))
|
||||
|
||||
# Determine Label Text based on Effect ID
|
||||
# 0: Speed -> 1
|
||||
# 2: Wall -> 2
|
||||
# 1: Freeze -> 3
|
||||
# 3: Ghost -> 4
|
||||
var key_text = ""
|
||||
match effect_id:
|
||||
0: key_text = "1"
|
||||
2: key_text = "2"
|
||||
1: key_text = "3"
|
||||
3: key_text = "4"
|
||||
if LobbyManager.game_mode == "Stop n Go":
|
||||
# Stop n Go Mapping: 1, 2, 3 (No Wall)
|
||||
match effect_id:
|
||||
0: key_text = "1"
|
||||
1: key_text = "2"
|
||||
3: key_text = "3"
|
||||
else:
|
||||
# Free Mode Mapping: 1, 2, 3, 4 (Original)
|
||||
match effect_id:
|
||||
0: key_text = "1"
|
||||
2: key_text = "2"
|
||||
1: key_text = "3"
|
||||
3: key_text = "4"
|
||||
|
||||
sc_lbl.text = key_text
|
||||
btn.add_child(sc_lbl)
|
||||
|
||||
Reference in New Issue
Block a user