feat: Introduce player movement manager with push mechanics, multiplayer synchronization, and new touch controls and powerup inventory UI.
This commit is contained in:
@@ -17,8 +17,11 @@ func _ready():
|
||||
# We try to get them immediately. If they are children, they should be accessible.
|
||||
var container = get_node_or_null("Container")
|
||||
if not container:
|
||||
print("[PowerUpUI] ERROR: HBoxContainer not found in ", get_path())
|
||||
print("[PowerUpUI] ERROR: Container not found in ", get_path())
|
||||
return
|
||||
|
||||
# Center buttons in the container instead of spreading them out
|
||||
container.alignment = BoxContainer.ALIGNMENT_CENTER
|
||||
|
||||
# Mapping based on User Request
|
||||
# 11: FASTER_SPEED (0) -> SpeedBtn
|
||||
@@ -65,6 +68,11 @@ func _setup_btn(effect_id: int, btn: Button):
|
||||
btn.modulate = Color(0.5, 0.5, 0.5, 0.5) # Grayed out
|
||||
btn.focus_mode = Control.FOCUS_NONE
|
||||
|
||||
# Fix "Floating" issue: don't expand button to fill whole container height
|
||||
# This keeps the buttons grouped tightly together
|
||||
btn.size_flags_vertical = Control.SIZE_SHRINK_CENTER
|
||||
btn.custom_minimum_size.y = 80 # Consistent height
|
||||
|
||||
# Add Level Label
|
||||
if not btn.has_node("LevelLabel"):
|
||||
var lvl_lbl = Label.new()
|
||||
@@ -100,9 +108,9 @@ func _setup_btn(effect_id: int, btn: Button):
|
||||
sc_lbl.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
sc_lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
|
||||
sc_lbl.vertical_alignment = VERTICAL_ALIGNMENT_TOP
|
||||
sc_lbl.set_anchors_preset(Control.PRESET_TOP_LEFT)
|
||||
sc_lbl.offset_left = 0
|
||||
sc_lbl.offset_top = -5
|
||||
sc_lbl.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
sc_lbl.offset_left = 5
|
||||
sc_lbl.offset_top = -4 # Lowered slightly from -12
|
||||
sc_lbl.add_theme_font_size_override("font_size", 16)
|
||||
sc_lbl.add_theme_color_override("font_outline_color", Color.BLACK)
|
||||
sc_lbl.add_theme_constant_override("outline_size", 4)
|
||||
@@ -185,7 +193,7 @@ func _connect_special_manager(special_manager):
|
||||
# Initial State Sync
|
||||
if icon_containers.is_empty():
|
||||
print("[PowerUpUI] Warning: Icon containers empty during setup. Attempting _ready logic now...")
|
||||
var container = get_node_or_null("HBoxContainer")
|
||||
var container = get_node_or_null("Container")
|
||||
if container:
|
||||
# Fix: Use correct IDs 0-3 here too
|
||||
_setup_btn(0, container.get_node_or_null("SpeedBtn"))
|
||||
|
||||
Reference in New Issue
Block a user