Added a class and script property by default to the property inspector.

This commit is contained in:
Relintai 2021-12-27 22:20:09 +01:00
parent cfc3bc5ff7
commit e13be6f3f5
3 changed files with 56 additions and 4 deletions

View File

@ -106,7 +106,7 @@ func generate_terra_chunk(chunk: TerraChunk, pseed : int, spawn_mobs: bool) -> v
_generate_terra_chunk_fallback(chunk, pseed, spawn_mobs)
return
for i in range(stack.size() - 1, -1, -1):
for i in range(stack.size()):
stack[i]._generate_terra_chunk(chunk, pseed, spawn_mobs, stack, i)
func _generate_terra_chunk(chunk: TerraChunk, pseed : int, spawn_mobs: bool, stack : Array, stack_index : int) -> void:

View File

@ -348,9 +348,21 @@ func clear() -> void:
func refresh() -> void:
clear()
var cls_str : String = "[none]"
var script_str : String = "[none]"
if _edited_resource:
cls_str = _edited_resource.get_class()
var scr = _edited_resource.get_script()
if scr:
script_str = scr.resource_path
_edited_resource.setup_property_inspector(self)
$MainContainer/HBoxContainer/ClassLE.text = cls_str
$MainContainer/HBoxContainer2/ScriptLE.text = script_str
func edit_resource(wgw) -> void:
if _edited_resource:

View File

@ -14,7 +14,7 @@ __meta__ = {
[node name="MainContainer" type="VBoxContainer" parent="."]
margin_right = 1024.0
margin_bottom = 18.0
margin_bottom = 74.0
size_flags_horizontal = 3
[node name="Label" type="Label" parent="MainContainer"]
@ -24,8 +24,48 @@ text = "Properties"
align = 1
valign = 1
[node name="Content" type="VBoxContainer" parent="MainContainer"]
[node name="HBoxContainer" type="HBoxContainer" parent="MainContainer"]
margin_top = 18.0
margin_right = 1024.0
margin_bottom = 18.0
margin_bottom = 42.0
size_flags_horizontal = 3
[node name="Label" type="Label" parent="MainContainer/HBoxContainer"]
margin_top = 5.0
margin_right = 37.0
margin_bottom = 19.0
text = "Class "
valign = 1
[node name="ClassLE" type="LineEdit" parent="MainContainer/HBoxContainer"]
margin_left = 41.0
margin_right = 1024.0
margin_bottom = 24.0
size_flags_horizontal = 3
editable = false
[node name="HBoxContainer2" type="HBoxContainer" parent="MainContainer"]
margin_top = 46.0
margin_right = 1024.0
margin_bottom = 70.0
size_flags_horizontal = 3
[node name="Label" type="Label" parent="MainContainer/HBoxContainer2"]
margin_top = 5.0
margin_right = 36.0
margin_bottom = 19.0
text = "Script"
valign = 1
[node name="ScriptLE" type="LineEdit" parent="MainContainer/HBoxContainer2"]
margin_left = 40.0
margin_right = 1024.0
margin_bottom = 24.0
size_flags_horizontal = 3
editable = false
[node name="Content" type="VBoxContainer" parent="MainContainer"]
margin_top = 74.0
margin_right = 1024.0
margin_bottom = 74.0
size_flags_horizontal = 3