From 3975fa7a171cf9f54616f3432c2af8397a506d42 Mon Sep 17 00:00:00 2001 From: LMW Date: Fri, 9 Jan 2026 16:55:41 +0800 Subject: [PATCH] Improve comment node --- .../engine/nodes/gen_comment.gd | 29 +- material_maker/globals.gd | 8 + material_maker/main_window.gd | 1 + material_maker/node_factory.gd | 2 + material_maker/nodes/comment/comment.gd | 343 ++++++++++-------- material_maker/nodes/comment/comment.tscn | 107 ++---- .../panels/graph_edit/graph_edit.gd | 84 ++++- .../panels/graph_edit/graph_edit.tscn | 2 + material_maker/theme/classic_base.tres | 52 ++- material_maker/theme/default light.tres | 19 +- material_maker/theme/default.tres | 79 ++-- material_maker/theme/default_theme_icons.svg | 56 ++- 12 files changed, 466 insertions(+), 316 deletions(-) diff --git a/addons/material_maker/engine/nodes/gen_comment.gd b/addons/material_maker/engine/nodes/gen_comment.gd index ee8016257..ada966111 100644 --- a/addons/material_maker/engine/nodes/gen_comment.gd +++ b/addons/material_maker/engine/nodes/gen_comment.gd @@ -1,5 +1,5 @@ @tool -extends MMGenTexture +extends MMGenBase class_name MMGenComment @@ -7,16 +7,17 @@ class_name MMGenComment var text : String = "" -var size : Vector2 = Vector2(300, 200) +var size : Vector2 = Vector2(350, 200) var title : String = "Comment" +var autoshrink : bool = false + +var attached : PackedStringArray var color = null func _ready() -> void: - if !parameters.has("size"): - parameters.size = 4 if color == null: - color = Color.WHITE if "light" in mm_globals.main_window.theme.resource_path else Color.BLACK + color = Color.WHITE if mm_globals.is_theme_light() else Color.BLACK func get_type() -> String: return "comment" @@ -24,21 +25,15 @@ func get_type() -> String: func get_type_name() -> String: return "Comment" -func get_parameter_defs() -> Array: - return [] - -func get_input_defs() -> Array: - return [] - -func get_output_defs(_show_hidden : bool = false) -> Array: - return [] - -func _serialize(data: Dictionary) -> Dictionary: +func _serialize(data : Dictionary) -> Dictionary: data.type = "comment" data.title = title data.color = MMType.serialize_value(color) data.text = text data.size = { x=size.x, y=size.y } + data.autoshrink = autoshrink + data.attached = attached + data.erase("parameters") return data func _deserialize(data : Dictionary) -> void: @@ -50,3 +45,7 @@ func _deserialize(data : Dictionary) -> void: title = data.title if data.has("color"): color = MMType.deserialize_value(data.color) + if data.has("autoshrink"): + autoshrink = data.autoshrink + if data.has("attached"): + attached = data.attached diff --git a/material_maker/globals.gd b/material_maker/globals.gd index 9fad26779..011e70ed0 100644 --- a/material_maker/globals.gd +++ b/material_maker/globals.gd @@ -251,3 +251,11 @@ func get_node_title_from_gen(generator : MMGenBase) -> String: var gnode : GraphNode = graph.get_node(node_path) return gnode.title.to_snake_case() return "unnamed" + +## Whether light theme (i.e. Default Light) is currently set. +func is_theme_light() -> bool: + return "light" in main_window.theme.resource_path + +## Whether dark theme(i.e. Default Dark or Classic) is currently set. +func is_theme_dark() -> bool: + return "light" not in main_window.theme.resource_path diff --git a/material_maker/main_window.gd b/material_maker/main_window.gd index c5e4389eb..371f51ac5 100644 --- a/material_maker/main_window.gd +++ b/material_maker/main_window.gd @@ -1053,6 +1053,7 @@ func frame_nodes() -> void: # Avoid calling resize twice if not mm_globals.get_config("auto_size_comment"): nodes[0].resize_to_selection() + edit_select_none() nodes[0].selected = true graph_edit.undoredo.end_group() diff --git a/material_maker/node_factory.gd b/material_maker/node_factory.gd index 7a3187c60..109e7c5ce 100644 --- a/material_maker/node_factory.gd +++ b/material_maker/node_factory.gd @@ -21,6 +21,8 @@ func create_node(generator : MMGenBase) -> Node: return node func set_theme_overrides(node, generator : MMGenBase = null) -> void: + if node is GraphFrame: + return var theme : Theme = mm_globals.main_window.theme if node.theme != null && node.theme != theme: return diff --git a/material_maker/nodes/comment/comment.gd b/material_maker/nodes/comment/comment.gd index 4bc3d62ce..205a38015 100644 --- a/material_maker/nodes/comment/comment.gd +++ b/material_maker/nodes/comment/comment.gd @@ -1,39 +1,108 @@ -extends GraphElement +extends GraphFrame class_name MMGraphComment -@onready var title = %Title -@onready var title_edit = %TitleEdit -@onready var editor = %Text +@onready var editor := %Text +var title_label : Label +var title_edit : LineEdit + +var close_button : TextureButton +var autoshrink_button : TextureButton var disable_undoredo_for_offset : bool = false +var undo_action : Dictionary +var redo_action : Dictionary + +var is_resizing : bool = false + +const CHANGE_COLOR_ICON = preload("res://material_maker/icons/color_palette.png") +const CLOSE_BUTTON_ICON = preload("res://material_maker/icons/close.tres") + var generator : MMGenComment: set(g): generator = g - title.text = generator.title + title = generator.title editor.text = generator.text position_offset = generator.position size = generator.size - update_stylebox() - + autoshrink_enabled = generator.autoshrink + + generator.attached = g.attached.duplicate() + attach_from_generator.call_deferred() + if mm_globals.get_config("auto_size_comment"): resize_to_selection() + update_theme() + update_autoshrink_button_tooltip() -var pallette_colors = [ +var palette_colors := [ Color("F8B8B3"), Color("F7FDAF"), Color("AAF3A2"), Color("92DEFC"), Color("AEC5F1"), - Color("B1A7F0") + Color("B1A7F0"), ] -const AUTO_SIZE_PADDING : int = 22 -const AUTO_SIZE_TOP_PADDING : int = 72 -var is_resizing : bool = false -var undo_action : Dictionary = { type="resize_comment" } +func _ready() -> void: + setup_titlebar_controls() + +func attach_from_generator() -> void: + # attach nodes from generator attachments + var graph : MMGraphEdit = get_parent() + if graph and generator.attached.size(): + for node in generator.attached: + if not graph.has_node(node): + return + if graph.get_element_frame(node) == null: + graph.attach_graph_element_to_frame(node, name) + +func setup_titlebar_controls() -> void: + title_label = get_titlebar_hbox().get_child(0) + get_titlebar_hbox().remove_child(title_label) + title_label.size_flags_vertical = Control.SIZE_SHRINK_CENTER + title_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT + title_label.custom_minimum_size.y = 25 + + title_edit = LineEdit.new() + title_edit.alignment = HORIZONTAL_ALIGNMENT_LEFT + title_edit.hide() + title_edit.mouse_filter = Control.MOUSE_FILTER_IGNORE + title_edit.size_flags_horizontal = Control.SIZE_EXPAND_FILL + title_edit.text_submitted.connect(_on_title_edit_focus_exited.unbind(1)) + title_edit.focus_exited.connect(_on_title_edit_focus_exited) + + var change_color_button := TextureButton.new() + change_color_button.texture_normal = CHANGE_COLOR_ICON + change_color_button.size_flags_vertical = Control.SIZE_SHRINK_CENTER + change_color_button.size_flags_horizontal = Control.SIZE_SHRINK_BEGIN + change_color_button.pressed.connect(_on_change_color_pressed) + + close_button = TextureButton.new() + close_button.texture_normal = CLOSE_BUTTON_ICON + close_button.size_flags_vertical = Control.SIZE_SHRINK_CENTER + close_button.size_flags_horizontal = Control.SIZE_SHRINK_BEGIN + close_button.pressed.connect(_on_close_pressed) + + autoshrink_button = TextureButton.new() + autoshrink_button.texture_normal = get_theme_icon("shrink", "MM_Icons") + autoshrink_button.size_flags_vertical = Control.SIZE_SHRINK_CENTER + autoshrink_button.size_flags_horizontal = Control.SIZE_SHRINK_BEGIN + autoshrink_button.gui_input.connect(_on_autoshrink_gui_input) + + var hbox_spacer := Control.new() + hbox_spacer.custom_minimum_size.x = 0.5 + hbox_spacer.size_flags_horizontal = Control.SIZE_SHRINK_BEGIN + + get_titlebar_hbox().add_child(hbox_spacer) + get_titlebar_hbox().add_child(title_label) + get_titlebar_hbox().add_child(title_edit) + get_titlebar_hbox().add_child(autoshrink_button) + get_titlebar_hbox().add_child(change_color_button) + get_titlebar_hbox().add_child(close_button) + get_titlebar_hbox().add_child(hbox_spacer.duplicate()) func do_set_position(o : Vector2) -> void: disable_undoredo_for_offset = true @@ -41,150 +110,109 @@ func do_set_position(o : Vector2) -> void: generator.position = o disable_undoredo_for_offset = false -func _on_resize_request(new_size : Vector2) -> void: - if is_resizing: - return - undo_action = { type="resize_comment", node=generator.get_hier_name(), size=new_size } - is_resizing = true - size = new_size - -func _on_resize_end(new_size: Vector2) -> void: - is_resizing = false - size = new_size - generator.size = new_size - var redo_action := { type="resize_comment", node=generator.get_hier_name(), size=size } - get_parent().undoredo.add("Resize comment", [undo_action], [redo_action], true) - func resize_to_selection() -> void: - # If any nodes are selected on initialization automatically adjust size to match - var parent : GraphEdit = get_parent() - var selected_nodes : Array = parent.get_selected_nodes() - + var graph : MMGraphEdit = get_parent() + var selected_nodes : PackedStringArray + selected_nodes = graph.get_selected_nodes().map(func(n): return n.name) if selected_nodes.is_empty(): return - var min_bounds : Vector2 = Vector2(INF, INF) - var max_bounds : Vector2 = Vector2(-INF, -INF) - for node in selected_nodes: - var node_pos : Vector2 = node.position_offset - var node_size : Vector2 = node.get_size() - - # Top-left corner - if node_pos.x < min_bounds.x: - min_bounds.x = node_pos.x - if node_pos.y < min_bounds.y: - min_bounds.y = node_pos.y - - # Bottom-right corner - var bottom_right : Vector2 = Vector2(node_pos.x + node_size.x, node_pos.y + node_size.y) - if bottom_right.x > max_bounds.x: - max_bounds.x = bottom_right.x - if bottom_right.y > max_bounds.y: - max_bounds.y = bottom_right.y - - position_offset = Vector2(min_bounds.x - AUTO_SIZE_PADDING, min_bounds.y - AUTO_SIZE_TOP_PADDING) + graph._on_graph_elements_linked_to_frame_request(selected_nodes, name) + autoshrink_enabled = true + autoshrink_enabled = false generator.position = position_offset - # Size needs to account for offset padding as well (Padding * 2) - var new_size : Vector2 = Vector2(max_bounds.x - min_bounds.x, max_bounds.y - min_bounds.y) - new_size += Vector2(AUTO_SIZE_PADDING * 2, AUTO_SIZE_TOP_PADDING + AUTO_SIZE_PADDING) - - size = new_size - generator.size = new_size - -# Title edit - -func _on_gui_input(event): - if event is InputEventMouseMotion: - if event.position.x > size.x-10 and event.position.y > size.y-10: - mouse_default_cursor_shape = Control.CURSOR_FDIAGSIZE - else: - mouse_default_cursor_shape = Control.CURSOR_ARROW - if event is InputEventMouseButton and event.double_click and event.button_index == MOUSE_BUTTON_LEFT: - editor.editable = true - editor.mouse_filter = MOUSE_FILTER_STOP - editor.select_all() - editor.grab_focus() - accept_event() +# Title / Text edit -func _on_Title_gui_input(event): +func _on_gui_input(event : InputEvent) -> void: if event is InputEventMouseButton and event.double_click and event.button_index == MOUSE_BUTTON_LEFT: - title_edit.text = title.text - title.visible = false - title_edit.visible = true - title_edit.select_all() - title_edit.grab_focus() - accept_event() - -func _on_title_edit_focus_exited(): - title.text = title_edit.text - generator.title = title.text - title.visible = true - title_edit.visible = false - -func _on_title_edit_text_submitted(_new_text): - _on_title_edit_focus_exited() - -# Text edit + if title_label.get_rect().has_point(get_local_mouse_position()): + title_edit.text = title + title_edit.mouse_filter = MOUSE_FILTER_STOP + title_label.hide() + title_edit.show() + title_edit.select_all() + title_edit.grab_focus() + accept_event() + elif editor.get_rect().has_point(get_local_mouse_position()): + editor.editable = true + editor.mouse_filter = MOUSE_FILTER_STOP + editor.select_all() + editor.grab_focus() + # show caret immediately on double click + editor.caret_blink = false + editor.caret_blink = true + accept_event() + +func _on_title_edit_focus_exited() -> void: + title = title_edit.text + generator.title = title + title_label.show() + title_edit.hide() + +func _on_node_selected() -> void: + %Text.placeholder_text = tr("Double click to add comment") + +func _on_node_deselected() -> void: + %Text.placeholder_text = "" -func _on_text_focus_exited(): +func _on_text_focus_exited() -> void: editor.editable = false editor.mouse_filter = MOUSE_FILTER_IGNORE generator.text = editor.text # Comment color -func _on_change_color_pressed(): - var light_theme = "light" in mm_globals.main_window.theme.resource_path +func _on_change_color_pressed() -> void: + var light_theme : bool = mm_globals.is_theme_light() accept_event() var content_scale_factor = mm_globals.main_window.get_window().content_scale_factor $Popup.get_window().content_scale_factor = content_scale_factor $Popup.get_window().size = $Popup.get_window().get_contents_minimum_size() * content_scale_factor $Popup.position = get_screen_transform() * get_local_mouse_position() $Popup.popup() - var corrected_color = pallette_colors.duplicate(true) + var corrected_color = palette_colors.duplicate(true) if !light_theme: for i in corrected_color.size(): corrected_color[i] = corrected_color[i].darkened(0.5) corrected_color.push_front(Color.WEB_GRAY) corrected_color.push_front(Color.WHITE if light_theme else Color.BLACK) - var palette_rects = $Popup/GridContainer.get_children() + var palette_rects := $Popup/GridContainer.get_children() palette_rects.pop_back() for i in palette_rects.size(): palette_rects[i].color = corrected_color[i] - if not palette_rects[i].is_connected("pressed",Callable(self,"set_color")): - palette_rects[i].connect("pressed",Callable(self,"set_color")) + if not palette_rects[i].pressed.is_connected(set_color): + palette_rects[i].pressed.connect(set_color) func update_node() -> void: size = generator.size - update_stylebox() + update_theme() -func set_color(c): +func set_color(c : Color) -> void: $Popup.hide() if c == generator.color: return - var undo_action = { type="comment_color_change", node=generator.get_hier_name(), color=generator.color } - var redo_action = { type="comment_color_change", node=generator.get_hier_name(), color=c } + undo_action = { type="comment_color_change", node=generator.get_hier_name(), color=generator.color } + redo_action = { type="comment_color_change", node=generator.get_hier_name(), color=c } get_parent().undoredo.add("Change comment color", [undo_action], [redo_action], true) generator.color = c - update_stylebox() + tint_color = c + update_theme() get_parent().send_changed_signal() -func update_stylebox(): +func update_theme() -> void: var c : Color = generator.color c.a = 0.5 - var stylebox : StyleBoxFlat = get_theme_stylebox("selected" if selected else "default", "MM_CommentNode").duplicate() - stylebox.bg_color = c - $PanelContainer.add_theme_stylebox_override("panel", stylebox) - $PanelContainer/ResizerIcon.texture = get_theme_icon("resizer", "MM_CommentNode") + tint_color = c + _on_theme_changed() -func _on_ColorChooser_gui_input(event: InputEvent) -> void: +func _on_ColorChooser_gui_input(event : InputEvent) -> void: if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT: accept_event() $Popup.hide() - var content_scale_factor = mm_globals.main_window.get_window().content_scale_factor - $PopupSelector.get_window().content_scale_factor = content_scale_factor - $PopupSelector.get_window().min_size = $PopupSelector.get_window().get_contents_minimum_size() * content_scale_factor - $PopupSelector.get_window().position = get_global_mouse_position() * content_scale_factor + var csf := get_tree().root.content_scale_factor + $PopupSelector.get_window().content_scale_factor = csf + $PopupSelector.get_window().min_size = $PopupSelector.get_window().get_contents_minimum_size() * csf + $PopupSelector.get_window().position = $Popup.position var color_picker : ColorPicker = $PopupSelector/PanelContainer/ColorPicker $PopupSelector.about_to_popup.connect(func(): if mm_globals.has_config("color_picker_color_mode"): @@ -196,52 +224,67 @@ func _on_ColorChooser_gui_input(event: InputEvent) -> void: mm_globals.set_config("color_picker_shape", color_picker.picker_shape)) $PopupSelector.popup() color_picker.color = generator.color - if not color_picker.color_changed.is_connected(self.set_color): - color_picker.color_changed.connect(self.set_color) + if not color_picker.color_changed.is_connected(set_color): + color_picker.color_changed.connect(set_color) -func _on_close_pressed(): +func _on_autoshrink_gui_input(event : InputEvent) -> void: + if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT: + if event.shift_pressed: + autoshrink_enabled = not autoshrink_enabled + generator.autoshrink = autoshrink_enabled + _on_theme_changed() + update_autoshrink_button_tooltip() + else: + if autoshrink_enabled: + return + else: + autoshrink_enabled = true + autoshrink_enabled = false + +func _on_close_pressed() -> void: get_parent().remove_node(self) -func _on_dragged(_from, to): - _on_raise_request() +func _on_dragged(_from : Vector2, to : Vector2) -> void: generator.position = to -func _on_position_offset_changed(): - _on_raise_request() +func _on_position_offset_changed() -> void: if ! disable_undoredo_for_offset: get_parent().undoredo_move_node(generator.name, generator.position, position_offset) generator.set_position(position_offset) -func _on_node_selected(): - _on_raise_request() - update_stylebox() - %Text.placeholder_text = TranslationServer.translate("Type your comment here") - -func _on_node_deselected(): - _on_raise_request() - update_stylebox() - %Text.placeholder_text = "" - -func _on_raise_request(): - var parent = get_parent() - for i in parent.get_child_count(): - var child = parent.get_child(i) - if child == self: - break - if not child is MMGraphComment: - get_parent().move_child(self, i) - break - - -func _context_menu_about_to_popup(context_menu : PopupMenu) -> void: - context_menu.position = get_screen_transform() * get_local_mouse_position() - - -func _on_title_edit_ready() -> void: - %TitleEdit.get_menu().about_to_popup.connect( - _context_menu_about_to_popup.bind(%TitleEdit.get_menu())) +func _on_theme_changed() -> void: + if not is_node_ready(): + await ready + if autoshrink_enabled: + autoshrink_button.modulate = Color.HOT_PINK + elif mm_globals.is_theme_light(): + autoshrink_button.modulate = Color.BLACK + close_button.modulate = Color.BLACK + else: + autoshrink_button.modulate = Color.WHITE + close_button.modulate = Color.WHITE + editor.add_theme_color_override("font_placeholder_color", + mm_globals.main_window.get_theme_color( + "editor_placeholder_color", "GraphFrame")) + title_label.add_theme_font_override("font", + mm_globals.main_window.get_theme_font( + "title_font", "GraphFrame")) + +func _on_resize_request(_new_size : Vector2) -> void: + if is_resizing: + return + is_resizing = true + await get_tree().process_frame + undo_action = { type="resize_comment", node=generator.get_hier_name(), size=size } +func _on_resize_end(new_size : Vector2) -> void: + is_resizing = false + redo_action = { type="resize_comment", node=generator.get_hier_name(), size=size } + get_parent().undoredo.add("Resize comment", [undo_action], [redo_action], true) + generator.size = new_size -func _on_text_ready() -> void: - %Text.get_menu().about_to_popup.connect( - _context_menu_about_to_popup.bind(%Text.get_menu())) +func update_autoshrink_button_tooltip() -> void: + if autoshrink_enabled: + autoshrink_button.tooltip_text = "Shift-LMB: Toggle Autoshrink" + else: + autoshrink_button.tooltip_text = "LMB: Shrink to fit\nShift-LMB: Toggle Autoshrink" diff --git a/material_maker/nodes/comment/comment.tscn b/material_maker/nodes/comment/comment.tscn index 83d16a274..c53458be2 100644 --- a/material_maker/nodes/comment/comment.tscn +++ b/material_maker/nodes/comment/comment.tscn @@ -2,85 +2,57 @@ [ext_resource type="Script" uid="uid://6w4xc06fs82p" path="res://material_maker/nodes/comment/comment.gd" id="1"] [ext_resource type="Script" uid="uid://s0k653ve15pr" path="res://material_maker/nodes/comment/palette_button.gd" id="2"] -[ext_resource type="Texture2D" uid="uid://bntuquclal2jq" path="res://material_maker/icons/color_palette.png" id="2_x7nyr"] [ext_resource type="Texture2D" uid="uid://carfoptwr44o4" path="res://material_maker/icons/color_picker.png" id="3"] -[ext_resource type="Texture2D" uid="uid://7gf42vko52o1" path="res://material_maker/icons/close.tres" id="3_awsjf"] -[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_awsjf"] - -[node name="CommentNode" type="GraphElement"] -offset_left = 1.0 -offset_top = 1.0 -offset_right = 311.0 -offset_bottom = 165.0 +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_awsjf"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ippp6"] +bg_color = Color(0, 0, 0, 0.19607843) +border_width_left = 2 +border_width_top = 2 +border_width_right = 2 +border_width_bottom = 2 +border_color = Color(1, 1, 1, 0.19607843) +corner_radius_top_left = 2 +corner_radius_top_right = 2 +corner_radius_bottom_right = 2 +corner_radius_bottom_left = 2 +corner_detail = 4 + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_54nb2"] + +[node name="CommentNode" type="GraphFrame"] +custom_minimum_size = Vector2(150, 80) +offset_right = 150.0 +offset_bottom = 102.0 size_flags_horizontal = 3 size_flags_vertical = 3 -mouse_filter = 0 resizable = true +autoshrink_enabled = false +drag_margin = 25 +tint_color_enabled = true script = ExtResource("1") -[node name="PanelContainer" type="PanelContainer" parent="."] -layout_mode = 2 -mouse_filter = 2 - -[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"] +[node name="MarginContainer" type="MarginContainer" parent="."] layout_mode = 2 -theme_override_constants/margin_left = 5 +theme_override_constants/margin_left = 25 theme_override_constants/margin_top = 5 -theme_override_constants/margin_right = 5 -theme_override_constants/margin_bottom = 4 - -[node name="VBox" type="VBoxContainer" parent="PanelContainer/MarginContainer"] -layout_mode = 2 -mouse_filter = 2 - -[node name="TitleBar" type="HBoxContainer" parent="PanelContainer/MarginContainer/VBox"] -layout_mode = 2 - -[node name="Title" type="Label" parent="PanelContainer/MarginContainer/VBox/TitleBar"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -mouse_filter = 1 -text = "Comment" +theme_override_constants/margin_right = 25 +theme_override_constants/margin_bottom = 25 -[node name="TitleEdit" type="LineEdit" parent="PanelContainer/MarginContainer/VBox/TitleBar"] -unique_name_in_owner = true -visible = false -layout_mode = 2 -size_flags_horizontal = 3 -text = "Comment" - -[node name="ChangeColor" type="TextureButton" parent="PanelContainer/MarginContainer/VBox/TitleBar"] -layout_mode = 2 -size_flags_horizontal = 0 -size_flags_vertical = 4 -texture_normal = ExtResource("2_x7nyr") - -[node name="Close" type="TextureButton" parent="PanelContainer/MarginContainer/VBox/TitleBar"] -layout_mode = 2 -size_flags_horizontal = 0 -size_flags_vertical = 4 -texture_normal = ExtResource("3_awsjf") - -[node name="Text" type="TextEdit" parent="PanelContainer/MarginContainer/VBox"] +[node name="Text" type="TextEdit" parent="MarginContainer"] unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 3 focus_mode = 1 mouse_filter = 2 +theme_override_styles/normal = SubResource("StyleBoxEmpty_awsjf") +theme_override_styles/focus = SubResource("StyleBoxFlat_ippp6") +theme_override_styles/read_only = SubResource("StyleBoxEmpty_54nb2") wrap_mode = 1 caret_blink = true caret_multiple = false -[node name="ResizerIcon" type="TextureRect" parent="PanelContainer"] -custom_minimum_size = Vector2(16, 16) -layout_mode = 2 -size_flags_horizontal = 8 -size_flags_vertical = 8 -mouse_filter = 2 -texture = SubResource("PlaceholderTexture2D_awsjf") - [node name="Popup" type="PopupPanel" parent="."] size = Vector2i(64, 64) @@ -140,8 +112,8 @@ texture = ExtResource("3") [node name="PanelContainer" type="PanelContainer" parent="PopupSelector"] offset_left = 4.0 offset_top = 4.0 -offset_right = 302.0 -offset_bottom = 545.0 +offset_right = 96.0 +offset_bottom = 96.0 [node name="ColorPicker" type="ColorPicker" parent="PopupSelector/PanelContainer"] layout_mode = 2 @@ -152,15 +124,8 @@ edit_alpha = false [connection signal="node_deselected" from="." to="." method="_on_node_deselected"] [connection signal="node_selected" from="." to="." method="_on_node_selected"] [connection signal="position_offset_changed" from="." to="." method="_on_position_offset_changed"] -[connection signal="raise_request" from="." to="." method="_on_raise_request"] [connection signal="resize_end" from="." to="." method="_on_resize_end"] [connection signal="resize_request" from="." to="." method="_on_resize_request"] -[connection signal="gui_input" from="PanelContainer/MarginContainer/VBox/TitleBar/Title" to="." method="_on_Title_gui_input"] -[connection signal="focus_exited" from="PanelContainer/MarginContainer/VBox/TitleBar/TitleEdit" to="." method="_on_title_edit_focus_exited"] -[connection signal="ready" from="PanelContainer/MarginContainer/VBox/TitleBar/TitleEdit" to="." method="_on_title_edit_ready"] -[connection signal="text_submitted" from="PanelContainer/MarginContainer/VBox/TitleBar/TitleEdit" to="." method="_on_title_edit_text_submitted"] -[connection signal="pressed" from="PanelContainer/MarginContainer/VBox/TitleBar/ChangeColor" to="." method="_on_change_color_pressed"] -[connection signal="pressed" from="PanelContainer/MarginContainer/VBox/TitleBar/Close" to="." method="_on_close_pressed"] -[connection signal="focus_exited" from="PanelContainer/MarginContainer/VBox/Text" to="." method="_on_text_focus_exited"] -[connection signal="ready" from="PanelContainer/MarginContainer/VBox/Text" to="." method="_on_text_ready"] +[connection signal="theme_changed" from="." to="." method="_on_theme_changed"] +[connection signal="focus_exited" from="MarginContainer/Text" to="." method="_on_text_focus_exited"] [connection signal="gui_input" from="Popup/GridContainer/ColorChooser" to="." method="_on_ColorChooser_gui_input"] diff --git a/material_maker/panels/graph_edit/graph_edit.gd b/material_maker/panels/graph_edit/graph_edit.gd index c30a1b2fe..a080988fa 100644 --- a/material_maker/panels/graph_edit/graph_edit.gd +++ b/material_maker/panels/graph_edit/graph_edit.gd @@ -138,7 +138,12 @@ func _input(event: InputEvent) -> void: for node in selected_nodes: if node is not MMGraphComment: node.move_to_front() + else: + for n in get_attached_nodes_of_frame(node.name): + var gnode : GraphElement = get_node(NodePath(n)) + gnode.position_offset += event.relative / zoom node.position_offset += event.relative / zoom + elif (event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT): accept_event() @@ -292,6 +297,8 @@ func _gui_input(event) -> void: has_grab = true KEY_ESCAPE: has_grab = false + KEY_D: + detach_selected_nodes() match event.get_keycode(): KEY_SHIFT, KEY_CTRL, KEY_ALT: var found_tip : bool = false @@ -946,14 +953,39 @@ func do_paste(data) -> void: var node_position = scroll_offset+0.5*size if Rect2(Vector2(0, 0), size).has_point(get_local_mouse_position()): node_position = offset_from_global_position(get_global_mouse_position()) + for c in get_children(): if c is GraphElement: c.selected = false + var new_nodes = await create_nodes(data, node_position) if new_nodes != null: for c in new_nodes: c.selected = true + # Attach duplicated nodes to frames + if data.has("nodes"): + var i := 0 + var dupe_map : Dictionary[String, String] + for n in data.nodes.map(func(d): return d.name): + dupe_map["node_"+n] = "" + + for c in new_nodes: + dupe_map[dupe_map.keys()[i]] = c.name + i += 1 + + # Attach duplicated nodes to frames + for old_node in dupe_map.keys(): + if get_node(old_node) is MMGraphComment: + var new_frame = dupe_map[old_node] + get_node(new_frame).generator.attached.clear() + for attached_node in get_attached_nodes_of_frame(old_node): + if dupe_map.has(attached_node): + if dupe_map[attached_node] == "": + continue + attach_graph_element_to_frame(dupe_map[attached_node], new_frame) + get_node(new_frame).generator.attached.append(dupe_map[attached_node]) + func paste() -> void: var data : String = DisplayServer.clipboard_get().strip_edges() var parsed_data = await mm_globals.parse_paste_data(data) @@ -1089,13 +1121,7 @@ func highlight_connections() -> void: highlighting_connections = false func _on_GraphEdit_node_selected(node : GraphElement) -> void: - if node is MMGraphComment: - #print("Selecting enclosed nodes...") - for c in get_children(): - if (c is GraphNode or c is MMGraphCommentLine) and c != node: - if node.get_rect().encloses(c.get_rect()): - c.selected = true - elif node is MMGraphCommentLine: + if node is MMGraphCommentLine or node is MMGraphComment: pass else: highlight_connections() @@ -1323,6 +1349,17 @@ func undoredo_command(command : Dictionary) -> void: if has_node("node_"+g.name): var node = get_node("node_"+g.name) node.update_node() + "comment_attach_node": + var parent_generator = get_node_from_hier_name(command.parent) + if parent_generator == generator: + for node in command.nodes: + if command.frame: + do_attach_node(node, command.frame) + "comment_detach_node": + var parent_generator = get_node_from_hier_name(command.parent) + if parent_generator == generator: + for node in command.nodes: + do_detach_node(NodePath(node)) _: print("Unknown undo/redo command:") print(command) @@ -1849,3 +1886,36 @@ func _on_resized() -> void: $GraphUI.size = Vector2.ZERO $GraphUI.position = global_position $GraphUI.position += Vector2(size.x - $GraphUI.size.x, 11) + +func _on_graph_elements_linked_to_frame_request(elements: Array, frame: StringName) -> void: + for el in elements: + do_attach_node(el, frame) + var undo_actions := { type="comment_detach_node", parent=generator.get_hier_name(), nodes=elements } + var redo_actions := { type="comment_attach_node", parent=generator.get_hier_name(), nodes=elements, frame=frame} + undoredo.add("Comment attached nodes", [undo_actions], [redo_actions]) + +func detach_selected_nodes() -> void: + if get_selected_nodes().is_empty(): + return + undoredo.start_group() + for node in get_selected_nodes(): + var detached_from : MMGraphComment = get_element_frame(node.name) + if detached_from: + var undo_actions := [{ type="comment_attach_node", parent=generator.get_hier_name(), nodes=[node.name], frame=detached_from.name}] + var redo_actions := [{ type="comment_detach_node", parent=generator.get_hier_name(), nodes=[node.name] }] + undoredo.add("Comment detached nodes", undo_actions, redo_actions) + do_detach_node(node.name) + undoredo.end_group() + +func do_attach_node(element : String, frame: String) -> void: + attach_graph_element_to_frame(element, frame) + get_node(NodePath(frame)).generator.attached.append(element) + +func do_detach_node(element : String) -> void: + var frame : MMGraphComment = get_element_frame(element) + if frame != null: + frame.generator.attached.erase(element) + detach_graph_element_from_frame(element) + +func _on_frame_rect_changed(frame: GraphFrame, new_rect: Rect2) -> void: + frame.generator.size = new_rect.size diff --git a/material_maker/panels/graph_edit/graph_edit.tscn b/material_maker/panels/graph_edit/graph_edit.tscn index 905520d91..f2d8fc4b4 100644 --- a/material_maker/panels/graph_edit/graph_edit.tscn +++ b/material_maker/panels/graph_edit/graph_edit.tscn @@ -94,6 +94,8 @@ script = ExtResource("3") [connection signal="copy_nodes_request" from="." to="." method="copy"] [connection signal="disconnection_request" from="." to="." method="on_disconnect_node"] [connection signal="duplicate_nodes_request" from="." to="." method="duplicate_selected"] +[connection signal="frame_rect_changed" from="." to="." method="_on_frame_rect_changed"] +[connection signal="graph_elements_linked_to_frame_request" from="." to="." method="_on_graph_elements_linked_to_frame_request"] [connection signal="node_deselected" from="." to="." method="_on_GraphEdit_node_unselected"] [connection signal="node_selected" from="." to="." method="_on_GraphEdit_node_selected"] [connection signal="paste_nodes_request" from="." to="." method="paste"] diff --git a/material_maker/theme/classic_base.tres b/material_maker/theme/classic_base.tres index 7a69df814..42c81c19c 100644 --- a/material_maker/theme/classic_base.tres +++ b/material_maker/theme/classic_base.tres @@ -1,4 +1,4 @@ -[gd_resource type="Theme" load_steps=148 format=3 uid="uid://w487nirev8y5"] +[gd_resource type="Theme" load_steps=150 format=3 uid="uid://w487nirev8y5"] [ext_resource type="Texture2D" uid="uid://1s0c37uoj4rf" path="res://material_maker/theme/default_theme_icons.svg" id="1_fw8f4"] [ext_resource type="FontFile" uid="uid://lro0qdrhfytt" path="res://material_maker/theme/font_rubik/Rubik-Light.ttf" id="3_h5b0q"] @@ -140,6 +140,29 @@ border_color = Color(0.099986, 0.099986, 0.0999859, 1) [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_62l4s"] +[sub_resource type="AtlasTexture" id="AtlasTexture_a74kv"] +atlas = ExtResource("1_fw8f4") +region = Rect2(31.18, 176, 16, 16) +margin = Rect2(-2, -2, 0, 0) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_a74kv"] +bg_color = Color(0.3137255, 0.3137255, 0.34901962, 1) +corner_radius_top_left = 11 +corner_radius_top_right = 11 +corner_radius_bottom_right = 11 +corner_radius_bottom_left = 11 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_nmkov"] +bg_color = Color(0.42352942, 0.42352942, 0.4627451, 1) +border_width_left = 2 +border_width_top = 2 +border_width_right = 2 +border_width_bottom = 2 +corner_radius_top_left = 11 +corner_radius_top_right = 11 +corner_radius_bottom_right = 11 +corner_radius_bottom_left = 11 + [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uwck0"] content_margin_left = 28.0 content_margin_top = 8.0 @@ -441,6 +464,10 @@ region = Rect2(80, 0, 16, 16) atlas = ExtResource("1_fw8f4") region = Rect2(32, 0, 16, 16) +[sub_resource type="AtlasTexture" id="AtlasTexture_wbe58"] +atlas = ExtResource("1_fw8f4") +region = Rect2(48, 208, 16, 16) + [sub_resource type="AtlasTexture" id="AtlasTexture_fs6qc"] atlas = ExtResource("1_fw8f4") region = Rect2(64, 16, 16, 16) @@ -612,24 +639,6 @@ corner_detail = 4 [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5e0gw"] content_margin_top = 3.0 -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_a74kv"] -bg_color = Color(0.3137255, 0.3137255, 0.34901962, 1) -corner_radius_top_left = 11 -corner_radius_top_right = 11 -corner_radius_bottom_right = 11 -corner_radius_bottom_left = 11 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_nmkov"] -bg_color = Color(0.42352942, 0.42352942, 0.4627451, 1) -border_width_left = 2 -border_width_top = 2 -border_width_right = 2 -border_width_bottom = 2 -corner_radius_top_left = 11 -corner_radius_top_right = 11 -corner_radius_bottom_right = 11 -corner_radius_bottom_left = 11 - [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ppdpb"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_btb0w"] @@ -960,6 +969,10 @@ GraphEdit/icons/zoom_out = SubResource("AtlasTexture_scuvh") GraphEdit/icons/zoom_reset = SubResource("AtlasTexture_cpts2") GraphEdit/styles/menu_panel = SubResource("StyleBoxFlat_btw0t") GraphEdit/styles/panel = SubResource("StyleBoxEmpty_62l4s") +GraphFrame/colors/editor_placeholder_color = Color(1, 1, 1, 0.49803922) +GraphFrame/icons/resizer = SubResource("AtlasTexture_a74kv") +GraphFrame/styles/panel = SubResource("StyleBoxFlat_a74kv") +GraphFrame/styles/panel_selected = SubResource("StyleBoxFlat_nmkov") GraphNode/colors/portpreview_color = Color(0.89059, 0.89059, 0.89059, 1) GraphNode/colors/title_color = Color(1, 1, 1, 1) GraphNode/constants/port_h_offset = 10 @@ -1030,6 +1043,7 @@ MM_Icons/icons/section_transform = SubResource("AtlasTexture_w8nfu") MM_Icons/icons/section_workflow = SubResource("AtlasTexture_ropwn") MM_Icons/icons/select = SubResource("AtlasTexture_ck0hb") MM_Icons/icons/settings = SubResource("AtlasTexture_33srw") +MM_Icons/icons/shrink = SubResource("AtlasTexture_wbe58") MM_Icons/icons/spline_link = SubResource("AtlasTexture_fs6qc") MM_Icons/icons/spline_progressive = SubResource("AtlasTexture_70aex") MM_Icons/icons/spline_reverse = SubResource("AtlasTexture_ahanl") diff --git a/material_maker/theme/default light.tres b/material_maker/theme/default light.tres index 9b02c342c..cf307c981 100644 --- a/material_maker/theme/default light.tres +++ b/material_maker/theme/default light.tres @@ -1,4 +1,4 @@ -[gd_resource type="Theme" script_class="EnhancedTheme" load_steps=62 format=3 uid="uid://u00kx2lkkx8j"] +[gd_resource type="Theme" script_class="EnhancedTheme" load_steps=65 format=3 uid="uid://u00kx2lkkx8j"] [ext_resource type="Theme" uid="uid://b628lwfk6ig2c" path="res://material_maker/theme/default.tres" id="1_ugsao"] [ext_resource type="Script" uid="uid://3ga2k3abkk0d" path="res://material_maker/theme/enhanced_theme_system/color_swap.gd" id="4_rhf2q"] @@ -378,15 +378,28 @@ orig = Color(0.039215688, 0.039215688, 0.039215688, 1) target = Color(0, 0, 0, 0.05882353) metadata/_custom_type_script = "uid://3ga2k3abkk0d" -[sub_resource type="Resource" id="Resource_41atc"] +[sub_resource type="Resource" id="Resource_kh8x1"] script = ExtResource("4_rhf2q") name = "RichTextLabelDefaultColor" orig = Color(1, 1, 1, 1) metadata/_custom_type_script = "uid://3ga2k3abkk0d" +[sub_resource type="Resource" id="Resource_d2i8i"] +script = ExtResource("4_rhf2q") +name = "GraphFrameEditorPlaceholderColor" +orig = Color(1, 1, 1, 0.49019608) +target = Color(0, 0, 0, 0.49019608) +metadata/_custom_type_script = "uid://3ga2k3abkk0d" + +[sub_resource type="Resource" id="Resource_jbrv2"] +script = ExtResource("4_rhf2q") +name = "GraphFrameOutlineColor" +orig = Color(1, 1, 1, 1) +metadata/_custom_type_script = "uid://3ga2k3abkk0d" + [resource] script = ExtResource("5_fagh3") base_theme = ExtResource("1_ugsao") font_color_swaps = Array[ExtResource("4_rhf2q")]([SubResource("Resource_silay"), SubResource("Resource_eavso"), SubResource("Resource_1jhxl"), SubResource("Resource_qiwix"), SubResource("Resource_5yhcl"), SubResource("Resource_vdnfu"), SubResource("Resource_21aar"), SubResource("Resource_us4qf"), SubResource("Resource_3wcad"), SubResource("Resource_mhcke"), SubResource("Resource_41atc")]) icon_color_swaps = Array[ExtResource("4_rhf2q")]([SubResource("Resource_cisvi"), SubResource("Resource_j2h7k"), SubResource("Resource_8dhbo"), SubResource("Resource_5oh4i")]) -theme_color_swaps = Array[ExtResource("4_rhf2q")]([SubResource("Resource_ub5ur"), SubResource("Resource_5rv7m"), SubResource("Resource_xqbwo"), SubResource("Resource_a2t6i"), SubResource("Resource_pekt7"), SubResource("Resource_vbpcr"), SubResource("Resource_qngft"), SubResource("Resource_5mixu"), SubResource("Resource_kxmra"), SubResource("Resource_siafh"), SubResource("Resource_s732t"), SubResource("Resource_j1t84"), SubResource("Resource_g7e3b"), SubResource("Resource_oirgf"), SubResource("Resource_1pump"), SubResource("Resource_fxm05"), SubResource("Resource_mfxjg"), SubResource("Resource_upxps"), SubResource("Resource_upxps"), SubResource("Resource_lk0mo"), SubResource("Resource_sgt8g"), SubResource("Resource_p6yfp"), SubResource("Resource_mntha"), SubResource("Resource_5l403"), SubResource("Resource_qx1ic"), SubResource("Resource_skxhu"), SubResource("Resource_gf74u"), SubResource("Resource_6iwcg"), SubResource("Resource_emwrq"), SubResource("Resource_g0345"), SubResource("Resource_mqr67"), SubResource("Resource_enwto"), SubResource("Resource_t0kvp"), SubResource("Resource_tw3yc"), SubResource("Resource_5w06f"), SubResource("Resource_m8hbw"), SubResource("Resource_xnhnj"), SubResource("Resource_jh8b5"), SubResource("Resource_2d8ce"), SubResource("Resource_qqxbn"), SubResource("Resource_4naeq"), SubResource("Resource_pu57y"), SubResource("Resource_wwbst"), SubResource("Resource_q74a5"), SubResource("Resource_41atc")]) +theme_color_swaps = Array[ExtResource("4_rhf2q")]([SubResource("Resource_ub5ur"), SubResource("Resource_5rv7m"), SubResource("Resource_xqbwo"), SubResource("Resource_a2t6i"), SubResource("Resource_pekt7"), SubResource("Resource_vbpcr"), SubResource("Resource_qngft"), SubResource("Resource_5mixu"), SubResource("Resource_kxmra"), SubResource("Resource_siafh"), SubResource("Resource_s732t"), SubResource("Resource_j1t84"), SubResource("Resource_g7e3b"), SubResource("Resource_oirgf"), SubResource("Resource_1pump"), SubResource("Resource_fxm05"), SubResource("Resource_mfxjg"), SubResource("Resource_upxps"), SubResource("Resource_upxps"), SubResource("Resource_lk0mo"), SubResource("Resource_sgt8g"), SubResource("Resource_p6yfp"), SubResource("Resource_mntha"), SubResource("Resource_5l403"), SubResource("Resource_qx1ic"), SubResource("Resource_skxhu"), SubResource("Resource_gf74u"), SubResource("Resource_6iwcg"), SubResource("Resource_emwrq"), SubResource("Resource_g0345"), SubResource("Resource_mqr67"), SubResource("Resource_enwto"), SubResource("Resource_t0kvp"), SubResource("Resource_tw3yc"), SubResource("Resource_5w06f"), SubResource("Resource_m8hbw"), SubResource("Resource_xnhnj"), SubResource("Resource_jh8b5"), SubResource("Resource_2d8ce"), SubResource("Resource_qqxbn"), SubResource("Resource_4naeq"), SubResource("Resource_pu57y"), SubResource("Resource_wwbst"), SubResource("Resource_q74a5"), SubResource("Resource_41atc"), SubResource("Resource_kh8x1"), SubResource("Resource_d2i8i"), SubResource("Resource_jbrv2")]) diff --git a/material_maker/theme/default.tres b/material_maker/theme/default.tres index 5f863568f..ee5b7aacb 100644 --- a/material_maker/theme/default.tres +++ b/material_maker/theme/default.tres @@ -1,4 +1,4 @@ -[gd_resource type="Theme" load_steps=174 format=3 uid="uid://b628lwfk6ig2c"] +[gd_resource type="Theme" load_steps=173 format=3 uid="uid://b628lwfk6ig2c"] [ext_resource type="FontFile" uid="uid://lro0qdrhfytt" path="res://material_maker/theme/font_rubik/Rubik-Light.ttf" id="1_5tfb1"] [ext_resource type="Texture2D" uid="uid://1s0c37uoj4rf" path="res://material_maker/theme/default_theme_icons.svg" id="1_s43fy"] @@ -156,6 +156,27 @@ corner_detail = 4 [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_en6gw"] +[sub_resource type="AtlasTexture" id="AtlasTexture_08mel"] +atlas = ExtResource("1_s43fy") +region = Rect2(31.18, 176, 16, 16) +margin = Rect2(-2, -2, 0, 0) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_08mel"] +corner_radius_top_left = 4 +corner_radius_top_right = 4 +corner_radius_bottom_right = 4 +corner_radius_bottom_left = 4 +corner_detail = 4 +expand_margin_top = 38.0 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8uenv"] +bg_color = Color(0.3137255, 0.3137255, 0.34901962, 1) +corner_radius_top_left = 11 +corner_radius_top_right = 11 +corner_radius_bottom_right = 11 +corner_radius_bottom_left = 11 +corner_detail = 4 + [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uwck0"] content_margin_left = 10.0 content_margin_top = 8.0 @@ -314,32 +335,6 @@ border_color = Color(0.359069, 0.359069, 0.359069, 1) [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_agwde"] bg_color = Color(0.0980392, 0.0980392, 0.101961, 1) -[sub_resource type="AtlasTexture" id="AtlasTexture_08mel"] -atlas = ExtResource("1_s43fy") -region = Rect2(32, 176, 16, 16) - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_asgc8"] -border_width_left = 1 -border_width_top = 1 -border_width_right = 1 -border_width_bottom = 1 -border_color = Color(0.498039, 0.498039, 0.498039, 0) -corner_radius_top_left = 4 -corner_radius_top_right = 4 -corner_radius_bottom_right = 4 -corner_radius_bottom_left = 4 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_en6gw"] -border_width_left = 1 -border_width_top = 1 -border_width_right = 1 -border_width_bottom = 1 -border_color = Color(0.485703, 0.485704, 0.485703, 1) -corner_radius_top_left = 4 -corner_radius_top_right = 4 -corner_radius_bottom_right = 4 -corner_radius_bottom_left = 4 - [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dyhk7"] content_margin_left = 10.0 content_margin_top = 2.0 @@ -573,6 +568,10 @@ region = Rect2(80, 0, 16, 16) atlas = ExtResource("1_s43fy") region = Rect2(32, 0, 16, 16) +[sub_resource type="AtlasTexture" id="AtlasTexture_8xpdb"] +atlas = ExtResource("1_s43fy") +region = Rect2(48, 208, 16, 16) + [sub_resource type="AtlasTexture" id="AtlasTexture_e07v0"] atlas = ExtResource("1_s43fy") region = Rect2(112, 96, 16, 16) @@ -820,13 +819,6 @@ corner_detail = 4 [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5e0gw"] content_margin_top = 3.0 -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8uenv"] -bg_color = Color(0.3137255, 0.3137255, 0.34901962, 1) -corner_radius_top_left = 11 -corner_radius_top_right = 11 -corner_radius_bottom_right = 11 -corner_radius_bottom_left = 11 - [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pkv4t"] bg_color = Color(0.42352942, 0.42352942, 0.4627451, 1) border_width_left = 2 @@ -1086,15 +1078,6 @@ content_margin_top = 8.0 content_margin_right = 8.0 content_margin_bottom = 8.0 -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_08mel"] -content_margin_left = 7.0 -content_margin_top = 5.0 -content_margin_right = 7.0 -content_margin_bottom = 5.0 -bg_color = Color(0.09411765, 0.09803922, 0.101960786, 1) -corner_radius_top_left = 3 -corner_radius_top_right = 3 - [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ld0tj"] content_margin_left = 7.0 content_margin_top = 5.0 @@ -1233,6 +1216,12 @@ GraphEdit/icons/zoom_reset = SubResource("AtlasTexture_cpts2") GraphEdit/styles/menu_panel = SubResource("StyleBoxFlat_pxlc8") GraphEdit/styles/panel = SubResource("StyleBoxEmpty_62l4s") GraphEdit/styles/panel_focus = SubResource("StyleBoxEmpty_en6gw") +GraphFrame/colors/editor_placeholder_color = Color(1, 1, 1, 0.49019608) +GraphFrame/colors/resizer_color = Color(1, 1, 1, 1) +GraphFrame/fonts/title_font = ExtResource("2_5e0gw") +GraphFrame/icons/resizer = SubResource("AtlasTexture_08mel") +GraphFrame/styles/panel = SubResource("StyleBoxFlat_08mel") +GraphFrame/styles/panel_selected = SubResource("StyleBoxFlat_8uenv") GraphNode/colors/portpreview_color = Color(0.89059, 0.89059, 0.89059, 1) GraphNode/colors/title_color = Color(0.87451, 0.878431, 0.886275, 1) GraphNode/constants/portpreview_radius = 6 @@ -1267,9 +1256,6 @@ MM_AddNodePanel/base_type = &"PanelContainer" MM_AddNodePanel/styles/panel = SubResource("StyleBoxFlat_f0kci") MM_AddNodePanelList/base_type = &"ItemList" MM_AddNodePanelList/styles/panel = SubResource("StyleBoxFlat_agwde") -MM_CommentNode/icons/resizer = SubResource("AtlasTexture_08mel") -MM_CommentNode/styles/default = SubResource("StyleBoxFlat_asgc8") -MM_CommentNode/styles/selected = SubResource("StyleBoxFlat_en6gw") MM_FilterLineEdit/base_type = &"LineEdit" MM_FilterLineEdit/styles/focus = SubResource("StyleBoxFlat_dyhk7") MM_FilterLineEdit/styles/normal = SubResource("StyleBoxFlat_mv8c7") @@ -1323,6 +1309,7 @@ MM_Icons/icons/section_transform = SubResource("AtlasTexture_oea07") MM_Icons/icons/section_workflow = SubResource("AtlasTexture_a45we") MM_Icons/icons/select = SubResource("AtlasTexture_ck0hb") MM_Icons/icons/settings = SubResource("AtlasTexture_33srw") +MM_Icons/icons/shrink = SubResource("AtlasTexture_8xpdb") MM_Icons/icons/snapping = SubResource("AtlasTexture_e07v0") MM_Icons/icons/spline_link = SubResource("AtlasTexture_fs6qc") MM_Icons/icons/spline_progressive = SubResource("AtlasTexture_70aex") diff --git a/material_maker/theme/default_theme_icons.svg b/material_maker/theme/default_theme_icons.svg index bd0af37d3..370ddb210 100644 --- a/material_maker/theme/default_theme_icons.svg +++ b/material_maker/theme/default_theme_icons.svg @@ -28,15 +28,15 @@ inkscape:deskcolor="#d1d1d1" inkscape:document-units="mm" showgrid="true" - inkscape:zoom="16" - inkscape:cx="113.5" - inkscape:cy="206.84375" + inkscape:zoom="32" + inkscape:cx="52.4375" + inkscape:cy="212.0625" inkscape:window-width="1152" inkscape:window-height="981" inkscape:window-x="0" inkscape:window-y="38" inkscape:window-maximized="0" - inkscape:current-layer="g11-3" + inkscape:current-layer="g44" showguides="false"> + id="g196" + inkscape:label="align_center"> + + + + + + + + + + + +