From ecb1890024530e189c2e5e6c7cb2b1cf9c202e5d Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 7 May 2024 23:20:15 +0300 Subject: [PATCH] Change AnimationTagUI to be a Control instead of a VBoxContainer --- src/Classes/Project.gd | 4 ++-- src/UI/Timeline/AnimationTagUI.gd | 2 +- src/UI/Timeline/AnimationTagUI.tscn | 18 ++++++++++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/Classes/Project.gd b/src/Classes/Project.gd index d344d2481..50db0a0a9 100644 --- a/src/Classes/Project.gd +++ b/src/Classes/Project.gd @@ -487,7 +487,7 @@ func _animation_tags_changed(value: Array[AnimationTag]) -> void: child.queue_free() for tag in animation_tags: - var tag_c: Container = animation_tag_node.instantiate() + var tag_c := animation_tag_node.instantiate() tag_c.tag = tag Global.tag_container.add_child(tag_c) var tag_position := Global.tag_container.get_child_count() - 1 @@ -506,7 +506,7 @@ func _set_timeline_first_and_last_frames() -> void: for tag in animation_tags: if current_frame + 1 >= tag.from && current_frame + 1 <= tag.to: Global.animation_timeline.first_frame = tag.from - 1 - Global.animation_timeline.last_frame = min(frames.size() - 1, tag.to - 1) + Global.animation_timeline.last_frame = mini(frames.size() - 1, tag.to - 1) func is_empty() -> bool: diff --git a/src/UI/Timeline/AnimationTagUI.gd b/src/UI/Timeline/AnimationTagUI.gd index bfe14d56f..728afc039 100644 --- a/src/UI/Timeline/AnimationTagUI.gd +++ b/src/UI/Timeline/AnimationTagUI.gd @@ -1,4 +1,4 @@ -extends VBoxContainer +extends Control var tag: AnimationTag @onready var tag_properties := Global.control.find_child("TagProperties") as ConfirmationDialog diff --git a/src/UI/Timeline/AnimationTagUI.tscn b/src/UI/Timeline/AnimationTagUI.tscn index b3d7951ad..7923c6998 100644 --- a/src/UI/Timeline/AnimationTagUI.tscn +++ b/src/UI/Timeline/AnimationTagUI.tscn @@ -2,10 +2,13 @@ [ext_resource type="Script" path="res://src/UI/Timeline/AnimationTagUI.gd" id="1"] -[node name="AnimationTagUI" type="VBoxContainer"] +[node name="AnimationTagUI" type="Control"] custom_minimum_size = Vector2(39, 32) +layout_mode = 3 +anchors_preset = 0 offset_right = 39.0 offset_bottom = 32.0 +mouse_filter = 2 script = ExtResource("1") [node name="Line2D" type="Line2D" parent="."] @@ -16,7 +19,18 @@ begin_cap_mode = 2 end_cap_mode = 2 [node name="Button" type="Button" parent="."] -layout_mode = 2 +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -18.5 +offset_top = -16.0 +offset_right = 18.5 +offset_bottom = 16.0 +grow_horizontal = 2 +grow_vertical = 2 size_flags_horizontal = 4 size_flags_vertical = 3 auto_translate = false