From 9a85de74b5027a1b3d6e9abaf214b7bc58ae2c53 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 5 Dec 2023 00:10:42 +0200 Subject: [PATCH] Make the color picker be always visible in the UI instead of a popup (#953) * Initial work of a color picker that is always visible * Make the new color picker fully functional * Minor UI fixes * Change the UI a bit so the color picker buttons look like they used to To save horizontal space * Add sliders as a separate panel and rename some file names * Move the left/right color buttons next to the hex text edit * Add color picker sliders to the same panel as the rest of the color picker, as an expandable/collapsible area * Change default layout * Some minor UI improvements * Remove guides from ColorPicker.tscn * Reduce the lines of code that calculate the average color * Make Pixelorama remember if the color picker is expanded and its color mode * Update tallscreen.tres * Update tallscreen.tres * Pixelorama now also remembers the last used picker shape * Add some extra comments in the code * Fix typo * Add some translation strings --- Translations/Translations.pot | 12 +- assets/graphics/misc/color_defaults.png | Bin 272 -> 0 bytes assets/graphics/misc/value_arrow_up.svg | 1 + ...s.png.import => value_arrow_up.svg.import} | 11 +- assets/layouts/default.tres | 195 ++++++++--------- assets/layouts/tallscreen.tres | 168 +++++++-------- src/Autoload/Tools.gd | 1 + src/UI/ColorPickers/ColorPicker.gd | 123 +++++++++++ src/UI/ColorPickers/ColorPicker.tscn | 196 ++++++++++++++++++ src/UI/ColorPickers/ColorPickers.gd | 72 ------- src/UI/ColorPickers/ColorPickers.tscn | 175 ---------------- src/UI/UI.tscn | 13 +- 12 files changed, 530 insertions(+), 437 deletions(-) delete mode 100644 assets/graphics/misc/color_defaults.png create mode 100644 assets/graphics/misc/value_arrow_up.svg rename assets/graphics/misc/{color_defaults.png.import => value_arrow_up.svg.import} (59%) create mode 100644 src/UI/ColorPickers/ColorPicker.gd create mode 100644 src/UI/ColorPickers/ColorPicker.tscn delete mode 100644 src/UI/ColorPickers/ColorPickers.gd delete mode 100644 src/UI/ColorPickers/ColorPickers.tscn diff --git a/Translations/Translations.pot b/Translations/Translations.pot index c6645bfe8..14959db57 100644 --- a/Translations/Translations.pot +++ b/Translations/Translations.pot @@ -1236,13 +1236,21 @@ msgstr "" msgid "Choose a color for the right tool" msgstr "" -msgid "Switch left and right colors\n" -"(%s)" +#. Tooltip of the switch colors button found in the color picker panel. +msgid "Switch left and right colors." msgstr "" msgid "Reset the colors to their default state (black for left, white for right)" msgstr "" +#. Tooltip of the screen color picker button found in the color picker panel. +msgid "Pick a color from the screen." +msgstr "" + +#. Tooltip of the button found in the color picker panel that lets users change the shape of the color picker. +msgid "Select a picker shape." +msgstr "" + msgid "Left tool" msgstr "" diff --git a/assets/graphics/misc/color_defaults.png b/assets/graphics/misc/color_defaults.png deleted file mode 100644 index c8193228c70278a1740e4576c0ec1e0f263c6291..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 272 zcmeAS@N?(olHy`uVBq!ia0vp^l0eMC!2%?gWzD$;q*&4&eH|GXHuiJ>Nn{1`nUcKS zT^QECc{0}<$m1;Vh%9Dc;5!V$jK}j=qyPokOFVsD*`KhAitw;)xNlVh6w>!}aSV~T ze0IV{UIqi6<{$qh=X%5Ytb%w``;bR!z#A7!Ek0*GU{F|-wZ2$b2&HO47OpF}Y zfm&5dTq8h>?Mnp&<}y8yHv_7`)v(F&#xiZhlH; YS|x4`a~^2k25MmNboFyt=akR{0GLls4gdfE diff --git a/assets/graphics/misc/value_arrow_up.svg b/assets/graphics/misc/value_arrow_up.svg new file mode 100644 index 000000000..f7354308d --- /dev/null +++ b/assets/graphics/misc/value_arrow_up.svg @@ -0,0 +1 @@ + diff --git a/assets/graphics/misc/color_defaults.png.import b/assets/graphics/misc/value_arrow_up.svg.import similarity index 59% rename from assets/graphics/misc/color_defaults.png.import rename to assets/graphics/misc/value_arrow_up.svg.import index c816142b6..e783a415f 100644 --- a/assets/graphics/misc/color_defaults.png.import +++ b/assets/graphics/misc/value_arrow_up.svg.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dkpxkdk1xf0ea" -path="res://.godot/imported/color_defaults.png-c124fa16d0ba44ed53b431d16e310948.ctex" +uid="uid://bhkmiijflfqxx" +path="res://.godot/imported/value_arrow_up.svg-96ec51cd97c5466d50744c7e1ca664bd.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/graphics/misc/color_defaults.png" -dest_files=["res://.godot/imported/color_defaults.png-c124fa16d0ba44ed53b431d16e310948.ctex"] +source_file="res://assets/graphics/misc/value_arrow_up.svg" +dest_files=["res://.godot/imported/value_arrow_up.svg-96ec51cd97c5466d50744c7e1ca664bd.ctex"] [params] @@ -32,3 +32,6 @@ process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/assets/layouts/default.tres b/assets/layouts/default.tres index 984567f78..45d045f86 100644 --- a/assets/layouts/default.tres +++ b/assets/layouts/default.tres @@ -1,175 +1,178 @@ -[gd_resource type="Resource" script_class="DockableLayout" load_steps=27 format=3 uid="uid://cmssfxor8u6ph"] +[gd_resource type="Resource" script_class="DockableLayout" load_steps=27 format=3 uid="uid://4xtpiowddm7p"] -[ext_resource type="Script" path="res://addons/dockable_container/layout_panel.gd" id="1_5ntxi"] -[ext_resource type="Script" path="res://addons/dockable_container/layout_split.gd" id="2_ky8yd"] -[ext_resource type="Script" path="res://addons/dockable_container/layout.gd" id="3_7wdyb"] +[ext_resource type="Script" path="res://addons/dockable_container/layout_panel.gd" id="1_jp0wv"] +[ext_resource type="Script" path="res://addons/dockable_container/layout_split.gd" id="2_fa4kc"] +[ext_resource type="Script" path="res://addons/dockable_container/layout.gd" id="3_bjjec"] -[sub_resource type="Resource" id="Resource_xnnnd"] +[sub_resource type="Resource" id="Resource_atmme"] resource_name = "Tabs" -script = ExtResource("1_5ntxi") +script = ExtResource("1_jp0wv") names = PackedStringArray("Tools", "Reference Images") -current_tab = 0 +current_tab = 1 -[sub_resource type="Resource" id="Resource_34hle"] +[sub_resource type="Resource" id="Resource_ouvfk"] resource_name = "Tabs" -script = ExtResource("1_5ntxi") +script = ExtResource("1_jp0wv") names = PackedStringArray("Main Canvas") current_tab = 0 -[sub_resource type="Resource" id="Resource_l6i6g"] +[sub_resource type="Resource" id="Resource_an0ef"] resource_name = "Tabs" -script = ExtResource("1_5ntxi") +script = ExtResource("1_jp0wv") names = PackedStringArray("Perspective Editor") current_tab = 0 -[sub_resource type="Resource" id="Resource_r2r5t"] +[sub_resource type="Resource" id="Resource_xgnjk"] resource_name = "Split" -script = ExtResource("2_ky8yd") +script = ExtResource("2_fa4kc") direction = 0 percent = 0.5 -first = SubResource("Resource_34hle") -second = SubResource("Resource_l6i6g") +first = SubResource("Resource_ouvfk") +second = SubResource("Resource_an0ef") -[sub_resource type="Resource" id="Resource_k7omi"] +[sub_resource type="Resource" id="Resource_o7cqb"] resource_name = "Tabs" -script = ExtResource("1_5ntxi") +script = ExtResource("1_jp0wv") names = PackedStringArray("Second Canvas") current_tab = 0 -[sub_resource type="Resource" id="Resource_l142s"] +[sub_resource type="Resource" id="Resource_ataha"] resource_name = "Split" -script = ExtResource("2_ky8yd") +script = ExtResource("2_fa4kc") direction = 0 percent = 0.980952 -first = SubResource("Resource_r2r5t") -second = SubResource("Resource_k7omi") +first = SubResource("Resource_xgnjk") +second = SubResource("Resource_o7cqb") -[sub_resource type="Resource" id="Resource_wobi1"] +[sub_resource type="Resource" id="Resource_8y4au"] resource_name = "Tabs" -script = ExtResource("1_5ntxi") +script = ExtResource("1_jp0wv") names = PackedStringArray("Animation Timeline") current_tab = 0 -[sub_resource type="Resource" id="Resource_85y6p"] +[sub_resource type="Resource" id="Resource_q2jwk"] resource_name = "Split" -script = ExtResource("2_ky8yd") +script = ExtResource("2_fa4kc") direction = 1 -percent = 0.74711 -first = SubResource("Resource_l142s") -second = SubResource("Resource_wobi1") +percent = 0.731214 +first = SubResource("Resource_ataha") +second = SubResource("Resource_8y4au") -[sub_resource type="Resource" id="Resource_4egp5"] +[sub_resource type="Resource" id="Resource_5r0ap"] resource_name = "Tabs" -script = ExtResource("1_5ntxi") +script = ExtResource("1_jp0wv") names = PackedStringArray("Canvas Preview") current_tab = 0 -[sub_resource type="Resource" id="Resource_fcw5v"] +[sub_resource type="Resource" id="Resource_6pqxe"] resource_name = "Tabs" -script = ExtResource("1_5ntxi") -names = PackedStringArray("Color Pickers") -current_tab = 0 - -[sub_resource type="Resource" id="Resource_c7hpy"] -resource_name = "Tabs" -script = ExtResource("1_5ntxi") -names = PackedStringArray("Global Tool Options") -current_tab = 0 - -[sub_resource type="Resource" id="Resource_56tpw"] -resource_name = "Tabs" -script = ExtResource("1_5ntxi") +script = ExtResource("1_jp0wv") names = PackedStringArray("Recorder") current_tab = 0 -[sub_resource type="Resource" id="Resource_fhmn0"] +[sub_resource type="Resource" id="Resource_ln20x"] resource_name = "Split" -script = ExtResource("2_ky8yd") -direction = 1 -percent = 0.5 -first = SubResource("Resource_c7hpy") -second = SubResource("Resource_56tpw") - -[sub_resource type="Resource" id="Resource_u1u2a"] -resource_name = "Split" -script = ExtResource("2_ky8yd") -direction = 1 -percent = 0.5 -first = SubResource("Resource_fcw5v") -second = SubResource("Resource_fhmn0") - -[sub_resource type="Resource" id="Resource_6eonw"] -resource_name = "Split" -script = ExtResource("2_ky8yd") +script = ExtResource("2_fa4kc") direction = 1 percent = 0.911765 -first = SubResource("Resource_4egp5") -second = SubResource("Resource_u1u2a") +first = SubResource("Resource_5r0ap") +second = SubResource("Resource_6pqxe") -[sub_resource type="Resource" id="Resource_6pwxm"] +[sub_resource type="Resource" id="Resource_dksrd"] resource_name = "Tabs" -script = ExtResource("1_5ntxi") +script = ExtResource("1_jp0wv") +names = PackedStringArray("Global Tool Options") +current_tab = 0 + +[sub_resource type="Resource" id="Resource_kmey0"] +resource_name = "Tabs" +script = ExtResource("1_jp0wv") +names = PackedStringArray("Color Picker") +current_tab = 0 + +[sub_resource type="Resource" id="Resource_1tm61"] +resource_name = "Split" +script = ExtResource("2_fa4kc") +direction = 1 +percent = 0.126756 +first = SubResource("Resource_dksrd") +second = SubResource("Resource_kmey0") + +[sub_resource type="Resource" id="Resource_btl4b"] +resource_name = "Tabs" +script = ExtResource("1_jp0wv") names = PackedStringArray("Left Tool Options") current_tab = 0 -[sub_resource type="Resource" id="Resource_24rfh"] +[sub_resource type="Resource" id="Resource_eu0mc"] resource_name = "Tabs" -script = ExtResource("1_5ntxi") +script = ExtResource("1_jp0wv") names = PackedStringArray("Right Tool Options") current_tab = 0 -[sub_resource type="Resource" id="Resource_tcb26"] +[sub_resource type="Resource" id="Resource_8ff4m"] resource_name = "Split" -script = ExtResource("2_ky8yd") +script = ExtResource("2_fa4kc") direction = 0 percent = 0.5 -first = SubResource("Resource_6pwxm") -second = SubResource("Resource_24rfh") +first = SubResource("Resource_btl4b") +second = SubResource("Resource_eu0mc") -[sub_resource type="Resource" id="Resource_ugja0"] +[sub_resource type="Resource" id="Resource_e72nu"] +resource_name = "Split" +script = ExtResource("2_fa4kc") +direction = 1 +percent = 0.660142 +first = SubResource("Resource_1tm61") +second = SubResource("Resource_8ff4m") + +[sub_resource type="Resource" id="Resource_sg54a"] resource_name = "Tabs" -script = ExtResource("1_5ntxi") +script = ExtResource("1_jp0wv") names = PackedStringArray("Palettes") current_tab = 0 -[sub_resource type="Resource" id="Resource_hr77s"] +[sub_resource type="Resource" id="Resource_gdwmg"] resource_name = "Split" -script = ExtResource("2_ky8yd") +script = ExtResource("2_fa4kc") direction = 1 -percent = 0.692661 -first = SubResource("Resource_tcb26") -second = SubResource("Resource_ugja0") +percent = 0.817919 +first = SubResource("Resource_e72nu") +second = SubResource("Resource_sg54a") -[sub_resource type="Resource" id="Resource_l8roh"] +[sub_resource type="Resource" id="Resource_acda3"] resource_name = "Split" -script = ExtResource("2_ky8yd") +script = ExtResource("2_fa4kc") direction = 1 -percent = 0.339595 -first = SubResource("Resource_6eonw") -second = SubResource("Resource_hr77s") +percent = 0.0549133 +first = SubResource("Resource_ln20x") +second = SubResource("Resource_gdwmg") -[sub_resource type="Resource" id="Resource_s2xu6"] +[sub_resource type="Resource" id="Resource_2qk0j"] resource_name = "Split" -script = ExtResource("2_ky8yd") +script = ExtResource("2_fa4kc") direction = 0 -percent = 0.727569 -first = SubResource("Resource_85y6p") -second = SubResource("Resource_l8roh") +percent = 0.74062 +first = SubResource("Resource_q2jwk") +second = SubResource("Resource_acda3") -[sub_resource type="Resource" id="Resource_cwe4h"] +[sub_resource type="Resource" id="Resource_msuil"] resource_name = "Split" -script = ExtResource("2_ky8yd") +script = ExtResource("2_fa4kc") direction = 0 -percent = 0.0398437 -first = SubResource("Resource_xnnnd") -second = SubResource("Resource_s2xu6") +percent = 0.0 +first = SubResource("Resource_atmme") +second = SubResource("Resource_2qk0j") [resource] resource_name = "Layout" -script = ExtResource("3_7wdyb") -root = SubResource("Resource_cwe4h") +script = ExtResource("3_bjjec") +root = SubResource("Resource_msuil") hidden_tabs = { +"Canvas Preview": true, +"Color Picker Sliders": true, "Perspective Editor": true, "Recorder": true, +"Reference Images": true, "Second Canvas": true } diff --git a/assets/layouts/tallscreen.tres b/assets/layouts/tallscreen.tres index 7cc35c797..c34b6abad 100644 --- a/assets/layouts/tallscreen.tres +++ b/assets/layouts/tallscreen.tres @@ -1,145 +1,147 @@ [gd_resource type="Resource" script_class="DockableLayout" load_steps=23 format=3 uid="uid://brcnmadkdaqok"] -[ext_resource type="Script" path="res://addons/dockable_container/layout_panel.gd" id="1_uy50t"] -[ext_resource type="Script" path="res://addons/dockable_container/layout_split.gd" id="2_1m5ot"] -[ext_resource type="Script" path="res://addons/dockable_container/layout.gd" id="3_uod50"] +[ext_resource type="Script" path="res://addons/dockable_container/layout_panel.gd" id="1_nokpu"] +[ext_resource type="Script" path="res://addons/dockable_container/layout_split.gd" id="2_q5vl6"] +[ext_resource type="Script" path="res://addons/dockable_container/layout.gd" id="3_ox7l5"] -[sub_resource type="Resource" id="Resource_k2hh0"] +[sub_resource type="Resource" id="Resource_kn4x4"] resource_name = "Tabs" -script = ExtResource("1_uy50t") -names = PackedStringArray("Main Canvas", "Reference Images", "Perspective Editor", "Recorder") +script = ExtResource("1_nokpu") +names = PackedStringArray("Main Canvas") current_tab = 0 -[sub_resource type="Resource" id="Resource_t1ktk"] +[sub_resource type="Resource" id="Resource_btw27"] resource_name = "Tabs" -script = ExtResource("1_uy50t") +script = ExtResource("1_nokpu") names = PackedStringArray("Second Canvas") current_tab = 0 -[sub_resource type="Resource" id="Resource_nvw7v"] +[sub_resource type="Resource" id="Resource_bp28t"] resource_name = "Split" -script = ExtResource("2_1m5ot") +script = ExtResource("2_q5vl6") direction = 0 -percent = 0.9875 -first = SubResource("Resource_k2hh0") -second = SubResource("Resource_t1ktk") +percent = 0.829091 +first = SubResource("Resource_kn4x4") +second = SubResource("Resource_btw27") -[sub_resource type="Resource" id="Resource_nqfbu"] +[sub_resource type="Resource" id="Resource_10g0s"] resource_name = "Tabs" -script = ExtResource("1_uy50t") +script = ExtResource("1_nokpu") +names = PackedStringArray("Perspective Editor") +current_tab = 0 + +[sub_resource type="Resource" id="Resource_otntk"] +resource_name = "Split" +script = ExtResource("2_q5vl6") +direction = 0 +percent = 0.8625 +first = SubResource("Resource_bp28t") +second = SubResource("Resource_10g0s") + +[sub_resource type="Resource" id="Resource_12axs"] +resource_name = "Tabs" +script = ExtResource("1_nokpu") names = PackedStringArray("Tools") current_tab = 0 -[sub_resource type="Resource" id="Resource_tube0"] +[sub_resource type="Resource" id="Resource_1omiw"] resource_name = "Tabs" -script = ExtResource("1_uy50t") -names = PackedStringArray("Left Tool Options") +script = ExtResource("1_nokpu") +names = PackedStringArray("Left Tool Options", "Right Tool Options") current_tab = 0 -[sub_resource type="Resource" id="Resource_37h2m"] +[sub_resource type="Resource" id="Resource_p32ds"] resource_name = "Tabs" -script = ExtResource("1_uy50t") -names = PackedStringArray("Right Tool Options") +script = ExtResource("1_nokpu") +names = PackedStringArray("Color Picker") current_tab = 0 -[sub_resource type="Resource" id="Resource_1pnqq"] +[sub_resource type="Resource" id="Resource_n6xyc"] resource_name = "Split" -script = ExtResource("2_1m5ot") +script = ExtResource("2_q5vl6") direction = 0 percent = 0.5 -first = SubResource("Resource_tube0") -second = SubResource("Resource_37h2m") +first = SubResource("Resource_1omiw") +second = SubResource("Resource_p32ds") -[sub_resource type="Resource" id="Resource_3l4wk"] +[sub_resource type="Resource" id="Resource_1dcep"] resource_name = "Tabs" -script = ExtResource("1_uy50t") -names = PackedStringArray("Color Pickers") +script = ExtResource("1_nokpu") +names = PackedStringArray("Canvas Preview", "Reference Images", "Recorder") current_tab = 0 -[sub_resource type="Resource" id="Resource_x153t"] +[sub_resource type="Resource" id="Resource_hc3ve"] resource_name = "Tabs" -script = ExtResource("1_uy50t") +script = ExtResource("1_nokpu") names = PackedStringArray("Global Tool Options") current_tab = 0 -[sub_resource type="Resource" id="Resource_bb7vq"] +[sub_resource type="Resource" id="Resource_nppps"] resource_name = "Split" -script = ExtResource("2_1m5ot") +script = ExtResource("2_q5vl6") direction = 1 -percent = 0.5 -first = SubResource("Resource_3l4wk") -second = SubResource("Resource_x153t") +percent = 0.729839 +first = SubResource("Resource_1dcep") +second = SubResource("Resource_hc3ve") -[sub_resource type="Resource" id="Resource_m77lt"] +[sub_resource type="Resource" id="Resource_d54jb"] resource_name = "Tabs" -script = ExtResource("1_uy50t") -names = PackedStringArray("Canvas Preview") -current_tab = 0 - -[sub_resource type="Resource" id="Resource_k7yue"] -resource_name = "Split" -script = ExtResource("2_1m5ot") -direction = 1 -percent = 0.5 -first = SubResource("Resource_bb7vq") -second = SubResource("Resource_m77lt") - -[sub_resource type="Resource" id="Resource_g2hy1"] -resource_name = "Tabs" -script = ExtResource("1_uy50t") +script = ExtResource("1_nokpu") names = PackedStringArray("Palettes") current_tab = 0 -[sub_resource type="Resource" id="Resource_wuga1"] +[sub_resource type="Resource" id="Resource_f6rik"] resource_name = "Split" -script = ExtResource("2_1m5ot") +script = ExtResource("2_q5vl6") direction = 0 percent = 0.5 -first = SubResource("Resource_k7yue") -second = SubResource("Resource_g2hy1") +first = SubResource("Resource_nppps") +second = SubResource("Resource_d54jb") -[sub_resource type="Resource" id="Resource_1k0pg"] +[sub_resource type="Resource" id="Resource_26vov"] resource_name = "Split" -script = ExtResource("2_1m5ot") +script = ExtResource("2_q5vl6") direction = 0 percent = 0.501251 -first = SubResource("Resource_1pnqq") -second = SubResource("Resource_wuga1") +first = SubResource("Resource_n6xyc") +second = SubResource("Resource_f6rik") -[sub_resource type="Resource" id="Resource_5hlsb"] +[sub_resource type="Resource" id="Resource_m3axb"] resource_name = "Tabs" -script = ExtResource("1_uy50t") +script = ExtResource("1_nokpu") names = PackedStringArray("Animation Timeline") current_tab = 0 -[sub_resource type="Resource" id="Resource_cgtbw"] +[sub_resource type="Resource" id="Resource_af0bk"] resource_name = "Split" -script = ExtResource("2_1m5ot") -direction = 1 -percent = 0.8125 -first = SubResource("Resource_1k0pg") -second = SubResource("Resource_5hlsb") - -[sub_resource type="Resource" id="Resource_lwm7e"] -resource_name = "Split" -script = ExtResource("2_1m5ot") -direction = 0 -percent = 0.03125 -first = SubResource("Resource_nqfbu") -second = SubResource("Resource_cgtbw") - -[sub_resource type="Resource" id="Resource_fwg3p"] -resource_name = "Split" -script = ExtResource("2_1m5ot") +script = ExtResource("2_q5vl6") direction = 1 percent = 0.5 -first = SubResource("Resource_nvw7v") -second = SubResource("Resource_lwm7e") +first = SubResource("Resource_26vov") +second = SubResource("Resource_m3axb") + +[sub_resource type="Resource" id="Resource_1xpva"] +resource_name = "Split" +script = ExtResource("2_q5vl6") +direction = 0 +percent = 0.03125 +first = SubResource("Resource_12axs") +second = SubResource("Resource_af0bk") + +[sub_resource type="Resource" id="Resource_6dytr"] +resource_name = "Split" +script = ExtResource("2_q5vl6") +direction = 1 +percent = 0.459538 +first = SubResource("Resource_otntk") +second = SubResource("Resource_1xpva") [resource] resource_name = "Layout" -script = ExtResource("3_uod50") -root = SubResource("Resource_fwg3p") +script = ExtResource("3_ox7l5") +root = SubResource("Resource_6dytr") hidden_tabs = { +"Perspective Editor": true, +"Recorder": true, "Second Canvas": true } diff --git a/src/Autoload/Tools.gd b/src/Autoload/Tools.gd index a4edd80f9..6201c16cf 100644 --- a/src/Autoload/Tools.gd +++ b/src/Autoload/Tools.gd @@ -4,6 +4,7 @@ signal color_changed(color, button) enum Dynamics { NONE, PRESSURE, VELOCITY } +var picking_color_for := MOUSE_BUTTON_LEFT var horizontal_mirror := false var vertical_mirror := false var pixel_perfect := false diff --git a/src/UI/ColorPickers/ColorPicker.gd b/src/UI/ColorPickers/ColorPicker.gd new file mode 100644 index 000000000..1d45ec70d --- /dev/null +++ b/src/UI/ColorPickers/ColorPicker.gd @@ -0,0 +1,123 @@ +extends Container + +@onready var color_picker := %ColorPicker as ColorPicker +@onready var color_buttons := %ColorButtons as HBoxContainer +@onready var left_color_rect := %LeftColorRect as ColorRect +@onready var right_color_rect := %RightColorRect as ColorRect +@onready var average_color := %AverageColor as ColorRect +@onready var expand_button: TextureButton = $ScrollContainer/VerticalContainer/ExpandButton + + +func _ready() -> void: + Tools.color_changed.connect(update_color) + _average(left_color_rect.color, right_color_rect.color) + expand_button.button_pressed = Global.config_cache.get_value( + "color_picker", "is_expanded", false + ) + color_picker.color_mode = Global.config_cache.get_value( + "color_picker", "color_mode", ColorPicker.MODE_RGB + ) + color_picker.picker_shape = Global.config_cache.get_value( + "color_picker", "picker_shape", ColorPicker.SHAPE_HSV_RECTANGLE + ) + + # Make changes to the UI of the color picker by modifying its internal children + await get_tree().process_frame + # The MarginContainer that contains all of the color picker nodes. + var picker_margin_container := color_picker.get_child(0, true) as MarginContainer + picker_margin_container.size_flags_vertical = Control.SIZE_EXPAND_FILL + var picker_vbox_container := picker_margin_container.get_child(0, true) as VBoxContainer + # The HBoxContainer of the picker shapes. + var shapes_container := picker_vbox_container.get_child(0, true) as HBoxContainer + shapes_container.size_flags_vertical = Control.SIZE_EXPAND_FILL + # The Control of the HSV Rectangle picker shape + var hsv_rectangle_control := shapes_container.get_child(0, true) as Control + hsv_rectangle_control.custom_minimum_size = Vector2(32, 32) + # The AspectRatioContainer that holds the rest of the picker shapes + var shape_aspect_ratio := shapes_container.get_child(1, true) as AspectRatioContainer + shape_aspect_ratio.custom_minimum_size = Vector2(32, 32) + # The HBoxContainer of the screen color picker, the color preview rectangle and the + # button that lets users change the picker shape. It is visible because + # color_picker.sampler_visible is set to true. + # We are hiding the color preview rectangle, adding the hex LineEdit, the + # left/right color buttons and the color switch, default and average buttons. + var sampler_cont := picker_vbox_container.get_child(1, true) as HBoxContainer + # The color preview rectangle that we're hiding. + var color_texture_rect := sampler_cont.get_child(1, true) as TextureRect + color_texture_rect.visible = false + # The HBoxContainer where we get the hex LineEdit node from, and moving it to sampler_cont + var hex_cont := picker_vbox_container.get_child(4, true).get_child(1, true) as Container + var hex_edit := hex_cont.get_child(2, true) + hex_cont.remove_child(hex_edit) + sampler_cont.add_child(hex_edit) + sampler_cont.move_child(hex_edit, 1) + # Move the color buttons (left, right, switch, default, average) on the sampler container + color_buttons.get_parent().remove_child(color_buttons) + sampler_cont.add_child(color_buttons) + sampler_cont.move_child(color_buttons, 0) + + +func _on_color_picker_color_changed(color: Color) -> void: + if Tools.picking_color_for == MOUSE_BUTTON_RIGHT: + right_color_rect.color = color + else: + left_color_rect.color = color + Tools.assign_color(color, Tools.picking_color_for) + + +func _on_left_color_button_toggled(toggled_on: bool) -> void: + if toggled_on: + Tools.picking_color_for = MOUSE_BUTTON_LEFT + color_picker.color = left_color_rect.color + else: + Tools.picking_color_for = MOUSE_BUTTON_RIGHT + color_picker.color = right_color_rect.color + _average(left_color_rect.color, right_color_rect.color) + + +func update_color(color: Color, button: int) -> void: + if Tools.picking_color_for == button: + color_picker.color = color + if button == MOUSE_BUTTON_RIGHT: + right_color_rect.color = color + else: + left_color_rect.color = color + _average(left_color_rect.color, right_color_rect.color) + Global.config_cache.set_value("color_picker", "color_mode", color_picker.color_mode) + Global.config_cache.set_value("color_picker", "picker_shape", color_picker.picker_shape) + + +func _on_ColorSwitch_pressed() -> void: + Tools.swap_color() + + +func _on_ColorDefaults_pressed() -> void: + Tools.default_color() + + +func _on_expand_button_toggled(toggled_on: bool) -> void: + color_picker.color_modes_visible = toggled_on + color_picker.sliders_visible = toggled_on + Global.config_cache.set_value("color_picker", "is_expanded", toggled_on) + + +func _average(color_1: Color, color_2: Color) -> void: + var average := (color_1 + color_2) / 2.0 + var copy_button := average_color.get_parent() as Control + copy_button.tooltip_text = str("Average Color:\n#", average.to_html()) + average_color.color = average + + +func _on_CopyAverage_button_down(): + average_color.visible = false + + +func _on_CopyAverage_button_up(): + average_color.visible = true + + +func _on_copy_average_gui_input(event: InputEvent) -> void: + if event.is_action_released(&"left_mouse"): + Tools.assign_color(average_color.color, MOUSE_BUTTON_LEFT) + elif event.is_action_released(&"right_mouse"): + Tools.assign_color(average_color.color, MOUSE_BUTTON_RIGHT) diff --git a/src/UI/ColorPickers/ColorPicker.tscn b/src/UI/ColorPickers/ColorPicker.tscn new file mode 100644 index 000000000..37fe9672a --- /dev/null +++ b/src/UI/ColorPickers/ColorPicker.tscn @@ -0,0 +1,196 @@ +[gd_scene load_steps=13 format=3 uid="uid://c3vcvhh4d8hd7"] + +[ext_resource type="Script" path="res://src/UI/ColorPickers/ColorPicker.gd" id="1_r8ot0"] +[ext_resource type="Texture2D" uid="uid://d0v821l01w7go" path="res://assets/graphics/misc/color_switch.png" id="2_ojj3i"] +[ext_resource type="PackedScene" uid="uid://3pmb60gpst7b" path="res://src/UI/Nodes/TransparentChecker.tscn" id="3_vjkb0"] +[ext_resource type="Shader" path="res://src/Shaders/TransparentChecker.gdshader" id="4_oxnnt"] +[ext_resource type="Texture2D" uid="uid://ct8wn8m6x4m54" path="res://assets/graphics/misc/value_arrow.svg" id="6_b86m2"] +[ext_resource type="Texture2D" uid="uid://bhkmiijflfqxx" path="res://assets/graphics/misc/value_arrow_up.svg" id="7_p4te3"] + +[sub_resource type="ButtonGroup" id="ButtonGroup_02x7w"] + +[sub_resource type="InputEventAction" id="InputEventAction_5llr2"] +action = &"switch_colors" + +[sub_resource type="Shortcut" id="19"] +events = [SubResource("InputEventAction_5llr2")] + +[sub_resource type="ShaderMaterial" id="1"] +shader = ExtResource("4_oxnnt") +shader_parameter/size = 10.0 +shader_parameter/alpha = 1.0 +shader_parameter/color1 = Color(0.7, 0.7, 0.7, 1) +shader_parameter/color2 = Color(1, 1, 1, 1) +shader_parameter/offset = Vector2(0, 0) +shader_parameter/scale = Vector2(0, 0) +shader_parameter/rect_size = Vector2(0, 0) +shader_parameter/follow_movement = false +shader_parameter/follow_scale = false + +[sub_resource type="InputEventAction" id="InputEventAction_nptxe"] +action = &"reset_colors_default" + +[sub_resource type="Shortcut" id="Shortcut_uay2n"] +events = [SubResource("InputEventAction_nptxe")] + +[node name="ColorPicker" type="PanelContainer"] +offset_right = 312.0 +offset_bottom = 358.0 +script = ExtResource("1_r8ot0") + +[node name="ScrollContainer" type="ScrollContainer" parent="."] +layout_mode = 2 + +[node name="VerticalContainer" type="VBoxContainer" parent="ScrollContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme_override_constants/separation = -6 +alignment = 1 + +[node name="ColorPicker" type="ColorPicker" parent="ScrollContainer/VerticalContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme_override_constants/h_width = 28 +can_add_swatches = false +color_modes_visible = false +sliders_visible = false +hex_visible = false +presets_visible = false + +[node name="ColorButtons" type="HBoxContainer" parent="ScrollContainer/VerticalContainer"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 0 +alignment = 1 + +[node name="LeftColorButton" type="Button" parent="ScrollContainer/VerticalContainer/ColorButtons"] +custom_minimum_size = Vector2(42, 32) +layout_mode = 2 +size_flags_vertical = 4 +tooltip_text = "Choose a color for the left tool" +mouse_default_cursor_shape = 2 +toggle_mode = true +button_pressed = true +button_group = SubResource("ButtonGroup_02x7w") + +[node name="LeftColorRect" type="ColorRect" parent="ScrollContainer/VerticalContainer/ColorButtons/LeftColorButton"] +unique_name_in_owner = true +layout_mode = 0 +offset_left = 2.0 +offset_top = 2.0 +offset_right = 40.0 +offset_bottom = 30.0 +mouse_filter = 2 +color = Color(0, 0, 0, 1) +metadata/_edit_lock_ = true + +[node name="ColorSwitch" type="TextureButton" parent="ScrollContainer/VerticalContainer/ColorButtons" groups=["UIButtons"]] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +tooltip_text = "Switch left and right colors." +mouse_default_cursor_shape = 2 +shortcut = SubResource("19") +texture_normal = ExtResource("2_ojj3i") + +[node name="RightColorButton" type="Button" parent="ScrollContainer/VerticalContainer/ColorButtons"] +custom_minimum_size = Vector2(42, 32) +layout_mode = 2 +size_flags_vertical = 4 +tooltip_text = "Choose a color for the right tool" +mouse_default_cursor_shape = 2 +toggle_mode = true +button_group = SubResource("ButtonGroup_02x7w") + +[node name="RightColorRect" type="ColorRect" parent="ScrollContainer/VerticalContainer/ColorButtons/RightColorButton"] +unique_name_in_owner = true +layout_mode = 0 +offset_left = 2.0 +offset_top = 2.0 +offset_right = 40.0 +offset_bottom = 30.0 +mouse_filter = 2 +metadata/_edit_lock_ = true + +[node name="ColorButtonsVertical" type="VBoxContainer" parent="ScrollContainer/VerticalContainer/ColorButtons"] +layout_mode = 2 +theme_override_constants/separation = 2 +alignment = 1 + +[node name="CopyAverage" type="Button" parent="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical"] +custom_minimum_size = Vector2(15, 15) +layout_mode = 2 +size_flags_horizontal = 4 +mouse_default_cursor_shape = 2 +button_mask = 3 + +[node name="AverageColor" type="ColorRect" parent="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/CopyAverage"] +unique_name_in_owner = true +layout_mode = 0 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -5.5 +offset_top = -5.5 +offset_right = 5.5 +offset_bottom = 5.5 +mouse_filter = 2 +metadata/_edit_lock_ = true + +[node name="TransparentChecker" parent="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/CopyAverage/AverageColor" instance=ExtResource("3_vjkb0")] +unique_name_in_owner = true +show_behind_parent = true +material = SubResource("1") +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +metadata/_edit_lock_ = true + +[node name="ColorDefaults" type="Button" parent="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical"] +custom_minimum_size = Vector2(15, 15) +layout_mode = 2 +size_flags_horizontal = 4 +tooltip_text = "Reset the colors to their default state (black for left, white for right)" +mouse_default_cursor_shape = 2 +shortcut = SubResource("Shortcut_uay2n") + +[node name="ColorRectBlack" type="ColorRect" parent="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/ColorDefaults"] +layout_mode = 0 +offset_left = 2.0 +offset_top = 2.0 +offset_right = 7.0 +offset_bottom = 13.0 +mouse_filter = 2 +color = Color(0, 0, 0, 1) + +[node name="ColorRectWhite" type="ColorRect" parent="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/ColorDefaults"] +layout_mode = 0 +offset_left = 8.0 +offset_top = 2.0 +offset_right = 13.0 +offset_bottom = 13.0 +mouse_filter = 2 + +[node name="ExpandButton" type="TextureButton" parent="ScrollContainer/VerticalContainer" groups=["UIButtons"]] +layout_mode = 2 +size_flags_horizontal = 4 +mouse_default_cursor_shape = 2 +toggle_mode = true +texture_normal = ExtResource("6_b86m2") +texture_pressed = ExtResource("7_p4te3") + +[connection signal="color_changed" from="ScrollContainer/VerticalContainer/ColorPicker" to="." method="_on_color_picker_color_changed"] +[connection signal="toggled" from="ScrollContainer/VerticalContainer/ColorButtons/LeftColorButton" to="." method="_on_left_color_button_toggled"] +[connection signal="pressed" from="ScrollContainer/VerticalContainer/ColorButtons/ColorSwitch" to="." method="_on_ColorSwitch_pressed"] +[connection signal="button_down" from="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/CopyAverage" to="." method="_on_CopyAverage_button_down"] +[connection signal="button_up" from="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/CopyAverage" to="." method="_on_CopyAverage_button_up"] +[connection signal="gui_input" from="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/CopyAverage" to="." method="_on_copy_average_gui_input"] +[connection signal="pressed" from="ScrollContainer/VerticalContainer/ColorButtons/ColorButtonsVertical/ColorDefaults" to="." method="_on_ColorDefaults_pressed"] +[connection signal="toggled" from="ScrollContainer/VerticalContainer/ExpandButton" to="." method="_on_expand_button_toggled"] diff --git a/src/UI/ColorPickers/ColorPickers.gd b/src/UI/ColorPickers/ColorPickers.gd deleted file mode 100644 index 9620e4bef..000000000 --- a/src/UI/ColorPickers/ColorPickers.gd +++ /dev/null @@ -1,72 +0,0 @@ -extends Container - -@onready var left_picker := $ColorPickersHorizontal/LeftColorPickerButton as ColorPickerButton -@onready var right_picker := $ColorPickersHorizontal/RightColorPickerButton as ColorPickerButton -@onready var average_color := $"%AverageColor" as ColorRect - - -func _ready() -> void: - Tools.color_changed.connect(update_color) - left_picker.get_picker().presets_visible = false - right_picker.get_picker().presets_visible = false - _average(left_picker.color, right_picker.color) - - -func _on_ColorSwitch_pressed() -> void: - Tools.swap_color() - - -func _on_ColorPickerButton_color_changed(color: Color, right: bool): - var button := MOUSE_BUTTON_RIGHT if right else MOUSE_BUTTON_LEFT - Tools.assign_color(color, button) - _average(left_picker.color, right_picker.color) - - -func _on_ToLeft_pressed(): - Tools.assign_color(average_color.color, MOUSE_BUTTON_LEFT) - - -func _on_ToRight_pressed(): - Tools.assign_color(average_color.color, MOUSE_BUTTON_RIGHT) - - -func _on_ColorPickerButton_pressed() -> void: - Global.can_draw = false - Tools.color_changed.disconnect(update_color) - - -func _on_ColorPickerButton_popup_closed() -> void: - Global.can_draw = true - Tools.color_changed.connect(update_color) - - -func _on_ColorDefaults_pressed() -> void: - Tools.default_color() - - -func update_color(color: Color, button: int) -> void: - if button == MOUSE_BUTTON_LEFT: - left_picker.color = color - else: - right_picker.color = color - _average(left_picker.color, right_picker.color) - - -func _average(color_1: Color, color_2: Color) -> void: - var average_r := (color_1.r + color_2.r) / 2.0 - var average_g := (color_1.g + color_2.g) / 2.0 - var average_b := (color_1.b + color_2.b) / 2.0 - var average_a := (color_1.a + color_2.a) / 2.0 - var average := Color(average_r, average_g, average_b, average_a) - - var copy_button = average_color.get_parent() - copy_button.tooltip_text = str("Average Color:\n#", average.to_html(), "\n(Press to Copy)") - average_color.color = average - - -func _on_CopyAverage_button_down(): - average_color.visible = false - - -func _on_CopyAverage_button_up(): - average_color.visible = true diff --git a/src/UI/ColorPickers/ColorPickers.tscn b/src/UI/ColorPickers/ColorPickers.tscn deleted file mode 100644 index 772e8cb2a..000000000 --- a/src/UI/ColorPickers/ColorPickers.tscn +++ /dev/null @@ -1,175 +0,0 @@ -[gd_scene load_steps=12 format=3 uid="uid://c3vcvhh4d8hd7"] - -[ext_resource type="Texture2D" uid="uid://dkpxkdk1xf0ea" path="res://assets/graphics/misc/color_defaults.png" id="1"] -[ext_resource type="Texture2D" uid="uid://d0v821l01w7go" path="res://assets/graphics/misc/color_switch.png" id="2"] -[ext_resource type="Script" path="res://src/UI/ColorPickers/ColorPickers.gd" id="3"] -[ext_resource type="PackedScene" uid="uid://3pmb60gpst7b" path="res://src/UI/Nodes/TransparentChecker.tscn" id="4"] -[ext_resource type="Shader" path="res://src/Shaders/TransparentChecker.gdshader" id="5"] -[ext_resource type="Texture2D" uid="uid://d1oxrkwndy5fi" path="res://assets/graphics/timeline/move_arrow.png" id="6"] - -[sub_resource type="InputEventAction" id="InputEventAction_5llr2"] -action = &"switch_colors" - -[sub_resource type="Shortcut" id="19"] -events = [SubResource("InputEventAction_5llr2")] - -[sub_resource type="ShaderMaterial" id="1"] -shader = ExtResource("5") -shader_parameter/size = 10.0 -shader_parameter/alpha = 1.0 -shader_parameter/color1 = Color(0.7, 0.7, 0.7, 1) -shader_parameter/color2 = Color(1, 1, 1, 1) -shader_parameter/offset = Vector2(0, 0) -shader_parameter/scale = Vector2(0, 0) -shader_parameter/rect_size = Vector2(0, 0) -shader_parameter/follow_movement = false -shader_parameter/follow_scale = false - -[sub_resource type="InputEventAction" id="InputEventAction_nptxe"] -action = &"reset_colors_default" - -[sub_resource type="Shortcut" id="Shortcut_uay2n"] -events = [SubResource("InputEventAction_nptxe")] - -[node name="ColorPickers" type="PanelContainer"] -offset_left = 958.0 -offset_top = 170.0 -offset_right = 1276.0 -offset_bottom = 229.062 -script = ExtResource("3") - -[node name="ColorPickersHorizontal" type="HBoxContainer" parent="."] -layout_mode = 2 -theme_override_constants/separation = 13 -alignment = 1 - -[node name="LeftColorPickerButton" type="ColorPickerButton" parent="ColorPickersHorizontal"] -custom_minimum_size = Vector2(64, 32) -layout_mode = 2 -size_flags_horizontal = 0 -size_flags_vertical = 4 -tooltip_text = "Choose a color for the left tool" -mouse_default_cursor_shape = 2 - -[node name="ColorButtonsVertical" type="VBoxContainer" parent="ColorPickersHorizontal"] -layout_mode = 2 -alignment = 1 - -[node name="ColorSwitch" type="TextureButton" parent="ColorPickersHorizontal/ColorButtonsVertical" groups=["UIButtons"]] -layout_mode = 2 -size_flags_horizontal = 4 -tooltip_text = "Switch left and right colors -(%s)" -mouse_default_cursor_shape = 2 -shortcut = SubResource("19") -shortcut_in_tooltip = false -texture_normal = ExtResource("2") - -[node name="HBoxContainer" type="HBoxContainer" parent="ColorPickersHorizontal/ColorButtonsVertical"] -layout_mode = 2 -alignment = 1 - -[node name="ToLeft" type="Button" parent="ColorPickersHorizontal/ColorButtonsVertical/HBoxContainer"] -custom_minimum_size = Vector2(25, 25) -layout_mode = 2 -tooltip_text = "Interpolate the (Left Color) -towards the (Right Color)" - -[node name="TextureRect" type="TextureRect" parent="ColorPickersHorizontal/ColorButtonsVertical/HBoxContainer/ToLeft"] -layout_mode = 0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_left = 4.0 -offset_top = 4.0 -offset_right = -4.0 -offset_bottom = -4.0 -texture = ExtResource("6") -expand_mode = 1 -stretch_mode = 6 -flip_h = true - -[node name="Line1" type="HSeparator" parent="ColorPickersHorizontal/ColorButtonsVertical/HBoxContainer"] -custom_minimum_size = Vector2(10, 0) -layout_mode = 2 -size_flags_horizontal = 3 - -[node name="CopyAverage" type="Button" parent="ColorPickersHorizontal/ColorButtonsVertical/HBoxContainer"] -custom_minimum_size = Vector2(25, 25) -layout_mode = 2 - -[node name="AverageColor" type="ColorRect" parent="ColorPickersHorizontal/ColorButtonsVertical/HBoxContainer/CopyAverage"] -unique_name_in_owner = true -layout_mode = 0 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -10.5 -offset_top = -10.5 -offset_right = 10.5 -offset_bottom = 10.5 -mouse_filter = 2 - -[node name="TransparentChecker" parent="ColorPickersHorizontal/ColorButtonsVertical/HBoxContainer/CopyAverage/AverageColor" instance=ExtResource("4")] -unique_name_in_owner = true -show_behind_parent = true -material = SubResource("1") -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="Line2" type="HSeparator" parent="ColorPickersHorizontal/ColorButtonsVertical/HBoxContainer"] -custom_minimum_size = Vector2(10, 0) -layout_mode = 2 -size_flags_horizontal = 3 - -[node name="ToRight" type="Button" parent="ColorPickersHorizontal/ColorButtonsVertical/HBoxContainer"] -custom_minimum_size = Vector2(25, 25) -layout_mode = 2 -tooltip_text = "Interpolate the (Right Color) -towards the (Left Color)" - -[node name="TextureRect" type="TextureRect" parent="ColorPickersHorizontal/ColorButtonsVertical/HBoxContainer/ToRight"] -layout_mode = 0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_left = 4.0 -offset_top = 4.0 -offset_right = -4.0 -offset_bottom = -4.0 -texture = ExtResource("6") -expand_mode = 1 -stretch_mode = 6 - -[node name="ColorDefaults" type="TextureButton" parent="ColorPickersHorizontal/ColorButtonsVertical"] -layout_mode = 2 -size_flags_horizontal = 4 -tooltip_text = "Reset the colors to their default state (black for left, white for right)" -mouse_default_cursor_shape = 2 -shortcut = SubResource("Shortcut_uay2n") -texture_normal = ExtResource("1") - -[node name="RightColorPickerButton" type="ColorPickerButton" parent="ColorPickersHorizontal"] -custom_minimum_size = Vector2(64, 32) -layout_mode = 2 -size_flags_horizontal = 0 -size_flags_vertical = 4 -tooltip_text = "Choose a color for the right tool" -mouse_default_cursor_shape = 2 -color = Color(1, 1, 1, 1) - -[connection signal="color_changed" from="ColorPickersHorizontal/LeftColorPickerButton" to="." method="_on_ColorPickerButton_color_changed" binds= [false]] -[connection signal="popup_closed" from="ColorPickersHorizontal/LeftColorPickerButton" to="." method="_on_ColorPickerButton_popup_closed"] -[connection signal="pressed" from="ColorPickersHorizontal/LeftColorPickerButton" to="." method="_on_ColorPickerButton_pressed"] -[connection signal="pressed" from="ColorPickersHorizontal/ColorButtonsVertical/ColorSwitch" to="." method="_on_ColorSwitch_pressed"] -[connection signal="pressed" from="ColorPickersHorizontal/ColorButtonsVertical/HBoxContainer/ToLeft" to="." method="_on_ToLeft_pressed"] -[connection signal="button_down" from="ColorPickersHorizontal/ColorButtonsVertical/HBoxContainer/CopyAverage" to="." method="_on_CopyAverage_button_down"] -[connection signal="button_up" from="ColorPickersHorizontal/ColorButtonsVertical/HBoxContainer/CopyAverage" to="." method="_on_CopyAverage_button_up"] -[connection signal="pressed" from="ColorPickersHorizontal/ColorButtonsVertical/HBoxContainer/ToRight" to="." method="_on_ToRight_pressed"] -[connection signal="pressed" from="ColorPickersHorizontal/ColorButtonsVertical/ColorDefaults" to="." method="_on_ColorDefaults_pressed"] -[connection signal="color_changed" from="ColorPickersHorizontal/RightColorPickerButton" to="." method="_on_ColorPickerButton_color_changed" binds= [true]] -[connection signal="popup_closed" from="ColorPickersHorizontal/RightColorPickerButton" to="." method="_on_ColorPickerButton_popup_closed"] -[connection signal="pressed" from="ColorPickersHorizontal/RightColorPickerButton" to="." method="_on_ColorPickerButton_pressed"] diff --git a/src/UI/UI.tscn b/src/UI/UI.tscn index fd8e74fab..ef838d590 100644 --- a/src/UI/UI.tscn +++ b/src/UI/UI.tscn @@ -15,7 +15,7 @@ [ext_resource type="PackedScene" uid="uid://dl6ook010q86o" path="res://src/UI/Recorder/Recorder.tscn" id="13"] [ext_resource type="Script" path="res://addons/dockable_container/layout.gd" id="14"] [ext_resource type="PackedScene" uid="uid://ccsihk3yxwei5" path="res://src/UI/CanvasPreviewContainer/CanvasPreviewContainer.tscn" id="16"] -[ext_resource type="PackedScene" uid="uid://c3vcvhh4d8hd7" path="res://src/UI/ColorPickers/ColorPickers.tscn" id="17"] +[ext_resource type="PackedScene" uid="uid://c3vcvhh4d8hd7" path="res://src/UI/ColorPickers/ColorPicker.tscn" id="17"] [ext_resource type="PackedScene" uid="uid://dbr6mulku2qju" path="res://src/UI/Timeline/AnimationTimeline.tscn" id="18"] [ext_resource type="PackedScene" uid="uid://ba24iuv55m4l3" path="res://src/UI/Canvas/Canvas.tscn" id="19"] [ext_resource type="PackedScene" uid="uid://wplk62pbgih4" path="res://src/Palette/PalettePanel.tscn" id="20"] @@ -96,7 +96,7 @@ current_tab = 0 [sub_resource type="Resource" id="Resource_fcw5v"] resource_name = "Tabs" script = ExtResource("36") -names = PackedStringArray("Color Pickers") +names = PackedStringArray("Color Picker") current_tab = 0 [sub_resource type="Resource" id="Resource_c7hpy"] @@ -189,7 +189,7 @@ second = SubResource("Resource_l8roh") resource_name = "Split" script = ExtResource("27") direction = 0 -percent = 0.0398437 +percent = 0.0103806 first = SubResource("Resource_xnnnd") second = SubResource("Resource_s2xu6") @@ -198,6 +198,8 @@ resource_name = "Layout" script = ExtResource("14") root = SubResource("Resource_cwe4h") hidden_tabs = { +"Canvas Preview": true, +"Color Picker Sliders": true, "Perspective Editor": true, "Recorder": true, "Second Canvas": true @@ -306,7 +308,7 @@ camera_path = NodePath("SubViewport/Camera2D") [node name="SubViewport" type="SubViewport" parent="DockableContainer/Main Canvas/ViewportandVerticalRuler/SubViewportContainer"] handle_input_locally = false canvas_item_default_texture_filter = 0 -size = Vector2i(867, 515) +size = Vector2i(861, 503) render_target_update_mode = 4 [node name="TransparentChecker" parent="DockableContainer/Main Canvas/ViewportandVerticalRuler/SubViewportContainer/SubViewport" instance=ExtResource("5")] @@ -360,9 +362,10 @@ index = 1 layout_mode = 2 [node name="Canvas Preview" parent="DockableContainer" instance=ExtResource("16")] +visible = false layout_mode = 2 -[node name="Color Pickers" parent="DockableContainer" instance=ExtResource("17")] +[node name="Color Picker" parent="DockableContainer" instance=ExtResource("17")] layout_mode = 2 [node name="Global Tool Options" parent="DockableContainer" instance=ExtResource("10")]