Intial commit
This commit is contained in:
@ -0,0 +1,111 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://addons/EXP-System-Dialog/Dialog Editor/Nodes/Line/line_node.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/EXP-System-Dialog/Dialog Editor/Nodes/Line/icon_distraction_free.svg" type="Texture" id=2]
|
||||
|
||||
|
||||
[node name="Line" type="GraphNode"]
|
||||
margin_right = 324.0
|
||||
margin_bottom = 137.0
|
||||
rect_min_size = Vector2( 324, 137 )
|
||||
title = "Line"
|
||||
offset = Vector2( 40, 40 )
|
||||
show_close = true
|
||||
resizable = true
|
||||
slot/0/left_enabled = true
|
||||
slot/0/left_type = 0
|
||||
slot/0/left_color = Color( 1, 1, 1, 1 )
|
||||
slot/0/right_enabled = true
|
||||
slot/0/right_type = 0
|
||||
slot/0/right_color = Color( 1, 1, 1, 1 )
|
||||
slot/1/left_enabled = false
|
||||
slot/1/left_type = 0
|
||||
slot/1/left_color = Color( 1, 1, 1, 1 )
|
||||
slot/1/right_enabled = false
|
||||
slot/1/right_type = 0
|
||||
slot/1/right_color = Color( 1, 1, 1, 1 )
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
margin_left = 16.0
|
||||
margin_top = 39.0
|
||||
margin_right = 380.0
|
||||
margin_bottom = 131.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"]
|
||||
margin_right = 364.0
|
||||
margin_bottom = 64.0
|
||||
|
||||
[node name="TextEdit" type="TextEdit" parent="VBoxContainer/HBoxContainer2"]
|
||||
margin_right = 328.0
|
||||
margin_bottom = 64.0
|
||||
rect_min_size = Vector2( 256, 64 )
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
smooth_scrolling = true
|
||||
|
||||
[node name="Editor_BTN" type="Button" parent="VBoxContainer/HBoxContainer2"]
|
||||
margin_left = 332.0
|
||||
margin_right = 364.0
|
||||
margin_bottom = 64.0
|
||||
rect_min_size = Vector2( 32, 0 )
|
||||
hint_tooltip = "Expand this node's text editor."
|
||||
icon = ExtResource( 2 )
|
||||
expand_icon = true
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
margin_top = 68.0
|
||||
margin_right = 364.0
|
||||
margin_bottom = 92.0
|
||||
alignment = 1
|
||||
|
||||
[node name="Save_BTN" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
margin_right = 125.0
|
||||
margin_bottom = 24.0
|
||||
hint_tooltip = "Save the current text as a template that can quickly loaded into new nodes."
|
||||
text = "Save Template As"
|
||||
|
||||
[node name="Load_BTN" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
margin_left = 129.0
|
||||
margin_right = 235.0
|
||||
margin_bottom = 24.0
|
||||
hint_tooltip = "Load a template from file."
|
||||
text = "Load Template"
|
||||
|
||||
[node name="VSeparator" type="VSeparator" parent="VBoxContainer/HBoxContainer"]
|
||||
margin_left = 239.0
|
||||
margin_right = 243.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="Link_LBL" type="Label" parent="VBoxContainer/HBoxContainer"]
|
||||
margin_left = 247.0
|
||||
margin_top = 5.0
|
||||
margin_right = 286.0
|
||||
margin_bottom = 19.0
|
||||
text = "Slots: "
|
||||
|
||||
[node name="Link_SpinBox" type="SpinBox" parent="VBoxContainer/HBoxContainer"]
|
||||
margin_left = 290.0
|
||||
margin_right = 364.0
|
||||
margin_bottom = 24.0
|
||||
hint_tooltip = "Change the number of output slots on this node."
|
||||
min_value = 1.0
|
||||
value = 1.0
|
||||
rounded = true
|
||||
allow_greater = true
|
||||
[connection signal="close_request" from="." to="." method="_on_Line_close_request"]
|
||||
[connection signal="offset_changed" from="." to="." method="_on_Line_offset_changed"]
|
||||
[connection signal="resize_request" from="." to="." method="_on_Line_resize_request"]
|
||||
[connection signal="text_changed" from="VBoxContainer/HBoxContainer2/TextEdit" to="." method="_on_TextEdit_text_changed"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Editor_BTN" to="." method="_on_Editor_BTN_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Save_BTN" to="." method="_on_Save_BTN_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Load_BTN" to="." method="_on_Load_BTN_pressed"]
|
||||
[connection signal="value_changed" from="VBoxContainer/HBoxContainer/Link_SpinBox" to="." method="_on_Link_SpinBox_value_changed"]
|
@ -0,0 +1 @@
|
||||
<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1 1v5l1.793-1.793 2.5 2.5 1.4141-1.4141-2.5-2.5 1.793-1.793h-5zm9 0 1.793 1.793-2.5 2.5 1.4141 1.4141 2.5-2.5 1.793 1.793v-5h-5zm-4.707 8.293-2.5 2.5-1.793-1.793v5h5l-1.793-1.793 2.5-2.5-1.4141-1.4141zm5.4141 0-1.4141 1.4141 2.5 2.5-1.793 1.793h5v-5l-1.793 1.793-2.5-2.5z" fill="#e0e0e0"/></svg>
|
After Width: | Height: | Size: 388 B |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon_distraction_free.svg-5120bf5545890a3868c1108c903f7cd9.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/EXP-System-Dialog/Dialog Editor/Nodes/Line/icon_distraction_free.svg"
|
||||
dest_files=[ "res://.import/icon_distraction_free.svg-5120bf5545890a3868c1108c903f7cd9.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
@ -0,0 +1,114 @@
|
||||
tool
|
||||
extends GraphNode
|
||||
|
||||
signal changed_offset(nid, vec2)
|
||||
signal changed_size(this)
|
||||
signal changed_slots(this)
|
||||
signal erased(this)
|
||||
signal pressed_editor(this)
|
||||
signal pressed_load(this)
|
||||
signal pressed_save(this)
|
||||
signal text_changed(nid, new_text)
|
||||
|
||||
onready var _Link_SpinBox = self.get_node("VBoxContainer/HBoxContainer/Link_SpinBox")
|
||||
onready var _Text_Editor = self.get_node("VBoxContainer/HBoxContainer2/TextEdit")
|
||||
|
||||
var _nid : int = 0
|
||||
var _slot_amount : int = 1
|
||||
|
||||
#Virtual Methods
|
||||
|
||||
func _ready():
|
||||
self._update_slots()
|
||||
|
||||
#Callback Methods
|
||||
|
||||
func _on_Editor_BTN_pressed():
|
||||
self.emit_signal("pressed_editor", self)
|
||||
|
||||
|
||||
func _on_Line_close_request():
|
||||
self.emit_signal("erased", self)
|
||||
|
||||
|
||||
func _on_Line_offset_changed():
|
||||
self.emit_signal("changed_offset", self._nid, self.offset)
|
||||
|
||||
|
||||
func _on_Line_resize_request(new_minsize):
|
||||
self.rect_size = new_minsize
|
||||
self.emit_signal("changed_size", self)
|
||||
|
||||
|
||||
func _on_Link_SpinBox_value_changed(value):
|
||||
self._slot_amount = int(self._Link_SpinBox.value)
|
||||
self._update_slots()
|
||||
self.emit_signal("changed_slots", self)
|
||||
|
||||
|
||||
func _on_Load_BTN_pressed():
|
||||
self.emit_signal("pressed_load", self)
|
||||
|
||||
|
||||
func _on_Save_BTN_pressed():
|
||||
self.emit_signal("pressed_save", self)
|
||||
|
||||
|
||||
func _on_TextEdit_text_changed():
|
||||
self.emit_signal("text_changed", self._nid, self._Text_Editor.text)
|
||||
|
||||
#Public Methods
|
||||
|
||||
func get_nid() -> int:
|
||||
return self._nid
|
||||
|
||||
|
||||
func get_slot_amount() -> int:
|
||||
return self._slot_amount
|
||||
|
||||
|
||||
func get_text() -> String:
|
||||
return self._Text_Editor.text
|
||||
|
||||
|
||||
func set_nid(new_nid):
|
||||
self._nid = new_nid
|
||||
var new_name = "NID " + str(new_nid)
|
||||
self.title = new_name
|
||||
self.name = new_name
|
||||
|
||||
|
||||
func set_slot_amount(new_amount : int):
|
||||
self._slot_amount = new_amount
|
||||
|
||||
|
||||
func set_text(new_text : String):
|
||||
self._Text_Editor.text = new_text
|
||||
self.emit_signal("text_changed", self._nid, new_text)
|
||||
|
||||
#Private Methods
|
||||
|
||||
func _clear_link_labels():
|
||||
var children = self.get_children()
|
||||
for child in children:
|
||||
if child is Label:
|
||||
child.free()
|
||||
|
||||
|
||||
func _update_slots():
|
||||
self.clear_all_slots()
|
||||
self._clear_link_labels()
|
||||
self.set_slot(0, true, 0, Color(1.0, 1.0, 1.0, 1.0), true, 0, Color(1.0, 1.0, 1.0, 1.0), null, null)
|
||||
var base_link_label = Label.new()
|
||||
base_link_label.text = "0"
|
||||
base_link_label.align = Label.ALIGN_RIGHT
|
||||
self.add_child(base_link_label)
|
||||
self.move_child(base_link_label, 0)
|
||||
var last_output_link_label = base_link_label
|
||||
for slot in range(1, self._slot_amount):
|
||||
self.set_slot(slot, false, 0, Color(1.0, 1.0, 1.0, 1.0), true, 0, Color(1.0, 1.0, 1.0, 1.0), null, null)
|
||||
var output_link_label = Label.new()
|
||||
output_link_label.text = str(slot)
|
||||
output_link_label.align = Label.ALIGN_RIGHT
|
||||
self.add_child_below_node(last_output_link_label, output_link_label)
|
||||
last_output_link_label = output_link_label
|
Reference in New Issue
Block a user