mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-13 20:47:19 +01:00
Add line edit slot support to mm_graph_node.
This commit is contained in:
parent
ebef2b0fd5
commit
52858a6970
@ -48,6 +48,25 @@ func add_slot_label(input_type : int, output_type : int, getter : String, setter
|
||||
|
||||
return add_slot(input_type, output_type, getter, setter, l)
|
||||
|
||||
func add_slot_line_edit(input_type : int, output_type : int, getter : String, setter : String, slot_name : String, placeholder : String = "") -> int:
|
||||
var bc : VBoxContainer = VBoxContainer.new()
|
||||
|
||||
var l : Label = Label.new()
|
||||
l.text = slot_name
|
||||
bc.add_child(l)
|
||||
|
||||
var le : LineEdit = LineEdit.new()
|
||||
le.placeholder_text = placeholder
|
||||
bc.add_child(le)
|
||||
|
||||
var slot_idx : int = add_slot(input_type, output_type, getter, setter, bc)
|
||||
|
||||
le.text = _node.call(getter)
|
||||
|
||||
le.connect("text_entered", self, "on_slot_line_edit_text_entered", [ slot_idx ])
|
||||
|
||||
return slot_idx
|
||||
|
||||
func add_slot_enum(input_type : int, output_type : int, getter : String, setter : String, slot_name : String, values : Array) -> int:
|
||||
var bc : VBoxContainer = VBoxContainer.new()
|
||||
|
||||
@ -328,3 +347,5 @@ func on_universal_texture_changed(slot_idx : int) -> void:
|
||||
else:
|
||||
properties[slot_idx][5].texture = ImageTexture.new()
|
||||
|
||||
func on_slot_line_edit_text_entered(text : String, slot_idx : int) -> void:
|
||||
_node.call(properties[slot_idx][4], text)
|
||||
|
Loading…
Reference in New Issue
Block a user