Skip to content

Revert "Block: Handle bottom_snap property directly" #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion addons/block_code/ui/blocks/block/block.gd
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@ signal modified
@export var category: String

## The next block in the line of execution (can be null if end)
@export var bottom_snap: SnapPoint
@export var bottom_snap_path: NodePath

## The scope of the block (statement of matching entry block)
@export var scope: String = ""

## The resource containing the block properties and the snapped blocks
@export var resource: SerializedBlockTreeNode

var bottom_snap: SnapPoint


func _ready():
bottom_snap = get_node_or_null(bottom_snap_path)
mouse_filter = Control.MOUSE_FILTER_IGNORE


Expand Down
4 changes: 2 additions & 2 deletions addons/block_code/ui/blocks/control_block/control_block.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
[ext_resource type="Script" path="res://addons/block_code/ui/blocks/control_block/control_block.gd" id="1_2hbir"]
[ext_resource type="PackedScene" uid="uid://b1oge52xhjqnu" path="res://addons/block_code/ui/blocks/utilities/snap_point/snap_point.tscn" id="3_nhryi"]

[node name="ControlBlock" type="MarginContainer" node_paths=PackedStringArray("bottom_snap")]
[node name="ControlBlock" type="MarginContainer"]
size_flags_horizontal = 0
mouse_filter = 2
script = ExtResource("1_2hbir")
block_name = "control_block"
label = "Control Block"
color = Color(0.59979, 0.536348, 0.876215, 1)
bottom_snap = NodePath("VBoxContainer/SnapPoint")
bottom_snap_path = NodePath("VBoxContainer/SnapPoint")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
[ext_resource type="PackedScene" uid="uid://c7puyxpqcq6xo" path="res://addons/block_code/ui/blocks/utilities/drag_drop_area/drag_drop_area.tscn" id="2_owgdx"]
[ext_resource type="PackedScene" uid="uid://b1oge52xhjqnu" path="res://addons/block_code/ui/blocks/utilities/snap_point/snap_point.tscn" id="3_5vaov"]

[node name="StatementBlock" type="MarginContainer" node_paths=PackedStringArray("bottom_snap")]
[node name="StatementBlock" type="MarginContainer"]
size_flags_horizontal = 0
mouse_filter = 2
script = ExtResource("1_6wvlf")
block_name = "statement_block"
label = "StatementBlock"
bottom_snap = NodePath("VBoxContainer/SnapPoint")
bottom_snap_path = NodePath("VBoxContainer/SnapPoint")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
Expand Down