From fbadf41f82a155ce494d82568285cae26f84a5e3 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 22 Jan 2025 21:27:45 +0200 Subject: [PATCH] Add icons to the tool panel buttons --- assets/graphics/tiles_panel/tiles_auto.png | Bin 0 -> 164 bytes .../tiles_auto.png.import} | 8 +-- assets/graphics/tiles_panel/tiles_draw.png | Bin 0 -> 162 bytes .../tiles_draw.png.import} | 8 +-- assets/graphics/tiles_panel/tiles_manual.png | Bin 0 -> 133 bytes .../tiles_panel/tiles_manual.png.import | 34 ++++++++++ assets/graphics/tiles_panel/tiles_stack.png | Bin 0 -> 147 bytes .../tiles_panel/tiles_stack.png.import | 34 ++++++++++ .../graphics/tileset/place_tiles_disabled.png | Bin 204 -> 0 bytes .../graphics/tileset/place_tiles_enabled.png | Bin 185 -> 0 bytes src/UI/TilesPanel.gd | 4 -- src/UI/TilesPanel.tscn | 64 +++++++++++++++--- 12 files changed, 129 insertions(+), 23 deletions(-) create mode 100644 assets/graphics/tiles_panel/tiles_auto.png rename assets/graphics/{tileset/place_tiles_enabled.png.import => tiles_panel/tiles_auto.png.import} (65%) create mode 100644 assets/graphics/tiles_panel/tiles_draw.png rename assets/graphics/{tileset/place_tiles_disabled.png.import => tiles_panel/tiles_draw.png.import} (64%) create mode 100644 assets/graphics/tiles_panel/tiles_manual.png create mode 100644 assets/graphics/tiles_panel/tiles_manual.png.import create mode 100644 assets/graphics/tiles_panel/tiles_stack.png create mode 100644 assets/graphics/tiles_panel/tiles_stack.png.import delete mode 100644 assets/graphics/tileset/place_tiles_disabled.png delete mode 100644 assets/graphics/tileset/place_tiles_enabled.png diff --git a/assets/graphics/tiles_panel/tiles_auto.png b/assets/graphics/tiles_panel/tiles_auto.png new file mode 100644 index 0000000000000000000000000000000000000000..f47997cc12d8d9200f23e315d526663b9a0991ba GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|;yhg(Lo9l) zPCCfNpupiA`{n=soaq(XwczKUJufFFGMqm4SS8yH|zedG|0TMQC-$jX8pRFlv&3j&6U|hUQa7MI44$rj JF6*2UngEOTJMRDh literal 0 HcmV?d00001 diff --git a/assets/graphics/tileset/place_tiles_disabled.png.import b/assets/graphics/tiles_panel/tiles_draw.png.import similarity index 64% rename from assets/graphics/tileset/place_tiles_disabled.png.import rename to assets/graphics/tiles_panel/tiles_draw.png.import index 509a1aad5..85026d215 100644 --- a/assets/graphics/tileset/place_tiles_disabled.png.import +++ b/assets/graphics/tiles_panel/tiles_draw.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bqr3n3tm8b6w2" -path="res://.godot/imported/place_tiles_disabled.png-f43e25b0863e3eedf3c6fc7ef902127f.ctex" +uid="uid://d4by47alul2qw" +path="res://.godot/imported/tiles_draw.png-2161bdef1f2df0ebc1822c447f728c76.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/graphics/tileset/place_tiles_disabled.png" -dest_files=["res://.godot/imported/place_tiles_disabled.png-f43e25b0863e3eedf3c6fc7ef902127f.ctex"] +source_file="res://assets/graphics/tiles_panel/tiles_draw.png" +dest_files=["res://.godot/imported/tiles_draw.png-2161bdef1f2df0ebc1822c447f728c76.ctex"] [params] diff --git a/assets/graphics/tiles_panel/tiles_manual.png b/assets/graphics/tiles_panel/tiles_manual.png new file mode 100644 index 0000000000000000000000000000000000000000..f752f6ccd92033f6f6a500c2625c7705a9afe4e2 GIT binary patch literal 133 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|>^)r^Lo9le z6C_v{H{>-;Y;0_N_#X&XW@#uZD+`-4#yqbP0l+XkKAm}c$ literal 0 HcmV?d00001 diff --git a/assets/graphics/tiles_panel/tiles_stack.png.import b/assets/graphics/tiles_panel/tiles_stack.png.import new file mode 100644 index 000000000..bde31f77d --- /dev/null +++ b/assets/graphics/tiles_panel/tiles_stack.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://uo1ikty26del" +path="res://.godot/imported/tiles_stack.png-2dc663bcc395d8055dd966383581e31a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/tiles_panel/tiles_stack.png" +dest_files=["res://.godot/imported/tiles_stack.png-2dc663bcc395d8055dd966383581e31a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/graphics/tileset/place_tiles_disabled.png b/assets/graphics/tileset/place_tiles_disabled.png deleted file mode 100644 index efb1e23868af57559fa14e6999506dcd7e4ed45b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{1|(OCFP#RY7>k44ofy`glX(f`w0XKXhFJ8T zo$AeXKtaISdg=H5MZ1KW&Ryr9G1cRDkFYx{!@Rq`DnSMQZ@3jf*+Ium7zcWvH zefiimrLf5>+U<*T_E>ITEVbd*HocN>d=rH8ukf!F^D%!m&D0C%A_h-aKbLh*2~7a{ CzfF<= diff --git a/assets/graphics/tileset/place_tiles_enabled.png b/assets/graphics/tileset/place_tiles_enabled.png deleted file mode 100644 index ae61a09ebea891d4353cfd5feb2862567e60b4ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{1|(OCFP#RY7>k44ofy`glX(f`6nnZjhFJ8z z4UXnIpupqZ_I-cRpQ4hkSZ!(Nh<{m^1%5A3VPx=Ra_COaS9IYvvRNi`r(^OG718x8 zYVErZcYV>@Ge>*ZqbJgVx3}+Wk2`nRV8zvkF&|FN%PS5%%4WRiZE?%?i}U_1>VF)w h@ void: mode_buttons_container.visible = !placing_tiles for child: Button in transform_buttons_container.get_children(): Global.disable_button(child, not toggled_on) - if toggled_on: - Global.change_button_texturerect(place_tiles.get_child(0), "place_tiles_enabled.png") - else: - Global.change_button_texturerect(place_tiles.get_child(0), "place_tiles_disabled.png") update_tip() diff --git a/src/UI/TilesPanel.tscn b/src/UI/TilesPanel.tscn index 44440e3d5..e5522a51d 100644 --- a/src/UI/TilesPanel.tscn +++ b/src/UI/TilesPanel.tscn @@ -1,10 +1,13 @@ -[gd_scene load_steps=23 format=3 uid="uid://bfbragmmdwfbl"] +[gd_scene load_steps=26 format=3 uid="uid://bfbragmmdwfbl"] [ext_resource type="Script" path="res://src/UI/TilesPanel.gd" id="1_d2oc5"] -[ext_resource type="Texture2D" uid="uid://bqr3n3tm8b6w2" path="res://assets/graphics/tileset/place_tiles_disabled.png" id="2_pv2cd"] +[ext_resource type="Texture2D" uid="uid://d4by47alul2qw" path="res://assets/graphics/tiles_panel/tiles_draw.png" id="2_h0p0x"] [ext_resource type="Texture2D" uid="uid://bv7ldl8obhawm" path="res://assets/graphics/misc/icon_reload.png" id="2_r1kie"] [ext_resource type="Texture2D" uid="uid://bpsfilx47bw3r" path="res://assets/graphics/misc/mirror_x.svg" id="3_5o62r"] [ext_resource type="Texture2D" uid="uid://bk6iaxiyl74ih" path="res://assets/graphics/misc/mirror_y.svg" id="4_2xhnr"] +[ext_resource type="Texture2D" uid="uid://dfq0wpxsd51co" path="res://assets/graphics/tiles_panel/tiles_manual.png" id="6_gwj5u"] +[ext_resource type="Texture2D" uid="uid://7m4hln3mo2e5" path="res://assets/graphics/tiles_panel/tiles_auto.png" id="7_afsgi"] +[ext_resource type="Texture2D" uid="uid://uo1ikty26del" path="res://assets/graphics/tiles_panel/tiles_stack.png" id="8_yoaya"] [sub_resource type="InputEventAction" id="InputEventAction_klv67"] action = &"toggle_draw_tiles_mode" @@ -81,6 +84,7 @@ unique_name_in_owner = true custom_minimum_size = Vector2(25, 25) layout_mode = 2 size_flags_vertical = 0 +tooltip_text = "Draw tiles mode" mouse_default_cursor_shape = 2 toggle_mode = true shortcut = SubResource("Shortcut_6ebuw") @@ -92,9 +96,9 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -texture = ExtResource("2_pv2cd") +texture = ExtResource("2_h0p0x") expand_mode = 1 -stretch_mode = 5 +stretch_mode = 3 [node name="VSeparator" type="VSeparator" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons"] layout_mode = 2 @@ -179,27 +183,65 @@ unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 -[node name="Manual" type="CheckBox" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer"] +[node name="Manual" type="Button" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer" groups=["UIButtons"]] +custom_minimum_size = Vector2(24, 24) layout_mode = 2 +tooltip_text = "Manual" mouse_default_cursor_shape = 2 +toggle_mode = true button_group = SubResource("ButtonGroup_uxnt0") shortcut = SubResource("Shortcut_pgg48") -text = "Manual" -[node name="Auto" type="CheckBox" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer"] +[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer/Manual"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("6_gwj5u") +expand_mode = 1 +stretch_mode = 3 + +[node name="Auto" type="Button" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer" groups=["UIButtons"]] +custom_minimum_size = Vector2(24, 24) layout_mode = 2 +tooltip_text = "Auto" mouse_default_cursor_shape = 2 -button_pressed = true +toggle_mode = true button_group = SubResource("ButtonGroup_uxnt0") shortcut = SubResource("Shortcut_a0fx5") -text = "Auto" -[node name="Stack" type="CheckBox" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer"] +[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer/Auto"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("7_afsgi") +expand_mode = 1 +stretch_mode = 3 + +[node name="Stack" type="Button" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer" groups=["UIButtons"]] +custom_minimum_size = Vector2(24, 24) layout_mode = 2 +tooltip_text = "Stack" mouse_default_cursor_shape = 2 +toggle_mode = true button_group = SubResource("ButtonGroup_uxnt0") shortcut = SubResource("Shortcut_ysxej") -text = "Stack" + +[node name="TextureRect" type="TextureRect" parent="VBoxContainer/MarginContainer/VBoxContainer/Buttons/ModeButtonsContainer/Stack"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("8_yoaya") +expand_mode = 1 +stretch_mode = 3 [node name="HSeparator" type="HSeparator" parent="VBoxContainer/MarginContainer/VBoxContainer"] layout_mode = 2