Skip to content

Commit 93d3578

Browse files
authored
Merge pull request #53 from endlessm/rename-bsd
BlockCode node: Rename bsd to block_script
2 parents db25ba8 + f02a4cc commit 93d3578

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

addons/block_code/block_code_node/block_code.gd

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class_name BlockCode
44
extends Node
55

6-
@export var bsd: BlockScriptData = null
6+
@export var block_script: BlockScriptData = null
77
static var plugin
88

99

@@ -25,11 +25,11 @@ func _enter_tree():
2525
return
2626

2727
# Create script
28-
if bsd == null:
28+
if block_script == null:
2929
var new_bsd: BlockScriptData = load("res://addons/block_code/ui/bsd_templates/default_bsd.tres").duplicate(true)
3030
new_bsd.script_inherits = _get_custom_or_native_class(get_parent())
3131
new_bsd.generated_script = new_bsd.generated_script.replace("INHERIT_DEFAULT", new_bsd.script_inherits)
32-
bsd = new_bsd
32+
block_script = new_bsd
3333

3434
if plugin == null:
3535
plugin = ClassDB.instantiate("EditorPlugin")
@@ -43,15 +43,15 @@ func _update_parent_script():
4343

4444
var parent: Node = get_parent()
4545
var script := GDScript.new()
46-
script.set_source_code(bsd.generated_script)
46+
script.set_source_code(block_script.generated_script)
4747
script.reload()
4848
parent.set_script(script)
4949
parent.set_process(true)
5050

5151

5252
func _get_configuration_warnings():
5353
var warnings = []
54-
if bsd and _get_custom_or_native_class(get_parent()) != bsd.script_inherits:
55-
var warning = "The parent is not a %s. Create a new BlockCode node and reattach." % bsd.script_inherits
54+
if block_script and _get_custom_or_native_class(get_parent()) != block_script.script_inherits:
55+
var warning = "The parent is not a %s. Create a new BlockCode node and reattach." % block_script.script_inherits
5656
warnings.append(warning)
5757
return warnings

addons/block_code/ui/main_panel.gd

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func switch_scene(scene_root: Node):
4040

4141

4242
func switch_script(block_code_node: BlockCode):
43-
var bsd = block_code_node.bsd if block_code_node else null
43+
var bsd = block_code_node.block_script if block_code_node else null
4444
_current_bsd = bsd
4545
_current_block_code_node = block_code_node
4646
_picker.bsd_selected(bsd)

addons/block_code/ui/title_bar/title_bar.gd

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func _update_node_option_button_options():
4444

4545
for block_code_node in scene_root.find_children("*", "BlockCode"):
4646
var node_item_index = _node_option_button.item_count
47-
var node_label = "{name} ({type})".format({"name": scene_root.get_path_to(block_code_node).get_concatenated_names(), "type": block_code_node.bsd.script_inherits})
47+
var node_label = "{name} ({type})".format({"name": scene_root.get_path_to(block_code_node).get_concatenated_names(), "type": block_code_node.block_script.script_inherits})
4848
_node_option_button.add_item(node_label)
4949
_node_option_button.set_item_icon(node_item_index, _block_code_icon)
5050
_node_option_button.set_item_metadata(node_item_index, block_code_node)
@@ -53,7 +53,7 @@ func _update_node_option_button_options():
5353
func _get_index_for_bsd(bsd: BlockScriptData) -> int:
5454
for index in range(_node_option_button.item_count):
5555
var block_code_node = _node_option_button.get_item_metadata(index)
56-
if block_code_node.bsd == bsd:
56+
if block_code_node.block_script == bsd:
5757
return index
5858
return -1
5959

pong_game/pong_game.tscn

+3-3
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ position = Vector2(64, 544)
158158

159159
[node name="BlockCode" type="Node" parent="PaddleLeft"]
160160
script = ExtResource("3_6jaq8")
161-
bsd = SubResource("Resource_t7nl4")
161+
block_script = SubResource("Resource_t7nl4")
162162

163163
[node name="PaddleRight" parent="." instance=ExtResource("1_1k5k2")]
164164
modulate = Color(0.511, 0.362, 0.972, 1)
165165
position = Vector2(1856, 544)
166166

167167
[node name="BlockCode" type="Node" parent="PaddleRight"]
168168
script = ExtResource("3_6jaq8")
169-
bsd = SubResource("Resource_52r02")
169+
block_script = SubResource("Resource_52r02")
170170

171171
[node name="Ball" parent="." instance=ExtResource("9_xrqll")]
172172
modulate = Color(0.511, 0.362, 0.972, 1)
@@ -186,4 +186,4 @@ position = Vector2(1984, 544)
186186

187187
[node name="BlockCode" type="Node" parent="."]
188188
script = ExtResource("3_6jaq8")
189-
bsd = SubResource("Resource_f070g")
189+
block_script = SubResource("Resource_f070g")

test_game/test_game.tscn

+5-5
Original file line numberDiff line numberDiff line change
@@ -1114,14 +1114,14 @@ position = Vector2(-71, -18)
11141114

11151115
[node name="BlockCode" type="Node" parent="Will"]
11161116
script = ExtResource("2_ewral")
1117-
bsd = SubResource("Resource_l007i")
1117+
block_script = SubResource("Resource_l007i")
11181118

11191119
[node name="Manuel" parent="." instance=ExtResource("1_hrpwq")]
11201120
position = Vector2(64, 6)
11211121

11221122
[node name="BlockCode" type="Node" parent="Manuel"]
11231123
script = ExtResource("2_ewral")
1124-
bsd = SubResource("Resource_qakr4")
1124+
block_script = SubResource("Resource_qakr4")
11251125

11261126
[node name="Node2D" type="Node2D" parent="."]
11271127
position = Vector2(-34, 39)
@@ -1132,7 +1132,7 @@ texture = ExtResource("7_a27o8")
11321132

11331133
[node name="BlockCode" type="Node" parent="Node2D"]
11341134
script = ExtResource("2_ewral")
1135-
bsd = SubResource("Resource_iw7o0")
1135+
block_script = SubResource("Resource_iw7o0")
11361136

11371137
[node name="RigidBody2D" type="RigidBody2D" parent="."]
11381138

@@ -1141,10 +1141,10 @@ shape = SubResource("CircleShape2D_wymn4")
11411141

11421142
[node name="BlockCode" type="Node" parent="RigidBody2D"]
11431143
script = ExtResource("2_ewral")
1144-
bsd = SubResource("Resource_37its")
1144+
block_script = SubResource("Resource_37its")
11451145

11461146
[node name="Counter" type="Node2D" parent="."]
11471147

11481148
[node name="BlockCode" type="Node" parent="Counter"]
11491149
script = ExtResource("2_ewral")
1150-
bsd = SubResource("Resource_bw4t7")
1150+
block_script = SubResource("Resource_bw4t7")

0 commit comments

Comments
 (0)