make nodes always show visual name
This commit is contained in:
parent
694a55f8e1
commit
24e44cfbff
5 changed files with 17 additions and 5 deletions
|
@ -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
Add a link
Reference in a new issue