From 5ece616a9adae6ed4b5979175263bc2cdb575690 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas Date: Tue, 5 Dec 2023 01:08:26 +0200 Subject: [PATCH] Only use one LayerButton scene instead of using inheritence And make some code improvements in LayerButton.gd --- src/Autoload/Global.gd | 8 +- src/Classes/Layers/BaseLayer.gd | 2 +- src/Classes/Layers/GroupLayer.gd | 4 - src/Classes/Layers/Layer3D.gd | 4 - src/Classes/Layers/PixelLayer.gd | 4 - src/Classes/Project.gd | 2 +- src/UI/Timeline/AnimationTimeline.gd | 2 +- src/UI/Timeline/GroupLayerButton.tscn | 44 ------- src/UI/Timeline/LayerButton.gd | 118 +++++++++--------- ...{BaseLayerButton.tscn => LayerButton.tscn} | 48 +++++-- src/UI/Timeline/PixelLayerButton.tscn | 65 ---------- 11 files changed, 107 insertions(+), 194 deletions(-) delete mode 100644 src/UI/Timeline/GroupLayerButton.tscn rename src/UI/Timeline/{BaseLayerButton.tscn => LayerButton.tscn} (71%) delete mode 100644 src/UI/Timeline/PixelLayerButton.tscn diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index de2693735..2204c3c3f 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -421,12 +421,8 @@ var onion_skinning_blue_red := false ## If [code]true[/code], then blue-red mod var current_version: String = ProjectSettings.get_setting("application/config/Version") # Nodes -## The preload of button used by the [BaseLayer]. -var base_layer_button_node: PackedScene = load("res://src/UI/Timeline/BaseLayerButton.tscn") -## The preload of button used by the [PixelLayer]. -var pixel_layer_button_node: PackedScene = load("res://src/UI/Timeline/PixelLayerButton.tscn") -## The preload of button used by the [GroupLayer]. -var group_layer_button_node: PackedScene = load("res://src/UI/Timeline/GroupLayerButton.tscn") +## TThe [PackedScene] of the button used by layers in the timeline. +var layer_button_node := preload("res://src/UI/Timeline/LayerButton.tscn") ## The [PackedScene] of the button used by cels in the timeline. var cel_button_scene: PackedScene = load("res://src/UI/Timeline/CelButton.tscn") diff --git a/src/Classes/Layers/BaseLayer.gd b/src/Classes/Layers/BaseLayer.gd index 0332d1dee..74b6d344d 100644 --- a/src/Classes/Layers/BaseLayer.gd +++ b/src/Classes/Layers/BaseLayer.gd @@ -289,4 +289,4 @@ func accepts_child(_layer: BaseLayer) -> bool: ## Returns an instance of the layer button that will be added to the timeline. func instantiate_layer_button() -> Node: - return null + return Global.layer_button_node.instantiate() diff --git a/src/Classes/Layers/GroupLayer.gd b/src/Classes/Layers/GroupLayer.gd index c95593181..aeceb5ffb 100644 --- a/src/Classes/Layers/GroupLayer.gd +++ b/src/Classes/Layers/GroupLayer.gd @@ -63,7 +63,3 @@ func set_name_to_default(number: int) -> void: func accepts_child(_layer: BaseLayer) -> bool: return true - - -func instantiate_layer_button() -> Node: - return Global.group_layer_button_node.instantiate() diff --git a/src/Classes/Layers/Layer3D.gd b/src/Classes/Layers/Layer3D.gd index 6d96c8446..f830b5a1e 100644 --- a/src/Classes/Layers/Layer3D.gd +++ b/src/Classes/Layers/Layer3D.gd @@ -27,7 +27,3 @@ func new_empty_cel() -> BaseCel: func can_layer_get_drawn() -> bool: return is_visible_in_hierarchy() && !is_locked_in_hierarchy() - - -func instantiate_layer_button() -> Node: - return Global.base_layer_button_node.instantiate() diff --git a/src/Classes/Layers/PixelLayer.gd b/src/Classes/Layers/PixelLayer.gd index 6efc7ae62..c0230d59a 100644 --- a/src/Classes/Layers/PixelLayer.gd +++ b/src/Classes/Layers/PixelLayer.gd @@ -34,7 +34,3 @@ func new_empty_cel() -> BaseCel: func can_layer_get_drawn() -> bool: return is_visible_in_hierarchy() && !is_locked_in_hierarchy() - - -func instantiate_layer_button() -> Node: - return Global.pixel_layer_button_node.instantiate() diff --git a/src/Classes/Project.gd b/src/Classes/Project.gd index a4197bba4..b1f1d85db 100644 --- a/src/Classes/Project.gd +++ b/src/Classes/Project.gd @@ -884,7 +884,7 @@ func _update_frame_ui() -> void: func _update_layer_ui() -> void: for l in layers.size(): layers[l].index = l - Global.layer_vbox.get_child(layers.size() - 1 - l).layer = l + Global.layer_vbox.get_child(layers.size() - 1 - l).layer_index = l var cel_hbox: HBoxContainer = Global.cel_vbox.get_child(layers.size() - 1 - l) for f in frames.size(): cel_hbox.get_child(f).layer = l diff --git a/src/UI/Timeline/AnimationTimeline.gd b/src/UI/Timeline/AnimationTimeline.gd index 9ea675837..f71d7ac1a 100644 --- a/src/UI/Timeline/AnimationTimeline.gd +++ b/src/UI/Timeline/AnimationTimeline.gd @@ -1052,7 +1052,7 @@ func project_layer_added(layer: int) -> void: var project := Global.current_project var layer_button := project.layers[layer].instantiate_layer_button() as LayerButton - layer_button.layer = layer + layer_button.layer_index = layer if project.layers[layer].name == "": project.layers[layer].set_name_to_default(Global.current_project.layers.size()) diff --git a/src/UI/Timeline/GroupLayerButton.tscn b/src/UI/Timeline/GroupLayerButton.tscn deleted file mode 100644 index f01d88636..000000000 --- a/src/UI/Timeline/GroupLayerButton.tscn +++ /dev/null @@ -1,44 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://j2uq83bsi4si"] - -[ext_resource type="PackedScene" uid="uid://bai814sqvk68f" path="res://src/UI/Timeline/BaseLayerButton.tscn" id="1"] -[ext_resource type="Texture2D" uid="uid://dndlglvqc7v6a" path="res://assets/graphics/layers/group_expanded.png" id="4"] - -[node name="GroupLayerButton" instance=ExtResource("1")] -hide_expand_button = false - -[node name="HBoxContainer" parent="." index="0"] -layout_mode = 1 -anchors_preset = 15 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="TextureRect" parent="HBoxContainer/LayerButtons/ExpandButton" index="0"] -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -offset_left = 0.0 -offset_top = 0.0 -offset_right = 22.0 -offset_bottom = 22.0 -texture = ExtResource("4") - -[node name="TextureRect" parent="HBoxContainer/LayerButtons/VisibilityButton" index="0"] -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -offset_left = 0.0 -offset_top = 0.0 -offset_right = 22.0 -offset_bottom = 22.0 - -[node name="TextureRect" parent="HBoxContainer/LayerButtons/LockButton" index="0"] -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -offset_left = 0.0 -offset_top = 0.0 -offset_right = 22.0 -offset_bottom = 22.0 diff --git a/src/UI/Timeline/LayerButton.gd b/src/UI/Timeline/LayerButton.gd index 8b9bea59f..66230c0b0 100644 --- a/src/UI/Timeline/LayerButton.gd +++ b/src/UI/Timeline/LayerButton.gd @@ -1,26 +1,29 @@ class_name LayerButton extends Button -const HIERARCHY_DEPTH_PIXEL_SHIFT = 8 +const HIERARCHY_DEPTH_PIXEL_SHIFT := 8 -@export var hide_expand_button := true +var layer_index := 0 -var layer := 0 - -@onready var expand_button: BaseButton = find_child("ExpandButton") +@onready var expand_button := %ExpandButton as BaseButton @onready var visibility_button: BaseButton = find_child("VisibilityButton") @onready var lock_button: BaseButton = find_child("LockButton") @onready var label: Label = find_child("Label") @onready var line_edit: LineEdit = find_child("LineEdit") @onready var hierarchy_spacer: Control = find_child("HierarchySpacer") -@onready var linked_button: BaseButton = find_child("LinkButton") +@onready var linked_button := %LinkButton as BaseButton func _ready() -> void: + var layer := Global.current_project.layers[layer_index] + if layer is PixelLayer: + linked_button.visible = true + elif layer is GroupLayer: + expand_button.visible = true custom_minimum_size.y = Global.animation_timeline.cel_size - label.text = Global.current_project.layers[layer].name - line_edit.text = Global.current_project.layers[layer].name + label.text = layer.name + line_edit.text = layer.name var layer_buttons = find_child("LayerButtons") for child in layer_buttons.get_children(): @@ -28,7 +31,7 @@ func _ready() -> void: texture.modulate = Global.modulate_icon_color # Visualize how deep into the hierarchy the layer is - var hierarchy_depth := Global.current_project.layers[layer].get_hierarchy_depth() + var hierarchy_depth := layer.get_hierarchy_depth() hierarchy_spacer.custom_minimum_size.x = hierarchy_depth * HIERARCHY_DEPTH_PIXEL_SHIFT if Global.control.theme.get_color("font_color", "Button").v > 0.5: # Light text is dark theme @@ -42,45 +45,44 @@ func _ready() -> void: func update_buttons() -> void: - if hide_expand_button: - expand_button.mouse_filter = Control.MOUSE_FILTER_IGNORE - expand_button.get_child(0).visible = false # Hide the TextureRect - else: - if Global.current_project.layers[layer].expanded: + var layer := Global.current_project.layers[layer_index] + if layer is GroupLayer: + if layer.expanded: Global.change_button_texturerect(expand_button.get_child(0), "group_expanded.png") else: Global.change_button_texturerect(expand_button.get_child(0), "group_collapsed.png") - if Global.current_project.layers[layer].visible: + if layer.visible: Global.change_button_texturerect(visibility_button.get_child(0), "layer_visible.png") else: Global.change_button_texturerect(visibility_button.get_child(0), "layer_invisible.png") - if Global.current_project.layers[layer].locked: + if layer.locked: Global.change_button_texturerect(lock_button.get_child(0), "lock.png") else: Global.change_button_texturerect(lock_button.get_child(0), "unlock.png") if linked_button: - if Global.current_project.layers[layer].new_cels_linked: # If new layers will be linked + if layer.new_cels_linked: # If new layers will be linked Global.change_button_texturerect(linked_button.get_child(0), "linked_layer.png") else: Global.change_button_texturerect(linked_button.get_child(0), "unlinked_layer.png") visibility_button.modulate.a = 1 lock_button.modulate.a = 1 - if is_instance_valid(Global.current_project.layers[layer].parent): - if not Global.current_project.layers[layer].parent.is_visible_in_hierarchy(): + if is_instance_valid(layer.parent): + if not layer.parent.is_visible_in_hierarchy(): visibility_button.modulate.a = 0.33 - if Global.current_project.layers[layer].parent.is_locked_in_hierarchy(): + if layer.parent.is_locked_in_hierarchy(): lock_button.modulate.a = 0.33 ## When pressing a button, change the appearance of other layers (ie: expand or visible) func _update_buttons_all_layers() -> void: + var layer := Global.current_project.layers[layer_index] for layer_button in Global.layer_vbox.get_children(): layer_button.update_buttons() - var expanded := Global.current_project.layers[layer_button.layer].is_expanded_in_hierarchy() + var expanded := layer.is_expanded_in_hierarchy() layer_button.visible = expanded Global.cel_vbox.get_child(layer_button.get_index()).visible = expanded @@ -109,21 +111,21 @@ func _on_LayerContainer_gui_input(event: InputEvent) -> void: Global.canvas.selection.transform_content_confirm() var prev_curr_layer := project.current_layer if Input.is_action_pressed("shift"): - var layer_diff_sign := signi(layer - prev_curr_layer) + var layer_diff_sign := signi(layer_index - prev_curr_layer) if layer_diff_sign == 0: layer_diff_sign = 1 for i in range(0, project.frames.size()): - for j in range(prev_curr_layer, layer + layer_diff_sign, layer_diff_sign): + for j in range(prev_curr_layer, layer_index + layer_diff_sign, layer_diff_sign): var frame_layer := [i, j] if !project.selected_cels.has(frame_layer): project.selected_cels.append(frame_layer) - project.change_cel(-1, layer) + project.change_cel(-1, layer_index) elif Input.is_action_pressed("ctrl"): for i in range(0, project.frames.size()): - var frame_layer := [i, layer] + var frame_layer := [i, layer_index] if !project.selected_cels.has(frame_layer): project.selected_cels.append(frame_layer) - project.change_cel(-1, layer) + project.change_cel(-1, layer_index) else: # If the button is pressed without Shift or Control _select_current_layer() @@ -143,18 +145,20 @@ func _save_layer_name(new_name: String) -> void: line_edit.visible = false line_edit.editable = false label.text = new_name - if layer < Global.current_project.layers.size(): - Global.current_project.layers[layer].name = new_name + if layer_index < Global.current_project.layers.size(): + Global.current_project.layers[layer_index].name = new_name func _on_ExpandButton_pressed() -> void: - Global.current_project.layers[layer].expanded = !Global.current_project.layers[layer].expanded + var layer := Global.current_project.layers[layer_index] + layer.expanded = !layer.expanded _update_buttons_all_layers() func _on_VisibilityButton_pressed() -> void: Global.canvas.selection.transform_content_confirm() - Global.current_project.layers[layer].visible = !Global.current_project.layers[layer].visible + var layer := Global.current_project.layers[layer_index] + layer.visible = !layer.visible Global.canvas.update_all_layers = true Global.canvas.queue_redraw() if Global.select_layer_on_button_click: @@ -164,7 +168,8 @@ func _on_VisibilityButton_pressed() -> void: func _on_LockButton_pressed() -> void: Global.canvas.selection.transform_content_confirm() - Global.current_project.layers[layer].locked = !Global.current_project.layers[layer].locked + var layer := Global.current_project.layers[layer_index] + layer.locked = !layer.locked if Global.select_layer_on_button_click: _select_current_layer() _update_buttons_all_layers() @@ -172,10 +177,10 @@ func _on_LockButton_pressed() -> void: func _on_LinkButton_pressed() -> void: Global.canvas.selection.transform_content_confirm() - var layer_class := Global.current_project.layers[layer] - if not layer_class is PixelLayer: + var layer := Global.current_project.layers[layer_index] + if not layer is PixelLayer: return - layer_class.new_cels_linked = !layer_class.new_cels_linked + layer.new_cels_linked = !layer.new_cels_linked update_buttons() if Global.select_layer_on_button_click: _select_current_layer() @@ -183,17 +188,16 @@ func _on_LinkButton_pressed() -> void: func _select_current_layer() -> void: Global.current_project.selected_cels.clear() - var frame_layer := [Global.current_project.current_frame, layer] + var frame_layer := [Global.current_project.current_frame, layer_index] if !Global.current_project.selected_cels.has(frame_layer): Global.current_project.selected_cels.append(frame_layer) - Global.current_project.change_cel(-1, layer) + Global.current_project.change_cel(-1, layer_index) func _get_drag_data(_position: Vector2) -> Variant: - var layers := range( - layer - Global.current_project.layers[layer].get_child_count(true), layer + 1 - ) + var layer := Global.current_project.layers[layer_index] + var layers := range(layer_index - layer.get_child_count(true), layer_index + 1) var box := VBoxContainer.new() for i in layers.size(): @@ -204,7 +208,7 @@ func _get_drag_data(_position: Vector2) -> Variant: box.add_child(button) set_drag_preview(box) - return ["Layer", layer] + return ["Layer", layer_index] func _can_drop_data(_pos: Vector2, data) -> bool: @@ -214,7 +218,7 @@ func _can_drop_data(_pos: Vector2, data) -> bool: if data[0] != "Layer": Global.animation_timeline.drag_highlight.visible = false return false - var curr_layer: BaseLayer = Global.current_project.layers[layer] + var curr_layer: BaseLayer = Global.current_project.layers[layer_index] var drag_layer: BaseLayer = Global.current_project.layers[data[1]] if curr_layer == drag_layer: @@ -222,7 +226,7 @@ func _can_drop_data(_pos: Vector2, data) -> bool: return false var region: Rect2 - var depth := Global.current_project.layers[layer].get_hierarchy_depth() + var depth := curr_layer.get_hierarchy_depth() if Input.is_action_pressed("ctrl"): # Swap layers if drag_layer.is_ancestor_of(curr_layer) or curr_layer.is_ancestor_of(drag_layer): @@ -236,7 +240,7 @@ func _can_drop_data(_pos: Vector2, data) -> bool: return false # If accepted as a child, is it in the center region? if ( - Global.current_project.layers[layer].accepts_child(drag_layer) + curr_layer.accepts_child(drag_layer) and _get_region_rect(0.25, 0.75).has_point(get_global_mouse_position()) ): # Drawn regions are adjusted a bit from actual to clarify drop position @@ -275,7 +279,9 @@ func _drop_data(_pos: Vector2, data) -> void: if Input.is_action_pressed("ctrl"): # Swap layers # a and b both need "from", "to", and "to_parents" # a is this layer (and children), b is the dropped layers - var a := {"from": range(layer - layers[layer].get_child_count(true), layer + 1)} + var a := { + "from": range(layer_index - layers[layer_index].get_child_count(true), layer_index + 1) + } var b := {"from": drop_from_indices} if a.from[0] < b.from[0]: @@ -311,28 +317,28 @@ func _drop_data(_pos: Vector2, data) -> void: # If accepted as a child, is it in the center region? if ( - layers[layer].accepts_child(layers[drop_layer]) + layers[layer_index].accepts_child(layers[drop_layer]) and _get_region_rect(0.25, 0.75).has_point(get_global_mouse_position()) ): - to_index = layer - to_parent = layers[layer] + to_index = layer_index + to_parent = layers[layer_index] else: # Top or bottom region? if _get_region_rect(0, 0.5).has_point(get_global_mouse_position()): - to_index = layer + 1 - to_parent = layers[layer].parent + to_index = layer_index + 1 + to_parent = layers[layer_index].parent else: # Place under the layer, if it has children, place after its lowest child - if layers[layer].has_children(): - to_index = layers[layer].get_children(true)[0].index + if layers[layer_index].has_children(): + to_index = layers[layer_index].get_children(true)[0].index - if layers[layer].is_ancestor_of(layers[drop_layer]): + if layers[layer_index].is_ancestor_of(layers[drop_layer]): to_index += drop_from_indices.size() else: - to_index = layer - to_parent = layers[layer].parent + to_index = layer_index + to_parent = layers[layer_index].parent - if drop_layer < layer: + if drop_layer < layer_index: to_index -= drop_from_indices.size() var drop_to_indices := range(to_index, to_index + drop_from_indices.size()) @@ -347,7 +353,7 @@ func _drop_data(_pos: Vector2, data) -> void: project.move_layers.bind(drop_to_indices, drop_from_indices, drop_from_parents) ) if project.current_layer == drop_layer: - project.undo_redo.add_do_method(project.change_cel.bind(-1, layer)) + project.undo_redo.add_do_method(project.change_cel.bind(-1, layer_index)) else: project.undo_redo.add_do_method(project.change_cel.bind(-1, project.current_layer)) project.undo_redo.add_undo_method(project.change_cel.bind(-1, project.current_layer)) diff --git a/src/UI/Timeline/BaseLayerButton.tscn b/src/UI/Timeline/LayerButton.tscn similarity index 71% rename from src/UI/Timeline/BaseLayerButton.tscn rename to src/UI/Timeline/LayerButton.tscn index 19fb5e1b0..6dcbde3ad 100644 --- a/src/UI/Timeline/BaseLayerButton.tscn +++ b/src/UI/Timeline/LayerButton.tscn @@ -1,17 +1,19 @@ -[gd_scene load_steps=4 format=3 uid="uid://bai814sqvk68f"] +[gd_scene load_steps=6 format=3 uid="uid://bai814sqvk68f"] -[ext_resource type="Script" path="res://src/UI/Timeline/LayerButton.gd" id="1"] -[ext_resource type="Texture2D" uid="uid://c2b3htff5yox8" path="res://assets/graphics/layers/layer_visible.png" id="2"] -[ext_resource type="Texture2D" uid="uid://dhc0pnnqojd2m" path="res://assets/graphics/layers/unlock.png" id="3"] +[ext_resource type="Script" path="res://src/UI/Timeline/LayerButton.gd" id="1_6hlpe"] +[ext_resource type="Texture2D" uid="uid://c2b3htff5yox8" path="res://assets/graphics/layers/layer_visible.png" id="2_ef6fb"] +[ext_resource type="Texture2D" uid="uid://dndlglvqc7v6a" path="res://assets/graphics/layers/group_expanded.png" id="2_enrtd"] +[ext_resource type="Texture2D" uid="uid://dhc0pnnqojd2m" path="res://assets/graphics/layers/unlock.png" id="3_ah1my"] +[ext_resource type="Texture2D" uid="uid://cofw1x6chh4i" path="res://assets/graphics/layers/unlinked_layer.png" id="4_058qm"] -[node name="BaseLayerButton" type="Button"] +[node name="LayerButton" type="Button"] offset_right = 200.0 offset_bottom = 36.0 focus_mode = 0 mouse_default_cursor_shape = 2 toggle_mode = true action_mode = 0 -script = ExtResource("1") +script = ExtResource("1_6hlpe") [node name="HBoxContainer" type="HBoxContainer" parent="."] layout_mode = 1 @@ -32,6 +34,8 @@ layout_mode = 2 theme_override_constants/separation = 10 [node name="ExpandButton" type="Button" parent="HBoxContainer/LayerButtons" groups=["UIButtons"]] +unique_name_in_owner = true +visible = false custom_minimum_size = Vector2(22, 22) layout_mode = 2 size_flags_horizontal = 0 @@ -51,6 +55,7 @@ offset_right = 11.0 offset_bottom = 11.0 size_flags_horizontal = 0 size_flags_vertical = 0 +texture = ExtResource("2_enrtd") [node name="VisibilityButton" type="Button" parent="HBoxContainer/LayerButtons" groups=["UIButtons"]] custom_minimum_size = Vector2(22, 22) @@ -73,7 +78,7 @@ offset_right = 11.0 offset_bottom = 11.0 size_flags_horizontal = 0 size_flags_vertical = 0 -texture = ExtResource("2") +texture = ExtResource("2_ef6fb") [node name="LockButton" type="Button" parent="HBoxContainer/LayerButtons" groups=["UIButtons"]] custom_minimum_size = Vector2(22, 22) @@ -96,7 +101,33 @@ offset_right = 11.0 offset_bottom = 11.0 size_flags_horizontal = 0 size_flags_vertical = 0 -texture = ExtResource("3") +texture = ExtResource("3_ah1my") + +[node name="LinkButton" type="Button" parent="HBoxContainer/LayerButtons" groups=["UIButtons"]] +unique_name_in_owner = true +visible = false +custom_minimum_size = Vector2(22, 22) +layout_mode = 2 +size_flags_horizontal = 0 +size_flags_vertical = 4 +tooltip_text = "Enable/disable automatic linking of new cels when creating new frames + +Linked cels share content across multiple frames" +mouse_default_cursor_shape = 2 + +[node name="TextureRect" type="TextureRect" parent="HBoxContainer/LayerButtons/LinkButton"] +layout_mode = 0 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -11.0 +offset_top = -11.0 +offset_right = 11.0 +offset_bottom = 11.0 +size_flags_horizontal = 0 +size_flags_vertical = 0 +texture = ExtResource("4_058qm") [node name="LayerName" type="HBoxContainer" parent="HBoxContainer"] layout_mode = 2 @@ -132,4 +163,5 @@ mouse_filter = 2 [connection signal="pressed" from="HBoxContainer/LayerButtons/ExpandButton" to="." method="_on_ExpandButton_pressed"] [connection signal="pressed" from="HBoxContainer/LayerButtons/VisibilityButton" to="." method="_on_VisibilityButton_pressed"] [connection signal="pressed" from="HBoxContainer/LayerButtons/LockButton" to="." method="_on_LockButton_pressed"] +[connection signal="pressed" from="HBoxContainer/LayerButtons/LinkButton" to="." method="_on_LinkButton_pressed"] [connection signal="focus_exited" from="HBoxContainer/LayerName/LineEdit" to="." method="_on_LineEdit_focus_exited"] diff --git a/src/UI/Timeline/PixelLayerButton.tscn b/src/UI/Timeline/PixelLayerButton.tscn deleted file mode 100644 index d950a36ee..000000000 --- a/src/UI/Timeline/PixelLayerButton.tscn +++ /dev/null @@ -1,65 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://b7huapiokn3h4"] - -[ext_resource type="PackedScene" uid="uid://bai814sqvk68f" path="res://src/UI/Timeline/BaseLayerButton.tscn" id="1"] -[ext_resource type="Texture2D" uid="uid://cofw1x6chh4i" path="res://assets/graphics/layers/unlinked_layer.png" id="4"] - -[node name="PixelLayerButton" instance=ExtResource("1")] - -[node name="ExpandButton" parent="HBoxContainer/LayerButtons" index="0"] -visible = false - -[node name="TextureRect" parent="HBoxContainer/LayerButtons/ExpandButton" index="0"] -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -offset_left = 0.0 -offset_top = 0.0 -offset_right = 22.0 -offset_bottom = 22.0 - -[node name="TextureRect" parent="HBoxContainer/LayerButtons/VisibilityButton" index="0"] -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -offset_left = 0.0 -offset_top = 0.0 -offset_right = 22.0 -offset_bottom = 22.0 - -[node name="TextureRect" parent="HBoxContainer/LayerButtons/LockButton" index="0"] -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -offset_left = 0.0 -offset_top = 0.0 -offset_right = 22.0 -offset_bottom = 22.0 - -[node name="LinkButton" type="Button" parent="HBoxContainer/LayerButtons" index="3" groups=["UIButtons"]] -custom_minimum_size = Vector2(22, 22) -layout_mode = 2 -size_flags_horizontal = 0 -size_flags_vertical = 4 -tooltip_text = "Enable/disable automatic linking of new cels when creating new frames - -Linked cels share content across multiple frames" -mouse_default_cursor_shape = 2 - -[node name="TextureRect" type="TextureRect" parent="HBoxContainer/LayerButtons/LinkButton" index="0"] -layout_mode = 0 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -11.0 -offset_top = -11.0 -offset_right = 11.0 -offset_bottom = 11.0 -size_flags_horizontal = 0 -size_flags_vertical = 0 -texture = ExtResource("4") - -[connection signal="pressed" from="HBoxContainer/LayerButtons/LinkButton" to="." method="_on_LinkButton_pressed"]