diff --git a/addons/material_maker/icons/add.png b/addons/material_maker/icons/add.png deleted file mode 100644 index c4b0c58..0000000 Binary files a/addons/material_maker/icons/add.png and /dev/null differ diff --git a/addons/material_maker/icons/add_config.png b/addons/material_maker/icons/add_config.png deleted file mode 100644 index 358c235..0000000 Binary files a/addons/material_maker/icons/add_config.png and /dev/null differ diff --git a/addons/material_maker/icons/add_link.png b/addons/material_maker/icons/add_link.png deleted file mode 100644 index 6555533..0000000 Binary files a/addons/material_maker/icons/add_link.png and /dev/null differ diff --git a/addons/material_maker/icons/config.png b/addons/material_maker/icons/config.png deleted file mode 100644 index c565d96..0000000 Binary files a/addons/material_maker/icons/config.png and /dev/null differ diff --git a/addons/material_maker/icons/edit.png b/addons/material_maker/icons/edit.png deleted file mode 100644 index 4e76bbc..0000000 Binary files a/addons/material_maker/icons/edit.png and /dev/null differ diff --git a/addons/material_maker/icons/icons.svg b/addons/material_maker/icons/icons.svg index a4a4505..f7fed9a 100644 --- a/addons/material_maker/icons/icons.svg +++ b/addons/material_maker/icons/icons.svg @@ -50,7 +50,7 @@ inkscape:pageshadow="2" inkscape:zoom="14.304427" inkscape:cx="33.274902" - inkscape:cy="30.161917" + inkscape:cy="41.347265" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -63,7 +63,8 @@ units="px" scale-x="2.1" inkscape:snap-to-guides="false" - inkscape:snap-grids="false"> + inkscape:snap-grids="false" + inkscape:snap-global="false"> image/svg+xml - + @@ -89,7 +90,7 @@ transform="translate(0,-280.06665)"> @@ -133,7 +134,7 @@ inkscape:export-filename="config.png" inkscape:export-xdpi="16.559999" inkscape:export-ydpi="16.559999" - transform="matrix(0.53954693,0,0,0.52735129,-2.0235322,258.7025)"> + transform="matrix(0.52573689,0,0,0.513409,30.847756,292.09585)"> + + + + + + + + + diff --git a/addons/material_maker/icons/link.png b/addons/material_maker/icons/link.png deleted file mode 100644 index 062da20..0000000 Binary files a/addons/material_maker/icons/link.png and /dev/null differ diff --git a/addons/material_maker/icons/link.tres b/addons/material_maker/icons/link.tres new file mode 100644 index 0000000..6f79838 --- /dev/null +++ b/addons/material_maker/icons/link.tres @@ -0,0 +1,8 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=2] + +[ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=1] + +[resource] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 16, 0, 16, 15 ) diff --git a/addons/material_maker/icons/load.png b/addons/material_maker/icons/load.png deleted file mode 100644 index a30d97e..0000000 Binary files a/addons/material_maker/icons/load.png and /dev/null differ diff --git a/addons/material_maker/icons/minus.png b/addons/material_maker/icons/minus.png deleted file mode 100644 index 4d18aa8..0000000 Binary files a/addons/material_maker/icons/minus.png and /dev/null differ diff --git a/addons/material_maker/icons/plus.png b/addons/material_maker/icons/plus.png deleted file mode 100644 index 1b3d9e1..0000000 Binary files a/addons/material_maker/icons/plus.png and /dev/null differ diff --git a/addons/material_maker/icons/remove.png b/addons/material_maker/icons/remove.png deleted file mode 100644 index 8fceffe..0000000 Binary files a/addons/material_maker/icons/remove.png and /dev/null differ diff --git a/addons/material_maker/icons/remove.tres b/addons/material_maker/icons/remove.tres new file mode 100644 index 0000000..34f6a88 --- /dev/null +++ b/addons/material_maker/icons/remove.tres @@ -0,0 +1,8 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=2] + +[ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=1] + +[resource] +flags = 4 +atlas = ExtResource( 1 ) +region = Rect2( 32, 0, 16, 16 ) diff --git a/addons/material_maker/icons/save.png b/addons/material_maker/icons/save.png deleted file mode 100644 index c2e227e..0000000 Binary files a/addons/material_maker/icons/save.png and /dev/null differ diff --git a/addons/material_maker/nodes/custom.tscn b/addons/material_maker/nodes/custom.tscn index d9e6ba0..bc8e85d 100644 --- a/addons/material_maker/nodes/custom.tscn +++ b/addons/material_maker/nodes/custom.tscn @@ -1,9 +1,22 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://addons/material_maker/nodes/custom.gd" type="Script" id=1] -[ext_resource path="res://addons/material_maker/icons/edit.png" type="Texture" id=2] -[ext_resource path="res://addons/material_maker/icons/load.png" type="Texture" id=3] -[ext_resource path="res://addons/material_maker/icons/save.png" type="Texture" id=4] +[ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=2] + +[sub_resource type="AtlasTexture" id=1] +flags = 4 +atlas = ExtResource( 2 ) +region = Rect2( 16, 16, 15, 17 ) + +[sub_resource type="AtlasTexture" id=2] +flags = 4 +atlas = ExtResource( 2 ) +region = Rect2( 48, 16, 16, 16 ) + +[sub_resource type="AtlasTexture" id=3] +flags = 4 +atlas = ExtResource( 2 ) +region = Rect2( 32, 16, 16, 16 ) [node name="Custom" type="GraphNode"] margin_left = 1.0 @@ -25,27 +38,27 @@ model = null [node name="CustomNodeButtons" type="HBoxContainer" parent="."] margin_left = 16.0 margin_top = 24.0 -margin_right = 107.0 -margin_bottom = 46.0 +margin_right = 92.0 +margin_bottom = 47.0 [node name="Edit" type="Button" parent="CustomNodeButtons"] margin_right = 27.0 -margin_bottom = 22.0 -icon = ExtResource( 2 ) +margin_bottom = 23.0 +icon = SubResource( 1 ) flat = true [node name="Load" type="Button" parent="CustomNodeButtons"] margin_left = 31.0 margin_right = 59.0 -margin_bottom = 22.0 -icon = ExtResource( 3 ) +margin_bottom = 23.0 +icon = SubResource( 2 ) flat = true [node name="Save" type="Button" parent="CustomNodeButtons"] margin_left = 63.0 -margin_right = 91.0 -margin_bottom = 22.0 -icon = ExtResource( 4 ) +margin_right = 76.0 +margin_bottom = 23.0 +icon = SubResource( 3 ) flat = true [connection signal="pressed" from="CustomNodeButtons/Edit" to="." method="_on_Edit_pressed"] [connection signal="pressed" from="CustomNodeButtons/Load" to="." method="_on_Load_pressed"] diff --git a/addons/material_maker/nodes/remote.gd b/addons/material_maker/nodes/remote.gd index f7cc1ee..53274e8 100644 --- a/addons/material_maker/nodes/remote.gd +++ b/addons/material_maker/nodes/remote.gd @@ -15,11 +15,11 @@ func add_control(text, control): control.connect("mouse_entered", self, "on_enter_widget", [ control ]) control.connect("mouse_exited", self, "on_exit_widget", [ control ]) var button = Button.new() - button.icon = preload("res://addons/material_maker/icons/link.png") + button.icon = preload("res://addons/material_maker/icons/link.tres") grid.add_child(button) button.connect("pressed", self, "_on_Link_pressed", [ index ]) button = Button.new() - button.icon = preload("res://addons/material_maker/icons/remove.png") + button.icon = preload("res://addons/material_maker/icons/remove.tres") grid.add_child(button) button.connect("pressed", generator, "remove_parameter", [ index ]) diff --git a/addons/material_maker/nodes/remote.tscn b/addons/material_maker/nodes/remote.tscn index c0219f8..0297273 100644 --- a/addons/material_maker/nodes/remote.tscn +++ b/addons/material_maker/nodes/remote.tscn @@ -1,16 +1,25 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://addons/material_maker/nodes/remote.gd" type="Script" id=1] -[ext_resource path="res://addons/material_maker/icons/add_link.png" type="Texture" id=2] -[ext_resource path="res://addons/material_maker/icons/add_config.png" type="Texture" id=3] +[ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=2] -[sub_resource type="Theme" id=1] +[sub_resource type="Theme" id=3] + +[sub_resource type="AtlasTexture" id=2] +flags = 4 +atlas = ExtResource( 2 ) +region = Rect2( 48, 32, 16, 16 ) + +[sub_resource type="AtlasTexture" id=4] +flags = 4 +atlas = ExtResource( 2 ) +region = Rect2( 32, 32, 16, 16 ) [node name="Remote" type="GraphNode"] margin_right = 95.0 margin_bottom = 52.0 mouse_filter = 1 -theme = SubResource( 1 ) +theme = SubResource( 3 ) title = "Remote" show_close = true slot/0/left_enabled = false @@ -45,14 +54,14 @@ margin_right = 28.0 margin_bottom = 22.0 hint_tooltip = "Add linked control" size_flags_horizontal = 0 -icon = ExtResource( 2 ) +icon = SubResource( 2 ) [node name="AddConfig" type="Button" parent="HBoxContainer"] margin_left = 32.0 margin_right = 60.0 margin_bottom = 22.0 hint_tooltip = "Add configurations" -icon = ExtResource( 3 ) +icon = SubResource( 4 ) [connection signal="close_request" from="." to="." method="on_close_request"] [connection signal="offset_changed" from="." to="." method="on_offset_changed"] [connection signal="pressed" from="HBoxContainer/AddLink" to="." method="_on_AddLink_pressed"] diff --git a/addons/material_maker/widgets/linked_widgets/config_control.gd b/addons/material_maker/widgets/linked_widgets/config_control.gd deleted file mode 100644 index 8100501..0000000 --- a/addons/material_maker/widgets/linked_widgets/config_control.gd +++ /dev/null @@ -1,122 +0,0 @@ -tool -extends "res://addons/material_maker/widgets/linked_widgets/linked_control_base.gd" - -var configurations = {} - -var current = null -onready var button = null - -const Types = preload("res://addons/material_maker/types/types.gd") - -func _ready(): - update_options() - -func update_options(): - # Seems "clear" might cause crashes, so we create a new button... - if button != null: - button.hide() - button.queue_free() - button = OptionButton.new() - button.connect("item_selected", self, "_on_item_selected") - button.connect("mouse_entered", self, "_on_mouse_entered") - button.connect("mouse_exited", self, "_on_mouse_exited") - add_child(button) - # Create list of configurations - var keys = configurations.keys() - keys.sort() - # if no configuration is selected, select the first one - if current == null and !keys.empty(): - current = keys[0] - for c in keys: - button.add_item(c) - button.add_separator() - button.add_item("") - if current != null: - button.add_separator() - button.add_item("") - button.add_item("") - for i in range(button.get_item_count()): - if button.get_item_text(i) == current: - button.selected = i - break - -func add_linked(node, widget): - linked_widgets.append({ node=node, widget=widget }) - -func duplicate_value(value): - if typeof(value) == TYPE_OBJECT and value.has_method("duplicate"): - value = value.duplicate() - return value - -func apply_configuration(i): - get_parent().get_parent().generator.set_parameter("param"+str(get_index()%4-1), i) - -func do_update_configuration(name): - var configuration = [] - for w in linked_widgets: - configuration.append({ node=w.node, widget=w.widget, value=duplicate_value(w.node.parameters[w.widget.name]) }) - configurations[name] = configuration - current = name - update_options() - -func update_configuration(): - var dialog = preload("res://addons/material_maker/widgets/line_dialog.tscn").instance() - add_child(dialog) - dialog.set_texts("Configuration", "Enter a name for the new configuration") - dialog.connect("ok", self, "do_update_configuration", []) - dialog.popup_centered() - -func _on_item_selected(ID): - var count = configurations.keys().size() - if ID >= 0 && ID < count: - current = button.get_item_text(ID) - update_options() - apply_configuration(ID) - elif ID == count+1: - button.selected = 0 - update_configuration() - elif ID == count+3: - do_update_configuration(current) - else: - configurations.erase(current) - current = null - update_options() - -func serialize(): - var data = .serialize() - data.type = "config_control" - var data_configurations = {} - var keys = configurations.keys() - for k in keys: - var c = configurations[k] - var data_configuration = [] - for e in c: - data_configuration.append({ node=e.node.name, widget=e.widget.name, value=Types.serialize_value(e.value) }) - data_configurations[k] = data_configuration - data.configurations = data_configurations - return data - -func deserialize(data): - .deserialize(data) - graph_edit = get_parent() - while graph_edit != null && !(graph_edit is GraphEdit): - graph_edit = graph_edit.get_parent() - if graph_edit == null: - return - var keys = data.configurations.keys() - for k in keys: - var c = data.configurations[k] - var configuration = [] - for e in c: - var node = graph_edit.get_node("node_"+e.node) - var widget = null - for w in node.controls: - if w == e.widget: - widget = w - break - configuration.append({ node=node, widget=widget, value=Types.deserialize_value(e.value) }) - configurations[k] = configuration - update_options() - - - diff --git a/addons/material_maker/widgets/linked_widgets/config_control.tscn b/addons/material_maker/widgets/linked_widgets/config_control.tscn deleted file mode 100644 index df482b1..0000000 --- a/addons/material_maker/widgets/linked_widgets/config_control.tscn +++ /dev/null @@ -1,22 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://addons/material_maker/widgets/linked_widgets/config_control.gd" type="Script" id=1] - -[node name="ConfigControl" type="VBoxContainer"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -rect_min_size = Vector2( 70, 0 ) -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 3 -size_flags_vertical = 1 -alignment = 0 -script = ExtResource( 1 ) -_sections_unfolded = [ "Rect", "Size Flags" ] - - diff --git a/addons/material_maker/widgets/linked_widgets/linked_control.gd b/addons/material_maker/widgets/linked_widgets/linked_control.gd deleted file mode 100644 index 82ebee5..0000000 --- a/addons/material_maker/widgets/linked_widgets/linked_control.gd +++ /dev/null @@ -1,107 +0,0 @@ -tool -extends "res://addons/material_maker/widgets/linked_widgets/linked_control_base.gd" - -var control = null - -func add_linked(node, widget): - if linked_widgets.empty(): - control = null - var type - if widget is SpinBox: - control = SpinBox.new() - type = "SpinBox" - elif widget is ColorPickerButton: - control = ColorPickerButton.new() - type = "ColorPickerButton" - elif widget is Control && widget.filename == "res://addons/material_maker/widgets/gradient_editor.tscn": - control = preload("res://addons/material_maker/widgets/gradient_editor.tscn").instance() - type = "GradientEditor" - elif widget is HSlider: - control = HSlider.new() - type = "HSlider" - elif widget is OptionButton: - control = OptionButton.new() - type = "OptionButton" - for i in range(widget.get_item_count()): - control.add_item(widget.get_item_text(i), widget.get_item_id(i)) - if control != null: - add_child(control) - mirror(control, widget, type) - control.connect("mouse_entered", self, "_on_mouse_entered") - control.connect("mouse_exited", self, "_on_mouse_exited") - control.connect(WIDGETS[type].sig, self, WIDGETS[type].sig_handler) - else: - if !can_link_to(widget): - return - linked_widgets.append({ node=node, widget=widget }) - -func can_link_to(c): - if c == null: - return false - var widget_type = get_widget_type(c) - if control == null: - return widget_type != null - elif widget_type != get_widget_type(control): - return false - else: - for l in linked_widgets: - if l.widget == c: - return false - var winfo = WIDGETS[widget_type] - for a in winfo.attrs: - if c.get(a) != control.get(a): - return false - return true - -func mirror(to, from, type): - var winfo = WIDGETS[type] - for a in winfo.attrs: - to.set(a, from.get(a)) - to.set(winfo.value_attr, from.get(winfo.value_attr)) - -func update_shaders(): - var graph_edit = get_parent() - while !(graph_edit is GraphEdit): - graph_edit = graph_edit.get_parent() - graph_edit.send_changed_signal() - -func _on_value_changed(v): - for l in linked_widgets: - l.widget.value = v - var parent = l.widget.get_parent() - while !(parent is GraphNode): - parent = parent.get_parent() - parent.generator.set_parameter(l.widget.name, v) - update_shaders() - -func _on_color_changed(c): - for l in linked_widgets: - l.widget.color = c - var parent = l.widget.get_parent() - while !(parent is GraphNode): - parent = parent.get_parent() - parent.generator.set_parameter(l.widget.name, c) - update_shaders() - -func _on_item_selected(i): - for l in linked_widgets: - l.widget.selected = i - var parent = l.widget.get_parent() - while !(parent is GraphNode): - parent = parent.get_parent() - parent.generator.set_parameter(l.widget.name, i) - update_shaders() - -func _on_gradient_updated(g): - for l in linked_widgets: - l.widget.value = g - var parent = l.widget.get_parent() - while !(parent is GraphNode): - parent = parent.get_parent() - parent.generator.set_parameter(l.widget.name, g) - update_shaders() - -func serialize(): - var data = .serialize() - data.type = "linked_control" - return data diff --git a/addons/material_maker/widgets/linked_widgets/linked_control.tscn b/addons/material_maker/widgets/linked_widgets/linked_control.tscn deleted file mode 100644 index c55268c..0000000 --- a/addons/material_maker/widgets/linked_widgets/linked_control.tscn +++ /dev/null @@ -1,22 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://addons/material_maker/widgets/linked_widgets/linked_control.gd" type="Script" id=1] - -[node name="LinkedControl" type="VBoxContainer"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -rect_min_size = Vector2( 70, 0 ) -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 3 -size_flags_vertical = 1 -alignment = 0 -script = ExtResource( 1 ) -_sections_unfolded = [ "Rect", "Size Flags" ] - - diff --git a/addons/material_maker/widgets/linked_widgets/linked_control_base.gd b/addons/material_maker/widgets/linked_widgets/linked_control_base.gd deleted file mode 100644 index 0952958..0000000 --- a/addons/material_maker/widgets/linked_widgets/linked_control_base.gd +++ /dev/null @@ -1,150 +0,0 @@ -tool -extends VBoxContainer - -var label = null -var buttons = null - -var linked_widgets = [] -var links = null - -const Link = preload("res://addons/material_maker/widgets/linked_widgets/link.gd") - -const WIDGETS = { - SpinBox={ attrs=[ "min_value", "max_value", "step" ], value_attr="value", sig="value_changed", sig_handler="_on_value_changed" }, - HSlider={ attrs=[ "min_value", "max_value", "step" ], value_attr="value", sig="value_changed", sig_handler="_on_value_changed" }, - ColorPickerButton={ attrs=[ "edit_alpha", ], value_attr="color", sig="color_changed", sig_handler="_on_color_changed" }, - OptionButton={ attrs=[ ], value_attr="selected", sig="item_selected", sig_handler="_on_item_selected" }, - GradientEditor={ attrs=[ ], value_attr="value", sig="updated", sig_handler="_on_gradient_updated" } -} - -func get_widget_type(widget): - if widget is SpinBox: - return "SpinBox" - elif widget is ColorPickerButton: - return "ColorPickerButton" - elif widget is Control && widget.filename == "res://addons/material_maker/widgets/gradient_editor.tscn": - return "GradientEditor" - elif widget is HSlider: - return "HSlider" - elif widget is OptionButton: - return "OptionButton" - else: - return null - -func _ready(): - set_process_input(false) - -func add_linked(node, widget): - pass - -func can_link_to(c): - return c != null - -func get_associated_controls(): - label = preload("res://addons/material_maker/widgets/linked_widgets/editable_label.tscn").instance() - label.set_text("Unnamed") - buttons = preload("res://addons/material_maker/widgets/linked_widgets/linked_control_buttons.tscn").instance() - buttons.control = self - return { label=label, buttons=buttons } - -func delete(): - var parent = get_parent() - label.queue_free() - buttons.queue_free() - queue_free() - -func _on_mouse_entered(): - _on_mouse_exited() - get_graph_edit() - if graph_edit == null: - return - links = [] - var viewport = get_viewport() - for w in linked_widgets: - var link = Link.new(graph_edit) - link.source = self - link.target = w.widget - links.append(link) - -func _on_mouse_exited(): - if links != null: - for l in links: - l.queue_free() - links = null - -# Capture mouse to link to a control - -var link = null -var graph_edit = null -var pointed_control = null - -func get_graph_edit(): - graph_edit = get_parent() - while graph_edit != null && !(graph_edit is GraphEdit): - graph_edit = graph_edit.get_parent() - -func find_control(gp): - for c in graph_edit.get_children(): - if c is GraphNode: - if c.get("controls") != null: - for w in c.controls: - var widget = c.controls[w] - if Rect2(widget.rect_global_position, widget.rect_size*widget.get_global_transform().get_scale()).has_point(gp): - return { node=c, widget=widget } - return null - -func _input(event): - if event is InputEventKey: - if event.scancode == KEY_ESCAPE: - set_process_input(false) - link.queue_free() - link = null - elif event is InputEventMouseMotion: - var control = find_control(event.global_position) - link.end = event.global_position - link.target = control.widget if control != null && can_link_to(control.widget) else null - link.update() - elif event is InputEventMouseButton: - if event.pressed: - if event.button_index == BUTTON_LEFT: - var control = find_control(event.global_position) - if control != null: - add_linked(control.node, control.widget) - set_process_input(false) - link.queue_free() - link = null - get_tree().set_input_as_handled() - -func pick_linked(): - # Verify we are in a graph edit - get_graph_edit() - if graph_edit == null: - return - # Create line that will be shown when looking for a target - var viewport = get_viewport() - link = Link.new(graph_edit) - link.source = self - link.end = rect_global_position+0.5*rect_size*get_global_transform().get_scale() - set_process_input(true) - pointed_control = null - -func serialize(): - var data = { label=label.text, linked_widgets=[] } - for w in linked_widgets: - data.linked_widgets.append( { node=w.node.name, widget=w.widget.name } ) - return data - -func deserialize(data): - if data.has("label"): - label.text = data.label - if !data.has("linked_widgets"): - return - var graph_edit = get_parent() - while !(graph_edit is GraphEdit): - graph_edit = graph_edit.get_parent() - for w in data.linked_widgets: - var node = graph_edit.get_node(w.node) - if node != null && node.get("property_widgets") != null: - for widget in node.property_widgets: - if widget.name == w.widget: - add_linked(node, widget) diff --git a/addons/material_maker/widgets/linked_widgets/linked_control_buttons.gd b/addons/material_maker/widgets/linked_widgets/linked_control_buttons.gd deleted file mode 100644 index 139a2cf..0000000 --- a/addons/material_maker/widgets/linked_widgets/linked_control_buttons.gd +++ /dev/null @@ -1,10 +0,0 @@ -tool -extends HBoxContainer - -var control = null - -func _on_Link_pressed(): - control.pick_linked() - -func _on_Remove_pressed(): - control.delete() diff --git a/addons/material_maker/widgets/linked_widgets/linked_control_buttons.tscn b/addons/material_maker/widgets/linked_widgets/linked_control_buttons.tscn deleted file mode 100644 index 761e7c5..0000000 --- a/addons/material_maker/widgets/linked_widgets/linked_control_buttons.tscn +++ /dev/null @@ -1,25 +0,0 @@ -[gd_scene load_steps=4 format=2] - -[ext_resource path="res://addons/material_maker/widgets/linked_widgets/linked_control_buttons.gd" type="Script" id=1] -[ext_resource path="res://addons/material_maker/icons/link.png" type="Texture" id=2] -[ext_resource path="res://addons/material_maker/icons/remove.png" type="Texture" id=3] - -[node name="Buttons" type="HBoxContainer"] -margin_right = 60.0 -margin_bottom = 22.0 -script = ExtResource( 1 ) - -[node name="Link" type="Button" parent="."] -margin_right = 28.0 -margin_bottom = 22.0 -hint_tooltip = "Link new parameter" -icon = ExtResource( 2 ) - -[node name="Remove" type="Button" parent="."] -margin_left = 32.0 -margin_right = 60.0 -margin_bottom = 22.0 -hint_tooltip = "Delete this control" -icon = ExtResource( 3 ) -[connection signal="pressed" from="Link" to="." method="_on_Link_pressed"] -[connection signal="pressed" from="Remove" to="." method="_on_Remove_pressed"] diff --git a/addons/material_maker/widgets/node_editor/input.tscn b/addons/material_maker/widgets/node_editor/input.tscn index b82b98a..0f6b2fd 100644 --- a/addons/material_maker/widgets/node_editor/input.tscn +++ b/addons/material_maker/widgets/node_editor/input.tscn @@ -1,159 +1,56 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://addons/material_maker/widgets/node_editor/input.gd" type="Script" id=1] -[ext_resource path="res://addons/material_maker/icons/minus.png" type="Texture" id=2] +[ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=2] -[node name="Parameter" type="HBoxContainer" index="0"] +[sub_resource type="AtlasTexture" id=1] +flags = 4 +atlas = ExtResource( 2 ) +region = Rect2( 0, 16, 16, 16 ) -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Parameter" type="HBoxContainer"] margin_right = 201.0 margin_bottom = 24.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -alignment = 0 script = ExtResource( 1 ) -[node name="Delete" type="Button" parent="." index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Delete" type="Button" parent="."] margin_right = 28.0 margin_bottom = 24.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null -icon = ExtResource( 2 ) +icon = SubResource( 1 ) flat = true -align = 1 -[node name="Name" type="LineEdit" parent="." index="1"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Name" type="LineEdit" parent="."] margin_left = 32.0 margin_right = 102.0 margin_bottom = 24.0 rect_min_size = Vector2( 70, 0 ) -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false hint_tooltip = "Input name" -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 1 -size_flags_horizontal = 1 -size_flags_vertical = 1 text = "name" -focus_mode = 2 -context_menu_enabled = true -placeholder_alpha = 0.6 -caret_blink = false -caret_blink_speed = 0.65 -caret_position = 0 -_sections_unfolded = [ "Hint", "Rect" ] -[node name="Label" type="LineEdit" parent="." index="2"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Label" type="LineEdit" parent="."] margin_left = 106.0 margin_right = 176.0 margin_bottom = 24.0 rect_min_size = Vector2( 70, 0 ) -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false hint_tooltip = "Input Label" -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 1 -size_flags_horizontal = 1 -size_flags_vertical = 1 text = "Label" -focus_mode = 2 -context_menu_enabled = true -placeholder_alpha = 0.6 -caret_blink = false -caret_blink_speed = 0.65 -caret_position = 0 -_sections_unfolded = [ "Hint", "Rect" ] -[node name="Type" type="OptionButton" parent="." index="3"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Type" type="OptionButton" parent="."] margin_left = 180.0 -margin_right = 282.0 +margin_right = 284.0 margin_bottom = 24.0 rect_min_size = Vector2( 102, 0 ) -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false hint_tooltip = "Input flag" -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -toggle_mode = false -action_mode = 0 -enabled_focus_mode = 2 -shortcut = null -group = null text = "GreyScale" -flat = false -align = 0 items = [ "GreyScale", null, false, 0, null, "Color", null, false, 1, null, "RGBA", null, false, -1, null ] selected = 0 -_sections_unfolded = [ "Focus", "Hint", "Rect" ] -[node name="Default" type="LineEdit" parent="." index="4"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_left = 286.0 -margin_right = 356.0 +[node name="Default" type="LineEdit" parent="."] +margin_left = 288.0 +margin_right = 358.0 margin_bottom = 24.0 rect_min_size = Vector2( 70, 0 ) -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false hint_tooltip = "Default value" -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 1 size_flags_horizontal = 3 -size_flags_vertical = 1 text = "0.0" -focus_mode = 2 -context_menu_enabled = true -placeholder_alpha = 0.6 -caret_blink = false -caret_blink_speed = 0.65 -caret_position = 0 -_sections_unfolded = [ "Hint", "Rect", "Size Flags" ] - [connection signal="pressed" from="Delete" to="." method="_on_Delete_pressed"] - - diff --git a/addons/material_maker/widgets/node_editor/node_editor.tscn b/addons/material_maker/widgets/node_editor/node_editor.tscn index e10dc1e..6f59874 100644 --- a/addons/material_maker/widgets/node_editor/node_editor.tscn +++ b/addons/material_maker/widgets/node_editor/node_editor.tscn @@ -1,584 +1,193 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://addons/material_maker/widgets/node_editor/node_editor.gd" type="Script" id=1] -[ext_resource path="res://addons/material_maker/icons/plus.png" type="Texture" id=2] +[ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=2] -[node name="NodeEditor" type="WindowDialog" index="0"] +[sub_resource type="AtlasTexture" id=1] +flags = 4 +atlas = ExtResource( 2 ) +region = Rect2( 48, 0, 16, 16 ) -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="NodeEditor" type="WindowDialog"] margin_right = 833.0 margin_bottom = 398.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 popup_exclusive = true window_title = "Node Editor" -resizable = false script = ExtResource( 1 ) -_sections_unfolded = [ "Popup" ] -[node name="Sizer" type="VBoxContainer" parent="." index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 +[node name="Sizer" type="VBoxContainer" parent="."] anchor_right = 1.0 anchor_bottom = 1.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 size_flags_horizontal = 3 size_flags_vertical = 3 -alignment = 0 -_sections_unfolded = [ "Size Flags" ] -[node name="Tabs" type="TabContainer" parent="Sizer" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Tabs" type="TabContainer" parent="Sizer"] margin_right = 833.0 margin_bottom = 374.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 0 -mouse_default_cursor_shape = 0 size_flags_horizontal = 3 size_flags_vertical = 3 tab_align = 0 -tabs_visible = true -_sections_unfolded = [ "Size Flags" ] -[node name="General" type="VBoxContainer" parent="Sizer/Tabs" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 +[node name="General" type="VBoxContainer" parent="Sizer/Tabs"] anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 4.0 margin_top = 32.0 margin_right = -4.0 margin_bottom = -4.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -alignment = 0 -[node name="Name" type="HBoxContainer" parent="Sizer/Tabs/General" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Name" type="HBoxContainer" parent="Sizer/Tabs/General"] margin_right = 825.0 margin_bottom = 24.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 size_flags_horizontal = 3 -size_flags_vertical = 1 -alignment = 0 -_sections_unfolded = [ "Size Flags" ] -[node name="LabelName" type="Label" parent="Sizer/Tabs/General/Name" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="LabelName" type="Label" parent="Sizer/Tabs/General/Name"] margin_top = 5.0 margin_right = 42.0 margin_bottom = 19.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 2 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 4 text = "Name:" -percent_visible = 1.0 -lines_skipped = 0 -max_lines_visible = -1 -_sections_unfolded = [ "Size Flags" ] -[node name="Name" type="LineEdit" parent="Sizer/Tabs/General/Name" index="1"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Name" type="LineEdit" parent="Sizer/Tabs/General/Name"] margin_left = 46.0 margin_right = 825.0 margin_bottom = 24.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 1 size_flags_horizontal = 3 -size_flags_vertical = 1 -focus_mode = 2 -context_menu_enabled = true -placeholder_alpha = 0.6 -caret_blink = false -caret_blink_speed = 0.65 -caret_position = 0 -_sections_unfolded = [ "Size Flags" ] -[node name="LabelParameters" type="Label" parent="Sizer/Tabs/General" index="1"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="LabelParameters" type="Label" parent="Sizer/Tabs/General"] margin_top = 28.0 margin_right = 825.0 margin_bottom = 42.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 2 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 4 text = "Parameters:" -percent_visible = 1.0 -lines_skipped = 0 -max_lines_visible = -1 -_sections_unfolded = [ "Size Flags" ] -[node name="Parameters" type="ScrollContainer" parent="Sizer/Tabs/General" index="2"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Parameters" type="ScrollContainer" parent="Sizer/Tabs/General"] margin_top = 46.0 margin_right = 825.0 margin_bottom = 181.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = true -mouse_filter = 0 -mouse_default_cursor_shape = 0 size_flags_horizontal = 3 size_flags_vertical = 3 scroll_horizontal_enabled = false -scroll_horizontal = 0 -scroll_vertical_enabled = true -scroll_vertical = 0 -scroll_deadzone = 0 -_sections_unfolded = [ "Size Flags" ] -[node name="Sizer" type="VBoxContainer" parent="Sizer/Tabs/General/Parameters" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Sizer" type="VBoxContainer" parent="Sizer/Tabs/General/Parameters"] margin_right = 825.0 margin_bottom = 22.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 size_flags_horizontal = 3 -size_flags_vertical = 1 -alignment = 0 -_sections_unfolded = [ "Size Flags" ] -[node name="AddParameter" type="Button" parent="Sizer/Tabs/General/Parameters/Sizer" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="AddParameter" type="Button" parent="Sizer/Tabs/General/Parameters/Sizer"] margin_right = 28.0 margin_bottom = 22.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 size_flags_horizontal = 0 -size_flags_vertical = 1 -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null -icon = ExtResource( 2 ) +icon = SubResource( 1 ) flat = true -align = 1 -_sections_unfolded = [ "Size Flags" ] -[node name="LabelInputs" type="Label" parent="Sizer/Tabs/General" index="3"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="LabelInputs" type="Label" parent="Sizer/Tabs/General"] margin_top = 185.0 margin_right = 825.0 margin_bottom = 199.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 2 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 4 text = "Inputs:" -percent_visible = 1.0 -lines_skipped = 0 -max_lines_visible = -1 -_sections_unfolded = [ "Size Flags" ] -[node name="Inputs" type="ScrollContainer" parent="Sizer/Tabs/General" index="4"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Inputs" type="ScrollContainer" parent="Sizer/Tabs/General"] margin_top = 203.0 margin_right = 825.0 margin_bottom = 338.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = true -mouse_filter = 0 -mouse_default_cursor_shape = 0 size_flags_horizontal = 3 size_flags_vertical = 3 scroll_horizontal_enabled = false -scroll_horizontal = 0 -scroll_vertical_enabled = true -scroll_vertical = 0 -scroll_deadzone = 0 -_sections_unfolded = [ "Scroll", "Size Flags" ] -[node name="Sizer" type="VBoxContainer" parent="Sizer/Tabs/General/Inputs" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Sizer" type="VBoxContainer" parent="Sizer/Tabs/General/Inputs"] margin_right = 825.0 margin_bottom = 22.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 size_flags_horizontal = 3 -size_flags_vertical = 1 -alignment = 0 -_sections_unfolded = [ "Size Flags" ] -[node name="AddInput" type="Button" parent="Sizer/Tabs/General/Inputs/Sizer" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="AddInput" type="Button" parent="Sizer/Tabs/General/Inputs/Sizer"] margin_right = 28.0 margin_bottom = 22.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 size_flags_horizontal = 0 -size_flags_vertical = 1 -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null -icon = ExtResource( 2 ) +icon = SubResource( 1 ) flat = true -align = 1 -_sections_unfolded = [ "Size Flags" ] - -[node name="Outputs" type="VBoxContainer" parent="Sizer/Tabs" index="1"] +[node name="Outputs" type="VBoxContainer" parent="Sizer/Tabs"] visible = false -anchor_left = 0.0 -anchor_top = 0.0 anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 4.0 margin_top = 32.0 margin_right = -4.0 margin_bottom = -4.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -alignment = 0 -[node name="LabelOutputs" type="Label" parent="Sizer/Tabs/Outputs" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="LabelOutputs" type="Label" parent="Sizer/Tabs/Outputs"] margin_right = 825.0 margin_bottom = 14.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 2 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 4 text = "Outputs:" -percent_visible = 1.0 -lines_skipped = 0 -max_lines_visible = -1 -_sections_unfolded = [ "Size Flags" ] -[node name="Outputs" type="ScrollContainer" parent="Sizer/Tabs/Outputs" index="1"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Outputs" type="ScrollContainer" parent="Sizer/Tabs/Outputs"] margin_top = 18.0 margin_right = 825.0 margin_bottom = 338.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = true -mouse_filter = 0 -mouse_default_cursor_shape = 0 size_flags_horizontal = 3 size_flags_vertical = 3 scroll_horizontal_enabled = false -scroll_horizontal = 0 -scroll_vertical_enabled = true -scroll_vertical = 0 -scroll_deadzone = 0 -_sections_unfolded = [ "Size Flags" ] -[node name="Sizer" type="VBoxContainer" parent="Sizer/Tabs/Outputs/Outputs" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Sizer" type="VBoxContainer" parent="Sizer/Tabs/Outputs/Outputs"] margin_right = 825.0 margin_bottom = 22.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 size_flags_horizontal = 3 -size_flags_vertical = 1 -alignment = 0 -_sections_unfolded = [ "Size Flags" ] -[node name="AddOutput" type="Button" parent="Sizer/Tabs/Outputs/Outputs/Sizer" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="AddOutput" type="Button" parent="Sizer/Tabs/Outputs/Outputs/Sizer"] margin_right = 28.0 margin_bottom = 22.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 size_flags_horizontal = 0 -size_flags_vertical = 1 -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null -icon = ExtResource( 2 ) +icon = SubResource( 1 ) flat = true -align = 1 -_sections_unfolded = [ "Size Flags" ] - -[node name="Global" type="TextEdit" parent="Sizer/Tabs" index="2"] +[node name="Global" type="TextEdit" parent="Sizer/Tabs"] visible = false -anchor_left = 0.0 -anchor_top = 0.0 anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 4.0 margin_top = 32.0 margin_right = -4.0 margin_bottom = -4.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -text = "" -readonly = false -highlight_current_line = false -syntax_highlighting = false -show_line_numbers = false -highlight_all_occurrences = false -override_selected_font_color = false -context_menu_enabled = true -smooth_scrolling = false -v_scroll_speed = 80.0 -hiding_enabled = 0 -wrap_lines = false -caret_block_mode = false -caret_blink = false -caret_blink_speed = 0.65 -caret_moving_by_right_click = true - -[node name="Instance" type="TextEdit" parent="Sizer/Tabs" index="3"] +[node name="Instance" type="TextEdit" parent="Sizer/Tabs"] visible = false -anchor_left = 0.0 -anchor_top = 0.0 anchor_right = 1.0 anchor_bottom = 1.0 margin_left = 4.0 margin_top = 32.0 margin_right = -4.0 margin_bottom = -4.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -text = "" -readonly = false -highlight_current_line = false -syntax_highlighting = false -show_line_numbers = false -highlight_all_occurrences = false -override_selected_font_color = false -context_menu_enabled = true -smooth_scrolling = false -v_scroll_speed = 80.0 -hiding_enabled = 0 -wrap_lines = false -caret_block_mode = false -caret_blink = false -caret_blink_speed = 0.65 -caret_moving_by_right_click = true -[node name="HBoxContainer" type="HBoxContainer" parent="Sizer" index="1"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="HBoxContainer" type="HBoxContainer" parent="Sizer"] margin_left = 307.0 margin_top = 378.0 margin_right = 525.0 margin_bottom = 398.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 size_flags_horizontal = 4 -size_flags_vertical = 1 -alignment = 0 -_sections_unfolded = [ "Size Flags" ] -[node name="Apply" type="Button" parent="Sizer/HBoxContainer" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Apply" type="Button" parent="Sizer/HBoxContainer"] margin_right = 70.0 margin_bottom = 20.0 rect_min_size = Vector2( 70, 0 ) -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null text = "Apply" -flat = false -align = 1 -[node name="OK" type="Button" parent="Sizer/HBoxContainer" index="1"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="OK" type="Button" parent="Sizer/HBoxContainer"] margin_left = 74.0 margin_right = 144.0 margin_bottom = 20.0 rect_min_size = Vector2( 70, 0 ) -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null text = "OK" -flat = false -align = 1 -[node name="Cancel" type="Button" parent="Sizer/HBoxContainer" index="2"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Cancel" type="Button" parent="Sizer/HBoxContainer"] margin_left = 148.0 margin_right = 218.0 margin_bottom = 20.0 rect_min_size = Vector2( 70, 0 ) -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null text = "Cancel" -flat = false -align = 1 - [connection signal="pressed" from="Sizer/Tabs/General/Parameters/Sizer/AddParameter" to="." method="_on_AddParameter_pressed"] - [connection signal="pressed" from="Sizer/Tabs/General/Inputs/Sizer/AddInput" to="." method="_on_AddInput_pressed"] - [connection signal="pressed" from="Sizer/Tabs/Outputs/Outputs/Sizer/AddOutput" to="." method="_on_AddOutput_pressed"] - [connection signal="pressed" from="Sizer/HBoxContainer/Apply" to="." method="_on_Apply_pressed"] - [connection signal="pressed" from="Sizer/HBoxContainer/OK" to="." method="_on_OK_pressed"] - [connection signal="pressed" from="Sizer/HBoxContainer/Cancel" to="." method="_on_Cancel_pressed"] - - diff --git a/addons/material_maker/widgets/node_editor/output.tscn b/addons/material_maker/widgets/node_editor/output.tscn index 6374a1e..d6ce248 100644 --- a/addons/material_maker/widgets/node_editor/output.tscn +++ b/addons/material_maker/widgets/node_editor/output.tscn @@ -1,105 +1,40 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://addons/material_maker/widgets/node_editor/output.gd" type="Script" id=1] -[ext_resource path="res://addons/material_maker/icons/minus.png" type="Texture" id=2] +[ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=2] -[node name="Output" type="HBoxContainer" index="0"] +[sub_resource type="AtlasTexture" id=1] +flags = 4 +atlas = ExtResource( 2 ) +region = Rect2( 0, 16, 16, 16 ) -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Output" type="HBoxContainer"] margin_right = 201.0 margin_bottom = 24.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 size_flags_horizontal = 3 -size_flags_vertical = 1 -alignment = 0 script = ExtResource( 1 ) -_sections_unfolded = [ "Size Flags" ] -[node name="Delete" type="Button" parent="." index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Delete" type="Button" parent="."] margin_right = 28.0 margin_bottom = 24.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null -icon = ExtResource( 2 ) +icon = SubResource( 1 ) flat = true -align = 1 -[node name="Type" type="OptionButton" parent="." index="1"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 +[node name="Type" type="OptionButton" parent="."] margin_left = 32.0 -margin_right = 134.0 +margin_right = 136.0 margin_bottom = 24.0 rect_min_size = Vector2( 102, 0 ) -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false hint_tooltip = "Input flag" -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -toggle_mode = false -action_mode = 0 -enabled_focus_mode = 2 -shortcut = null -group = null text = "GreyScale" -flat = false -align = 0 items = [ "GreyScale", null, false, 0, null, "Color", null, false, 1, null, "RGBA", null, false, -1, null ] selected = 0 -_sections_unfolded = [ "Focus", "Hint", "Rect" ] -[node name="Value" type="LineEdit" parent="." index="2"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_left = 138.0 +[node name="Value" type="LineEdit" parent="."] +margin_left = 140.0 margin_right = 201.0 margin_bottom = 24.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false hint_tooltip = "Default value" -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 1 size_flags_horizontal = 3 -size_flags_vertical = 1 text = "0.0" -focus_mode = 2 -context_menu_enabled = true -placeholder_alpha = 0.6 -caret_blink = false -caret_blink_speed = 0.65 -caret_position = 0 -_sections_unfolded = [ "Hint", "Rect", "Size Flags" ] - [connection signal="pressed" from="Delete" to="." method="_on_Delete_pressed"] - - diff --git a/addons/material_maker/widgets/node_editor/parameter.tscn b/addons/material_maker/widgets/node_editor/parameter.tscn index 71b5cfe..43b3a8a 100644 --- a/addons/material_maker/widgets/node_editor/parameter.tscn +++ b/addons/material_maker/widgets/node_editor/parameter.tscn @@ -1,7 +1,7 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://addons/material_maker/widgets/node_editor/parameter.gd" type="Script" id=1] -[ext_resource path="res://addons/material_maker/icons/minus.png" type="Texture" id=2] +[ext_resource path="res://addons/material_maker/icons/icons.svg" type="Texture" id=2] [ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_float.tscn" type="PackedScene" id=3] [ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_size.tscn" type="PackedScene" id=4] [ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_enum.tscn" type="PackedScene" id=5] @@ -9,6 +9,11 @@ [ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_color.tscn" type="PackedScene" id=7] [ext_resource path="res://addons/material_maker/widgets/node_editor/parameter_gradient.tscn" type="PackedScene" id=8] +[sub_resource type="AtlasTexture" id=1] +flags = 4 +atlas = ExtResource( 2 ) +region = Rect2( 0, 16, 16, 16 ) + [node name="Parameter" type="HBoxContainer"] margin_right = 201.0 margin_bottom = 24.0 @@ -16,39 +21,38 @@ script = ExtResource( 1 ) [node name="Delete" type="Button" parent="."] margin_right = 28.0 -margin_bottom = 30.0 -icon = ExtResource( 2 ) +margin_bottom = 24.0 +icon = SubResource( 1 ) flat = true [node name="Name" type="LineEdit" parent="."] margin_left = 32.0 margin_right = 102.0 -margin_bottom = 30.0 +margin_bottom = 24.0 rect_min_size = Vector2( 70, 0 ) text = "name" [node name="Label" type="LineEdit" parent="."] margin_left = 106.0 margin_right = 176.0 -margin_bottom = 30.0 +margin_bottom = 24.0 rect_min_size = Vector2( 70, 0 ) text = "Label" [node name="Type" type="OptionButton" parent="."] margin_left = 180.0 margin_right = 249.0 -margin_bottom = 30.0 +margin_bottom = 24.0 text = "float" -items = [ "float", null, false, -1, null, "size", null, false, -1, null, "enum", null, false, -1, null, "boolean", null, false, -1, null, "color", null, false, -1, null ] +items = [ "float", null, false, -1, null, "size", null, false, -1, null, "enum", null, false, -1, null, "boolean", null, false, -1, null, "color", null, false, -1, null, "gradient", null, false, -1, null ] selected = 0 [node name="Types" type="HBoxContainer" parent="."] margin_left = 253.0 margin_right = 800.0 -margin_bottom = 30.0 +margin_bottom = 24.0 [node name="float" parent="Types" instance=ExtResource( 3 )] -margin_bottom = 30.0 [node name="size" parent="Types" instance=ExtResource( 4 )] visible = false