From 97453592a660cf80c9acc21d4773f417284a9428 Mon Sep 17 00:00:00 2001 From: don-tnowe <67479453+don-tnowe@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:42:31 +0300 Subject: [PATCH] Allow resizing of bottom docks --- .../typed_editors/dock_array.tscn | 7 +- .../typed_editors/dock_base.gd | 25 ++- .../typed_editors/dock_color.gd | 18 +- .../typed_editors/dock_color.tscn | 189 ++---------------- .../typed_editors/dock_dict.tscn | 9 +- .../typed_editors/dock_enum_array.tscn | 62 +----- .../typed_editors/dock_number.gd | 40 +++- .../typed_editors/dock_number.tscn | 88 +++++++- .../typed_editors/dock_texture.gd | 6 +- .../typed_editors/dock_texture.tscn | 46 +++-- 10 files changed, 231 insertions(+), 259 deletions(-) diff --git a/addons/resources_spreadsheet_view/typed_editors/dock_array.tscn b/addons/resources_spreadsheet_view/typed_editors/dock_array.tscn index 29032d3..6d3ff29 100644 --- a/addons/resources_spreadsheet_view/typed_editors/dock_array.tscn +++ b/addons/resources_spreadsheet_view/typed_editors/dock_array.tscn @@ -3,7 +3,7 @@ [ext_resource type="Script" path="res://addons/resources_spreadsheet_view/typed_editors/dock_array.gd" id="1"] [ext_resource type="Script" path="res://addons/resources_spreadsheet_view/editor_icon_button.gd" id="2"] -[sub_resource type="Image" id="Image_etyvi"] +[sub_resource type="Image" id="Image_ytggl"] data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 93, 93, 55, 255, 97, 97, 58, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -13,7 +13,7 @@ data = { } [sub_resource type="ImageTexture" id="ImageTexture_3oshq"] -image = SubResource("Image_etyvi") +image = SubResource("Image_ytggl") [node name="EditArray" type="VBoxContainer"] anchors_preset = 10 @@ -36,6 +36,7 @@ text = "EDIT: Array" [node name="HSeparator" type="HSeparator" parent="Header/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +mouse_filter = 2 [node name="Label" type="Label" parent="Header"] layout_mode = 2 @@ -44,9 +45,11 @@ text = "PROPERTY NAME" [node name="HSeparator2" type="HSeparator" parent="Header"] layout_mode = 2 size_flags_horizontal = 3 +mouse_filter = 2 [node name="HBoxContainer" type="HSplitContainer" parent="."] layout_mode = 2 +size_flags_vertical = 3 split_offset = 380 [node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer"] diff --git a/addons/resources_spreadsheet_view/typed_editors/dock_base.gd b/addons/resources_spreadsheet_view/typed_editors/dock_base.gd index c797671..4dce327 100644 --- a/addons/resources_spreadsheet_view/typed_editors/dock_base.gd +++ b/addons/resources_spreadsheet_view/typed_editors/dock_base.gd @@ -9,6 +9,8 @@ const TablesPluginSettingsClass := preload("res://addons/resources_spreadsheet_v var sheet : Control var selection : Array +var _resize_target_height := 0.0 + func _ready(): var parent := get_parent() @@ -18,6 +20,27 @@ func _ready(): sheet = parent get_node(path_property_name).add_theme_font_override(&"normal", get_theme_font(&"bold", &"EditorFonts")) + $"Header".gui_input.connect(_on_header_gui_input) + $"Header".mouse_filter = MOUSE_FILTER_STOP + $"Header".mouse_default_cursor_shape = CURSOR_VSIZE + ## Override to define when to show the dock and, if it can edit the value, how to handle it. -func try_edit_value(value, type, property_hint) -> bool: +func try_edit_value(value, type : int, property_hint : String) -> bool: return true + +## Override to define behaviour when stretching the header to change size. +func resize_drag(to_height : float): + return + + +func _on_header_gui_input(event : InputEvent): + if event is InputEventMouseMotion: + var pressed := Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT) + if pressed: + _resize_target_height -= event.relative.y + custom_minimum_size.y = clamp(_resize_target_height, 0.0, get_viewport().size.y * 0.75) + resize_drag(_resize_target_height) + get_child(1).visible = _resize_target_height > $"Header".size.y + + if event is InputEventMouseButton: + _resize_target_height = custom_minimum_size.y diff --git a/addons/resources_spreadsheet_view/typed_editors/dock_color.gd b/addons/resources_spreadsheet_view/typed_editors/dock_color.gd index 6b1a052..a3f69b0 100644 --- a/addons/resources_spreadsheet_view/typed_editors/dock_color.gd +++ b/addons/resources_spreadsheet_view/typed_editors/dock_color.gd @@ -4,9 +4,11 @@ extends ResourceTablesDockEditor @onready var _value_rect := $"EditColor/ColorProper/ColorRect" @onready var _color_picker_panel := $"EditColor/VSeparator6/Panel" @onready var _color_picker := $"EditColor/VSeparator6/Panel/MarginContainer/ColorPicker" -@onready var _custom_value_edit := $"EditColor/CustomX/LineEdit" +@onready var _custom_value_edit := $"EditColor/CustomX/Box/LineEdit" var _stored_value := Color.WHITE +var _resize_height_small := 0.0 +var _resize_expanded := true func _ready(): @@ -18,6 +20,8 @@ func _ready(): _connect_buttons($"EditColor/HSVGrid", 5, 4) _connect_buttons($"EditColor/HSVGrid", 10, 5) + _resize_height_small = get_child(1).get_minimum_size().y + func _connect_buttons(grid, start_index, property_bind): grid.get_child(start_index + 0).pressed.connect(_increment_values_custom.bind(-1.0, property_bind)) @@ -36,6 +40,18 @@ func try_edit_value(value, type, property_hint) -> bool: return true +func resize_drag(to_height : float): + var expanded := to_height > _resize_height_small + if _resize_expanded == expanded: + return + + _resize_expanded = expanded + $"EditColor/RGBGrid".visible = expanded + $"EditColor/ColorProper".visible = expanded + $"EditColor/HSVGrid".columns = 5 if expanded else 15 + $"EditColor/CustomX/Label".visible = expanded + + func _set_stored_value(v): _stored_value = v _color_picker.color = v diff --git a/addons/resources_spreadsheet_view/typed_editors/dock_color.tscn b/addons/resources_spreadsheet_view/typed_editors/dock_color.tscn index 0047437..d7774e1 100644 --- a/addons/resources_spreadsheet_view/typed_editors/dock_color.tscn +++ b/addons/resources_spreadsheet_view/typed_editors/dock_color.tscn @@ -3,7 +3,6 @@ [ext_resource type="Script" path="res://addons/resources_spreadsheet_view/typed_editors/dock_color.gd" id="1"] [node name="EditColor" type="VBoxContainer"] -anchors_preset = 10 offset_bottom = 131.0 grow_horizontal = 2 mouse_filter = 0 @@ -11,65 +10,47 @@ script = ExtResource("1") [node name="Header" type="HBoxContainer" parent="."] layout_mode = 2 -offset_right = 1152.0 -offset_bottom = 26.0 +mouse_filter = 0 +mouse_default_cursor_shape = 9 [node name="HBoxContainer" type="HBoxContainer" parent="Header"] layout_mode = 2 -offset_right = 506.0 -offset_bottom = 26.0 size_flags_horizontal = 3 [node name="Label" type="Label" parent="Header/HBoxContainer"] layout_mode = 2 -offset_right = 85.0 -offset_bottom = 26.0 text = "EDIT: Color" [node name="HSeparator" type="HSeparator" parent="Header/HBoxContainer"] layout_mode = 2 -offset_left = 89.0 -offset_right = 506.0 -offset_bottom = 26.0 size_flags_horizontal = 3 +mouse_filter = 2 [node name="Label" type="Label" parent="Header"] layout_mode = 2 -offset_left = 510.0 -offset_right = 642.0 -offset_bottom = 26.0 text = "PROPERTY NAME" [node name="HSeparator2" type="HSeparator" parent="Header"] layout_mode = 2 -offset_left = 646.0 -offset_right = 1152.0 -offset_bottom = 26.0 size_flags_horizontal = 3 +mouse_filter = 2 [node name="EditColor" type="HBoxContainer" parent="."] layout_mode = 2 -offset_top = 30.0 -offset_right = 1152.0 -offset_bottom = 131.0 +size_flags_vertical = 3 alignment = 1 [node name="VSeparator7" type="Control" parent="EditColor"] layout_mode = 2 -anchors_preset = 0 -offset_right = 200.0 -offset_bottom = 101.0 size_flags_horizontal = 3 [node name="VSeparator3" type="Control" parent="EditColor"] visible = false layout_mode = 2 -anchors_preset = 0 [node name="ButtonRowTemplate" type="Control" parent="EditColor"] visible = false layout_mode = 2 -anchors_preset = 0 [node name="Button3" type="Button" parent="EditColor/ButtonRowTemplate"] layout_mode = 0 @@ -93,336 +74,206 @@ text = "+X" [node name="RGBGrid" type="GridContainer" parent="EditColor"] layout_mode = 2 -offset_left = 204.0 -offset_right = 388.0 -offset_bottom = 101.0 columns = 5 [node name="Button3" type="Button" parent="EditColor/RGBGrid"] modulate = Color(1, 0.780392, 0.780392, 1) layout_mode = 2 -offset_right = 24.0 -offset_bottom = 31.0 text = "-X" [node name="Button2" type="Button" parent="EditColor/RGBGrid"] modulate = Color(1, 0.780392, 0.780392, 1) layout_mode = 2 -offset_left = 28.0 -offset_right = 60.0 -offset_bottom = 31.0 text = "-10" [node name="Label" type="Label" parent="EditColor/RGBGrid"] layout_mode = 2 -offset_left = 64.0 -offset_top = 2.0 -offset_right = 112.0 -offset_bottom = 28.0 text = "Red" horizontal_alignment = 1 [node name="Button5" type="Button" parent="EditColor/RGBGrid"] modulate = Color(1, 0.780392, 0.780392, 1) layout_mode = 2 -offset_left = 116.0 -offset_right = 152.0 -offset_bottom = 31.0 text = "+10" [node name="Button6" type="Button" parent="EditColor/RGBGrid"] modulate = Color(1, 0.780392, 0.780392, 1) layout_mode = 2 -offset_left = 156.0 -offset_right = 184.0 -offset_bottom = 31.0 text = "+X" [node name="Button7" type="Button" parent="EditColor/RGBGrid"] modulate = Color(0.666667, 1, 0.745098, 1) layout_mode = 2 -offset_top = 35.0 -offset_right = 24.0 -offset_bottom = 66.0 text = "-X" [node name="Button8" type="Button" parent="EditColor/RGBGrid"] modulate = Color(0.666667, 1, 0.745098, 1) layout_mode = 2 -offset_left = 28.0 -offset_top = 35.0 -offset_right = 60.0 -offset_bottom = 66.0 text = "-10" [node name="Label2" type="Label" parent="EditColor/RGBGrid"] layout_mode = 2 -offset_left = 64.0 -offset_top = 37.0 -offset_right = 112.0 -offset_bottom = 63.0 text = "Green" horizontal_alignment = 1 [node name="Button11" type="Button" parent="EditColor/RGBGrid"] modulate = Color(0.666667, 1, 0.745098, 1) layout_mode = 2 -offset_left = 116.0 -offset_top = 35.0 -offset_right = 152.0 -offset_bottom = 66.0 text = "+10" [node name="Button12" type="Button" parent="EditColor/RGBGrid"] modulate = Color(0.666667, 1, 0.745098, 1) layout_mode = 2 -offset_left = 156.0 -offset_top = 35.0 -offset_right = 184.0 -offset_bottom = 66.0 text = "+X" [node name="Button13" type="Button" parent="EditColor/RGBGrid"] modulate = Color(0.772549, 0.792157, 1, 1) layout_mode = 2 -offset_top = 70.0 -offset_right = 24.0 -offset_bottom = 101.0 text = "-X" [node name="Button14" type="Button" parent="EditColor/RGBGrid"] modulate = Color(0.772549, 0.792157, 1, 1) layout_mode = 2 -offset_left = 28.0 -offset_top = 70.0 -offset_right = 60.0 -offset_bottom = 101.0 text = "-10" [node name="Label3" type="Label" parent="EditColor/RGBGrid"] layout_mode = 2 -offset_left = 64.0 -offset_top = 72.0 -offset_right = 112.0 -offset_bottom = 98.0 text = "Blue" horizontal_alignment = 1 [node name="Button17" type="Button" parent="EditColor/RGBGrid"] modulate = Color(0.772549, 0.792157, 1, 1) layout_mode = 2 -offset_left = 116.0 -offset_top = 70.0 -offset_right = 152.0 -offset_bottom = 101.0 text = "+10" [node name="Button18" type="Button" parent="EditColor/RGBGrid"] modulate = Color(0.772549, 0.792157, 1, 1) layout_mode = 2 -offset_left = 156.0 -offset_top = 70.0 -offset_right = 184.0 -offset_bottom = 101.0 text = "+X" [node name="VSeparator" type="VSeparator" parent="EditColor"] layout_mode = 2 -offset_left = 392.0 -offset_right = 396.0 -offset_bottom = 101.0 [node name="ColorProper" type="VBoxContainer" parent="EditColor"] layout_mode = 2 -offset_left = 400.0 -offset_right = 511.0 -offset_bottom = 101.0 [node name="ColorRect" type="ColorRect" parent="EditColor/ColorProper"] layout_mode = 2 -offset_right = 111.0 -offset_bottom = 66.0 size_flags_vertical = 3 [node name="Button" type="Button" parent="EditColor/ColorProper"] layout_mode = 2 -offset_top = 70.0 -offset_right = 111.0 -offset_bottom = 101.0 text = "Choose Color" [node name="VSeparator2" type="VSeparator" parent="EditColor"] layout_mode = 2 -offset_left = 515.0 -offset_right = 519.0 -offset_bottom = 101.0 [node name="HSVGrid" type="GridContainer" parent="EditColor"] layout_mode = 2 -offset_left = 523.0 -offset_right = 703.0 -offset_bottom = 101.0 columns = 5 [node name="Button3" type="Button" parent="EditColor/HSVGrid"] modulate = Color(1, 0.913725, 0.776471, 1) layout_mode = 2 -offset_right = 24.0 -offset_bottom = 31.0 text = "-X" [node name="Button2" type="Button" parent="EditColor/HSVGrid"] modulate = Color(0.898039, 1, 0.698039, 1) layout_mode = 2 -offset_left = 28.0 -offset_right = 60.0 -offset_bottom = 31.0 text = "-10" [node name="Label" type="Label" parent="EditColor/HSVGrid"] layout_mode = 2 -offset_left = 64.0 -offset_top = 2.0 -offset_right = 108.0 -offset_bottom = 28.0 text = "Hue" horizontal_alignment = 1 [node name="Button5" type="Button" parent="EditColor/HSVGrid"] modulate = Color(0.717647, 1, 0.980392, 1) layout_mode = 2 -offset_left = 112.0 -offset_right = 148.0 -offset_bottom = 31.0 text = "+10" [node name="Button6" type="Button" parent="EditColor/HSVGrid"] modulate = Color(0.74902, 0.729412, 1, 1) layout_mode = 2 -offset_left = 152.0 -offset_right = 180.0 -offset_bottom = 31.0 text = "+X" [node name="Button7" type="Button" parent="EditColor/HSVGrid"] layout_mode = 2 -offset_top = 35.0 -offset_right = 24.0 -offset_bottom = 66.0 text = "-X" [node name="Button8" type="Button" parent="EditColor/HSVGrid"] layout_mode = 2 -offset_left = 28.0 -offset_top = 35.0 -offset_right = 60.0 -offset_bottom = 66.0 text = "-5" [node name="Label2" type="Label" parent="EditColor/HSVGrid"] layout_mode = 2 -offset_left = 64.0 -offset_top = 37.0 -offset_right = 108.0 -offset_bottom = 63.0 text = "Sat" horizontal_alignment = 1 [node name="Button11" type="Button" parent="EditColor/HSVGrid"] layout_mode = 2 -offset_left = 112.0 -offset_top = 35.0 -offset_right = 148.0 -offset_bottom = 66.0 text = "+5" [node name="Button12" type="Button" parent="EditColor/HSVGrid"] layout_mode = 2 -offset_left = 152.0 -offset_top = 35.0 -offset_right = 180.0 -offset_bottom = 66.0 text = "+X" [node name="Button13" type="Button" parent="EditColor/HSVGrid"] layout_mode = 2 -offset_top = 70.0 -offset_right = 24.0 -offset_bottom = 101.0 text = "-X" [node name="Button14" type="Button" parent="EditColor/HSVGrid"] layout_mode = 2 -offset_left = 28.0 -offset_top = 70.0 -offset_right = 60.0 -offset_bottom = 101.0 text = "-5" [node name="Label3" type="Label" parent="EditColor/HSVGrid"] layout_mode = 2 -offset_left = 64.0 -offset_top = 72.0 -offset_right = 108.0 -offset_bottom = 98.0 text = "Value" horizontal_alignment = 1 [node name="Button17" type="Button" parent="EditColor/HSVGrid"] layout_mode = 2 -offset_left = 112.0 -offset_top = 70.0 -offset_right = 148.0 -offset_bottom = 101.0 text = "+5" [node name="Button18" type="Button" parent="EditColor/HSVGrid"] layout_mode = 2 -offset_left = 152.0 -offset_top = 70.0 -offset_right = 180.0 -offset_bottom = 101.0 text = "+X" [node name="VSeparator4" type="VSeparator" parent="EditColor"] layout_mode = 2 -offset_left = 707.0 -offset_right = 711.0 -offset_bottom = 101.0 [node name="CustomX" type="VBoxContainer" parent="EditColor"] layout_mode = 2 -offset_left = 715.0 -offset_right = 947.0 -offset_bottom = 101.0 [node name="Label" type="Label" parent="EditColor/CustomX"] layout_mode = 2 -offset_top = 20.0 -offset_right = 232.0 -offset_bottom = 46.0 size_flags_vertical = 6 -text = "Custom Value (for +X buttons)" +text = "Custom Value" +horizontal_alignment = 1 -[node name="LineEdit" type="LineEdit" parent="EditColor/CustomX"] +[node name="Box" type="HBoxContainer" parent="EditColor/CustomX"] layout_mode = 2 -offset_top = 70.0 -offset_right = 232.0 -offset_bottom = 101.0 + +[node name="Label2" type="Label" parent="EditColor/CustomX/Box"] +layout_mode = 2 +size_flags_vertical = 6 +text = "X =" + +[node name="LineEdit" type="LineEdit" parent="EditColor/CustomX/Box"] +layout_mode = 2 +size_flags_horizontal = 3 text = "20" [node name="VSeparator6" type="Control" parent="EditColor"] layout_mode = 2 -anchors_preset = 0 -offset_left = 951.0 -offset_right = 1152.0 -offset_bottom = 101.0 size_flags_horizontal = 3 [node name="Panel" type="PanelContainer" parent="EditColor/VSeparator6"] visible = false layout_mode = 1 anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 grow_vertical = 0 [node name="Panel2" type="Panel" parent="EditColor/VSeparator6/Panel"] @@ -434,8 +285,6 @@ layout_mode = 2 [node name="ColorPicker" type="ColorPicker" parent="EditColor/VSeparator6/Panel/MarginContainer"] layout_mode = 2 -offset_right = 290.0 -offset_bottom = 542.0 [node name="Button" type="Button" parent="EditColor/VSeparator6/Panel/MarginContainer/ColorPicker"] layout_mode = 2 diff --git a/addons/resources_spreadsheet_view/typed_editors/dock_dict.tscn b/addons/resources_spreadsheet_view/typed_editors/dock_dict.tscn index 7b26ac3..66f54b8 100644 --- a/addons/resources_spreadsheet_view/typed_editors/dock_dict.tscn +++ b/addons/resources_spreadsheet_view/typed_editors/dock_dict.tscn @@ -3,7 +3,7 @@ [ext_resource type="Script" path="res://addons/resources_spreadsheet_view/typed_editors/dock_dict.gd" id="1_2yivi"] [ext_resource type="Script" path="res://addons/resources_spreadsheet_view/editor_icon_button.gd" id="2_yck0k"] -[sub_resource type="Image" id="Image_aiqvb"] +[sub_resource type="Image" id="Image_tit0e"] data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 93, 93, 55, 255, 97, 97, 58, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -13,7 +13,7 @@ data = { } [sub_resource type="ImageTexture" id="ImageTexture_3oshq"] -image = SubResource("Image_aiqvb") +image = SubResource("Image_tit0e") [node name="EditArray" type="VBoxContainer"] anchors_preset = 10 @@ -24,6 +24,8 @@ script = ExtResource("1_2yivi") [node name="Header" type="HBoxContainer" parent="."] layout_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 9 [node name="HBoxContainer" type="HBoxContainer" parent="Header"] layout_mode = 2 @@ -36,6 +38,7 @@ text = "EDIT: Dict/Object" [node name="HSeparator" type="HSeparator" parent="Header/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +mouse_filter = 2 [node name="Label" type="Label" parent="Header"] layout_mode = 2 @@ -44,9 +47,11 @@ text = "PROPERTY NAME" [node name="HSeparator2" type="HSeparator" parent="Header"] layout_mode = 2 size_flags_horizontal = 3 +mouse_filter = 2 [node name="HBoxContainer" type="HSplitContainer" parent="."] layout_mode = 2 +size_flags_vertical = 3 split_offset = 520 [node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer"] diff --git a/addons/resources_spreadsheet_view/typed_editors/dock_enum_array.tscn b/addons/resources_spreadsheet_view/typed_editors/dock_enum_array.tscn index 70538b9..c1540d5 100644 --- a/addons/resources_spreadsheet_view/typed_editors/dock_enum_array.tscn +++ b/addons/resources_spreadsheet_view/typed_editors/dock_enum_array.tscn @@ -3,7 +3,7 @@ [ext_resource type="Script" path="res://addons/resources_spreadsheet_view/typed_editors/dock_enum_array.gd" id="1_n3flg"] [ext_resource type="Script" path="res://addons/resources_spreadsheet_view/editor_icon_button.gd" id="2_mda1e"] -[sub_resource type="Image" id="Image_yhr7y"] +[sub_resource type="Image" id="Image_5ktp6"] data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 93, 93, 55, 255, 97, 97, 58, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -13,7 +13,7 @@ data = { } [sub_resource type="ImageTexture" id="ImageTexture_3oshq"] -image = SubResource("Image_yhr7y") +image = SubResource("Image_5ktp6") [node name="EditEnumArray" type="VBoxContainer"] anchors_preset = 10 @@ -23,89 +23,60 @@ script = ExtResource("1_n3flg") [node name="Header" type="HBoxContainer" parent="."] layout_mode = 2 -offset_right = 1152.0 -offset_bottom = 26.0 +mouse_filter = 0 +mouse_default_cursor_shape = 9 [node name="HBoxContainer" type="HBoxContainer" parent="Header"] layout_mode = 2 -offset_right = 506.0 -offset_bottom = 26.0 size_flags_horizontal = 3 [node name="Label" type="Label" parent="Header/HBoxContainer"] layout_mode = 2 -offset_right = 135.0 -offset_bottom = 26.0 text = "EDIT: Enum Array" [node name="HSeparator" type="HSeparator" parent="Header/HBoxContainer"] layout_mode = 2 -offset_left = 139.0 -offset_right = 506.0 -offset_bottom = 26.0 size_flags_horizontal = 3 +mouse_filter = 2 [node name="Label" type="Label" parent="Header"] layout_mode = 2 -offset_left = 510.0 -offset_right = 642.0 -offset_bottom = 26.0 text = "PROPERTY NAME" [node name="HSeparator2" type="HSeparator" parent="Header"] layout_mode = 2 -offset_left = 646.0 -offset_right = 1152.0 -offset_bottom = 26.0 size_flags_horizontal = 3 +mouse_filter = 2 [node name="HBoxContainer" type="HSplitContainer" parent="."] layout_mode = 2 -offset_top = 30.0 -offset_right = 1152.0 -offset_bottom = 61.0 +size_flags_vertical = 3 split_offset = 250 [node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer"] layout_mode = 2 -offset_right = 250.0 -offset_bottom = 31.0 alignment = 2 [node name="Panel" type="MarginContainer" parent="HBoxContainer/HBoxContainer"] layout_mode = 2 -offset_right = 58.0 -offset_bottom = 31.0 size_flags_horizontal = 3 [node name="Label" type="TextEdit" parent="HBoxContainer/HBoxContainer/Panel"] layout_mode = 2 -offset_right = 58.0 -offset_bottom = 31.0 size_flags_vertical = 5 text = "[]" [node name="VSeparator2" type="VSeparator" parent="HBoxContainer/HBoxContainer"] layout_mode = 2 -offset_left = 62.0 -offset_right = 66.0 -offset_bottom = 31.0 [node name="Control" type="MarginContainer" parent="HBoxContainer/HBoxContainer"] layout_mode = 2 -offset_left = 70.0 -offset_right = 242.0 -offset_bottom = 31.0 [node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer/HBoxContainer/Control"] layout_mode = 2 -offset_right = 172.0 -offset_bottom = 31.0 [node name="Remove" type="Button" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer"] layout_mode = 2 -offset_right = 172.0 -offset_bottom = 31.0 text = "Remove Last Value" icon = SubResource("ImageTexture_3oshq") script = ExtResource("2_mda1e") @@ -113,47 +84,28 @@ icon_name = "Remove" [node name="VSeparator" type="VSeparator" parent="HBoxContainer/HBoxContainer"] layout_mode = 2 -offset_left = 246.0 -offset_right = 250.0 -offset_bottom = 31.0 [node name="Control2" type="MarginContainer" parent="HBoxContainer"] layout_mode = 2 -offset_left = 262.0 -offset_right = 1152.0 -offset_bottom = 31.0 size_flags_horizontal = 3 [node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/Control2"] layout_mode = 2 -offset_right = 890.0 -offset_bottom = 31.0 alignment = 2 [node name="VSeparator2" type="VSeparator" parent="HBoxContainer/Control2/HBoxContainer"] layout_mode = 2 -offset_right = 4.0 -offset_bottom = 31.0 [node name="HFlowContainer" type="HFlowContainer" parent="HBoxContainer/Control2/HBoxContainer"] layout_mode = 2 -offset_left = 8.0 -offset_right = 890.0 -offset_bottom = 31.0 size_flags_horizontal = 3 [node name="Label" type="Label" parent="HBoxContainer/Control2/HBoxContainer/HFlowContainer"] layout_mode = 2 -offset_top = 2.0 -offset_right = 66.0 -offset_bottom = 28.0 text = "Options:" [node name="OptionButton" type="OptionButton" parent="HBoxContainer/Control2/HBoxContainer/HFlowContainer"] layout_mode = 2 -offset_left = 70.0 -offset_right = 144.0 -offset_bottom = 31.0 item_count = 2 selected = 0 fit_to_longest_item = false diff --git a/addons/resources_spreadsheet_view/typed_editors/dock_number.gd b/addons/resources_spreadsheet_view/typed_editors/dock_number.gd index 719cbde..7feebf0 100644 --- a/addons/resources_spreadsheet_view/typed_editors/dock_number.gd +++ b/addons/resources_spreadsheet_view/typed_editors/dock_number.gd @@ -3,21 +3,26 @@ extends ResourceTablesDockEditor @onready var _value_label := $"HBoxContainer/HBoxContainer/NumberPanel/Label" @onready var _button_grid := $"HBoxContainer/HBoxContainer/GridContainer" +@onready var _button_grid_small := $"HBoxContainer/HBoxContainer/GridContainerSmall" @onready var _sequence_gen_inputs := $"HBoxContainer/CustomX2/HBoxContainer" -@onready var _custom_value_edit := $"HBoxContainer/CustomX/LineEdit" +@onready var _custom_value_edit := $"HBoxContainer/CustomX/Box/LineEdit" var _stored_value = 0 var _stored_value_is_int := false + var _mouse_drag_increment := 0.0 var _mouse_down := false +var _resize_height_small := 0.0 +var _resize_expanded := true + func _ready(): super._ready() - _button_grid.get_child(0).pressed.connect(_increment_values.bind(0.1)) - _button_grid.get_child(1).pressed.connect(_increment_values.bind(1)) - _button_grid.get_child(2).pressed.connect(_increment_values.bind(10)) - _button_grid.get_child(3).pressed.connect(_increment_values.bind(100)) + _button_grid.get_child(0).pressed.connect(_increment_values.bind(+0.1)) + _button_grid.get_child(1).pressed.connect(_increment_values.bind(+1)) + _button_grid.get_child(2).pressed.connect(_increment_values.bind(+10)) + _button_grid.get_child(3).pressed.connect(_increment_values.bind(+100)) _button_grid.get_child(4).pressed.connect(_increment_values_custom.bind(true, false)) _button_grid.get_child(5).pressed.connect(_increment_values_custom.bind(true, true)) @@ -28,6 +33,15 @@ func _ready(): _button_grid.get_child(10).pressed.connect(_increment_values_custom.bind(false, false)) _button_grid.get_child(11).pressed.connect(_increment_values_custom.bind(false, true)) + _button_grid_small.get_child(1).pressed.connect(_increment_values_custom.bind(true, true)) + _button_grid_small.get_child(2).pressed.connect(_increment_values_custom.bind(true, false)) + _button_grid_small.get_child(3).pressed.connect(_increment_values.bind(-1)) + _button_grid_small.get_child(4).pressed.connect(_increment_values.bind(+1)) + _button_grid_small.get_child(5).pressed.connect(_increment_values_custom.bind(false, false)) + _button_grid_small.get_child(6).pressed.connect(_increment_values_custom.bind(false, true)) + + _resize_height_small = get_child(1).get_minimum_size().y + func try_edit_value(value, type, property_hint) -> bool: if type != TYPE_FLOAT and type != TYPE_INT: @@ -44,6 +58,22 @@ func try_edit_value(value, type, property_hint) -> bool: return true +func resize_drag(to_height : float): + var expanded : bool = to_height >= _resize_height_small + if _resize_expanded == expanded: + return + + _resize_expanded = expanded + _button_grid.visible = expanded + _button_grid_small.visible = !expanded + $"HBoxContainer/CustomX2/HBoxContainer/Label2".visible = !expanded + $"HBoxContainer/CustomX2/HBoxContainer3".visible = expanded + $"HBoxContainer/HBoxContainer/NumberPanel".visible = expanded + $"HBoxContainer/CustomX2/HBoxContainer2".visible = expanded + $"HBoxContainer/CustomX2/HBoxContainer/Box".visible = !expanded + $"HBoxContainer/CustomX/Label".visible = expanded + + func _increment_values(by : float): var cell_values = sheet.get_edited_cells_values() if _stored_value_is_int: diff --git a/addons/resources_spreadsheet_view/typed_editors/dock_number.tscn b/addons/resources_spreadsheet_view/typed_editors/dock_number.tscn index 16e2bdb..a191cda 100644 --- a/addons/resources_spreadsheet_view/typed_editors/dock_number.tscn +++ b/addons/resources_spreadsheet_view/typed_editors/dock_number.tscn @@ -3,11 +3,15 @@ [ext_resource type="Script" path="res://addons/resources_spreadsheet_view/typed_editors/dock_number.gd" id="1"] [node name="EditNumber" type="VBoxContainer"] +offset_right = 1141.0 +offset_bottom = 126.0 mouse_filter = 0 script = ExtResource("1") [node name="Header" type="HBoxContainer" parent="."] layout_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 9 [node name="HBoxContainer" type="HBoxContainer" parent="Header"] layout_mode = 2 @@ -20,6 +24,7 @@ text = "EDIT: Number" [node name="HSeparator" type="HSeparator" parent="Header/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +mouse_filter = 2 [node name="Label" type="Label" parent="Header"] layout_mode = 2 @@ -28,9 +33,11 @@ text = "PROPERTY NAME" [node name="HSeparator2" type="HSeparator" parent="Header"] layout_mode = 2 size_flags_horizontal = 3 +mouse_filter = 2 [node name="HBoxContainer" type="HBoxContainer" parent="."] layout_mode = 2 +size_flags_vertical = 3 alignment = 1 [node name="CustomX2" type="VBoxContainer" parent="HBoxContainer"] @@ -38,6 +45,7 @@ layout_mode = 2 [node name="HBoxContainer3" type="HBoxContainer" parent="HBoxContainer/CustomX2"] layout_mode = 2 +size_flags_vertical = 3 [node name="Label" type="Label" parent="HBoxContainer/CustomX2/HBoxContainer3"] layout_mode = 2 @@ -62,6 +70,11 @@ text = "(?)" [node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/CustomX2"] layout_mode = 2 +[node name="Label2" type="Label" parent="HBoxContainer/CustomX2/HBoxContainer"] +visible = false +layout_mode = 2 +text = "Sequence" + [node name="LineEdit" type="LineEdit" parent="HBoxContainer/CustomX2/HBoxContainer"] layout_mode = 2 tooltip_text = "Start (must not be blank)" @@ -77,13 +90,32 @@ layout_mode = 2 tooltip_text = "End" placeholder_text = "Step" +[node name="Box" type="HBoxContainer" parent="HBoxContainer/CustomX2/HBoxContainer"] +visible = false +layout_mode = 2 + +[node name="VSeparator" type="VSeparator" parent="HBoxContainer/CustomX2/HBoxContainer/Box"] +layout_mode = 2 + +[node name="SequenceFill3" type="Button" parent="HBoxContainer/CustomX2/HBoxContainer/Box"] +layout_mode = 2 +size_flags_horizontal = 3 +tooltip_text = "Set" +text = "=" + +[node name="SequenceFill4" type="Button" parent="HBoxContainer/CustomX2/HBoxContainer/Box"] +layout_mode = 2 +size_flags_horizontal = 3 +tooltip_text = "Add to each value" +text = "+" + [node name="HBoxContainer2" type="HBoxContainer" parent="HBoxContainer/CustomX2"] layout_mode = 2 [node name="SequenceFill" type="Button" parent="HBoxContainer/CustomX2/HBoxContainer2"] layout_mode = 2 size_flags_horizontal = 3 -text = "Replace" +text = "Set" [node name="SequenceFill2" type="Button" parent="HBoxContainer/CustomX2/HBoxContainer2"] layout_mode = 2 @@ -163,6 +195,44 @@ text = "-X" layout_mode = 2 text = "/X" +[node name="GridContainerSmall" type="HBoxContainer" parent="HBoxContainer/HBoxContainer"] +visible = false +layout_mode = 2 + +[node name="Label" type="Label" parent="HBoxContainer/HBoxContainer/GridContainerSmall"] +layout_mode = 2 +text = "Value" + +[node name="Button1" type="Button" parent="HBoxContainer/HBoxContainer/GridContainerSmall"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "/X" + +[node name="Button2" type="Button" parent="HBoxContainer/HBoxContainer/GridContainerSmall"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "-X" + +[node name="Button3" type="Button" parent="HBoxContainer/HBoxContainer/GridContainerSmall"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "-1" + +[node name="Button4" type="Button" parent="HBoxContainer/HBoxContainer/GridContainerSmall"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "+1" + +[node name="Button5" type="Button" parent="HBoxContainer/HBoxContainer/GridContainerSmall"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "+X" + +[node name="Button6" type="Button" parent="HBoxContainer/HBoxContainer/GridContainerSmall"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "*X" + [node name="VSeparator" type="VSeparator" parent="HBoxContainer"] layout_mode = 2 @@ -172,12 +242,24 @@ layout_mode = 2 [node name="Label" type="Label" parent="HBoxContainer/CustomX"] layout_mode = 2 size_flags_vertical = 6 -text = "Custom Value (for +X buttons)" +text = "Custom Value" +horizontal_alignment = 1 -[node name="LineEdit" type="LineEdit" parent="HBoxContainer/CustomX"] +[node name="Box" type="HBoxContainer" parent="HBoxContainer/CustomX"] layout_mode = 2 + +[node name="Label" type="Label" parent="HBoxContainer/CustomX/Box"] +layout_mode = 2 +text = "X =" + +[node name="LineEdit" type="LineEdit" parent="HBoxContainer/CustomX/Box"] +custom_minimum_size = Vector2(96, 0) +layout_mode = 2 +size_flags_horizontal = 3 text = "1000" +[connection signal="pressed" from="HBoxContainer/CustomX2/HBoxContainer/Box/SequenceFill3" to="." method="_on_SequenceFill_pressed"] +[connection signal="pressed" from="HBoxContainer/CustomX2/HBoxContainer/Box/SequenceFill4" to="." method="_on_SequenceFill_pressed"] [connection signal="pressed" from="HBoxContainer/CustomX2/HBoxContainer2/SequenceFill" to="." method="_on_SequenceFill_pressed"] [connection signal="pressed" from="HBoxContainer/CustomX2/HBoxContainer2/SequenceFill2" to="." method="_on_SequenceFill_pressed" binds= [true]] [connection signal="gui_input" from="HBoxContainer/HBoxContainer/NumberPanel" to="." method="_on_NumberPanel_gui_input"] diff --git a/addons/resources_spreadsheet_view/typed_editors/dock_texture.gd b/addons/resources_spreadsheet_view/typed_editors/dock_texture.gd index f5dbb09..dcb9e81 100644 --- a/addons/resources_spreadsheet_view/typed_editors/dock_texture.gd +++ b/addons/resources_spreadsheet_view/typed_editors/dock_texture.gd @@ -9,13 +9,13 @@ func try_edit_value(value, type, _property_hint) -> bool: return false _stored_value = value - $"CenterContainer/HBoxContainer/TextureRect".texture = value + $"HBoxContainer/TextureRect".texture = value return true func _on_Button_pressed(): - var h_count = $"CenterContainer/HBoxContainer/VBoxContainer/HBoxContainer/LineEdit".text.to_int() - var v_count = $"CenterContainer/HBoxContainer/VBoxContainer/HBoxContainer/LineEdit2".text.to_int() + var h_count = $"HBoxContainer/VBoxContainer/HBoxContainer/LineEdit".text.to_int() + var v_count = $"HBoxContainer/VBoxContainer/HBoxContainer/LineEdit2".text.to_int() # No, Scene Unique Names can not be used in-editor (last time i checked) var folder_name := _stored_value.resource_path.get_basename() diff --git a/addons/resources_spreadsheet_view/typed_editors/dock_texture.tscn b/addons/resources_spreadsheet_view/typed_editors/dock_texture.tscn index 46541c3..0f9c7b4 100644 --- a/addons/resources_spreadsheet_view/typed_editors/dock_texture.tscn +++ b/addons/resources_spreadsheet_view/typed_editors/dock_texture.tscn @@ -1,11 +1,12 @@ -[gd_scene load_steps=2 format=3 uid="uid://rww3gpl052bn"] +[gd_scene load_steps=3 format=3 uid="uid://rww3gpl052bn"] [ext_resource type="Script" path="res://addons/resources_spreadsheet_view/typed_editors/dock_texture.gd" id="1"] +[ext_resource type="Texture2D" uid="uid://c08qavfwqr3k7" path="res://icon.png" id="2_xbp0j"] [node name="EditTexture" type="VBoxContainer"] anchors_preset = -1 anchor_right = 1.0 -anchor_bottom = 0.0694444 +anchor_bottom = 0.25463 offset_bottom = 126.0 grow_horizontal = 2 mouse_filter = 0 @@ -14,6 +15,8 @@ metadata/_edit_use_anchors_ = true [node name="Header" type="HBoxContainer" parent="."] layout_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 9 [node name="HBoxContainer" type="HBoxContainer" parent="Header"] layout_mode = 2 @@ -26,6 +29,7 @@ text = "EDIT: Texture" [node name="HSeparator" type="HSeparator" parent="Header/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +mouse_filter = 2 [node name="Label" type="Label" parent="Header"] layout_mode = 2 @@ -34,55 +38,63 @@ text = "PROPERTY NAME" [node name="HSeparator2" type="HSeparator" parent="Header"] layout_mode = 2 size_flags_horizontal = 3 +mouse_filter = 2 -[node name="CenterContainer" type="CenterContainer" parent="."] -layout_mode = 2 - -[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="."] layout_mode = 2 +size_flags_vertical = 3 alignment = 1 -[node name="TextureRect" type="TextureRect" parent="CenterContainer/HBoxContainer"] -custom_minimum_size = Vector2(64, 64) +[node name="Control2" type="Control" parent="HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +mouse_filter = 2 + +[node name="TextureRect" type="TextureRect" parent="HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 +texture = ExtResource("2_xbp0j") expand_mode = 1 stretch_mode = 5 -[node name="VSeparator" type="VSeparator" parent="CenterContainer/HBoxContainer"] +[node name="VSeparator" type="VSeparator" parent="HBoxContainer"] layout_mode = 2 -[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/HBoxContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 auto_translate = false -[node name="Label" type="Label" parent="CenterContainer/HBoxContainer/VBoxContainer"] +[node name="Label" type="Label" parent="HBoxContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 text = "Atlas Chopper" horizontal_alignment = 1 vertical_alignment = 1 -[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/HBoxContainer/VBoxContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 4 -[node name="LineEdit" type="LineEdit" parent="CenterContainer/HBoxContainer/VBoxContainer/HBoxContainer"] +[node name="LineEdit" type="LineEdit" parent="HBoxContainer/VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 placeholder_text = "H Count" -[node name="LineEdit2" type="LineEdit" parent="CenterContainer/HBoxContainer/VBoxContainer/HBoxContainer"] +[node name="LineEdit2" type="LineEdit" parent="HBoxContainer/VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 placeholder_text = "V Count" -[node name="Button" type="Button" parent="CenterContainer/HBoxContainer/VBoxContainer"] -custom_minimum_size = Vector2(256, 0) +[node name="Button" type="Button" parent="HBoxContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 4 text = "Chop chop chop!!!" -[connection signal="pressed" from="CenterContainer/HBoxContainer/VBoxContainer/Button" to="." method="_on_Button_pressed"] +[node name="Control" type="Control" parent="HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +mouse_filter = 2 + +[connection signal="pressed" from="HBoxContainer/VBoxContainer/Button" to="." method="_on_Button_pressed"]