diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index 0afcb5a1a..32cf05c26 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -103,8 +103,7 @@ var palettes := {} # Nodes var notification_label_node: PackedScene = preload("res://src/UI/NotificationLabel.tscn") -onready var root: Node = get_tree().get_root() -onready var control: Node = root.get_node("Control") +onready var control: Node = get_tree().get_root().get_node("Control") onready var left_cursor: Sprite = control.find_node("LeftCursor") onready var right_cursor: Sprite = control.find_node("RightCursor") @@ -182,10 +181,7 @@ func _ready() -> void: var proj_size := Vector2(default_width, default_height) projects.append(Project.new([], tr("untitled"), proj_size)) current_project = projects[0] - current_project.layers.append(Layer.new()) current_project.fill_color = default_fill_color - var frame: Frame = current_project.new_empty_frame() - current_project.frames.append(frame) for node in get_tree().get_nodes_in_group("UIButtons"): var tooltip: String = node.hint_tooltip diff --git a/src/Main.gd b/src/Main.gd index 56b084877..24ba708c0 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -23,7 +23,10 @@ func _ready() -> void: Global.window_title = tr("untitled") + " - Pixelorama " + Global.current_version - Global.current_project.layers[0].name = tr("Layer") + " 0" + Global.current_project.layers.append(Layer.new()) + var frame: Frame = Global.current_project.new_empty_frame() + Global.current_project.frames.append(frame) + Global.current_project.layers = Global.current_project.layers Import.import_brushes(Global.directory_module.get_brushes_search_path_in_order()) Import.import_patterns(Global.directory_module.get_patterns_search_path_in_order()) diff --git a/src/UI/Timeline/AnimationTimeline.tscn b/src/UI/Timeline/AnimationTimeline.tscn index f58a24ef6..f8d2f8d7e 100644 --- a/src/UI/Timeline/AnimationTimeline.tscn +++ b/src/UI/Timeline/AnimationTimeline.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=44 format=2] +[gd_scene load_steps=43 format=2] [ext_resource path="res://src/UI/Timeline/AnimationTimeline.gd" type="Script" id=1] [ext_resource path="res://assets/graphics/layers/new.png" type="Texture" id=2] @@ -9,7 +9,6 @@ [ext_resource path="res://assets/graphics/layers/clone.png" type="Texture" id=7] [ext_resource path="res://assets/graphics/timeline/move_arrow.png" type="Texture" id=8] [ext_resource path="res://src/UI/Timeline/FrameButton.tscn" type="PackedScene" id=9] -[ext_resource path="res://src/UI/Timeline/LayerButton.tscn" type="PackedScene" id=18] [ext_resource path="res://assets/graphics/timeline/new_frame.png" type="Texture" id=19] [ext_resource path="res://assets/graphics/timeline/remove_frame.png" type="Texture" id=20] [ext_resource path="res://assets/graphics/timeline/go_to_first_frame.png" type="Texture" id=21] @@ -832,16 +831,16 @@ margin_right = 895.0 margin_bottom = 75.0 [node name="LayersAndFrames" type="HBoxContainer" parent="ScrollContainer/TimelineContainer/PanelContainer/TimelineScroll"] -margin_right = 252.0 +margin_right = 81.0 margin_bottom = 68.0 size_flags_vertical = 3 [node name="LayerVBoxCont" type="VBoxContainer" parent="ScrollContainer/TimelineContainer/PanelContainer/TimelineScroll/LayersAndFrames"] -margin_right = 212.0 +margin_right = 41.0 margin_bottom = 68.0 [node name="LayerLabel" type="Label" parent="ScrollContainer/TimelineContainer/PanelContainer/TimelineScroll/LayersAndFrames/LayerVBoxCont"] -margin_right = 212.0 +margin_right = 41.0 margin_bottom = 16.0 rect_min_size = Vector2( 0, 16 ) text = "Layers" @@ -850,15 +849,12 @@ valign = 1 [node name="LayersContainer" type="VBoxContainer" parent="ScrollContainer/TimelineContainer/PanelContainer/TimelineScroll/LayersAndFrames/LayerVBoxCont"] margin_top = 20.0 -margin_right = 212.0 -margin_bottom = 56.0 - -[node name="LayerContainer" parent="ScrollContainer/TimelineContainer/PanelContainer/TimelineScroll/LayersAndFrames/LayerVBoxCont/LayersContainer" instance=ExtResource( 18 )] -margin_right = 212.0 +margin_right = 41.0 +margin_bottom = 20.0 [node name="FrameButtonsAndIds" type="VBoxContainer" parent="ScrollContainer/TimelineContainer/PanelContainer/TimelineScroll/LayersAndFrames"] -margin_left = 216.0 -margin_right = 252.0 +margin_left = 45.0 +margin_right = 81.0 margin_bottom = 68.0 [node name="FrameIDs" type="HBoxContainer" parent="ScrollContainer/TimelineContainer/PanelContainer/TimelineScroll/LayersAndFrames/FrameButtonsAndIds"] diff --git a/src/UI/Timeline/LayerButton.gd b/src/UI/Timeline/LayerButton.gd index f5f2638d4..450657b7b 100644 --- a/src/UI/Timeline/LayerButton.gd +++ b/src/UI/Timeline/LayerButton.gd @@ -45,7 +45,7 @@ func _input(event: InputEvent) -> void: and line_edit.visible and event.scancode != KEY_SPACE ): - save_layer_name(line_edit.text) + _save_layer_name(line_edit.text) func _on_LayerContainer_gui_input(event: InputEvent) -> void: @@ -81,10 +81,10 @@ func _on_LayerContainer_gui_input(event: InputEvent) -> void: func _on_LineEdit_focus_exited() -> void: - save_layer_name(line_edit.text) + _save_layer_name(line_edit.text) -func save_layer_name(new_name: String) -> void: +func _save_layer_name(new_name: String) -> void: label.visible = true line_edit.visible = false line_edit.editable = false