feat: Introduce player movement manager with push mechanics, multiplayer synchronization, and new touch controls and powerup inventory UI.
This commit is contained in:
@@ -127,6 +127,10 @@ func _create_touch_ui():
|
||||
container.add_child(actions_container)
|
||||
else:
|
||||
print("[TouchControls] Found existing ActionsBtn container")
|
||||
|
||||
# Center buttons in the container instead of spreading them out
|
||||
if actions_container is BoxContainer:
|
||||
actions_container.alignment = BoxContainer.ALIGNMENT_CENTER
|
||||
|
||||
# Create action buttons (parented to actions_container if possible, or use logic)
|
||||
# User Request: "move those button to ActionsBtn children"
|
||||
@@ -248,6 +252,11 @@ func _style_button(btn: Button, opacity: float):
|
||||
|
||||
# Prevent buttons from stealing focus (fixes Spacebar activation)
|
||||
btn.focus_mode = Control.FOCUS_NONE
|
||||
|
||||
# Fix "Floating" issue: don't expand button to fill whole container height
|
||||
# This keeps the button (and its labels) centered near the icon/text
|
||||
btn.size_flags_vertical = Control.SIZE_SHRINK_CENTER
|
||||
btn.custom_minimum_size.y = 70 # Consistent height
|
||||
|
||||
func _ensure_shortcut_label(btn: Button, button_name: String):
|
||||
if btn.has_node("ShortcutLabel"):
|
||||
@@ -265,7 +274,7 @@ func _ensure_shortcut_label(btn: Button, button_name: String):
|
||||
# Ensure correct placement (Top Right)
|
||||
existing_lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
|
||||
existing_lbl.vertical_alignment = VERTICAL_ALIGNMENT_TOP
|
||||
existing_lbl.offset_top = -5 # Closer to top
|
||||
existing_lbl.offset_top = -8 # Lowered slightly from -18
|
||||
existing_lbl.offset_right = 0 # Aligned with right edge
|
||||
|
||||
# Ensure Outline
|
||||
@@ -279,7 +288,7 @@ func _ensure_shortcut_label(btn: Button, button_name: String):
|
||||
shortcut_lbl.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
shortcut_lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
|
||||
shortcut_lbl.vertical_alignment = VERTICAL_ALIGNMENT_TOP
|
||||
shortcut_lbl.offset_top = -5 # Closer to top
|
||||
shortcut_lbl.offset_top = -8 # Lowered slightly from -18
|
||||
shortcut_lbl.offset_right = 0 # Aligned with right edge
|
||||
shortcut_lbl.add_theme_font_size_override("font_size", 16)
|
||||
shortcut_lbl.add_theme_color_override("font_outline_color", Color.BLACK)
|
||||
|
||||
Reference in New Issue
Block a user