make nodes always show visual name
This commit is contained in:
parent
694a55f8e1
commit
24e44cfbff
5 changed files with 17 additions and 5 deletions
|
@ -21,8 +21,10 @@ anchor_left = 1.0
|
|||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -40.0
|
||||
offset_top = -23.0
|
||||
offset_left = -855.0
|
||||
offset_top = -59.0
|
||||
offset_right = -4.0
|
||||
offset_bottom = -4.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
theme = ExtResource("1_omqfp")
|
||||
|
|
|
@ -29,6 +29,14 @@ grow_vertical = 2
|
|||
texture = SubResource("GradientTexture1D_2eix6")
|
||||
stretch_mode = 1
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 4.0
|
||||
offset_top = 4.0
|
||||
offset_right = 249.0
|
||||
offset_bottom = 27.0
|
||||
text = "Editing nodes, press ESC to exit."
|
||||
|
||||
[node name="Search" parent="." instance=ExtResource("1_xwfut")]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
|
|
|
@ -8,9 +8,12 @@ var dragOffset : Vector2
|
|||
var loadNodeRow : Resource
|
||||
var special_condition : String
|
||||
|
||||
@export var visual_name : String
|
||||
|
||||
func _ready():
|
||||
loadNodeRow = preload("res://Scenes/Nodes/Node Row.tscn")
|
||||
(get_node("Margins").get_node("Holder").get_node("Title").get_node("Exit Button") as Button).connect("button_down",self.delete_whole_node)
|
||||
if (visual_name != ""): _set_title(visual_name)
|
||||
|
||||
func _process(delta):
|
||||
if dragging:
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
extends GL_Node
|
||||
|
||||
@export var identification : String
|
||||
@export var visual_name : String
|
||||
@export var names : PackedStringArray
|
||||
@export var types : PackedStringArray
|
||||
|
||||
func _ready():
|
||||
super._ready()
|
||||
_set_title(visual_name)
|
||||
for i in names.size():
|
||||
match(types[i].to_lower()):
|
||||
"float":
|
||||
|
|
|
@ -49,7 +49,8 @@ func _set_rows():
|
|||
for key in rows:
|
||||
var row = load("res://Scenes/UI/Search Row.tscn").instantiate()
|
||||
var button = (row.get_node("Button") as Button)
|
||||
button.text = str(key)
|
||||
var visualName = load("res://Scenes/Node Types/" + str(key) + ".tscn").instantiate().get_node("Node").visual_name
|
||||
button.text = visualName if visualName != "" else str(key)
|
||||
button.pressed.connect(func():
|
||||
_create_node(button.text)
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue