diff --git a/addons/enhanced_gridmap/meshlibrary/default.tres b/addons/enhanced_gridmap/meshlibrary/default.tres index dafe4ca..d6a659e 100644 --- a/addons/enhanced_gridmap/meshlibrary/default.tres +++ b/addons/enhanced_gridmap/meshlibrary/default.tres @@ -10,7 +10,7 @@ [ext_resource type="ArrayMesh" uid="uid://bqvqj3fhf5x51" path="res://assets/models/tiles/tile_ghost.tres" id="6_r32il"] [ext_resource type="ArrayMesh" uid="uid://cv4bedhida00g" path="res://assets/models/tiles/tile_star.tres" id="7_p5epg"] [ext_resource type="ArrayMesh" uid="uid://gpnl4cjrivor" path="res://assets/models/tiles/tile_speed.tres" id="7_sx8rm"] -[ext_resource type="ArrayMesh" uid="uid://dr80txgr61irt" path="res://assets/models/tiles/tile_diamond.tres" id="10_r32il"] +[ext_resource type="Texture2D" uid="uid://dpkx1a780pvwv" path="res://assets/textures/tile_diamond.png" id="10_sx8rm"] [sub_resource type="CompressedTexture2D" id="CompressedTexture2D_5d0gc"] load_path = "res://.godot/imported/tile_heart.png-deeef50755ca225f028608dfd16900e6.s3tc.ctex" @@ -54,6 +54,30 @@ _surfaces = [{ blend_shape_mode = 0 shadow_mesh = SubResource("ArrayMesh_r2l4m") +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_2vf4e"] +resource_name = "boost" +transparency = 1 +cull_mode = 2 +albedo_color = Color(0.91, 0.91, 0.91, 0.45098) +albedo_texture = ExtResource("10_sx8rm") + +[sub_resource type="ArrayMesh" id="ArrayMesh_r32il"] +resource_name = "tile_diamond" +_surfaces = [{ +"aabb": AABB(-0.282176, -0.000324821, -0.282176, 0.564351, 0.050792, 0.564351), +"attribute_data": PackedByteArray("sPss5W0hot47+9DosPv6720hXCE7+6/6sPvl75Heot6r9qfksPu0+pHeXCHM5KfkSvvl78X6sfqr9kDkSvu0+sX6tuTM5EDkSvss5c7ksfrU+tDoSvv6787ktuTU+q/6"), +"format": 34896613399, +"index_count": 36, +"index_data": PackedByteArray("FgANABAAFgATAA0AEQAIAAsAEQAOAAgAAAAMABIAAAAGAAwADwADABUADwAJAAMABwAEAAoABwABAAQABQAUABcABQACABQA"), +"material": SubResource("StandardMaterial3D_2vf4e"), +"name": "tile_coin_diamond", +"primitive": 3, +"uv_scale": Vector4(0, 0, 0, 0), +"vertex_count": 24, +"vertex_data": PackedByteArray("AAD//////78AAP//////vwAA/////6oqAAD+/wAAAAAAAP7/AAD/vwAA/v8AAKoq/////////7//////////v//////////////+/wAAAAD///7/AAD/v////v8AAP////8AAP///7///wAA////P///AAD///////8AAAAAAAD//wAAAAD/P///AAAAAP//AAAAAP///78AAAAA////PwAAAAD//6oqAAAAAAAAAAAAAAAAAAD/PwAAAAAAAKoq/////////39U1VTV/7//v////39U1VTV/////////3//v/9//7//v////3//v/9//////wAA/3//v/9//7//vwAA/3//v/9//////wAA/39U1VTV/7//vwAA/39U1VTV") +}] +blend_shape_mode = 0 + [resource] item/0/name = "normal" item/0/mesh = ExtResource("1_ptqbt") @@ -110,7 +134,7 @@ item/7/shapes = [] item/7/navigation_mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) item/7/navigation_layers = 1 item/8/name = "tile_diamond" -item/8/mesh = ExtResource("10_r32il") +item/8/mesh = SubResource("ArrayMesh_r32il") item/8/mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) item/8/mesh_cast_shadow = 1 item/8/shapes = [] diff --git a/scenes/main.gd b/scenes/main.gd index 303c481..9f1cda6 100644 --- a/scenes/main.gd +++ b/scenes/main.gd @@ -160,6 +160,8 @@ func add_message_to_bar(player_name: String, message: String, type: int = Messag # Create message label with rich styling var label = Label.new() label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER + label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART + #label.custom_minimum_size = Vector2(400, 0) # Width constraint for wrapping label.add_theme_font_size_override("font_size", 16) label.modulate.a = 0.0 # Start invisible for fade-in diff --git a/scenes/main.tscn b/scenes/main.tscn index d8334bf..051f738 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -80,12 +80,12 @@ current = true fov = 35.5 [node name="Camera3D200" type="Camera3D" parent="." unique_id=1763366951] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 7, 15, 6.35926) +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 7, 15, 7) environment = ExtResource("4_ky38j") projection = 1 current = true fov = 35.5 -size = 23.0 +size = 15.0 [node name="PlayerboardPanel" type="PanelContainer" parent="." unique_id=1098203639] anchors_preset = 4 @@ -1042,6 +1042,74 @@ visible = false layout_mode = 2 text = "Arrange" +[node name="PowerUpInventoryUI" type="Control" parent="." unique_id=1105620089] +layout_mode = 3 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -78.0 +offset_top = -476.0 +offset_right = -78.0 +offset_bottom = -476.0 +grow_horizontal = 0 +grow_vertical = 0 +script = ExtResource("powerup_ui_script") + +[node name="Container" type="VBoxContainer" parent="PowerUpInventoryUI" unique_id=1100906843] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -11.0 +offset_top = 2.0 +offset_right = 62.0 +offset_bottom = 281.1367 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/separation = 10 + +[node name="SpeedBtn" type="Button" parent="PowerUpInventoryUI/Container" unique_id=1549270030] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +focus_mode = 0 +icon = ExtResource("26_2f3dj") +flat = true +icon_alignment = 1 +expand_icon = true + +[node name="WallBtn" type="Button" parent="PowerUpInventoryUI/Container" unique_id=863365575] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +focus_mode = 0 +icon = ExtResource("27_yq6so") +flat = true +icon_alignment = 1 +expand_icon = true + +[node name="FreezeAreaBtn" type="Button" parent="PowerUpInventoryUI/Container" unique_id=1087493560] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +focus_mode = 0 +icon = ExtResource("28_fv21b") +flat = true +icon_alignment = 1 +expand_icon = true + +[node name="GhostBtn" type="Button" parent="PowerUpInventoryUI/Container" unique_id=2041811828] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +focus_mode = 0 +icon = ExtResource("33_5q0nq") +flat = true +icon_alignment = 1 +expand_icon = true + [node name="Menu" type="VBoxContainer" parent="." unique_id=1890529349] visible = false anchors_preset = 8 @@ -9347,16 +9415,13 @@ offset_bottom = 24.0 texture = ExtResource("10_my1qp") [node name="MessageBar" type="PanelContainer" parent="." unique_id=142729129] -anchors_preset = 7 -anchor_left = 0.5 +anchors_preset = 2 anchor_top = 1.0 -anchor_right = 0.5 anchor_bottom = 1.0 -offset_left = -200.0 +offset_left = 13.0 offset_top = -52.0 -offset_right = 200.0 +offset_right = 299.0 offset_bottom = -18.0 -grow_horizontal = 2 grow_vertical = 0 theme_override_styles/panel = ExtResource("5_dvx6y") @@ -9523,6 +9588,91 @@ theme_override_font_sizes/font_size = 28 text = "3:00" horizontal_alignment = 1 +[node name="TouchControls" type="CanvasLayer" parent="." unique_id=1390485948] +script = ExtResource("touch_manager") + +[node name="TouchControls" type="Control" parent="TouchControls" unique_id=1539594058] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = 318.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 + +[node name="VirtualJoystick" type="Control" parent="TouchControls/TouchControls" unique_id=1983608919] +visible = false +layout_mode = 1 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_left = 120.0 +offset_top = -280.0 +offset_right = 280.0 +offset_bottom = -120.0 +grow_vertical = 0 +script = ExtResource("virtual_joystick") + +[node name="ActionsBtn" type="HBoxContainer" parent="TouchControls/TouchControls" unique_id=1921269452] +layout_mode = 0 +offset_left = 24.0 +offset_top = 58.0 +offset_right = 231.0 +offset_bottom = 123.25 +theme_override_constants/separation = 15 + +[node name="PutBtn" type="Button" parent="TouchControls/TouchControls/ActionsBtn" unique_id=1027790362] +visible = false +layout_mode = 2 +size_flags_horizontal = 3 +focus_mode = 0 +icon = ExtResource("26_5q0nq") +flat = true +icon_alignment = 1 +expand_icon = true + +[node name="AttackModeBtn" type="Button" parent="TouchControls/TouchControls/ActionsBtn" unique_id=1380511463] +layout_mode = 2 +size_flags_horizontal = 3 +focus_mode = 0 +icon = ExtResource("27_dgi5k") +flat = true +icon_alignment = 1 +expand_icon = true + +[node name="SpawnBoostBtn" type="Button" parent="TouchControls/TouchControls/ActionsBtn" unique_id=1566173505] +layout_mode = 2 +size_flags_horizontal = 3 +icon = ExtResource("28_j8jky") +flat = true +icon_alignment = 1 +expand_icon = true + +[node name="GrabBtn" type="Button" parent="TouchControls/TouchControls/ActionsBtn" unique_id=914810452] +layout_mode = 2 +size_flags_horizontal = 3 +focus_mode = 0 +icon = ExtResource("25_qkpxi") +flat = true +icon_alignment = 1 +expand_icon = true + +[node name="SettingsBtn" type="Button" parent="TouchControls/TouchControls" unique_id=1964422444] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -70.0 +offset_top = -80.0 +offset_right = -22.0 +offset_bottom = -32.0 +grow_horizontal = 0 +grow_vertical = 0 +text = "⚙" + [node name="PauseMenu" type="CanvasLayer" parent="." unique_id=181131829] process_mode = 3 layer = 10 @@ -9697,154 +9847,6 @@ custom_minimum_size = Vector2(0, 40) layout_mode = 2 text = "Back" -[node name="TouchControls" type="CanvasLayer" parent="." unique_id=1390485948] -script = ExtResource("touch_manager") - -[node name="TouchControls" type="Control" parent="TouchControls" unique_id=1539594058] -layout_mode = 3 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_top = 318.0 -grow_horizontal = 2 -grow_vertical = 2 -mouse_filter = 2 - -[node name="VirtualJoystick" type="Control" parent="TouchControls/TouchControls" unique_id=1983608919] -visible = false -layout_mode = 1 -anchors_preset = 2 -anchor_top = 1.0 -anchor_bottom = 1.0 -offset_left = 120.0 -offset_top = -280.0 -offset_right = 280.0 -offset_bottom = -120.0 -grow_vertical = 0 -script = ExtResource("virtual_joystick") - -[node name="ActionsBtn" type="HBoxContainer" parent="TouchControls/TouchControls" unique_id=1921269452] -layout_mode = 0 -offset_left = 24.0 -offset_top = 58.0 -offset_right = 231.0 -offset_bottom = 123.25 -theme_override_constants/separation = 15 - -[node name="PutBtn" type="Button" parent="TouchControls/TouchControls/ActionsBtn" unique_id=1027790362] -visible = false -layout_mode = 2 -size_flags_horizontal = 3 -focus_mode = 0 -icon = ExtResource("26_5q0nq") -flat = true -icon_alignment = 1 -expand_icon = true - -[node name="AttackModeBtn" type="Button" parent="TouchControls/TouchControls/ActionsBtn" unique_id=1380511463] -layout_mode = 2 -size_flags_horizontal = 3 -focus_mode = 0 -icon = ExtResource("27_dgi5k") -flat = true -icon_alignment = 1 -expand_icon = true - -[node name="SpawnBoostBtn" type="Button" parent="TouchControls/TouchControls/ActionsBtn" unique_id=1566173505] -layout_mode = 2 -size_flags_horizontal = 3 -icon = ExtResource("28_j8jky") -flat = true -icon_alignment = 1 -expand_icon = true - -[node name="GrabBtn" type="Button" parent="TouchControls/TouchControls/ActionsBtn" unique_id=914810452] -layout_mode = 2 -size_flags_horizontal = 3 -focus_mode = 0 -icon = ExtResource("25_qkpxi") -flat = true -icon_alignment = 1 -expand_icon = true - -[node name="SettingsBtn" type="Button" parent="TouchControls/TouchControls" unique_id=1964422444] -layout_mode = 1 -anchors_preset = 3 -anchor_left = 1.0 -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_left = -70.0 -offset_top = -80.0 -offset_right = -22.0 -offset_bottom = -32.0 -grow_horizontal = 0 -grow_vertical = 0 -text = "⚙" - -[node name="PowerUpInventoryUI" type="Control" parent="." unique_id=1105620089] -layout_mode = 3 -anchors_preset = 3 -anchor_left = 1.0 -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_left = -450.0 -offset_top = -76.0 -offset_right = -450.0 -offset_bottom = -76.0 -grow_horizontal = 0 -grow_vertical = 0 -script = ExtResource("powerup_ui_script") - -[node name="HBoxContainer" type="HBoxContainer" parent="PowerUpInventoryUI" unique_id=251526179] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_top = 2.0 -offset_right = 237.07463 -offset_bottom = 58.0 -grow_horizontal = 2 -grow_vertical = 2 -theme_override_constants/separation = 10 - -[node name="SpeedBtn" type="Button" parent="PowerUpInventoryUI/HBoxContainer" unique_id=1549270030] -layout_mode = 2 -size_flags_horizontal = 3 -focus_mode = 0 -icon = ExtResource("26_2f3dj") -flat = true -icon_alignment = 1 -expand_icon = true - -[node name="WallBtn" type="Button" parent="PowerUpInventoryUI/HBoxContainer" unique_id=863365575] -layout_mode = 2 -size_flags_horizontal = 3 -focus_mode = 0 -icon = ExtResource("27_yq6so") -flat = true -icon_alignment = 1 -expand_icon = true - -[node name="FreezeAreaBtn" type="Button" parent="PowerUpInventoryUI/HBoxContainer" unique_id=1087493560] -layout_mode = 2 -size_flags_horizontal = 3 -focus_mode = 0 -icon = ExtResource("28_fv21b") -flat = true -icon_alignment = 1 -expand_icon = true - -[node name="GhostBtn" type="Button" parent="PowerUpInventoryUI/HBoxContainer" unique_id=2041811828] -layout_mode = 2 -size_flags_horizontal = 3 -focus_mode = 0 -icon = ExtResource("33_5q0nq") -flat = true -icon_alignment = 1 -expand_icon = true - [connection signal="pressed" from="Menu/Host" to="." method="_on_host_pressed"] [connection signal="pressed" from="Menu/Join" to="." method="_on_join_pressed"] [connection signal="text_submitted" from="MessageInput" to="." method="_on_message_input_text_submitted"] diff --git a/scripts/ui/powerup_inventory_ui.gd b/scripts/ui/powerup_inventory_ui.gd index 9440d29..ce13bff 100644 --- a/scripts/ui/powerup_inventory_ui.gd +++ b/scripts/ui/powerup_inventory_ui.gd @@ -15,7 +15,7 @@ func _ready(): print("[PowerUpUI] _ready called") # Map Effect Enum to UI Nodes (Assumes specific names in main.tscn) # We try to get them immediately. If they are children, they should be accessible. - var container = get_node_or_null("HBoxContainer") + var container = get_node_or_null("Container") if not container: print("[PowerUpUI] ERROR: HBoxContainer not found in ", get_path()) return @@ -79,14 +79,28 @@ func _setup_btn(effect_id: int, btn: Button): var sc_lbl = Label.new() sc_lbl.name = "ShortcutLabel" sc_lbl.mouse_filter = Control.MOUSE_FILTER_IGNORE - sc_lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER - sc_lbl.vertical_alignment = VERTICAL_ALIGNMENT_BOTTOM - sc_lbl.set_anchors_preset(Control.PRESET_FULL_RECT) - # Offset slightly below or at bottom edge - sc_lbl.offset_bottom = 20 - sc_lbl.add_theme_font_size_override("font_size", 14) + + # Position: Left of the button + sc_lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT + sc_lbl.vertical_alignment = VERTICAL_ALIGNMENT_CENTER + + # Anchor to left middle + sc_lbl.anchor_left = 0.0 + sc_lbl.anchor_top = 0.5 + sc_lbl.anchor_right = 0.0 + sc_lbl.anchor_bottom = 0.5 + + # Offset to the left (negative x) + sc_lbl.offset_left = -40 + sc_lbl.offset_right = -4 # Small padding + sc_lbl.offset_top = -10 + sc_lbl.offset_bottom = 10 + + 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) + # Add color override to make it distinct (optional, but good for visibility) + 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