Skip to content

Commit 97dc618

Browse files
committed
Set MOUSE_FILTER_IGNORE for blocks where necessary
Certain components inside our Block scenes were consuming input events, making it difficult to interact with other blocks positioned around them.
1 parent 5d57c2e commit 97dc618

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

addons/block_code/ui/blocks/block/block.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var bottom_snap: SnapPoint
3131

3232
func _ready():
3333
bottom_snap = get_node_or_null(bottom_snap_path)
34+
mouse_filter = Control.MOUSE_FILTER_IGNORE
3435

3536

3637
static func get_block_class():

addons/block_code/ui/blocks/control_block/control_block.gd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ func format():
141141

142142
var snap_container := MarginContainer.new()
143143
snap_container.name = "SnapContainer%d" % i
144+
snap_container.mouse_filter = Control.MOUSE_FILTER_IGNORE
145+
snap_container.custom_minimum_size.x = 30
144146
snap_container.custom_minimum_size.y = 30
147+
snap_container.size_flags_horizontal = Control.SIZE_SHRINK_BEGIN
145148
snap_container.add_theme_constant_override("margin_left", Constants.CONTROL_MARGIN)
146149

147150
var snap_point: SnapPoint = preload("res://addons/block_code/ui/blocks/utilities/snap_point/snap_point.tscn").instantiate()

addons/block_code/ui/blocks/control_block/control_block.tscn

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
[node name="ControlBlock" type="MarginContainer"]
77
size_flags_horizontal = 0
8+
mouse_filter = 2
89
script = ExtResource("1_2hbir")
910
block_name = "control_block"
1011
label = "Control Block"
@@ -13,13 +14,16 @@ bottom_snap_path = NodePath("VBoxContainer/SnapPoint")
1314

1415
[node name="VBoxContainer" type="VBoxContainer" parent="."]
1516
layout_mode = 2
17+
mouse_filter = 2
1618
theme_override_constants/separation = 0
1719

1820
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
1921
layout_mode = 2
22+
mouse_filter = 2
2023

2124
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/MarginContainer"]
2225
layout_mode = 2
26+
mouse_filter = 2
2327
theme_override_constants/margin_top = 30
2428
theme_override_constants/margin_bottom = 30
2529

@@ -34,8 +38,8 @@ color = Color(0.59979, 0.536348, 0.876215, 1)
3438
unique_name_in_owner = true
3539
layout_mode = 2
3640
size_flags_horizontal = 0
41+
mouse_filter = 2
3742
theme_override_constants/separation = 0
3843

3944
[node name="SnapPoint" parent="VBoxContainer" instance=ExtResource("3_nhryi")]
4045
layout_mode = 2
41-
block_path = NodePath("../..")

addons/block_code/ui/blocks/statement_block/statement_block.tscn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,22 @@
77

88
[node name="StatementBlock" type="MarginContainer"]
99
size_flags_horizontal = 0
10+
mouse_filter = 2
1011
script = ExtResource("1_6wvlf")
11-
defaults = null
1212
block_name = "statement_block"
1313
label = "StatementBlock"
1414
bottom_snap_path = NodePath("VBoxContainer/SnapPoint")
1515

1616
[node name="VBoxContainer" type="VBoxContainer" parent="."]
1717
layout_mode = 2
18+
mouse_filter = 2
1819
theme_override_constants/separation = 0
1920

2021
[node name="TopMarginContainer" type="MarginContainer" parent="VBoxContainer"]
2122
custom_minimum_size = Vector2(0, 30)
2223
layout_mode = 2
2324
size_flags_horizontal = 0
25+
mouse_filter = 2
2426
theme_override_constants/margin_left = 0
2527
theme_override_constants/margin_top = 0
2628
theme_override_constants/margin_right = 0
@@ -32,7 +34,6 @@ layout_mode = 2
3234
mouse_filter = 1
3335
script = ExtResource("2_lctqt")
3436
color = Color(1, 1, 1, 1)
35-
outline_color = Color(0.8, 0.8, 0.8, 1)
3637

3738
[node name="DragDropArea" parent="VBoxContainer/TopMarginContainer" instance=ExtResource("2_owgdx")]
3839
layout_mode = 2
@@ -54,6 +55,5 @@ theme_override_constants/separation = 0
5455

5556
[node name="SnapPoint" parent="VBoxContainer" instance=ExtResource("3_5vaov")]
5657
layout_mode = 2
57-
block_path = NodePath("../..")
5858

5959
[connection signal="mouse_down" from="VBoxContainer/TopMarginContainer/DragDropArea" to="." method="_on_drag_drop_area_mouse_down"]

addons/block_code/ui/blocks/utilities/snap_point/snap_point.tscn

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
anchors_preset = 15
77
anchor_right = 1.0
88
anchor_bottom = 1.0
9-
offset_right = -1152.0
10-
offset_bottom = -648.0
119
grow_horizontal = 2
1210
grow_vertical = 2
11+
mouse_filter = 2
1312
script = ExtResource("1_kseym")
1413

1514
[connection signal="child_entered_tree" from="." to="." method="_on_child_entered_tree"]

0 commit comments

Comments
 (0)