Skip to content

Commit

Permalink
fix: local item reference would get deleted after last patch, fix: bi…
Browse files Browse the repository at this point in the history
…tmask UI now works with both godot 3.3 and 3.4
  • Loading branch information
HungryProton committed Oct 12, 2021
1 parent 169b9d4 commit 1352d34
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
5 changes: 4 additions & 1 deletion src/core/scatter_item.gd
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ func update():

func get_mesh_instance_copy() -> MeshInstance:
var root = null
var local_root = false

if local_item_path:
root = get_node_or_null(local_item_path)
local_root = true

if item_path:
var scene = load(item_path)
Expand All @@ -99,7 +101,8 @@ func get_mesh_instance_copy() -> MeshInstance:

if root:
var mesh = _get_mesh_from_scene(root)
root.queue_free()
if not local_root:
root.queue_free()
if mesh:
_save_initial_data(mesh)
return mesh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,20 @@ var _layer_count := 32
func _ready() -> void:
_buttons = []
var grids = [_grid_1, _grid_2, _grid_3, _grid_4]

# Disable the extra layers if we're on 3.3
if not ProjectSettings.has_setting("layer_names/3d_physics/layer_21"):
_layer_count = 20

for g in grids:
for c in g.get_children():
if c is Button:
var layer_number = int(c.text)
if layer_number > _layer_count:
c.visible = false
continue
_buttons.push_front(c)
c.focus_mode = Control.FOCUS_NONE
c.connect("pressed", self, "_on_button_pressed")

_popup = _menu_button.get_popup()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@ __meta__ = {
}

[node name="Label" type="Label" parent="."]
margin_right = 1280.0
margin_right = 1024.0
margin_bottom = 14.0
text = "Parameter name"

[node name="MarginContainer" type="MarginContainer" parent="."]
margin_top = 18.0
margin_right = 1280.0
margin_right = 1024.0
margin_bottom = 88.0

[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
margin_right = 1280.0
margin_right = 1024.0
margin_bottom = 70.0
alignment = 2

[node name="MenuButton" type="MenuButton" parent="MarginContainer/HBoxContainer"]
margin_left = 1052.0
margin_right = 1080.0
margin_left = 796.0
margin_right = 824.0
margin_bottom = 70.0
icon = ExtResource( 3 )
items = [ "Default", null, 1, false, false, 19, 0, null, "", false, "Characters", null, 1, false, false, 18, 0, null, "", false, "Layer 3", null, 1, false, false, 17, 0, null, "", false, "Layer 4", null, 1, false, false, 16, 0, null, "", false, "Props", null, 1, false, false, 15, 0, null, "", false, "", null, 0, false, false, 105, 0, null, "", true, "Layer 6", null, 1, false, false, 14, 0, null, "", false, "Layer 7", null, 1, false, false, 13, 0, null, "", false, "Layer 8", null, 1, false, false, 12, 0, null, "", false, "LevelGeometry", null, 1, false, false, 11, 0, null, "", false, "Layer 10", null, 1, false, false, 10, 0, null, "", false, "", null, 0, false, false, 110, 0, null, "", true, "Layer 11", null, 1, false, false, 9, 0, null, "", false, "Layer 12", null, 1, false, false, 8, 0, null, "", false, "InvisibleWalls (Player)", null, 1, false, false, 7, 0, null, "", false, "InvisibleWalls (AI)", null, 1, false, false, 6, 0, null, "", false, "Layer 15", null, 1, false, false, 5, 0, null, "", false, "", null, 0, false, false, 115, 0, null, "", true, "Layer 16", null, 1, false, false, 4, 0, null, "", false, "Layer 17", null, 1, false, false, 3, 0, null, "", false, "Layer 18", null, 1, false, false, 2, 0, null, "", false, "Layer 19", null, 1, false, false, 1, 0, null, "", false, "Layer 20", null, 1, false, false, 0, 0, null, "", false ]
items = [ "Layer 1", null, 1, false, false, 31, 0, null, "", false, "Layer 2", null, 1, false, false, 30, 0, null, "", false, "Layer 3", null, 1, false, false, 29, 0, null, "", false, "Layer 4", null, 1, false, false, 28, 0, null, "", false, "", null, 0, false, false, 104, 0, null, "", true, "Layer 5", null, 1, false, false, 27, 0, null, "", false, "Layer 6", null, 1, false, false, 26, 0, null, "", false, "Layer 7", null, 1, false, false, 25, 0, null, "", false, "Layer 8", null, 1, false, false, 24, 0, null, "", false, "", null, 0, false, false, 108, 0, null, "", true, "Layer 9", null, 1, false, false, 23, 0, null, "", false, "Layer 10", null, 1, false, false, 22, 0, null, "", false, "Layer 11", null, 1, false, false, 21, 0, null, "", false, "Layer 12", null, 1, false, false, 20, 0, null, "", false, "", null, 0, false, false, 112, 0, null, "", true, "Layer 13", null, 1, false, false, 19, 0, null, "", false, "Layer 14", null, 1, false, false, 18, 0, null, "", false, "Layer 15", null, 1, false, false, 17, 0, null, "", false, "Layer 16", null, 1, false, false, 16, 0, null, "", false, "", null, 0, false, false, 116, 0, null, "", true, "Layer 17", null, 1, false, false, 15, 0, null, "", false, "Layer 18", null, 1, false, false, 14, 0, null, "", false, "Layer 19", null, 1, false, false, 13, 0, null, "", false, "Layer 20", null, 1, false, false, 12, 0, null, "", false, "", null, 0, false, false, 120, 0, null, "", true, "Layer 21", null, 1, false, false, 11, 0, null, "", false, "Layer 22", null, 1, false, false, 10, 0, null, "", false, "Layer 23", null, 1, false, false, 9, 0, null, "", false, "Layer 24", null, 1, false, false, 8, 0, null, "", false, "", null, 0, false, false, 124, 0, null, "", true, "Layer 25", null, 1, false, false, 7, 0, null, "", false, "Layer 26", null, 1, false, false, 6, 0, null, "", false, "Layer 27", null, 1, false, false, 5, 0, null, "", false, "Layer 28", null, 1, false, false, 4, 0, null, "", false, "", null, 0, false, false, 128, 0, null, "", true, "Layer 29", null, 1, false, false, 3, 0, null, "", false, "Layer 30", null, 1, false, false, 2, 0, null, "", false, "Layer 31", null, 1, false, false, 1, 0, null, "", false, "Layer 32", null, 1, false, false, 0, 0, null, "", false ]

[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer"]
margin_left = 1084.0
margin_right = 1248.0
margin_left = 828.0
margin_right = 992.0
margin_bottom = 70.0

[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer/VBoxContainer"]
Expand Down Expand Up @@ -200,31 +200,27 @@ text = "20"
margin_top = 15.0
margin_right = 18.0
margin_bottom = 29.0
focus_mode = 2
text = "21"

[node name="Button22" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer2/GridContainer3" instance=ExtResource( 2 )]
margin_left = 19.0
margin_top = 15.0
margin_right = 37.0
margin_bottom = 29.0
focus_mode = 2
text = "22"

[node name="Button23" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer2/GridContainer3" instance=ExtResource( 2 )]
margin_left = 38.0
margin_top = 15.0
margin_right = 56.0
margin_bottom = 29.0
focus_mode = 2
text = "23"

[node name="Button24" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer2/GridContainer3" instance=ExtResource( 2 )]
margin_left = 57.0
margin_top = 15.0
margin_right = 75.0
margin_bottom = 29.0
focus_mode = 2
text = "24"

[node name="VSeparator2" type="VSeparator" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer2"]
Expand All @@ -243,61 +239,53 @@ columns = 4

[node name="Button25" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer2/GridContainer4" instance=ExtResource( 2 )]
margin_right = 18.0
focus_mode = 2
text = "25"

[node name="Button26" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer2/GridContainer4" instance=ExtResource( 2 )]
margin_left = 19.0
margin_right = 37.0
focus_mode = 2
text = "26"

[node name="Button27" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer2/GridContainer4" instance=ExtResource( 2 )]
margin_left = 38.0
margin_right = 56.0
focus_mode = 2
text = "27"

[node name="Button28" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer2/GridContainer4" instance=ExtResource( 2 )]
margin_left = 57.0
margin_right = 75.0
focus_mode = 2
text = "28"

[node name="Button29" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer2/GridContainer4" instance=ExtResource( 2 )]
margin_top = 15.0
margin_right = 18.0
margin_bottom = 29.0
focus_mode = 2
text = "29"

[node name="Button30" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer2/GridContainer4" instance=ExtResource( 2 )]
margin_left = 19.0
margin_top = 15.0
margin_right = 37.0
margin_bottom = 29.0
focus_mode = 2
text = "30"

[node name="Button31" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer2/GridContainer4" instance=ExtResource( 2 )]
margin_left = 38.0
margin_top = 15.0
margin_right = 56.0
margin_bottom = 29.0
focus_mode = 2
text = "31"

[node name="Button32" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer2/GridContainer4" instance=ExtResource( 2 )]
margin_left = 57.0
margin_top = 15.0
margin_right = 75.0
margin_bottom = 29.0
focus_mode = 2
text = "32"

[node name="VBoxContainer2" type="VBoxContainer" parent="MarginContainer/HBoxContainer"]
margin_left = 1252.0
margin_right = 1280.0
margin_left = 996.0
margin_right = 1024.0
margin_bottom = 70.0
alignment = 1

Expand Down

0 comments on commit 1352d34

Please sign in to comment.