└── addons
└── fancy_folder_icons
├── plugin.gd.uid
├── menu_fancy.gd.uid
├── scene
├── accept.gd.uid
├── icon_selector.gd.uid
├── texture_select.gd.uid
├── textures_recent.gd.uid
├── accept.gd
├── texture_select.gd
├── icon_selector.gd
├── textures_recent.gd
└── icon_selector.tscn
├── samples
├── cd.png
├── blog.png
├── cancel.png
├── danger.png
├── delete.png
├── down.png
├── good.png
├── heart.png
├── help.png
├── movie.png
├── music.png
├── next.png
├── save.png
├── database.png
├── previous.png
├── warning.png
├── Folder.svg
├── cd.png.import
├── blog.png.import
├── down.png.import
├── good.png.import
├── heart.png.import
├── help.png.import
├── movie.png.import
├── next.png.import
├── save.png.import
├── cancel.png.import
├── danger.png.import
├── delete.png.import
├── music.png.import
├── warning.png.import
├── database.png.import
├── previous.png.import
└── Folder.svg.import
├── plugin.cfg
├── ZoomMore.svg
├── ZoomMore.svg.import
├── menu_fancy.gd
└── plugin.gd
/addons/fancy_folder_icons/plugin.gd.uid:
--------------------------------------------------------------------------------
1 | uid://nm7lrpvj3ang
2 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/menu_fancy.gd.uid:
--------------------------------------------------------------------------------
1 | uid://cshk45hn5u0uw
2 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/scene/accept.gd.uid:
--------------------------------------------------------------------------------
1 | uid://up3jia7nmthd
2 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/scene/icon_selector.gd.uid:
--------------------------------------------------------------------------------
1 | uid://b8j4rmn2s6wq8
2 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/scene/texture_select.gd.uid:
--------------------------------------------------------------------------------
1 | uid://b7q0u066xrji6
2 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/scene/textures_recent.gd.uid:
--------------------------------------------------------------------------------
1 | uid://bgqshjvc1g8kv
2 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/cd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/cd.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/blog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/blog.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/cancel.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/danger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/danger.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/delete.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/down.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/good.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/good.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/heart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/heart.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/help.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/movie.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/music.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/music.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/next.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/next.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/save.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/save.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/database.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/database.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/previous.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/previous.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodeNameTwister/Fancy-Folder-Icons/HEAD/addons/fancy_folder_icons/samples/warning.png
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/Folder.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/plugin.cfg:
--------------------------------------------------------------------------------
1 | [plugin]
2 |
3 | name="Fancy Folder Icons"
4 | description="Allow customize icons for folders/files"
5 | author="Twister"
6 | github="https://github.com/CodeNameTwister/Fancy-Folder-Icons"
7 | version="1.6.2"
8 | script="plugin.gd"
9 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/ZoomMore.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/cd.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://1wht64drftb0"
6 | path="res://.godot/imported/cd.png-2a20fb8f14d71d5eba40af2282b65d24.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/cd.png"
14 | dest_files=["res://.godot/imported/cd.png-2a20fb8f14d71d5eba40af2282b65d24.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/blog.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://c07i5lwi1wx52"
6 | path="res://.godot/imported/blog.png-3ce6b23b3540e9c5163419c99f4ea4de.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/blog.png"
14 | dest_files=["res://.godot/imported/blog.png-3ce6b23b3540e9c5163419c99f4ea4de.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/down.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://d0g5rcjw5k58r"
6 | path="res://.godot/imported/down.png-9408632598f757ad28b0533a0eb022f4.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/down.png"
14 | dest_files=["res://.godot/imported/down.png-9408632598f757ad28b0533a0eb022f4.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/good.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://b68pm3045j51i"
6 | path="res://.godot/imported/good.png-8cc712fcf9c12a71f1452756b7290260.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/good.png"
14 | dest_files=["res://.godot/imported/good.png-8cc712fcf9c12a71f1452756b7290260.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/heart.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://1p35vp6yh0ys"
6 | path="res://.godot/imported/heart.png-7b1b7c956dea13053b3f54697b74720c.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/heart.png"
14 | dest_files=["res://.godot/imported/heart.png-7b1b7c956dea13053b3f54697b74720c.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/help.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://vd35ns2md6ke"
6 | path="res://.godot/imported/help.png-3fa64c30fa268524e8bac49acc707d2e.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/help.png"
14 | dest_files=["res://.godot/imported/help.png-3fa64c30fa268524e8bac49acc707d2e.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/movie.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://rcwqv0vi0a6g"
6 | path="res://.godot/imported/movie.png-5e2c45a5207099e9cabe8053f60142b9.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/movie.png"
14 | dest_files=["res://.godot/imported/movie.png-5e2c45a5207099e9cabe8053f60142b9.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/next.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://blrbe81audjuk"
6 | path="res://.godot/imported/next.png-ccea7a4dffc0a59d54735c7ea7dcddb9.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/next.png"
14 | dest_files=["res://.godot/imported/next.png-ccea7a4dffc0a59d54735c7ea7dcddb9.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/save.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://cr30pejale7j7"
6 | path="res://.godot/imported/save.png-5a376869782345f739a55633a12200d7.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/save.png"
14 | dest_files=["res://.godot/imported/save.png-5a376869782345f739a55633a12200d7.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/cancel.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://cg0f55ae61sx1"
6 | path="res://.godot/imported/cancel.png-1a3b4f18d6174f61c7c2fea49f3d0775.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/cancel.png"
14 | dest_files=["res://.godot/imported/cancel.png-1a3b4f18d6174f61c7c2fea49f3d0775.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/danger.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dql1acxfd6yrd"
6 | path="res://.godot/imported/danger.png-1fa80d931ccec0bc16737f8803765fb6.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/danger.png"
14 | dest_files=["res://.godot/imported/danger.png-1fa80d931ccec0bc16737f8803765fb6.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/delete.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://camm6l6pbejlj"
6 | path="res://.godot/imported/delete.png-ab1fa9a00fa41c5fc59f5918f1edeff5.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/delete.png"
14 | dest_files=["res://.godot/imported/delete.png-ab1fa9a00fa41c5fc59f5918f1edeff5.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/music.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bhe0xeqkf4qax"
6 | path="res://.godot/imported/music.png-e71bc62e80f5bc309da00c12685bdf3e.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/music.png"
14 | dest_files=["res://.godot/imported/music.png-e71bc62e80f5bc309da00c12685bdf3e.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/warning.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://ccc6j3io7iw47"
6 | path="res://.godot/imported/warning.png-820c4479232aab20825e33932ad1d504.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/warning.png"
14 | dest_files=["res://.godot/imported/warning.png-820c4479232aab20825e33932ad1d504.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/database.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://d25e8idgct6n3"
6 | path="res://.godot/imported/database.png-6639c2fa8739ae254e7ef03960a0dc26.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/database.png"
14 | dest_files=["res://.godot/imported/database.png-6639c2fa8739ae254e7ef03960a0dc26.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/previous.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dvq68vmy18msn"
6 | path="res://.godot/imported/previous.png-4ebce6e70e2eab8f92aae107b12bea64.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/previous.png"
14 | dest_files=["res://.godot/imported/previous.png-4ebce6e70e2eab8f92aae107b12bea64.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/scene/accept.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Button
3 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
4 | # Fancy Folder Icons
5 | #
6 | # Folder Icons addon for addon godot 4
7 | # https://github.com/CodeNameTwister/Fancy-Folder-Icons
8 | # author: "Twister"
9 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
10 | var _nx : Color = Color.YELLOW
11 | var _delta : float = 0.0
12 |
13 | func _process(delta: float) -> void:
14 | _delta += delta * 4.0
15 | if _delta >= 1.0:
16 | _delta = 0.0
17 | set(&"theme_override_colors/font_color", _nx)
18 | if _nx == Color.YELLOW:
19 | _nx = Color.DARK_GRAY
20 | else:
21 | _nx = Color.YELLOW
22 | return
23 | var c_color : Color = get(&"theme_override_colors/font_color")
24 | set(&"theme_override_colors/font_color", lerp(c_color, _nx, _delta))
25 |
26 | func _ready() -> void:
27 | set_process(false)
28 | disabled = true
29 | owner.enable_accept_changes_button.connect(_on_enable)
30 | set(&"theme_override_colors/font_color", Color.WHITE)
31 |
32 | func _on_enable(e : bool) -> void:
33 | disabled = !e
34 | set_process(e)
35 | if !e:
36 | set(&"theme_override_colors/font_color", Color.WHITE)
37 |
38 | func _on_pressed() -> void:
39 | owner.accept_changes()
40 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/ZoomMore.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://blssopgxxr688"
6 | path="res://.godot/imported/ZoomMore.svg-9285dc7b7b612cd8cd72dec673436c34.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/ZoomMore.svg"
14 | dest_files=["res://.godot/imported/ZoomMore.svg-9285dc7b7b612cd8cd72dec673436c34.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/uastc_level=0
22 | compress/rdo_quality_loss=0.0
23 | compress/hdr_compression=1
24 | compress/normal_map=0
25 | compress/channel_pack=0
26 | mipmaps/generate=false
27 | mipmaps/limit=-1
28 | roughness/mode=0
29 | roughness/src_normal=""
30 | process/channel_remap/red=0
31 | process/channel_remap/green=1
32 | process/channel_remap/blue=2
33 | process/channel_remap/alpha=3
34 | process/fix_alpha_border=true
35 | process/premult_alpha=false
36 | process/normal_map_invert_y=false
37 | process/hdr_as_srgb=false
38 | process/hdr_clamp_exposure=false
39 | process/size_limit=0
40 | detect_3d/compress_to=1
41 | svg/scale=1.0
42 | editor/scale_with_editor_scale=false
43 | editor/convert_colors_with_editor_theme=false
44 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/samples/Folder.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://cdofmex30bl3q"
6 | path="res://.godot/imported/Folder.svg-808c0d059ca851d4bfac8646494006fb.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://addons/fancy_folder_icons/samples/Folder.svg"
14 | dest_files=["res://.godot/imported/Folder.svg-808c0d059ca851d4bfac8646494006fb.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/uastc_level=0
22 | compress/rdo_quality_loss=0.0
23 | compress/hdr_compression=1
24 | compress/normal_map=0
25 | compress/channel_pack=0
26 | mipmaps/generate=false
27 | mipmaps/limit=-1
28 | roughness/mode=0
29 | roughness/src_normal=""
30 | process/channel_remap/red=0
31 | process/channel_remap/green=1
32 | process/channel_remap/blue=2
33 | process/channel_remap/alpha=3
34 | process/fix_alpha_border=true
35 | process/premult_alpha=false
36 | process/normal_map_invert_y=false
37 | process/hdr_as_srgb=false
38 | process/hdr_clamp_exposure=false
39 | process/size_limit=0
40 | detect_3d/compress_to=1
41 | svg/scale=1.0
42 | editor/scale_with_editor_scale=false
43 | editor/convert_colors_with_editor_theme=false
44 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/menu_fancy.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends EditorContextMenuPlugin
3 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
4 | # Fancy Folder Icons
5 | #
6 | # Folder Icons addon for addon godot 4
7 | # https://github.com/CodeNameTwister/Fancy-Folder-Icons
8 | # author: "Twister"
9 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
10 | #region godotengine_repository_icons
11 | const ICON : Texture = preload("res://addons/fancy_folder_icons/ZoomMore.svg")
12 | #endregion
13 |
14 | signal iconize_paths(path : Variant)
15 |
16 | func _popup_menu(paths: PackedStringArray) -> void:
17 | var _process : bool = false
18 | for p : String in paths:
19 | if FileAccess.file_exists(p) or DirAccess.dir_exists_absolute(p):
20 | # The translation in tool mode doesn't seem to work at the moment, I'll leave the code anyway.
21 | var locale : String = OS.get_locale_language()
22 | var translation: Translation = TranslationServer.get_translation_object(locale)
23 | add_context_menu_item("{0} {1}".format([_get_tr(translation,&"Custom"), _get_tr(translation,&"Icon")]).capitalize(), _on_pick_cmd.bind(paths), ICON)
24 | break
25 |
26 | # v4.5.beta1.official [46c495ca2] Error, not receive arg0 values.Add commentMore actions
27 | func _on_pick_cmd(arg0 : Variant, arg1_fallvar : Variant = null) -> void:
28 | if arg0 is PackedStringArray and arg0.size() > 0:
29 | iconize_paths.emit(arg0)
30 | elif arg1_fallvar is PackedStringArray and arg1_fallvar.size() > 0:
31 | iconize_paths.emit(arg1_fallvar)
32 |
33 | func _get_tr(translation : Translation, msg : StringName) -> StringName:
34 | if translation == null:
35 | return msg
36 | var new_msg : StringName = translation.get_message(msg)
37 | if new_msg.is_empty():
38 | return msg
39 | return new_msg
40 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/scene/texture_select.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends TextureRect
3 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
4 | # Fancy Folder Icons
5 | #
6 | # Folder Icons addon for addon godot 4
7 | # https://github.com/CodeNameTwister/Fancy-Folder-Icons
8 | # author: "Twister"
9 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
10 |
11 | var _nxt : Color = Color.DARK_GRAY
12 | var _fps : float = 0.0
13 |
14 | var path : String = ""
15 |
16 | func _set(property: StringName, value: Variant) -> bool:
17 | if property == &"texture":
18 | set_meta(&"path", null)
19 | if null != value:
20 | if value is Resource:
21 | var new_path : String = (value as Resource).resource_path
22 | if !new_path.is_empty():
23 | path = new_path
24 | if value is Texture2D:
25 | value.set_meta(&"path", value.resource_path)
26 | if path.is_empty():
27 | path = str(get_index())
28 | texture = value
29 | return true
30 | return false
31 |
32 | func _ready() -> void:
33 | set_process(false)
34 | gui_input.connect(_on_gui)
35 | # I prevent using UID because of some bugs sometimes, Maybe i'll lose my fear of UIDs in future versions of Godot.
36 | path = "res://addons/fancy_folder_icons/samples/Folder.svg"
37 | if is_instance_valid(texture):
38 | if texture.resource_path == null:
39 | texture = null
40 | else:
41 | path = texture.resource_path
42 | else:
43 | #Placeholder
44 | texture = ResourceLoader.load("res://addons/fancy_folder_icons/samples/Folder.svg")
45 | path = texture.resource_path
46 | set_meta(&"path", path)
47 |
48 | func _on_gui(i : InputEvent) -> void:
49 | if i is InputEventMouseButton:
50 | if i.button_index == 1 and i.pressed:
51 | if texture == null:
52 | return
53 | owner.select_texture(texture, path, modulate)
54 |
55 | func enable() -> void:
56 | set_process(true)
57 |
58 | func reset() -> void:
59 | set_process(false)
60 | modulate = Color.WHITE
61 | _nxt = Color.DARK_GRAY
62 |
63 | func _process(delta: float) -> void:
64 | _fps += delta * 4.0
65 | if _fps >= 1.0:
66 | _fps = 0.0
67 | modulate = _nxt
68 | if _nxt == Color.DARK_GRAY:
69 | _nxt = Color.WHITE
70 | else:
71 | _nxt = Color.DARK_GRAY
72 | return
73 | modulate = lerp(modulate, _nxt, _fps)
74 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/scene/icon_selector.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Window
3 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
4 | # Fancy Folder Icons
5 | #
6 | # Folder Icons addon for addon godot 4
7 | # https://github.com/CodeNameTwister/Fancy-Folder-Icons
8 | # author: "Twister"
9 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
10 | @export var texture_container : Control
11 | @export var line_edit : LineEdit
12 | @export var file_dialog : FileDialog
13 | @export var timer : Timer
14 |
15 | @warning_ignore("unused_signal")
16 | signal on_set_texture(new_tx : Texture, path : String, color : Color)
17 | @warning_ignore("unused_signal")
18 | signal on_reset_texture()
19 |
20 | signal enable_accept_changes_button(e : bool)
21 |
22 | var _selected : Texture2D = null
23 | var _path : String = ""
24 | var _color : Color = Color.WHITE
25 |
26 | var plugin : Object = null
27 |
28 | func get_icon_size() -> Vector2:
29 | if is_instance_valid(plugin):
30 | return plugin.size
31 | return Vector2(12.0, 12.0)
32 |
33 | func _call_reorder(tx : Texture) -> void:
34 | if texture_container:
35 | texture_container.reorder(tx)
36 |
37 | func get_selected_texture() -> Texture2D:
38 | return _selected
39 | #
40 | func select_texture(tx: Texture2D, path : String, modulate : Color = Color.WHITE) -> void:
41 | _selected = null
42 | _path = path
43 | _color = modulate
44 | if tx:
45 | line_edit.text = path
46 | _selected = tx
47 | _call_reorder(tx)
48 | _on_line_edit_text_changed(line_edit.text)
49 | return
50 | enable_accept_changes_button.emit(false)
51 |
52 | func accept_changes() -> void:
53 | _call_reorder(_selected)
54 | on_set_texture.emit(_selected, _path, _color)
55 | hide.call_deferred()
56 |
57 | func _ready() -> void:
58 | enable_accept_changes_button.emit(false)
59 |
60 | func close_requested() -> void:
61 | enable_accept_changes_button.emit(false)
62 | hide.call_deferred()
63 |
64 | func _on_close_requested() -> void:
65 | close_requested()
66 |
67 | func _on_reset_pressed() -> void:
68 | on_reset_texture.emit()
69 | hide.call_deferred()
70 |
71 | func _on_exit_pressed() -> void:
72 | close_requested()
73 |
74 | func _on_go_back_requested() -> void:
75 | close_requested()
76 |
77 | func _on_visibility_changed() -> void:
78 | line_edit.text = ""
79 | enable_accept_changes_button.emit(false)
80 | texture_container.enable_by_path("")
81 |
82 | if !timer:return
83 | if !visible:
84 | timer.start(120)
85 | else:
86 | if !timer.is_stopped():
87 | timer.stop()
88 |
89 |
90 | func _on_line_edit_text_changed(path: String) -> void:
91 | enable_accept_changes_button.emit(line_edit.text.length() > 0)
92 | texture_container.enable_by_path(path)
93 |
94 | func _on_explore_pressed() -> void:
95 | if file_dialog and !file_dialog.visible:
96 | file_dialog.popup_centered()
97 |
98 | func _on_file_dialog_file_selected(path: String) -> void:
99 | if ResourceLoader.exists(path):
100 | var r : Resource = ResourceLoader.load(path)
101 | if r is Texture2D:
102 | select_texture(r, path)
103 |
104 | func _on_timer_timeout() -> void:
105 | name = "_qd"
106 | queue_free()
107 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/scene/textures_recent.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Control
3 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
4 | # Fancy Folder Icons
5 | #
6 | # Folder Icons addon for addon godot 4
7 | # https://github.com/CodeNameTwister/Fancy-Folder-Icons
8 | # author: "Twister"
9 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
10 | const DOT_USER : String = "user://editor/fancy_folder_icon_recents.dat"
11 |
12 | func reorder(new_tx : Texture2D) -> void:
13 | if is_instance_valid(new_tx):
14 | var exist : bool = false
15 | var last_path : String = new_tx.resource_path
16 | for x : Node in get_children():
17 | if x is TextureRect:
18 | if x.texture != null:
19 | if (!last_path.is_empty() and last_path == x.path) or new_tx == x.texture:
20 | if x.texture != new_tx:
21 | x.texture = new_tx
22 | exist = true
23 | break
24 | if exist:
25 | return
26 | var last_texture : Texture2D = new_tx
27 | for x : Node in get_children():
28 | if x is TextureRect:
29 | var _current_texture : Texture2D = x.texture
30 | var _current_path : String = x.path
31 | x.path = last_path
32 | x.texture = last_texture
33 | last_texture = _current_texture
34 | last_path = _current_path
35 | x.queue_redraw()
36 |
37 | func enable_by_path(p : String) -> void:
38 | for x : Node in get_children():
39 | if x is TextureRect:
40 | if null != x.texture:
41 | if x.path == p:
42 | x.enable()
43 | else:
44 | x.reset()
45 |
46 | func _setup() -> void:
47 | var folder : String = DOT_USER.get_base_dir()
48 | if !DirAccess.dir_exists_absolute(folder):
49 | DirAccess.make_dir_absolute(folder)
50 | return
51 | if FileAccess.file_exists(DOT_USER):
52 | var cfg : ConfigFile = ConfigFile.new()
53 | if OK != cfg.load(DOT_USER):return
54 | var _icons : PackedStringArray = cfg.get_value("RECENTS", "ICONS", [])
55 |
56 | var append : Array[Texture2D] = []
57 | for x : String in _icons:
58 | if FileAccess.file_exists(x):
59 | if ResourceLoader.exists(x):
60 | var r : Resource = ResourceLoader.load(x)
61 | if r is Texture2D:
62 | append.append(r)
63 | if append.size() >= get_child_count():break
64 | else:
65 | var image : Image = Image.load_from_file(x)
66 | if is_instance_valid(image):
67 | if image.is_compressed():
68 | image.decompress()
69 | var tx : Texture2D = ImageTexture.create_from_image(image)
70 | if tx is Texture2D:
71 | append.append(tx)
72 | if append.size() >= get_child_count():break
73 |
74 | if append.size() > 0:
75 | var index : int = 0
76 | for x : Node in get_children():
77 | if x is TextureRect:
78 | var tx : Variant = append[index]
79 | if tx is Texture2D:
80 | x.texture = tx
81 | x.path = tx.resource_path
82 | index += 1
83 | if index >= append.size():break
84 |
85 | func _on_exit() -> void:
86 | var pack : PackedStringArray = []
87 | for x : Node in get_children():
88 | if x is TextureRect:
89 | var tx : Texture2D = x.texture
90 | if null != tx:
91 | var path : String = x.path
92 | if path.is_empty():continue
93 | pack.append(path)
94 | if pack.size() > 0:
95 | var cfg : ConfigFile = ConfigFile.new()
96 | cfg.set_value("RECENTS", "ICONS", pack)
97 | if OK != cfg.save(DOT_USER):
98 | push_warning("Can not save recent icons changes!")
99 |
100 |
101 | func _ready() -> void:
102 | _setup()
103 | tree_exiting.connect(_on_exit)
104 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/scene/icon_selector.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=21 format=3 uid="uid://xar82qpavxyl"]
2 |
3 | [ext_resource type="Texture2D" uid="uid://cdofmex30bl3q" path="res://addons/fancy_folder_icons/samples/Folder.svg" id="1_wg60l"]
4 | [ext_resource type="Script" uid="uid://b8j4rmn2s6wq8" path="res://addons/fancy_folder_icons/scene/icon_selector.gd" id="1_yibo6"]
5 | [ext_resource type="Script" uid="uid://bgqshjvc1g8kv" path="res://addons/fancy_folder_icons/scene/textures_recent.gd" id="3_5niax"]
6 | [ext_resource type="Script" uid="uid://up3jia7nmthd" path="res://addons/fancy_folder_icons/scene/accept.gd" id="4_3dosb"]
7 | [ext_resource type="Texture2D" uid="uid://1p35vp6yh0ys" path="res://addons/fancy_folder_icons/samples/heart.png" id="4_i8b63"]
8 | [ext_resource type="Texture2D" uid="uid://cr30pejale7j7" path="res://addons/fancy_folder_icons/samples/save.png" id="4_ksxvb"]
9 | [ext_resource type="Texture2D" uid="uid://ccc6j3io7iw47" path="res://addons/fancy_folder_icons/samples/warning.png" id="4_nn354"]
10 | [ext_resource type="Texture2D" uid="uid://c07i5lwi1wx52" path="res://addons/fancy_folder_icons/samples/blog.png" id="4_s3hb1"]
11 | [ext_resource type="Script" uid="uid://b7q0u066xrji6" path="res://addons/fancy_folder_icons/scene/texture_select.gd" id="5_ksxvb"]
12 | [ext_resource type="Texture2D" uid="uid://1wht64drftb0" path="res://addons/fancy_folder_icons/samples/cd.png" id="5_nwwdh"]
13 | [ext_resource type="Texture2D" uid="uid://rcwqv0vi0a6g" path="res://addons/fancy_folder_icons/samples/movie.png" id="6_nn354"]
14 | [ext_resource type="Texture2D" uid="uid://dql1acxfd6yrd" path="res://addons/fancy_folder_icons/samples/danger.png" id="6_tiswq"]
15 | [ext_resource type="Texture2D" uid="uid://b68pm3045j51i" path="res://addons/fancy_folder_icons/samples/good.png" id="7_nn354"]
16 | [ext_resource type="Texture2D" uid="uid://d0g5rcjw5k58r" path="res://addons/fancy_folder_icons/samples/down.png" id="8_ksxvb"]
17 | [ext_resource type="Texture2D" uid="uid://d25e8idgct6n3" path="res://addons/fancy_folder_icons/samples/database.png" id="9_ksxvb"]
18 | [ext_resource type="Texture2D" uid="uid://cg0f55ae61sx1" path="res://addons/fancy_folder_icons/samples/cancel.png" id="10_i8b63"]
19 | [ext_resource type="Texture2D" uid="uid://bhe0xeqkf4qax" path="res://addons/fancy_folder_icons/samples/music.png" id="12_e2bde"]
20 |
21 | [sub_resource type="Gradient" id="Gradient_5niax"]
22 | offsets = PackedFloat32Array(0.570312, 1)
23 | colors = PackedColorArray(0.176471, 0.294118, 0.294118, 1, 0, 0.215686, 0.215686, 1)
24 |
25 | [sub_resource type="GradientTexture2D" id="GradientTexture2D_5fg00"]
26 | gradient = SubResource("Gradient_5niax")
27 | fill = 1
28 | fill_from = Vector2(0.5, 0.5)
29 |
30 | [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_465he"]
31 | texture = SubResource("GradientTexture2D_5fg00")
32 |
33 | [node name="IconSelector" type="Window" node_paths=PackedStringArray("texture_container", "line_edit", "file_dialog", "timer")]
34 | title = "Choose Icon"
35 | position = Vector2i(0, 36)
36 | size = Vector2i(520, 200)
37 | transient = true
38 | exclusive = true
39 | script = ExtResource("1_yibo6")
40 | texture_container = NodePath("PanelContainer/Container/VC/HC/GridContainer")
41 | line_edit = NodePath("PanelContainer/Container/VC/file_explorer/LineEdit")
42 | file_dialog = NodePath("FileDialog")
43 | timer = NodePath("Timer")
44 |
45 | [node name="PanelContainer" type="PanelContainer" parent="."]
46 | anchors_preset = 15
47 | anchor_right = 1.0
48 | anchor_bottom = 1.0
49 | grow_horizontal = 2
50 | grow_vertical = 2
51 | theme_override_styles/panel = SubResource("StyleBoxTexture_465he")
52 |
53 | [node name="Container" type="MarginContainer" parent="PanelContainer"]
54 | layout_mode = 2
55 | theme_override_constants/margin_left = 8
56 | theme_override_constants/margin_top = 8
57 | theme_override_constants/margin_right = 8
58 | theme_override_constants/margin_bottom = 8
59 |
60 | [node name="VC" type="VBoxContainer" parent="PanelContainer/Container"]
61 | layout_mode = 2
62 |
63 | [node name="Tittle" type="Label" parent="PanelContainer/Container/VC"]
64 | layout_mode = 2
65 | size_flags_vertical = 10
66 | text = "Custom Icon Path Selected"
67 | horizontal_alignment = 1
68 |
69 | [node name="file_explorer" type="HBoxContainer" parent="PanelContainer/Container/VC"]
70 | layout_mode = 2
71 | size_flags_vertical = 8
72 |
73 | [node name="explore" type="Button" parent="PanelContainer/Container/VC/file_explorer"]
74 | custom_minimum_size = Vector2(32, 32)
75 | layout_mode = 2
76 | icon = ExtResource("1_wg60l")
77 | icon_alignment = 1
78 |
79 | [node name="LineEdit" type="LineEdit" parent="PanelContainer/Container/VC/file_explorer"]
80 | layout_mode = 2
81 | size_flags_horizontal = 3
82 | placeholder_text = "Please select recent icon texture or search a new texture."
83 | editable = false
84 |
85 | [node name="HC" type="HBoxContainer" parent="PanelContainer/Container/VC"]
86 | layout_mode = 2
87 | size_flags_vertical = 0
88 |
89 | [node name="Label" type="Label" parent="PanelContainer/Container/VC/HC"]
90 | layout_mode = 2
91 | size_flags_vertical = 1
92 | text = "Recents:"
93 | horizontal_alignment = 2
94 |
95 | [node name="GridContainer" type="GridContainer" parent="PanelContainer/Container/VC/HC"]
96 | layout_mode = 2
97 | size_flags_horizontal = 3
98 | columns = 12
99 | script = ExtResource("3_5niax")
100 |
101 | [node name="Texture0" type="TextureRect" parent="PanelContainer/Container/VC/HC/GridContainer"]
102 | texture_filter = 2
103 | custom_minimum_size = Vector2(16, 16)
104 | layout_mode = 2
105 | size_flags_horizontal = 3
106 | size_flags_vertical = 3
107 | texture = ExtResource("4_i8b63")
108 | expand_mode = 1
109 | stretch_mode = 5
110 | script = ExtResource("5_ksxvb")
111 |
112 | [node name="Texture1" type="TextureRect" parent="PanelContainer/Container/VC/HC/GridContainer"]
113 | texture_filter = 2
114 | custom_minimum_size = Vector2(16, 16)
115 | layout_mode = 2
116 | size_flags_horizontal = 3
117 | size_flags_vertical = 3
118 | texture = ExtResource("4_ksxvb")
119 | expand_mode = 1
120 | stretch_mode = 5
121 | script = ExtResource("5_ksxvb")
122 |
123 | [node name="Texture2" type="TextureRect" parent="PanelContainer/Container/VC/HC/GridContainer"]
124 | texture_filter = 2
125 | custom_minimum_size = Vector2(16, 16)
126 | layout_mode = 2
127 | size_flags_horizontal = 3
128 | size_flags_vertical = 3
129 | texture = ExtResource("5_nwwdh")
130 | expand_mode = 1
131 | stretch_mode = 5
132 | script = ExtResource("5_ksxvb")
133 |
134 | [node name="Texture3" type="TextureRect" parent="PanelContainer/Container/VC/HC/GridContainer"]
135 | texture_filter = 2
136 | custom_minimum_size = Vector2(16, 16)
137 | layout_mode = 2
138 | size_flags_horizontal = 3
139 | size_flags_vertical = 3
140 | texture = ExtResource("6_nn354")
141 | expand_mode = 1
142 | stretch_mode = 5
143 | script = ExtResource("5_ksxvb")
144 |
145 | [node name="Texture4" type="TextureRect" parent="PanelContainer/Container/VC/HC/GridContainer"]
146 | texture_filter = 2
147 | custom_minimum_size = Vector2(16, 16)
148 | layout_mode = 2
149 | size_flags_horizontal = 3
150 | size_flags_vertical = 3
151 | texture = ExtResource("4_s3hb1")
152 | expand_mode = 1
153 | stretch_mode = 5
154 | script = ExtResource("5_ksxvb")
155 |
156 | [node name="Texture5" type="TextureRect" parent="PanelContainer/Container/VC/HC/GridContainer"]
157 | texture_filter = 2
158 | custom_minimum_size = Vector2(16, 16)
159 | layout_mode = 2
160 | size_flags_horizontal = 3
161 | size_flags_vertical = 3
162 | texture = ExtResource("10_i8b63")
163 | expand_mode = 1
164 | stretch_mode = 5
165 | script = ExtResource("5_ksxvb")
166 |
167 | [node name="Texture6" type="TextureRect" parent="PanelContainer/Container/VC/HC/GridContainer"]
168 | texture_filter = 2
169 | custom_minimum_size = Vector2(16, 16)
170 | layout_mode = 2
171 | size_flags_horizontal = 3
172 | size_flags_vertical = 3
173 | texture = ExtResource("4_nn354")
174 | expand_mode = 1
175 | stretch_mode = 5
176 | script = ExtResource("5_ksxvb")
177 |
178 | [node name="Texture7" type="TextureRect" parent="PanelContainer/Container/VC/HC/GridContainer"]
179 | texture_filter = 2
180 | custom_minimum_size = Vector2(16, 16)
181 | layout_mode = 2
182 | size_flags_horizontal = 3
183 | size_flags_vertical = 3
184 | texture = ExtResource("6_tiswq")
185 | expand_mode = 1
186 | stretch_mode = 5
187 | script = ExtResource("5_ksxvb")
188 |
189 | [node name="Texture8" type="TextureRect" parent="PanelContainer/Container/VC/HC/GridContainer"]
190 | texture_filter = 2
191 | custom_minimum_size = Vector2(16, 16)
192 | layout_mode = 2
193 | size_flags_horizontal = 3
194 | size_flags_vertical = 3
195 | texture = ExtResource("9_ksxvb")
196 | expand_mode = 1
197 | stretch_mode = 5
198 | script = ExtResource("5_ksxvb")
199 |
200 | [node name="Texture9" type="TextureRect" parent="PanelContainer/Container/VC/HC/GridContainer"]
201 | texture_filter = 2
202 | custom_minimum_size = Vector2(16, 16)
203 | layout_mode = 2
204 | size_flags_horizontal = 3
205 | size_flags_vertical = 3
206 | texture = ExtResource("8_ksxvb")
207 | expand_mode = 1
208 | stretch_mode = 5
209 | script = ExtResource("5_ksxvb")
210 |
211 | [node name="Texture10" type="TextureRect" parent="PanelContainer/Container/VC/HC/GridContainer"]
212 | texture_filter = 2
213 | custom_minimum_size = Vector2(16, 16)
214 | layout_mode = 2
215 | size_flags_horizontal = 3
216 | size_flags_vertical = 3
217 | texture = ExtResource("7_nn354")
218 | expand_mode = 1
219 | stretch_mode = 5
220 | script = ExtResource("5_ksxvb")
221 |
222 | [node name="Texture11" type="TextureRect" parent="PanelContainer/Container/VC/HC/GridContainer"]
223 | texture_filter = 2
224 | custom_minimum_size = Vector2(16, 16)
225 | layout_mode = 2
226 | size_flags_horizontal = 3
227 | size_flags_vertical = 3
228 | texture = ExtResource("12_e2bde")
229 | expand_mode = 1
230 | stretch_mode = 5
231 | script = ExtResource("5_ksxvb")
232 |
233 | [node name="HSeparator" type="HSeparator" parent="PanelContainer/Container/VC"]
234 | layout_mode = 2
235 |
236 | [node name="container" type="HBoxContainer" parent="PanelContainer/Container/VC"]
237 | layout_mode = 2
238 | size_flags_vertical = 10
239 |
240 | [node name="accept" type="Button" parent="PanelContainer/Container/VC/container"]
241 | layout_mode = 2
242 | size_flags_horizontal = 3
243 | theme_override_colors/font_color = Color(1, 1, 1, 1)
244 | disabled = true
245 | text = "Accept"
246 | script = ExtResource("4_3dosb")
247 |
248 | [node name="reset" type="Button" parent="PanelContainer/Container/VC/container"]
249 | layout_mode = 2
250 | size_flags_horizontal = 3
251 | text = "Reset Icon"
252 |
253 | [node name="exit" type="Button" parent="PanelContainer/Container/VC/container"]
254 | layout_mode = 2
255 | size_flags_horizontal = 3
256 | text = "Exit"
257 |
258 | [node name="FileDialog" type="FileDialog" parent="."]
259 | title = "Open a File"
260 | ok_button_text = "Open"
261 | dialog_hide_on_ok = true
262 | file_mode = 0
263 |
264 | [node name="Timer" type="Timer" parent="."]
265 | wait_time = 120.0
266 |
267 | [connection signal="close_requested" from="." to="." method="_on_close_requested"]
268 | [connection signal="go_back_requested" from="." to="." method="_on_go_back_requested"]
269 | [connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]
270 | [connection signal="pressed" from="PanelContainer/Container/VC/file_explorer/explore" to="." method="_on_explore_pressed"]
271 | [connection signal="text_changed" from="PanelContainer/Container/VC/file_explorer/LineEdit" to="." method="_on_line_edit_text_changed"]
272 | [connection signal="pressed" from="PanelContainer/Container/VC/container/accept" to="PanelContainer/Container/VC/container/accept" method="_on_pressed"]
273 | [connection signal="pressed" from="PanelContainer/Container/VC/container/reset" to="." method="_on_reset_pressed"]
274 | [connection signal="pressed" from="PanelContainer/Container/VC/container/exit" to="." method="_on_exit_pressed"]
275 | [connection signal="file_selected" from="FileDialog" to="." method="_on_file_dialog_file_selected"]
276 | [connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
277 |
--------------------------------------------------------------------------------
/addons/fancy_folder_icons/plugin.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends EditorPlugin
3 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
4 | # Fancy Folder Icons
5 | #
6 | # Folder Icons addon for addon godot 4
7 | # https://github.com/CodeNameTwister/Fancy-Folder-Icons
8 | # author: "Twister"
9 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
10 | var DOT_USER : String = "res://addons/fancy_folder_icons/user/fancy_folder_icons.dat"
11 |
12 |
13 | var size : Vector2 = Vector2(12.0, 12.0) #ICON SIZE
14 |
15 |
16 | var _buffer : Dictionary = {}
17 | var _tree : Tree = null
18 | var _busy : bool = false
19 |
20 | var _menu_service : EditorContextMenuPlugin = null
21 | var _popup : Window = null
22 |
23 | var _is_saving : bool = false
24 |
25 | var _ref_buffer : Dictionary = {}
26 |
27 | var _scan_request : bool = false
28 |
29 | func scan() ->void:
30 | if _scan_request:
31 | return
32 | _scan_request = true
33 | var rf : EditorFileSystem = EditorInterface.get_resource_filesystem()
34 | rf.scan()
35 | set_deferred(&"_scan_request", false)
36 |
37 | func get_buffer() -> Dictionary:
38 | return _buffer
39 |
40 | func _on_changes() -> void:
41 | var editor : EditorSettings = EditorInterface.get_editor_settings()
42 | if editor:
43 | var packed : PackedStringArray = editor.get_changed_settings()
44 | if "plugin/fancy_folder_icons/save_location" in packed:
45 | var new_path : String = editor.get_setting("plugin/fancy_folder_icons/save_location")
46 | if new_path.is_empty():
47 | editor.set_setting("plugin/fancy_folder_icons/save_location", DOT_USER)
48 | else:
49 | DOT_USER = new_path
50 | _setup(false)
51 |
52 | func _init() -> void:
53 | var editor : EditorSettings = EditorInterface.get_editor_settings()
54 | if editor:
55 | if !editor.has_setting("plugin/fancy_folder_icons/save_location"):
56 | editor.set_setting("plugin/fancy_folder_icons/save_location", DOT_USER)
57 | else:
58 | var new_path : String = editor.get_setting("plugin/fancy_folder_icons/save_location")
59 | if new_path.is_empty():
60 | editor.set_setting("plugin/fancy_folder_icons/save_location", DOT_USER)
61 | else:
62 | DOT_USER = new_path
63 | editor.settings_changed.connect(_on_changes)
64 |
65 | func _setup(load_buffer : bool = true) -> void:
66 | var dir : String = DOT_USER.get_base_dir()
67 | if !DirAccess.dir_exists_absolute(dir):
68 | DirAccess.make_dir_recursive_absolute(dir)
69 | return
70 | #if DOT_USER == "res://addons/fancy_folder_icons/user/fancy_folder_icons.dat":
71 | #(?) Do not ignore a possible important folder.
72 | #if !FileAccess.file_exists(dir.path_join(".gdignore")):
73 | #var file : FileAccess = FileAccess.open(dir.path_join(".gdignore"), FileAccess.WRITE)
74 | #file.store_string("Fancy Folder Icons Saved Folder")
75 | #file.close()
76 |
77 | if !load_buffer:
78 | return
79 |
80 | if !FileAccess.file_exists(DOT_USER):
81 | if FileAccess.file_exists("user://editor/fancy_folder_icons.dat"):
82 | var cfg : ConfigFile = ConfigFile.new()
83 | if OK != cfg.load("user://editor/fancy_folder_icons.dat"):return
84 | _buffer = cfg.get_value("DAT", "PTH", {})
85 | if _buffer.size() > 0 and _quick_save() == OK:
86 | print("[Fancy Folder Icons] Loaded from old version, now is secure manual delete: ", ProjectSettings.globalize_path("user://editor/fancy_folder_icons.dat"))
87 | else:
88 | var cfg : ConfigFile = ConfigFile.new()
89 | if OK != cfg.load(DOT_USER):return
90 | _buffer = cfg.get_value("DAT", "PTH", {})
91 |
92 | _clear_buff(_buffer)
93 |
94 | func _clear_buff(buffer : Dictionary) -> void:
95 | for x : Variant in buffer.keys():
96 | var value : Variant = buffer[x]
97 | if x is String:
98 | if !DirAccess.dir_exists_absolute(x) and !FileAccess.file_exists(x):
99 | buffer.erase(x)
100 | continue
101 | if value is Texture2D:
102 | value = _resize_to_explorer_icon(value, x)
103 | buffer[x] = value
104 |
105 | func _quick_save() -> int:
106 | var cfg : ConfigFile = ConfigFile.new()
107 | var result : int = -1
108 | if FileAccess.file_exists(DOT_USER):
109 | cfg.load(DOT_USER)
110 | cfg.set_value("DAT", "PTH", _buffer)
111 | result = cfg.save(DOT_USER)
112 | cfg = null
113 | set_deferred(&"_is_saving" , false)
114 | return result
115 |
116 | #region callbacks
117 | func _moved_callback(a0 : String, b0 : String ) -> void:
118 | if a0 != b0:
119 | if _buffer.has(a0):
120 | _buffer[b0] = _buffer[a0]
121 | _buffer.erase(a0)
122 | save_queue()
123 |
124 | func _remove_callback(path : String) -> void:
125 | if _buffer.has(path):
126 | _buffer.erase(path)
127 | save_queue()
128 | #endregion
129 |
130 | func _def_update() -> void:
131 | set_process(true)
132 |
133 | func _update_draw(x : Variant) -> void:
134 | for __ : int in range(2):
135 | var tree : SceneTree = get_tree()
136 | if !is_instance_valid(tree):
137 | return
138 | await tree.process_frame
139 |
140 | if is_instance_valid(x):
141 | if x is Tree:
142 | var _root: TreeItem = x.get_root()
143 | if _root != null:
144 | var child : TreeItem = _root.get_first_child()
145 | if child == null or child.get_custom_color(0) == Color.GRAY:
146 | return
147 | child.set_custom_color(0, Color.GRAY)
148 | var value : Variant = _root.get_metadata(0)
149 | if value == null:
150 | if child:
151 | value = child.get_metadata(0)
152 | if value is String and (value == "Favorites" or DirAccess.dir_exists_absolute(value) or FileAccess.file_exists(value)):
153 | _explore(_root)
154 | return
155 | elif value is String:
156 | if FileAccess.file_exists(value):
157 | _explore(_root)
158 | elif value is RefCounted:
159 | if value.get(&"_saved_path") is String:
160 | _tabby_explore(_root)
161 | elif x is ItemList:
162 | if x.item_count > 0:
163 | var color : Color = x.get_item_custom_fg_color(0)
164 | if color != Color.GRAY:
165 | x.set_item_custom_fg_color(0, Color.GRAY)
166 | var m : Variant = x.get_item_metadata(0)
167 | if m is String and (DirAccess.dir_exists_absolute(m) or FileAccess.file_exists(m)):
168 | for y : int in x.item_count:
169 | var path : Variant = x.get_item_metadata(y)
170 | if path is String:
171 | if _buffer.has(path):
172 | if x.max_columns == 1:
173 | x.set_item_icon(y, _buffer[path])
174 | else:
175 | x.set_item_icon(y, _get_item_texture(_buffer[path]))
176 | elif path.get_extension().is_empty():
177 | var tmp : String = path.path_join("")
178 | if _buffer.has(tmp):
179 | if x.max_columns == 1:
180 | x.set_item_icon(y, _buffer[tmp])
181 | else:
182 | x.set_item_icon(y, _get_item_texture(_buffer[tmp]))
183 | else:
184 | path = path.substr(0, path.rfind("/", path.length()-2)).path_join("")
185 | if _buffer.has(path):
186 | if x.max_columns == 1:
187 | x.set_item_icon(y, _buffer[path])
188 | else:
189 | x.set_item_icon(y, _get_item_texture(_buffer[path]))
190 | elif m is Dictionary and m.has("path"):
191 | for y : int in x.item_count:
192 | var data : Variant = x.get_item_metadata(y)
193 | if data is Dictionary and data.has("path"):
194 | var path : Variant = data["path"]
195 | if path is String:
196 | if _buffer.has(path):
197 | if x.max_columns == 1:
198 | x.set_item_icon(y, _buffer[path])
199 | else:
200 | x.set_item_icon(y, _get_item_texture(_buffer[path]))
201 | elif path.get_extension().is_empty():
202 | var tmp : String = path.path_join("")
203 | if _buffer.has(tmp):
204 | if x.max_columns == 1:
205 | x.set_item_icon(y, _buffer[tmp])
206 | else:
207 | x.set_item_icon(y, _get_item_texture(_buffer[tmp]))
208 | else:
209 | path = path.substr(0, path.rfind("/", path.length()-2)).path_join("")
210 | if _buffer.has(path):
211 | if x.max_columns == 1:
212 | x.set_item_icon(y, _buffer[path])
213 | else:
214 | x.set_item_icon(y, _get_item_texture(_buffer[path]))
215 | else:
216 | if x is Control:
217 | if x.draw.is_connected(_update_draw):
218 | x.draw.disconnect(_update_draw)
219 |
220 | func update() -> void:
221 | if _busy or _buffer.size() == 0 or _tree == null:
222 | return
223 | _busy = true
224 | for x : Variant in _ref_buffer.keys():
225 | if !is_instance_valid(x):
226 | _ref_buffer.erase(x)
227 | continue
228 | if x is Tree:
229 | var _root: TreeItem = x.get_root()
230 | if _root != null:
231 | var child : TreeItem = _root.get_first_child()
232 | if child == null:
233 | continue
234 | var value : Variant = _root.get_metadata(0)
235 | if value == null:
236 | if child:
237 | value = child.get_metadata(0)
238 | if value is String and (value == "Favorites" or DirAccess.dir_exists_absolute(value) or FileAccess.file_exists(value)):
239 | if !x.draw.is_connected(_update_draw):
240 | x.draw.connect(_update_draw.bind(x))
241 | _update_draw(x)
242 | continue
243 | elif value is String:
244 | if FileAccess.file_exists(value):
245 | if !x.draw.is_connected(_update_draw):
246 | x.draw.connect(_update_draw.bind(x))
247 | _update_draw(x)
248 | continue
249 | elif value is RefCounted:
250 | if value.get(&"_saved_path") is String:
251 | if !x.draw.is_connected(_update_draw):
252 | x.draw.connect(_update_draw.bind(x))
253 | _update_draw(x)
254 | continue
255 | elif x is ItemList:
256 | if !x.draw.is_connected(_update_draw):
257 | x.draw.connect(_update_draw.bind(x))
258 | if x.item_count > 0:
259 | var m : Variant = x.get_item_metadata(0)
260 | if m is String and (DirAccess.dir_exists_absolute(m) or FileAccess.file_exists(m)):
261 | if !x.draw.is_connected(_update_draw):
262 | x.draw.connect(_update_draw.bind(x))
263 | _update_draw(x)
264 | elif m is Dictionary and m.has("path"):
265 | if !x.draw.is_connected(_update_draw):
266 | x.draw.connect(_update_draw.bind(x))
267 | _update_draw(x)
268 | else:
269 | if !x.draw.is_connected(_update_draw):
270 | x.draw.connect(_update_draw.bind(x))
271 | continue
272 |
273 | set_deferred(&"_busy", false)
274 |
275 | func _is_tabby(tree : Tree, root : TreeItem) -> bool:
276 | var meta : Variant = root.get_metadata(0)
277 | if meta is RefCounted:
278 | if meta.get(&"_saved_path") is String:
279 | if !tree.draw.is_connected(_update_draw):
280 | tree.draw.connect(_update_draw.bind(tree))
281 | return true
282 | return false
283 |
284 | func _tabby_explore(item : TreeItem, texture : Texture2D = null, as_root : bool = true) -> void:
285 | var meta : Variant = item.get_metadata(0)
286 | if meta is RefCounted:
287 | meta = meta.get(&"_saved_path")
288 | if meta is String:
289 | if _buffer.has(meta):
290 | texture = _buffer[meta]
291 | as_root = true
292 |
293 | if texture != null:
294 | if as_root or !FileAccess.file_exists(meta):
295 | item.set_icon(0, texture)
296 |
297 | for i : TreeItem in item.get_children():
298 | _tabby_explore(i, texture, false)
299 |
300 | func _explore(item : TreeItem, texture : Texture2D = null, as_root : bool = true) -> void:
301 | var meta : Variant = str(item.get_metadata(0))
302 |
303 | if _buffer.has(meta):
304 | texture = _buffer[meta]
305 | as_root = true
306 |
307 | if texture != null:
308 | if as_root or !FileAccess.file_exists(meta):
309 | item.set_icon(0, texture)
310 |
311 | for i : TreeItem in item.get_children():
312 | _explore(i, texture, false)
313 |
314 | func _resize_to_explorer_icon(tx : Texture2D, key: Variant) -> Texture2D:
315 | if tx.get_size() != size:
316 | var tx_size : Vector2 = tx.get_size()
317 | var img : Image = tx.get_image()
318 | var path : String = tx.resource_path
319 |
320 | if img.is_compressed():
321 | img.decompress()
322 |
323 | var mb : float = maxf(minf(tx_size.x, tx_size.y), size.x)
324 | tx_size.x = maxf(minf(tx_size.x - maxf(mb - size.x, 0.0), size.x), 1.0)
325 | tx_size.y = maxf(minf(tx_size.y - maxf(mb - size.y, 0.0), size.y), 1.0)
326 |
327 | if tx_size.x < size.x and tx_size.y < size.y:
328 | mb = maxf(tx_size.x, tx_size.y)
329 | tx_size.x += size.x - mb
330 | tx_size.y += size.y - mb
331 |
332 | img.resize(int(tx_size.x), int(tx_size.y), Image.INTERPOLATE_LANCZOS)
333 | tx = ImageTexture.create_from_image(img)
334 |
335 | if path.is_empty() or !FileAccess.file_exists(path):
336 | path = DOT_USER.get_base_dir().path_join(str(key).get_file())
337 | var index : int = 0
338 | var new_path : String = path + str(index) + ".png"
339 | while FileAccess.file_exists(new_path):
340 | #DUPLICATED
341 | if ResourceLoader.exists(new_path):
342 | var res : Resource = ResourceLoader.load(new_path)
343 | if res is Texture and res == tx:
344 | break
345 |
346 | index += 1
347 | new_path = path + str(index) + ".png"
348 | path = new_path
349 | ResourceSaver.save(tx, path)
350 | tx.resource_path = path
351 | scan.call_deferred()
352 |
353 | tx.set_meta(&"path", path)
354 | return tx
355 |
356 | func _on_select_texture(tx : Texture2D, texture_path : String, _modulate : Color, paths : PackedStringArray) -> void:
357 | if tx.get_size() != size:
358 | print("Image selected '", texture_path.get_file(), "' size: ", tx.get_size(), " resized to ", size.x, "x", size.y)
359 | tx = _resize_to_explorer_icon(tx, texture_path)
360 |
361 | for p : String in paths:
362 | _buffer[p] = tx
363 |
364 | _def_update()
365 | save_queue()
366 |
367 | EditorInterface.get_resource_filesystem().scan()
368 |
369 | func save_queue() -> void:
370 | if _is_saving:
371 | return
372 | _is_saving = true
373 | _quick_save.call_deferred()
374 |
375 | func _on_reset_texture(paths : PackedStringArray) -> void:
376 | for p : String in paths:
377 | if _buffer.has(p):
378 | _buffer.erase(p)
379 | var fs : EditorFileSystem = EditorInterface.get_resource_filesystem()
380 | if fs: fs.filesystem_changed.emit()
381 |
382 | func _on_iconize(paths : PackedStringArray) -> void:
383 | const PATH : String = "res://addons/fancy_folder_icons/scene/icon_selector.tscn"
384 | var pop : Window = get_node_or_null("_POP_ICONIZER_")
385 | if pop == null:
386 | pop = (ResourceLoader.load(PATH) as PackedScene).instantiate()
387 | pop.name = "_POP_ICONIZER_"
388 | pop.plugin = self
389 | add_child(pop)
390 | if pop.on_set_texture.is_connected(_on_select_texture):
391 | pop.on_set_texture.disconnect(_on_select_texture)
392 | if pop.on_reset_texture.is_connected(_on_reset_texture):
393 | pop.on_reset_texture.disconnect(_on_reset_texture)
394 | pop.on_set_texture.connect(_on_select_texture.bind(paths))
395 | pop.on_reset_texture.connect(_on_reset_texture.bind(paths))
396 | pop.popup_centered()
397 |
398 | func _ready() -> void:
399 | set_physics_process(false)
400 | var dock : FileSystemDock = EditorInterface.get_file_system_dock()
401 | var fs : EditorFileSystem = EditorInterface.get_resource_filesystem()
402 |
403 | _n(dock)
404 | _setup()
405 |
406 | if _tree.draw.is_connected(_update_draw):
407 | _tree.draw.connect(_update_draw.bind(_tree))
408 |
409 | add_context_menu_plugin(EditorContextMenuPlugin.CONTEXT_SLOT_FILESYSTEM, _menu_service)
410 |
411 | dock.files_moved.connect(_moved_callback)
412 | dock.folder_moved.connect(_moved_callback)
413 | dock.folder_removed.connect(_remove_callback)
414 | dock.file_removed.connect(_remove_callback)
415 | dock.folder_color_changed.connect(_def_update)
416 | fs.filesystem_changed.connect(_def_update)
417 |
418 | _def_update()
419 | #var _enable_icons_on_split : bool = true
420 |
421 | func _on_child(n : Node) -> void:
422 | if n is Tree:
423 | if !_ref_buffer.has(n):
424 | _ref_buffer[n] = null
425 | _def_update()
426 | if n is ItemList:
427 | if !_ref_buffer.has(n):
428 | _ref_buffer[n] = null
429 | _def_update()
430 | for x : Node in n.get_children():
431 | _on_child(x)
432 |
433 | func _enter_tree() -> void:
434 | var root : Node = get_tree().root
435 | get_tree().node_added.connect(_on_child)
436 | _on_child(root)
437 |
438 | _menu_service = ResourceLoader.load("res://addons/fancy_folder_icons/menu_fancy.gd").new()
439 | _menu_service.iconize_paths.connect(_on_iconize)
440 |
441 | var vp : Viewport = Engine.get_main_loop().root
442 | vp.focus_entered.connect(_on_wnd)
443 | vp.focus_exited.connect(_out_wnd)
444 |
445 | func _exit_tree() -> void:
446 | if is_instance_valid(_popup):
447 | _popup.queue_free()
448 |
449 | if is_instance_valid(_menu_service):
450 | remove_context_menu_plugin(_menu_service)
451 |
452 | if get_tree().node_added.is_connected(_on_child):
453 | get_tree().node_added.disconnect(_on_child)
454 |
455 |
456 | var dock : FileSystemDock = EditorInterface.get_file_system_dock()
457 | var fs : EditorFileSystem = EditorInterface.get_resource_filesystem()
458 | if dock.files_moved.is_connected(_moved_callback):
459 | dock.files_moved.disconnect(_moved_callback)
460 | if dock.folder_moved.is_connected(_moved_callback):
461 | dock.folder_moved.disconnect(_moved_callback)
462 | if dock.folder_removed.is_connected(_remove_callback):
463 | dock.folder_removed.disconnect(_remove_callback)
464 | if dock.file_removed.is_connected(_remove_callback):
465 | dock.file_removed.disconnect(_remove_callback)
466 | if dock.folder_color_changed.is_connected(_def_update):
467 | dock.folder_color_changed.disconnect(_def_update)
468 | if fs.filesystem_changed.is_connected(_def_update):
469 | fs.filesystem_changed.disconnect(_def_update)
470 |
471 | var editor : EditorSettings = EditorInterface.get_editor_settings()
472 | if editor:
473 | editor.settings_changed.disconnect(_on_changes)
474 |
475 |
476 | #region user_dat
477 | var cfg : ConfigFile = ConfigFile.new()
478 | for k : String in _buffer.keys():
479 | if !DirAccess.dir_exists_absolute(k) and !FileAccess.file_exists(k):
480 | _buffer.erase(k)
481 | continue
482 | cfg.set_value("DAT", "PTH", _buffer)
483 | if OK != cfg.save(DOT_USER):
484 | push_warning("Error on save HideFolders!")
485 | #endregion
486 |
487 | _menu_service = null
488 | _buffer.clear()
489 |
490 | if !fs.is_queued_for_deletion():
491 | fs.filesystem_changed.emit()
492 |
493 | var vp : Viewport = Engine.get_main_loop().root
494 | vp.focus_entered.disconnect(_on_wnd)
495 | vp.focus_exited.disconnect(_out_wnd)
496 |
497 | func _on_wnd() -> void:set_physics_process(true)
498 | func _out_wnd() -> void:set_physics_process(false)
499 |
500 | func _process(_delta: float) -> void:
501 | set_process(false)
502 | update()
503 |
504 | #region rescue_fav
505 | func _n(n : Node) -> bool:
506 | if n is Tree:
507 | var t : TreeItem = (n.get_root())
508 | if null != t:
509 | t = t.get_first_child()
510 | while t != null:
511 | if t.get_metadata(0) == "res://":
512 | _tree = n
513 | var tx : Texture2D = t.get_icon(0)
514 | if tx:
515 | size = tx.get_size()
516 | return true
517 | t = t.get_next()
518 | for x in n.get_children():
519 | if _n(x): return true
520 | return false
521 | #endregion
522 |
523 | func _get_item_texture(texture : Texture2D) -> Texture2D:
524 | if texture.get_size() != size:
525 | return texture
526 | else:
527 | var path : String = texture.resource_path
528 | if path.is_empty() and texture.has_meta(&"path"):
529 | path = texture.get_meta(&"path")
530 | if path.get_extension() != "svg" and not FileAccess.file_exists(path):
531 | return texture
532 |
533 | if !ResourceLoader.exists(path):
534 | var image : Image = Image.load_from_file(path)
535 | if is_instance_valid(image):
536 | if image.is_compressed():
537 | image.decompress()
538 | var tx : Texture2D = ImageTexture.create_from_image(image)
539 | if tx is Texture2D:
540 | return tx
541 | else:
542 | return null
543 | return ResourceLoader.load(path)
544 |
--------------------------------------------------------------------------------