From 31a688421c6959cfd3b9360c0bb46e0e0ac91f6e Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 8 Oct 2023 19:12:22 +0200 Subject: [PATCH] Added the addon from the broken seals repository. --- .gitignore | 27 ++ LICENSE | 19 ++ README.md | 5 + addons/data_manager/LICENSE | 19 ++ addons/data_manager/icons/empty.png | Bin 0 -> 939 bytes addons/data_manager/icons/empty.png.import | 35 ++ addons/data_manager/icons/gom.png | Bin 0 -> 1746 bytes addons/data_manager/icons/gom.png.import | 35 ++ addons/data_manager/icons/icon_add.png | Bin 0 -> 111 bytes addons/data_manager/icons/icon_add.png.import | 35 ++ addons/data_manager/icons/icon_copy.png | Bin 0 -> 248 bytes .../data_manager/icons/icon_copy.png.import | 35 ++ .../data_manager/icons/icon_display-name.png | Bin 0 -> 200 bytes .../icons/icon_display-name.png.import | 35 ++ addons/data_manager/icons/icon_duplicate.png | Bin 0 -> 167 bytes .../icons/icon_duplicate.png.import | 35 ++ addons/data_manager/icons/icon_edit.png | Bin 0 -> 346 bytes .../data_manager/icons/icon_edit.png.import | 35 ++ addons/data_manager/icons/icon_empty.png | Bin 0 -> 267 bytes .../data_manager/icons/icon_empty.png.import | 35 ++ addons/data_manager/icons/icon_load.png | Bin 0 -> 170 bytes .../data_manager/icons/icon_load.png.import | 35 ++ addons/data_manager/icons/icon_move_down.png | Bin 0 -> 268 bytes .../icons/icon_move_down.png.import | 35 ++ addons/data_manager/icons/icon_move_up.png | Bin 0 -> 269 bytes .../icons/icon_move_up.png.import | 35 ++ addons/data_manager/icons/icon_multi_line.png | Bin 0 -> 140 bytes .../icons/icon_multi_line.png.import | 35 ++ addons/data_manager/icons/icon_options.png | Bin 0 -> 392 bytes .../icons/icon_options.png.import | 35 ++ .../data_manager/icons/icon_reload_small.png | Bin 0 -> 409 bytes .../icons/icon_reload_small.png.import | 35 ++ addons/data_manager/icons/icon_remove.png | Bin 0 -> 166 bytes .../data_manager/icons/icon_remove.png.import | 35 ++ addons/data_manager/icons/icon_rename.png | Bin 0 -> 160 bytes .../data_manager/icons/icon_rename.png.import | 35 ++ addons/data_manager/icons/icon_save.png | Bin 0 -> 252 bytes .../data_manager/icons/icon_save.png.import | 35 ++ addons/data_manager/icons/icon_script.png | Bin 0 -> 262 bytes .../data_manager/icons/icon_script.png.import | 35 ++ addons/data_manager/panels/AddFolderDialog.gd | 74 +++++ addons/data_manager/panels/CreateNamePopup.gd | 64 ++++ .../data_manager/panels/CreateNamePopup.tscn | 58 ++++ addons/data_manager/panels/EntryButton.gd | 93 ++++++ addons/data_manager/panels/HistoryEntry.gd | 41 +++ addons/data_manager/panels/HistoryEntry.tscn | 11 + addons/data_manager/panels/MainPanel.gd | 221 +++++++++++++ addons/data_manager/panels/MainPanel.tscn | 98 ++++++ addons/data_manager/panels/ResourcePanel.gd | 299 ++++++++++++++++++ addons/data_manager/panels/ResourcePanel.tscn | 123 +++++++ addons/data_manager/panels/ResourceRow.tscn | 47 +++ .../panels/ResourceRowMainButton.gd | 18 ++ addons/data_manager/plugin.cfg | 7 + addons/data_manager/plugin.gd | 50 +++ .../data_manager/previews/ControlPreview.gd | 14 + .../data_manager/previews/ControlPreview.tscn | 22 ++ addons/data_manager/previews/Node2DPreview.gd | 14 + .../data_manager/previews/Node2DPreview.tscn | 25 ++ .../data_manager/previews/SpatialPreview.gd | 14 + .../data_manager/previews/SpatialPreview.tscn | 29 ++ .../data_manager/previews/TexturePreview.gd | 12 + .../data_manager/previews/TexturePreview.tscn | 13 + .../resources/data_manager_addon_settings.gd | 231 ++++++++++++++ default_env.tres | 7 + icon.png | Bin 0 -> 3218 bytes icon.png.import | 35 ++ project.pandemonium | 24 ++ 67 files changed, 2344 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 addons/data_manager/LICENSE create mode 100644 addons/data_manager/icons/empty.png create mode 100644 addons/data_manager/icons/empty.png.import create mode 100644 addons/data_manager/icons/gom.png create mode 100644 addons/data_manager/icons/gom.png.import create mode 100644 addons/data_manager/icons/icon_add.png create mode 100644 addons/data_manager/icons/icon_add.png.import create mode 100644 addons/data_manager/icons/icon_copy.png create mode 100644 addons/data_manager/icons/icon_copy.png.import create mode 100644 addons/data_manager/icons/icon_display-name.png create mode 100644 addons/data_manager/icons/icon_display-name.png.import create mode 100644 addons/data_manager/icons/icon_duplicate.png create mode 100644 addons/data_manager/icons/icon_duplicate.png.import create mode 100644 addons/data_manager/icons/icon_edit.png create mode 100644 addons/data_manager/icons/icon_edit.png.import create mode 100644 addons/data_manager/icons/icon_empty.png create mode 100644 addons/data_manager/icons/icon_empty.png.import create mode 100644 addons/data_manager/icons/icon_load.png create mode 100644 addons/data_manager/icons/icon_load.png.import create mode 100644 addons/data_manager/icons/icon_move_down.png create mode 100644 addons/data_manager/icons/icon_move_down.png.import create mode 100644 addons/data_manager/icons/icon_move_up.png create mode 100644 addons/data_manager/icons/icon_move_up.png.import create mode 100644 addons/data_manager/icons/icon_multi_line.png create mode 100644 addons/data_manager/icons/icon_multi_line.png.import create mode 100644 addons/data_manager/icons/icon_options.png create mode 100644 addons/data_manager/icons/icon_options.png.import create mode 100644 addons/data_manager/icons/icon_reload_small.png create mode 100644 addons/data_manager/icons/icon_reload_small.png.import create mode 100644 addons/data_manager/icons/icon_remove.png create mode 100644 addons/data_manager/icons/icon_remove.png.import create mode 100644 addons/data_manager/icons/icon_rename.png create mode 100644 addons/data_manager/icons/icon_rename.png.import create mode 100644 addons/data_manager/icons/icon_save.png create mode 100644 addons/data_manager/icons/icon_save.png.import create mode 100644 addons/data_manager/icons/icon_script.png create mode 100644 addons/data_manager/icons/icon_script.png.import create mode 100644 addons/data_manager/panels/AddFolderDialog.gd create mode 100644 addons/data_manager/panels/CreateNamePopup.gd create mode 100644 addons/data_manager/panels/CreateNamePopup.tscn create mode 100644 addons/data_manager/panels/EntryButton.gd create mode 100644 addons/data_manager/panels/HistoryEntry.gd create mode 100644 addons/data_manager/panels/HistoryEntry.tscn create mode 100644 addons/data_manager/panels/MainPanel.gd create mode 100644 addons/data_manager/panels/MainPanel.tscn create mode 100644 addons/data_manager/panels/ResourcePanel.gd create mode 100644 addons/data_manager/panels/ResourcePanel.tscn create mode 100644 addons/data_manager/panels/ResourceRow.tscn create mode 100644 addons/data_manager/panels/ResourceRowMainButton.gd create mode 100644 addons/data_manager/plugin.cfg create mode 100644 addons/data_manager/plugin.gd create mode 100644 addons/data_manager/previews/ControlPreview.gd create mode 100644 addons/data_manager/previews/ControlPreview.tscn create mode 100644 addons/data_manager/previews/Node2DPreview.gd create mode 100644 addons/data_manager/previews/Node2DPreview.tscn create mode 100644 addons/data_manager/previews/SpatialPreview.gd create mode 100644 addons/data_manager/previews/SpatialPreview.tscn create mode 100644 addons/data_manager/previews/TexturePreview.gd create mode 100644 addons/data_manager/previews/TexturePreview.tscn create mode 100644 addons/data_manager/resources/data_manager_addon_settings.gd create mode 100644 default_env.tres create mode 100644 icon.png create mode 100644 icon.png.import create mode 100644 project.pandemonium diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..60817db --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ + +*.d +*.o +*.meta +.import +.sconsign.dblite +.DS_Store + +export/** +release/** + +.vs/* +.kdev4/* +.vscode/* + +TestRWTextures + +_build/* +_binaries/* +game/android/build/* + +*.blend1 +.dir-locals.el + +build.config + +__pycache__/* \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a638113 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2019-Present Péter Magyar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..33eea60 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Data Manager + +An addon for the Pandemonium Engine to help with managing project resources. + +This addon was based on my [ESS Data](https://github.com/Relintai/ess_data) addon, and was developed in the broken seals repository. The original dev commits can be found [here](https://github.com/Relintai/broken_seals/commits/master/game/addons/data_manager). diff --git a/addons/data_manager/LICENSE b/addons/data_manager/LICENSE new file mode 100644 index 0000000..a638113 --- /dev/null +++ b/addons/data_manager/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2019-Present Péter Magyar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/addons/data_manager/icons/empty.png b/addons/data_manager/icons/empty.png new file mode 100644 index 0000000000000000000000000000000000000000..25043861ab61e8f6932a1597b2fa58f68a990752 GIT binary patch literal 939 zcmaJ=O^ee&7>*VeS$4sbpddTUA}H7-leSqB8cWl(Zorh1EpEY!X)#S{$j*bg=Mj=i34VD+rxx@G_}^)dMXOV^HHOWmiN9$TE+rHCaXvfg~bH z5ZNo2QB|$Us&oX_4`k6|Z=~8rXB~^JG&rF&QUxJRQ$DTmBpwS$QIuRmlFAHGPUazX zvT~Rl777MV+}Mw(PePC@Izuv}8f2MXmJmc6*)Ulj6FV>=b0PupVqQ`Kw5qL8id_zNhNdj?%2OQAe+~5NgX!rJ}S&8KEP+ijbriT!Xl?0Ee{T zdRJU&D>t`75V6Pxj{TR|>%=4gtCCfJYc57-tKORHZO=vA$`x2LLf+WF8eMEL_vF)! zZP{XDd>k^j$IRBhp4wm7l{hesWXhFNCv+Jn`$=5fu;VdjpR%M9&iDnv%H zi{N|cSkYzWXQ1)?Mf0fdl5reNSqO)WS;CT8Gb{COmv zk_Aa+AsH$tDuW*_%19E?#khctzy>Xd3dkWu0BGgO3N@%@;HGs!bZ*`z;(%!glElFM z<5Vm!9ALpJ2=FKP;zcAf8K6=LWIul@mAnq1kjNAw34N$|vLEPA1t~P({e?rVslT1tQSm6>7H`1vaD>sboq- z1}gxwqCg0zA`Ber=|3UJm9w%6_4_oT2_tF+N+Ov+GKVw+ZR#rGf+qtcr%=LRj3hxLIiQy3>>OJkjca#o62I6NMt67!t^DRgJ^UXo5`dH2GKbbCW}QS&v4nW zC{+$AkQuJ{1D7=?*W3znC2E-ssbp!8n4^N_z;wuEo-^d&W}9TaAJ@4(Ljc& z&qUS2%`_VugKdIAN55iPgT2upXmY=ASg8L~)6DpOW$CT-y#;LmZ7hENUzVm6a2{4!DQW*et~~|0b&1q-j8D3Hk2U3SWAl|oA;Eq7(w7%H5^5_7 zb)0AKLJA`Sn;d1kQv@PxTw>0iA`rNK(#jB5hyk-4Tq06y2fg#$g(56>6!?M7b+YjZ z|9bgI6E3~&rj1U8Pm^>7sA^>+MWDoWE}2TxBCu#z2RwDME@kJ&F$y!Z85 zIYm_sWX+FXOgX!AY(4o^=dzCD^|iTn73ZukKVFh!pKz@sJa12;S8}JHOIPRRk?ad~ zS#%@dn0u%qJScvgma)1l>XE)p7`4<#Z<6#*aLf47o9ErDU3Q*uR9@71ih9w;I=}AX z{-vctm$8;GCMk3$sJc_pstMrTaUL%kt@`L@eL;^}U$*tk0b*gXb9qgCdCY_1*O{lb z7Ul(ImFRn#f&R69{LiGL80B{dq&$4CrT_7_4z32*QT&3yr|p1$lpwBVNaCnpa4o_$ zr>m>IF0a!4=0Nui$2$o>wvUHiKTUWXd6b@VZTqF3!erxw@ug+cu1&PDmb9dZUE*@= z;ifBo4?GJGg7~o4@17mbF|EWJ9m2N-HGacCL^nQ3v43vLCP%F~xWwh4ujHm&m$`71 zX%7s0j63^0pPUpfA9`(9ZA=>O*5&WNxU23$_S2G|PwXpr=f5%W#AE K>;`7S&c6Y$GObYn literal 0 HcmV?d00001 diff --git a/addons/data_manager/icons/gom.png.import b/addons/data_manager/icons/gom.png.import new file mode 100644 index 0000000..56610df --- /dev/null +++ b/addons/data_manager/icons/gom.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/gom.png-7336a5cc19ade9f52daca73cd870ca75.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/data_manager/icons/gom.png" +dest_files=[ "res://.import/gom.png-7336a5cc19ade9f52daca73cd870ca75.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/data_manager/icons/icon_add.png b/addons/data_manager/icons/icon_add.png new file mode 100644 index 0000000000000000000000000000000000000000..297be1464c2abce00632c973439a617ee3366bdb GIT binary patch literal 111 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`W}YsNAr`&K2@6y!K0G-1pPgUs z&++ALok8Aiya@>jDG3cNW|p%=MMNYt%NXMfX7Rm9VK~aba6C_F%1<@D+dvZ-JYD@< J);T3K0RUK(AnE`B literal 0 HcmV?d00001 diff --git a/addons/data_manager/icons/icon_add.png.import b/addons/data_manager/icons/icon_add.png.import new file mode 100644 index 0000000..5406689 --- /dev/null +++ b/addons/data_manager/icons/icon_add.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon_add.png-4936253aec6c83c328ecfe2f83f4abdb.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/data_manager/icons/icon_add.png" +dest_files=[ "res://.import/icon_add.png-4936253aec6c83c328ecfe2f83f4abdb.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/data_manager/icons/icon_copy.png b/addons/data_manager/icons/icon_copy.png new file mode 100644 index 0000000000000000000000000000000000000000..d777f132d87ff6cfbf0497ea001a801267624df5 GIT binary patch literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt^@JzX3_ zEP9ttbmTi^z{7I9qy5Hx2boi=AB62VxOxRkZTsKJ1q(a^MV*ws3FS_nnT~gVdk;>zwAeiO3b(|L=&QV@nj3)*XYh3Ob6Mw<&;$U0z+?mf literal 0 HcmV?d00001 diff --git a/addons/data_manager/icons/icon_copy.png.import b/addons/data_manager/icons/icon_copy.png.import new file mode 100644 index 0000000..687fd49 --- /dev/null +++ b/addons/data_manager/icons/icon_copy.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon_copy.png-b8adcf38019b53173acfa7e965fd19ce.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/data_manager/icons/icon_copy.png" +dest_files=[ "res://.import/icon_copy.png-b8adcf38019b53173acfa7e965fd19ce.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/data_manager/icons/icon_display-name.png b/addons/data_manager/icons/icon_display-name.png new file mode 100644 index 0000000000000000000000000000000000000000..7c4493395ef189a22396208d4cc4162cf859bb95 GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_&o-U3d z7QK5Xo#s8PAmDO8;$8Dv<*qw>G*h%Wce0$EcCbb#)z9G3SskVd4aObSEOE{YM4UNp zf4a?okU?{)`GG2vvpJgb_NVXKSKej4vvRwkFMG-ku}#y?gk={uNyU89XWV->a=P}6 vnah~_-rrvR|4(yT!x9TFuUqq{F@IncRMoC2DOflU=nw`^S3j3^P6|i``PW7mOSW<3y zKtRF~HNPp0H)7a~CoC~Iz~;t#K#+UKA|B}mZ51`aMB_P0`T;x)MeB6tg)Y5%0%#9| Mr>mdKI;Vst0Gn(%zW@LL literal 0 HcmV?d00001 diff --git a/addons/data_manager/icons/icon_duplicate.png.import b/addons/data_manager/icons/icon_duplicate.png.import new file mode 100644 index 0000000..0a8641b --- /dev/null +++ b/addons/data_manager/icons/icon_duplicate.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon_duplicate.png-bc9124161be2304f34e2e5292fc9bb72.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/data_manager/icons/icon_duplicate.png" +dest_files=[ "res://.import/icon_duplicate.png-bc9124161be2304f34e2e5292fc9bb72.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/data_manager/icons/icon_edit.png b/addons/data_manager/icons/icon_edit.png new file mode 100644 index 0000000000000000000000000000000000000000..c114d2f84d99c530f47fec9a199afdfb86fecef9 GIT binary patch literal 346 zcmV-g0j2(lP)NeVk#i#2m?%#saRcO!n?4ELP-13i;v*`WCj`oPY)bT}NomSwr! zTcE0e_x=LdtE%e0D2lDM1=iY45%FOd9sw`FuJ?YLW!Ye*z&V!!Z`Ru5D2hH*^#FJR zE|Vmg$!~C;=VK9>03k2~#>SXiRSiVM11uG^;5whcjxpxF{^(r6IhS_86>#2!J120? zrK)<}0iPOUuG;krg1+#A;4ko8V6EK;9$N61s-DDge6tLOpChX3VMph)Rq$LOB1xaI so2k2Q0C%eT90b91G#Wjw1OH3D0d_HXv74Wf=g#o#;Oi1emML#IzPk1^=YzfT%O3B%WxLdb zu`ex6Y10}jv5BGui~(1--P)TU?;_TG>NVrL`cSEbKYuOv-*Keptj@$aVL&%Bc)I$z JtaD0e0sve*WHUKAa97EW-zCWk=rGL=Fl0)d@n8yzrtp!uPZxWM2no-e zKWY8$@;d)=y9eG!R=Y(`%Zt!nDz>jY?xXBKMthDI=OaR|PMrB!VY0w-jjl3(VGqsk z4CfgCaSO`sTEs8lWRdK{_P{Jzug5TRl1kYoC->Ov-p}ud9>}_qwPtJf+OM@5es+Og zHyLg)Wv~~WJ~MmcO=$)Oua!&=r_P8qBtO&Xd%W}NAAvwW7su&8XRxb2bPSRVG*}1p O41=eupUXO@geCxf5M?I- literal 0 HcmV?d00001 diff --git a/addons/data_manager/icons/icon_move_down.png.import b/addons/data_manager/icons/icon_move_down.png.import new file mode 100644 index 0000000..a1ce6de --- /dev/null +++ b/addons/data_manager/icons/icon_move_down.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon_move_down.png-0a5c510c5cd06b571858d1b2cf7a95cf.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/data_manager/icons/icon_move_down.png" +dest_files=[ "res://.import/icon_move_down.png-0a5c510c5cd06b571858d1b2cf7a95cf.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/data_manager/icons/icon_move_up.png b/addons/data_manager/icons/icon_move_up.png new file mode 100644 index 0000000000000000000000000000000000000000..684013dc4046f14021fb5ae2637be66c363e88b8 GIT binary patch literal 269 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_KJY5_^ zEPCHgwC8Iw5NWUPFVR+4FkCptLGQu2BM&UUsHn*uI>{?k_J}uTmtaN}+jBed4vt$A z|8weYSO49szh3u)_pWufx8?5snEK*oqoG>zvq>FHX>r<1Pfce%Hbdk9r^AiydS~_o zdCgsZGvU^TYiFVdQ&MBb@0MO5EjQ{`u literal 0 HcmV?d00001 diff --git a/addons/data_manager/icons/icon_move_up.png.import b/addons/data_manager/icons/icon_move_up.png.import new file mode 100644 index 0000000..ac214cc --- /dev/null +++ b/addons/data_manager/icons/icon_move_up.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon_move_up.png-8bbd78f84e89d3ab25e3b699f6e3ba8d.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/data_manager/icons/icon_move_up.png" +dest_files=[ "res://.import/icon_move_up.png-8bbd78f84e89d3ab25e3b699f6e3ba8d.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/data_manager/icons/icon_multi_line.png b/addons/data_manager/icons/icon_multi_line.png new file mode 100644 index 0000000000000000000000000000000000000000..95a029cc6e52396d5f7f22d5a069bf94a78b1d2a GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_Ro-U3d z7QM*{3j_>|3=9lxDn2~0*JI`4;QWRUxX^PLB{`Q{6ZHb(6%?{J zLZr$e#|T|6>=`EG1eAQ}Mfb1%^{cBI_JrF-h)8hG2|$c742Q$7uDGnZQPr`CjMDb9 z&f?rv5*?}PxYI!*?g0ZHfK%W&(Mwh2_d+wefVEw0A^O0*%WxMh|Okmw_dOFl>M%8XK7|rGb`#6DyZrV*y?i! z<{^Z-OSM2*mS-`>H(JBhfoNtIRVV7;7~^3QjKGYa;i+u{^Tavl+(D;wbCgA7qN=8< mmRgL6obMdvHvamV_Qp4&vXm;#cB%LP0000o?b9VrCmJ|({`9MlJ6Zxhblma-i)>f^x)eyoVfL8!b z=iIGQsuIn?D2lpsh?#e#lyAAFo5^JI7(y5VXfpHZqLGL?nY}1L0DxMp_U^sE1OOpK zN91Ok0AQ_sSh63SbN89u5?brN*4hJD0f0D;KeX2UpFknR;+P_i<1+xG+1kE9+hJvQ`DHHM@5wSn=*z2Zbz=YTwY_xOf*U^8ayAto+?_62Nme`&#WOZHQNN^Pf#iQ=p!@*PDo_wTNB z`G26g{^Pyl5AQ7BI^nwYbGgeArf>X}tfq=2Kl>dri6zVXc(CVG@3_e_LMk7m4UT=t zJ9z2ra|@e8vmS(A-^#S0^Tpmsh6l^G{?k~xs3YckNx+deqC!fSj!5L*-o~@wB&X8Z z`p1zjOdDdFXEI;3Xp&WNH7I_u>)fp!vD7&&#U+PEYc=y(QCS3j3^P6dwi~%Kh4i<{p+ma-uXKi<*sR!WWJfO5a void: + var entry_container : Control = $ScrollContainer/VBoxContainer + + for ch in entry_container.get_children(): + ch.queue_free() + + var dir : Directory = Directory.new() + + var label_str : String = "= " + get_module_label_text(_module) + " =" + window_title = "Add folder(s) for " + label_str + + var module_dir_base : String = _module.resource_path.get_base_dir() + + for f in _settings.folders: + if dir.dir_exists(module_dir_base + "/" + f.folder): + continue + + var ecb : CheckBox = CheckBox.new() + ecb.text = f.folder + " (" + f.type + ")" + ecb.set_meta("folder", f.folder) + entry_container.add_child(ecb) + +func on_confirmed() -> void: + var entry_container : Control = $ScrollContainer/VBoxContainer + + var dir : Directory = Directory.new() + var module_dir_base : String = _module.resource_path.get_base_dir() + + for c in entry_container.get_children(): + if !(c is CheckBox): + continue + + if !c.pressed: + continue + + var folder : String = c.get_meta("folder") + var d : String = module_dir_base + "/" + folder + if !dir.dir_exists(d): + dir.make_dir(d) + + emit_signal("folders_created") + +func set_module(module, settings : DataManagerAddonSettings) -> void: + _module = module + _settings = settings + setup() + #popup_centered() + + popup_centered() + +func get_module_label_text(module) -> String: + var label_str : String = module.resource_name + + if label_str == "": + label_str = module.resource_path + label_str = label_str.replace("res://", "") + label_str = label_str.replace("/game_module.tres", "") + label_str = label_str.replace("game_module.tres", "") + + return label_str diff --git a/addons/data_manager/panels/CreateNamePopup.gd b/addons/data_manager/panels/CreateNamePopup.gd new file mode 100644 index 0000000..b8a6bf7 --- /dev/null +++ b/addons/data_manager/panels/CreateNamePopup.gd @@ -0,0 +1,64 @@ +tool +extends ConfirmationDialog + +signal ok_pressed + +export(NodePath) var line_edit_path : NodePath +export(NodePath) var option_button_path : NodePath + +var _resource_type : String + +var _line_edit : LineEdit +var _option_button : OptionButton + +func _ready(): + _line_edit = get_node(line_edit_path) as LineEdit + _option_button = get_node(option_button_path) as OptionButton + + connect("confirmed", self, "_on_OK_pressed") + connect("about_to_show", self, "about_to_show") + +func set_resource_type(resource_type : String) -> void: + _resource_type = resource_type + + +func about_to_show(): + _option_button.clear() + + if not ClassDB.class_exists(_resource_type): + return + + var arr : PoolStringArray = PoolStringArray() + arr.append(_resource_type) + arr.append_array(ClassDB.get_inheriters_from_class(_resource_type)) + + var gsc : Array = ProjectSettings.get("_global_script_classes") + + var l : int = arr.size() - 1 + + while (arr.size() != l): + l = arr.size() + + for i in range(gsc.size()): + var d : Dictionary = gsc[i] as Dictionary + + var found = false + for j in range(arr.size()): + if arr[j] == d["class"]: + found = true + break + + if found: + continue + + for j in range(arr.size()): + if arr[j] == d["base"]: + arr.append(d["class"]) + + for a in arr: + _option_button.add_item(a) + + +func _on_OK_pressed(): + emit_signal("ok_pressed", _line_edit.text, _option_button.get_item_text(_option_button.selected)) + hide() diff --git a/addons/data_manager/panels/CreateNamePopup.tscn b/addons/data_manager/panels/CreateNamePopup.tscn new file mode 100644 index 0000000..03129d6 --- /dev/null +++ b/addons/data_manager/panels/CreateNamePopup.tscn @@ -0,0 +1,58 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://addons/data_manager/panels/CreateNamePopup.gd" type="Script" id=1] + + +[node name="CreateNamePopup" type="ConfirmationDialog"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -245.5 +margin_top = -125.5 +margin_right = 245.5 +margin_bottom = 125.5 +window_title = "Create New Resource" +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} +line_edit_path = NodePath("VBoxContainer/LineEdit") +option_button_path = NodePath("VBoxContainer/OptionButton") + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +margin_left = 8.0 +margin_top = 8.0 +margin_right = 483.0 +margin_bottom = 215.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label2" type="Label" parent="VBoxContainer"] +margin_right = 449.0 +margin_bottom = 25.0 +size_flags_horizontal = 3 +text = "Type" + +[node name="OptionButton" type="OptionButton" parent="VBoxContainer"] +margin_top = 33.0 +margin_right = 449.0 +margin_bottom = 70.0 +size_flags_horizontal = 3 + +[node name="Label" type="Label" parent="VBoxContainer"] +margin_top = 78.0 +margin_right = 449.0 +margin_bottom = 103.0 +size_flags_horizontal = 3 +text = "Name" + +[node name="LineEdit" type="LineEdit" parent="VBoxContainer"] +margin_top = 111.0 +margin_right = 449.0 +margin_bottom = 156.0 +size_flags_horizontal = 3 +caret_blink = true diff --git a/addons/data_manager/panels/EntryButton.gd b/addons/data_manager/panels/EntryButton.gd new file mode 100644 index 0000000..80913e3 --- /dev/null +++ b/addons/data_manager/panels/EntryButton.gd @@ -0,0 +1,93 @@ +tool +extends Control + +signal inspect_data +signal duplicate +signal delete + +export(PackedScene) var spatial_preview : PackedScene +export(PackedScene) var node2d_preview : PackedScene +export(PackedScene) var control_preview : PackedScene +export(PackedScene) var texture_preview : PackedScene + +export(NodePath) var main_button_path : NodePath + +var _main_button : Button + +var _preview : Node +var _data : Resource + +func _ready(): + _main_button = get_node(main_button_path) as Button + +func set_resource(data : Resource) -> void: + _data = data + + _main_button.set_resource(data) + + var name_text : String = "" + + if data.has_method("get_id"): + name_text += str(data.get_id()) + " - " + + if data.has_method("get_text_name"): + name_text += str(data.get_text_name()) + else: + if data.resource_name != "": + name_text += data.resource_name + else: + name_text += data.resource_path + + if data.has_method("get_rank"): + name_text += " - Rank " + str(data.get_rank()) + + if data is Texture: + _preview = texture_preview.instance() + add_child(_preview) + _preview.owner = self + move_child(_preview, 0) + + _preview.set_texture(data as Texture) + elif data is PackedScene: + var n : Node = data.instance() + + if _preview != null: + _preview.queue_free() + + if n is Spatial: + _preview = spatial_preview.instance() + add_child(_preview) + _preview.owner = self + move_child(_preview, 0) + + _preview.preview(n as Spatial) + elif n is Node2D: + _preview = node2d_preview.instance() + add_child(_preview) + _preview.owner = self + move_child(_preview, 0) + + _preview.preview(n as Node2D) + elif n is Control: + _preview = control_preview.instance() + add_child(_preview) + _preview.owner = self + move_child(_preview, 0) + + _preview.preview(n as Control) + else: + n.queue_free() + + _main_button.text = name_text + +func can_drop_data(position, data): + return false + +func inspect(): + emit_signal("inspect_data", _data) + +func duplicate_data(): + emit_signal("duplicate", _data) + +func delete(): + emit_signal("delete", _data) diff --git a/addons/data_manager/panels/HistoryEntry.gd b/addons/data_manager/panels/HistoryEntry.gd new file mode 100644 index 0000000..a60afea --- /dev/null +++ b/addons/data_manager/panels/HistoryEntry.gd @@ -0,0 +1,41 @@ +tool +extends Button + +signal history_entry_selected + +var data : Resource setget set_data#, get_data + +func _pressed() -> void: + emit_signal("history_entry_selected", data) + +func set_data(pdata: Resource) -> void: + data = pdata + + var s : String = "(" + data.get_class() + ") " + + if data.has_method("get_id"): + s += str(data.get_id()) + " - " + + if data.has_method("get_text_name"): + s += str(data.get_text_name()) + elif data.has_method("get_name"): + s += str(data.get_name()) + + if data.has_method("get_rank"): + s += " (R " + str(data.get_rank()) + ")" + + text = s + +func get_data() -> Resource: + return data + +func get_drag_data(position): + if data == null: + return null + + var d : Dictionary = Dictionary() + d["type"] = "resource" + d["resource"] = data + d["from"] = self + + return d diff --git a/addons/data_manager/panels/HistoryEntry.tscn b/addons/data_manager/panels/HistoryEntry.tscn new file mode 100644 index 0000000..8bc48dc --- /dev/null +++ b/addons/data_manager/panels/HistoryEntry.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://addons/data_manager/panels/HistoryEntry.gd" type="Script" id=1] + +[node name="HistoryEntry" type="Button"] +margin_right = 236.0 +margin_bottom = 37.0 +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/addons/data_manager/panels/MainPanel.gd b/addons/data_manager/panels/MainPanel.gd new file mode 100644 index 0000000..7821cf2 --- /dev/null +++ b/addons/data_manager/panels/MainPanel.gd @@ -0,0 +1,221 @@ +tool +extends Control + +const DataManagerAddonSettings = preload("res://addons/data_manager/resources/data_manager_addon_settings.gd") +const add_icon = preload("res://addons/data_manager/icons/icon_add.png") + +signal inspect_data + +export(PackedScene) var resource_scene : PackedScene +export(String) var base_folder : String = "res://" +export(NodePath) var main_container : NodePath +export(NodePath) var module_entry_container_path : NodePath +export(NodePath) var folder_entry_container_path : NodePath + +var _main_container : Node +var _resource_scene : Node +var _module_entry_container : Node +var _folder_entry_container : Node + +var _modules : Array = Array() +var _active_modules : Array = Array() +var _settings : DataManagerAddonSettings = null + +var _initialized : bool = false +var _plugin : EditorPlugin = null + +func _enter_tree(): + if !is_connected("visibility_changed", self, "on_visibility_changed"): + connect("visibility_changed", self, "on_visibility_changed") + + if !$Popups/AddFolderDialog.is_connected("folders_created", self, "on_folders_created"): + $Popups/AddFolderDialog.connect("folders_created", self, "on_folders_created") + +func on_visibility_changed(): + if _plugin && is_visible_in_tree() && !_initialized: + _initialized = true + load_data() + +func load_data(): + var dir : Directory = Directory.new() + + _settings = _plugin.settings + + _main_container = get_node(main_container) + + _resource_scene = resource_scene.instance() + _main_container.add_child(_resource_scene) + _resource_scene.owner = _main_container + _resource_scene.connect("inspect_data", self, "inspect_data") + _resource_scene.connect("edit_settings", self, "edit_settings") + + _module_entry_container = get_node(module_entry_container_path) + _folder_entry_container = get_node(folder_entry_container_path) + + generate_module_entry_list() + +func generate_module_entry_list() -> void: + for ch in _folder_entry_container.get_children(): + ch.queue_free() + + load_modules() + + for m in _modules: + var label_str : String = get_module_label_text(m) + + var b : Button = Button.new() + b.toggle_mode = true + b.text = label_str + b.set_h_size_flags(SIZE_EXPAND_FILL) + b.connect("toggled", self, "on_module_entry_button_toggled", [ m ]) + _module_entry_container.add_child(b) + +func generate_folder_entry_list() -> void: + for ch in _folder_entry_container.get_children(): + ch.queue_free() + + var dir : Directory = Directory.new() + + for i in range(_active_modules.size()): + var module = _active_modules[i] + + if i > 0: + _folder_entry_container.add_child(HSeparator.new()) + + var label_str : String = "= " + get_module_label_text(module) + " =" + var mlabel : Label = Label.new() + mlabel.text = label_str + mlabel.align = HALIGN_CENTER + mlabel.valign = VALIGN_CENTER + _folder_entry_container.add_child(mlabel) + var module_dir_base : String = module.resource_path.get_base_dir() + + var index = 0 + for j in range(_settings.get_folder_count()): + var f = _settings.folder_get(j) + var full_folder_path : String = module_dir_base + "/" + f.folder + + if !dir.dir_exists(full_folder_path): + continue + + if f.header != "": + var h : Label = Label.new() + + _folder_entry_container.add_child(h) + h.text = f.header + + var fe : Button = Button.new() + fe.text = f.name + fe.connect("pressed", self, "on_folder_entry_button_pressed", [ module, full_folder_path, j ]) + _folder_entry_container.add_child(fe) + + index += 1 + + var bsep : Label = Label.new() + bsep.text = "Actions" + _folder_entry_container.add_child(bsep) + + var add_folder_button : Button = Button.new() + add_folder_button.text = "Add Folder" + add_folder_button.icon = add_icon + _folder_entry_container.add_child(add_folder_button) + add_folder_button.connect("pressed", self, "on_add_folder_button_pressed", [ module ]) + + #set_tab(0) + +func on_folder_entry_button_pressed(module, full_folder_path : String, folder_index : int) -> void: + #_resource_scene.show() + _resource_scene.set_resource_type(full_folder_path, _settings.folder_get_type(folder_index)) + +func on_module_entry_button_toggled(on : bool, module) -> void: + if on: + for m in _active_modules: + if m == module: + return + + _active_modules.push_back(module) + generate_folder_entry_list() + else: + for i in range(_active_modules.size()): + if _active_modules[i] == module: + _active_modules.remove(i) + generate_folder_entry_list() + return + +func on_add_folder_button_pressed(module) -> void: + $Popups/AddFolderDialog.set_module(module, _settings) + +func load_modules() -> void: + _modules.clear() + load_modules_at("res://") + _modules.sort_custom(ModulePathSorter, "sort_ascending") + +func load_modules_at(path : String) -> void: + var dir = Directory.new() + if dir.open(path) == OK: + dir.list_dir_begin() + var file_name = dir.get_next() + while file_name != "": + if file_name == "." or file_name == "..": + file_name = dir.get_next() + continue + + if dir.current_is_dir(): + if path == "res://": + load_modules_at(path + file_name) + else: + load_modules_at(path + "/" + file_name) + else: + if file_name == "game_module.tres": + var res : Resource = null + + if path == "res://": + res = ResourceLoader.load(path + file_name) + else: + res = ResourceLoader.load(path + "/" + file_name) + + if res.enabled: + _modules.append(res) + + file_name = dir.get_next() + else: + print("An error occurred when trying to access the path: " + path) + +class ModulePathSorter: + static func sort_ascending(a, b): + if a.resource_path < b.resource_path: + return true + return false + +func set_tab(tab_index : int) -> void: + hide_all() + + _resource_scene.show() + _resource_scene.set_resource_type(_settings.folder_get_folder(tab_index), _settings.folder_get_type(tab_index)) + +func hide_all() -> void: + _resource_scene.hide() + +func inspect_data(var data : Resource) -> void: + emit_signal("inspect_data", data) + +func edit_settings() -> void: + emit_signal("inspect_data", _settings) + + +func set_plugin(plugin : EditorPlugin) -> void: + _plugin = plugin + +func get_module_label_text(module) -> String: + var label_str : String = module.resource_name + + if label_str == "": + label_str = module.resource_path + label_str = label_str.replace("res://", "") + label_str = label_str.replace("/game_module.tres", "") + label_str = label_str.replace("game_module.tres", "") + + return label_str + +func on_folders_created() -> void: + generate_folder_entry_list() diff --git a/addons/data_manager/panels/MainPanel.tscn b/addons/data_manager/panels/MainPanel.tscn new file mode 100644 index 0000000..ce15728 --- /dev/null +++ b/addons/data_manager/panels/MainPanel.tscn @@ -0,0 +1,98 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://addons/data_manager/panels/MainPanel.gd" type="Script" id=1] +[ext_resource path="res://addons/data_manager/panels/ResourcePanel.tscn" type="PackedScene" id=3] +[ext_resource path="res://addons/data_manager/panels/AddFolderDialog.gd" type="Script" id=4] + +[node name="Panel" type="MarginContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource( 1 ) +resource_scene = ExtResource( 3 ) +base_folder = "res://data/" +main_container = NodePath("HSplitContainer/MarginContainer") +module_entry_container_path = NodePath("HSplitContainer/TabContainer/Modules/VBoxContainer") +folder_entry_container_path = NodePath("HSplitContainer/TabContainer/Folders/VBoxContainer") + +[node name="HSplitContainer" type="HSplitContainer" parent="."] +margin_right = 1024.0 +margin_bottom = 600.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +split_offset = 210 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="TabContainer" type="TabContainer" parent="HSplitContainer"] +margin_right = 218.0 +margin_bottom = 600.0 + +[node name="Modules" type="ScrollContainer" parent="HSplitContainer/TabContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 4.0 +margin_top = 32.0 +margin_right = -4.0 +margin_bottom = -4.0 +size_flags_vertical = 3 +scroll_horizontal_enabled = false + +[node name="VBoxContainer" type="VBoxContainer" parent="HSplitContainer/TabContainer/Modules"] +margin_right = 210.0 +size_flags_horizontal = 3 + +[node name="Folders" type="ScrollContainer" parent="HSplitContainer/TabContainer"] +visible = false +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 4.0 +margin_top = 32.0 +margin_right = -4.0 +margin_bottom = -4.0 +size_flags_vertical = 3 +scroll_horizontal_enabled = false + +[node name="VBoxContainer" type="VBoxContainer" parent="HSplitContainer/TabContainer/Folders"] +margin_right = 210.0 +size_flags_horizontal = 3 + +[node name="MarginContainer" type="MarginContainer" parent="HSplitContainer"] +margin_left = 230.0 +margin_right = 1024.0 +margin_bottom = 600.0 + +[node name="Popups" type="Control" parent="."] +margin_right = 1024.0 +margin_bottom = 600.0 +mouse_filter = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +__meta__ = { +"_edit_lock_": true +} + +[node name="AddFolderDialog" type="ConfirmationDialog" parent="Popups"] +margin_left = 287.0 +margin_top = 100.0 +margin_right = 751.0 +margin_bottom = 447.0 +window_title = "Add folder(s)" +resizable = true +script = ExtResource( 4 ) + +[node name="ScrollContainer" type="ScrollContainer" parent="Popups/AddFolderDialog"] +margin_left = 8.0 +margin_top = 8.0 +margin_right = 456.0 +margin_bottom = 311.0 +scroll_horizontal_enabled = false +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="Popups/AddFolderDialog/ScrollContainer"] +margin_right = 448.0 +size_flags_horizontal = 3 diff --git a/addons/data_manager/panels/ResourcePanel.gd b/addons/data_manager/panels/ResourcePanel.gd new file mode 100644 index 0000000..57eaab4 --- /dev/null +++ b/addons/data_manager/panels/ResourcePanel.gd @@ -0,0 +1,299 @@ +tool +extends Control + +signal inspect_data +signal edit_settings + +export(PackedScene) var resource_row_scene : PackedScene +export(PackedScene) var history_row_scene : PackedScene + +export(NodePath) var entry_container_path : NodePath + +export(NodePath) var name_popup_path : NodePath +export(NodePath) var create_popup_path : NodePath +export(NodePath) var delete_popup_path : NodePath + +export(NodePath) var history_container_path : NodePath + +var _filter_term : String + +var _entry_container : Node +var _name_popup : Node +var _create_popup : ConfirmationDialog +var _delete_popup : ConfirmationDialog + +var _history_container : Node + +var _folder : String +var _resource_type : String + +var _queue_deleted : Resource + +var _state : Dictionary +var _states : Dictionary + +func _ready(): + _history_container = get_node(history_container_path) + + _entry_container = get_node(entry_container_path) + _name_popup = get_node(name_popup_path) + _name_popup.connect("ok_pressed", self, "ok_pressed") + + _create_popup = get_node(create_popup_path) + _delete_popup = get_node(delete_popup_path) + +func set_resource_type(folder : String, resource_type : String) -> void: + if !folder.ends_with("/"): + folder += "/" + + if folder == _folder and _resource_type == resource_type: + return + + _states[_folder + "," + _resource_type] = _state + + if _states.has(folder + "," + resource_type): + _state = _states[folder + "," + resource_type] + else: + _state = Dictionary() + + _folder = folder + _resource_type = resource_type + +# _filter_term = "" + + _create_popup.set_resource_type(resource_type) + + refresh() + +func refresh() -> void: + for ch in _entry_container.get_children(): + ch.queue_free() + + var dir : Directory = Directory.new() + + if dir.open(_folder) == OK: + dir.list_dir_begin() + var data_array : Array = Array() + + var file_name = dir.get_next() + + while (file_name != ""): + if not dir.current_is_dir(): + + if ResourceLoader.exists(_folder + file_name, _resource_type): + + var res = ResourceLoader.load(_folder + file_name, _resource_type) + + if _filter_term != "": + var ftext : String = "" + + if res.has_method("get_text_name"): + ftext = res.get_text_name() + + if ftext == "": + if res.resource_name != "": + ftext = res.resource_name + else: + ftext = res.resource_path + + ftext = ftext.to_lower() + + if ftext.find(_filter_term) == -1: + file_name = dir.get_next() + continue + + var id : int = 0 + + if res.has_method("get_id"): + id = res.get_id() + + data_array.append({ + "id": id, + "resource": res + }) + + file_name = dir.get_next() + + data_array.sort_custom(self, "sort_entries") + + for d in data_array: + + var resn : Node = resource_row_scene.instance() + + _entry_container.add_child(resn) + resn.owner = _entry_container + resn.set_resource(d["resource"]) + resn.connect("inspect_data", self, "inspect_data") + resn.connect("duplicate", self, "duplicate_data") + resn.connect("delete", self, "delete") + +func inspect_data(var data : Resource) -> void: + var found : bool = false + + for ch in _history_container.get_children(): + if ch.data == data: + found = true + + _history_container.move_child(ch, 0) + + break + + if not found: + var n : Node = history_row_scene.instance() + + _history_container.add_child(n) + _history_container.move_child(n, 0) + n.owner = _history_container + + n.data = data + n.connect("history_entry_selected", self, "inspect_data") + + if _history_container.get_child_count() > 20: + var ch : Node = _history_container.get_child(_history_container.get_child_count() - 1) + + ch.queue_free() + + emit_signal("inspect_data", data) + +func ok_pressed(res_name: String, pclass_name: String) -> void: + + var d : Directory = Directory.new() + + if d.open(_folder) == OK: + d.list_dir_begin() + + var file_name = d.get_next() + + var max_ind : int = 0 + + while (file_name != ""): + + if not d.current_is_dir(): + + var curr_ind : int = int(file_name.split("_")[0]) + + if curr_ind > max_ind: + max_ind = curr_ind + + file_name = d.get_next() + + max_ind += 1 + + var newfname : String = str(res_name) + newfname = newfname.replace(" ", "_") + newfname = newfname.to_lower() + newfname = str(max_ind) + "_" + newfname + ".tres" + + var res : Resource = null + + if ClassDB.class_exists(pclass_name) and ClassDB.can_instance(pclass_name): + res = ClassDB.instance(pclass_name) + else: + var gsc : Array = ProjectSettings.get("_global_script_classes") + + for i in range(gsc.size()): + var gsce : Dictionary = gsc[i] as Dictionary + + if gsce["class"] == pclass_name: + var script : Script = load(gsce["path"]) + + res = script.new() + + break + + if res == null: + print("ESSData: Error in creating resource type " + pclass_name) + return + + if res.has_method("set_id"): + res.set_id(max_ind) + + if res.has_method("set_text_name"): + res.set_text_name(str(res_name)) + + ResourceSaver.save(_folder + newfname, res) + + refresh() + +func duplicate_data(data): + if not data is Resource: + return + + var d : Directory = Directory.new() + + if d.open(_folder) == OK: + d.list_dir_begin() + + var file_name = d.get_next() + + var max_ind : int = 0 + + while (file_name != ""): + + if not d.current_is_dir(): + + var curr_ind : int = int(file_name.split("_")[0]) + + if curr_ind > max_ind: + max_ind = curr_ind + + file_name = d.get_next() + + max_ind += 1 + + var res_name : String = "" + + if data.has_method("get_text_name"): + res_name = data.get_text_name() + + var newfname : String = res_name + newfname = newfname.replace(" ", "_") + newfname = newfname.to_lower() + newfname = str(max_ind) + "_" + newfname + ".tres" + + var res : Resource = data.duplicate() + + if res.has_method("set_id"): + res.set_id(max_ind) + + if res.has_method("set_text_name"): + res.set_text_name(str(res_name)) + + ResourceSaver.save(_folder + newfname, res) + + refresh() + +func delete(data): + if data == null or data as Resource == null: + return + + _queue_deleted = data as Resource + + _delete_popup.popup_centered() + +func delete_confirm(): + if _queue_deleted == null: + return + + var d : Directory = Directory.new() + d.remove(_queue_deleted.resource_path) + + _queue_deleted = null + + refresh() + +func clear_history() -> void: + for ch in _history_container.get_children(): + ch.queue_free() + +func search(text : String) -> void: + _filter_term = text.to_lower() + + refresh() + +func sort_entries(a, b): + return a["id"] < b["id"] + + +func edit_settings(): + emit_signal("edit_settings") diff --git a/addons/data_manager/panels/ResourcePanel.tscn b/addons/data_manager/panels/ResourcePanel.tscn new file mode 100644 index 0000000..365039f --- /dev/null +++ b/addons/data_manager/panels/ResourcePanel.tscn @@ -0,0 +1,123 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://addons/data_manager/panels/CreateNamePopup.tscn" type="PackedScene" id=1] +[ext_resource path="res://addons/data_manager/panels/ResourceRow.tscn" type="PackedScene" id=2] +[ext_resource path="res://addons/data_manager/panels/HistoryEntry.tscn" type="PackedScene" id=3] +[ext_resource path="res://addons/data_manager/icons/icon_add.png" type="Texture" id=4] +[ext_resource path="res://addons/data_manager/panels/ResourcePanel.gd" type="Script" id=5] +[ext_resource path="res://addons/data_manager/icons/icon_empty.png" type="Texture" id=6] +[ext_resource path="res://addons/data_manager/icons/icon_reload_small.png" type="Texture" id=7] + +[node name="Panel" type="Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 +script = ExtResource( 5 ) +resource_row_scene = ExtResource( 2 ) +history_row_scene = ExtResource( 3 ) +entry_container_path = NodePath("ResourcePanel/VBoxContainer2/ScrollContainer2/VBoxContainer") +name_popup_path = NodePath("CreateNamePopup") +create_popup_path = NodePath("CreateNamePopup") +delete_popup_path = NodePath("DeletePopup") +history_container_path = NodePath("ResourcePanel/VBoxContainer/ScrollContainer/VBoxContainer") + +[node name="ResourcePanel" type="HSplitContainer" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +split_offset = 500 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer2" type="VBoxContainer" parent="ResourcePanel"] +margin_right = 600.0 +margin_bottom = 600.0 + +[node name="LineEdit" type="LineEdit" parent="ResourcePanel/VBoxContainer2"] +margin_right = 600.0 +margin_bottom = 26.0 +right_icon = ExtResource( 6 ) +placeholder_text = "Filter" +caret_blink = true + +[node name="CreateButton" type="Button" parent="ResourcePanel/VBoxContainer2"] +margin_top = 30.0 +margin_right = 600.0 +margin_bottom = 50.0 +rect_min_size = Vector2( 100, 0 ) +text = "Create" +icon = ExtResource( 4 ) +expand_icon = true + +[node name="HSeparator" type="HSeparator" parent="ResourcePanel/VBoxContainer2"] +margin_top = 54.0 +margin_right = 600.0 +margin_bottom = 58.0 +size_flags_horizontal = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ScrollContainer2" type="ScrollContainer" parent="ResourcePanel/VBoxContainer2"] +margin_top = 62.0 +margin_right = 600.0 +margin_bottom = 600.0 +size_flags_vertical = 3 + +[node name="VBoxContainer" type="VBoxContainer" parent="ResourcePanel/VBoxContainer2/ScrollContainer2"] +margin_right = 600.0 +size_flags_horizontal = 3 + +[node name="VBoxContainer" type="VBoxContainer" parent="ResourcePanel"] +margin_left = 612.0 +margin_right = 1024.0 +margin_bottom = 600.0 + +[node name="Settings" type="Button" parent="ResourcePanel/VBoxContainer"] +margin_right = 412.0 +margin_bottom = 20.0 +size_flags_horizontal = 3 +text = "Settings" + +[node name="Button" type="Button" parent="ResourcePanel/VBoxContainer"] +margin_top = 24.0 +margin_right = 412.0 +margin_bottom = 44.0 +size_flags_horizontal = 3 +text = "Clear History" +icon = ExtResource( 7 ) + +[node name="HSeparator" type="HSeparator" parent="ResourcePanel/VBoxContainer"] +margin_top = 48.0 +margin_right = 412.0 +margin_bottom = 52.0 +size_flags_horizontal = 3 + +[node name="ScrollContainer" type="ScrollContainer" parent="ResourcePanel/VBoxContainer"] +margin_top = 56.0 +margin_right = 412.0 +margin_bottom = 600.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="VBoxContainer" type="VBoxContainer" parent="ResourcePanel/VBoxContainer/ScrollContainer"] +margin_right = 412.0 +size_flags_horizontal = 3 + +[node name="CreateNamePopup" parent="." instance=ExtResource( 1 )] + +[node name="DeletePopup" type="ConfirmationDialog" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -139.0 +margin_top = -55.0 +margin_right = 139.0 +margin_bottom = 55.0 +dialog_text = "Delete?" + +[connection signal="text_entered" from="ResourcePanel/VBoxContainer2/LineEdit" to="." method="search"] +[connection signal="pressed" from="ResourcePanel/VBoxContainer2/CreateButton" to="CreateNamePopup" method="popup"] +[connection signal="pressed" from="ResourcePanel/VBoxContainer/Settings" to="." method="edit_settings"] +[connection signal="pressed" from="ResourcePanel/VBoxContainer/Button" to="." method="clear_history"] +[connection signal="confirmed" from="DeletePopup" to="." method="delete_confirm"] diff --git a/addons/data_manager/panels/ResourceRow.tscn b/addons/data_manager/panels/ResourceRow.tscn new file mode 100644 index 0000000..801367c --- /dev/null +++ b/addons/data_manager/panels/ResourceRow.tscn @@ -0,0 +1,47 @@ +[gd_scene load_steps=9 format=2] + +[ext_resource path="res://addons/data_manager/previews/TexturePreview.tscn" type="PackedScene" id=1] +[ext_resource path="res://addons/data_manager/previews/ControlPreview.tscn" type="PackedScene" id=2] +[ext_resource path="res://addons/data_manager/previews/Node2DPreview.tscn" type="PackedScene" id=3] +[ext_resource path="res://addons/data_manager/previews/SpatialPreview.tscn" type="PackedScene" id=4] +[ext_resource path="res://addons/data_manager/panels/ResourceRowMainButton.gd" type="Script" id=5] +[ext_resource path="res://addons/data_manager/panels/EntryButton.gd" type="Script" id=6] +[ext_resource path="res://addons/data_manager/icons/icon_duplicate.png" type="Texture" id=7] +[ext_resource path="res://addons/data_manager/icons/icon_remove.png" type="Texture" id=8] + + +[node name="ResourceRow" type="HBoxContainer"] +margin_right = 634.0 +margin_bottom = 37.0 +rect_min_size = Vector2( 100, 0 ) +size_flags_horizontal = 3 +script = ExtResource( 6 ) +__meta__ = { +"_edit_use_anchors_": false +} +spatial_preview = ExtResource( 4 ) +node2d_preview = ExtResource( 3 ) +control_preview = ExtResource( 2 ) +texture_preview = ExtResource( 1 ) +main_button_path = NodePath("ResourceRowMainButton") + +[node name="ResourceRowMainButton" type="Button" parent="."] +margin_right = 570.0 +margin_bottom = 37.0 +size_flags_horizontal = 3 +script = ExtResource( 5 ) + +[node name="Button2" type="Button" parent="."] +margin_left = 574.0 +margin_right = 602.0 +margin_bottom = 37.0 +icon = ExtResource( 7 ) + +[node name="Button3" type="Button" parent="."] +margin_left = 606.0 +margin_right = 634.0 +margin_bottom = 37.0 +icon = ExtResource( 8 ) +[connection signal="pressed" from="ResourceRowMainButton" to="." method="inspect"] +[connection signal="pressed" from="Button2" to="." method="duplicate_data"] +[connection signal="pressed" from="Button3" to="." method="delete"] diff --git a/addons/data_manager/panels/ResourceRowMainButton.gd b/addons/data_manager/panels/ResourceRowMainButton.gd new file mode 100644 index 0000000..37177fc --- /dev/null +++ b/addons/data_manager/panels/ResourceRowMainButton.gd @@ -0,0 +1,18 @@ +tool +extends Button + +var _data : Resource + +func get_drag_data(position): + if _data == null: + return null + + var d : Dictionary = Dictionary() + d["type"] = "resource" + d["resource"] = _data + d["from"] = self + + return d + +func set_resource(data : Resource) -> void: + _data = data diff --git a/addons/data_manager/plugin.cfg b/addons/data_manager/plugin.cfg new file mode 100644 index 0000000..fae3f87 --- /dev/null +++ b/addons/data_manager/plugin.cfg @@ -0,0 +1,7 @@ +[plugin] + +name="Data Manager" +description="" +author="Relintai" +version="1.0" +script="plugin.gd" diff --git a/addons/data_manager/plugin.gd b/addons/data_manager/plugin.gd new file mode 100644 index 0000000..9fde282 --- /dev/null +++ b/addons/data_manager/plugin.gd @@ -0,0 +1,50 @@ +tool +extends EditorPlugin + +const DataManagerAddonSettings = preload("res://addons/data_manager/resources/data_manager_addon_settings.gd") +const _main_panel : PackedScene = preload("res://addons/data_manager/panels/MainPanel.tscn") + +var _script_icon : Texture = null + +var settings : DataManagerAddonSettings = null + +var _main_panel_instance : Control + +func _enter_tree(): + load_settings() + + _main_panel_instance = _main_panel.instance() as Control + _main_panel_instance.set_plugin(self) + _main_panel_instance.connect("inspect_data", self, "inspect_data") + + get_editor_interface().get_editor_viewport().add_child(_main_panel_instance) + + make_visible(false) + +func _exit_tree(): + _main_panel_instance.queue_free() + +func has_main_screen(): + return true + +func make_visible(visible): + if visible: + _main_panel_instance.show() + else: + _main_panel_instance.hide() + +func get_plugin_icon(): + if !_script_icon: + _script_icon = get_editor_interface().get_base_control().get_theme_icon("ThemeSelectAll", "EditorIcons") + + return _script_icon + +func get_plugin_name(): + return "Data" + +func inspect_data(var data : Resource) -> void: + get_editor_interface().inspect_object(data) + +func load_settings() -> void: + settings = DataManagerAddonSettings.new() + settings.load_from_project_settings() diff --git a/addons/data_manager/previews/ControlPreview.gd b/addons/data_manager/previews/ControlPreview.gd new file mode 100644 index 0000000..0758c3e --- /dev/null +++ b/addons/data_manager/previews/ControlPreview.gd @@ -0,0 +1,14 @@ +tool +extends ViewportContainer + +export(NodePath) var container_path : NodePath + +var _container : Node + +func _ready() -> void: + _container = get_node(container_path) + +func preview(n: Control) -> void: + _container.add_child(n) + n.owner = _container + diff --git a/addons/data_manager/previews/ControlPreview.tscn b/addons/data_manager/previews/ControlPreview.tscn new file mode 100644 index 0000000..aa1afa5 --- /dev/null +++ b/addons/data_manager/previews/ControlPreview.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://addons/data_manager/previews/ControlPreview.gd" type="Script" id=1] + + +[node name="ControlPreview" type="ViewportContainer"] +margin_right = 60.0 +margin_bottom = 60.0 +rect_min_size = Vector2( 60, 60 ) +rect_pivot_offset = Vector2( -198.876, -96.6558 ) +stretch = true +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} +container_path = NodePath("Viewport") + +[node name="Viewport" type="Viewport" parent="."] +size = Vector2( 500, 500 ) +own_world_3d = true +handle_input_locally = false +render_target_update_mode = 3 diff --git a/addons/data_manager/previews/Node2DPreview.gd b/addons/data_manager/previews/Node2DPreview.gd new file mode 100644 index 0000000..586b8d9 --- /dev/null +++ b/addons/data_manager/previews/Node2DPreview.gd @@ -0,0 +1,14 @@ +tool +extends ViewportContainer + +export(NodePath) var container_path : NodePath + +var _container : Node + +func _ready() -> void: + _container = get_node(container_path) + +func preview(n: Node2D) -> void: + _container.add_child(n) + n.owner = _container + diff --git a/addons/data_manager/previews/Node2DPreview.tscn b/addons/data_manager/previews/Node2DPreview.tscn new file mode 100644 index 0000000..3f0299a --- /dev/null +++ b/addons/data_manager/previews/Node2DPreview.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://addons/data_manager/previews/Node2DPreview.gd" type="Script" id=1] + + +[node name="Node2DPreview" type="ViewportContainer"] +margin_right = 60.0 +margin_bottom = 60.0 +rect_min_size = Vector2( 60, 60 ) +rect_pivot_offset = Vector2( -198.876, -96.6558 ) +stretch = true +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} +container_path = NodePath("Viewport") + +[node name="Viewport" type="Viewport" parent="."] +size = Vector2( 500, 500 ) +own_world_3d = true +handle_input_locally = false +render_target_update_mode = 3 + +[node name="Camera2D" type="Camera2D" parent="Viewport"] +current = true diff --git a/addons/data_manager/previews/SpatialPreview.gd b/addons/data_manager/previews/SpatialPreview.gd new file mode 100644 index 0000000..565cb9d --- /dev/null +++ b/addons/data_manager/previews/SpatialPreview.gd @@ -0,0 +1,14 @@ +tool +extends ViewportContainer + +export(NodePath) var container_path : NodePath + +var _container : Node + +func _ready() -> void: + _container = get_node(container_path) + +func preview(n: Spatial) -> void: + _container.add_child(n) + n.owner = _container + diff --git a/addons/data_manager/previews/SpatialPreview.tscn b/addons/data_manager/previews/SpatialPreview.tscn new file mode 100644 index 0000000..81de3f9 --- /dev/null +++ b/addons/data_manager/previews/SpatialPreview.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://addons/data_manager/previews/SpatialPreview.gd" type="Script" id=1] + + +[node name="SpatialPreview" type="ViewportContainer"] +margin_right = 60.0 +margin_bottom = 60.0 +rect_min_size = Vector2( 60, 60 ) +rect_pivot_offset = Vector2( -198.876, -96.6558 ) +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} +container_path = NodePath("Viewport") + +[node name="Viewport" type="Viewport" parent="."] +size = Vector2( 60, 60 ) +size_override_stretch = true +own_world_3d = true +handle_input_locally = false +render_target_update_mode = 3 + +[node name="Camera" type="Camera" parent="Viewport"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10.9828 ) +current = true + +[node name="DirectionalLight" type="DirectionalLight" parent="Viewport"] +transform = Transform( 0.276929, 0, -0.96089, 0, 1, 0, 0.96089, 0, 0.276929, -13.093, 0, 6.67786 ) diff --git a/addons/data_manager/previews/TexturePreview.gd b/addons/data_manager/previews/TexturePreview.gd new file mode 100644 index 0000000..5b50e16 --- /dev/null +++ b/addons/data_manager/previews/TexturePreview.gd @@ -0,0 +1,12 @@ +tool +extends TextureRect + +func set_texture(tex: Texture)-> void: + texture = tex + + if tex is PackerImageResource: + var t : ImageTexture = ImageTexture.new() + + t.create_from_image(tex.data, 0) + + texture = t diff --git a/addons/data_manager/previews/TexturePreview.tscn b/addons/data_manager/previews/TexturePreview.tscn new file mode 100644 index 0000000..1dabb99 --- /dev/null +++ b/addons/data_manager/previews/TexturePreview.tscn @@ -0,0 +1,13 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://addons/data_manager/previews/TexturePreview.gd" type="Script" id=1] + + +[node name="TexturePreview" type="TextureRect"] +margin_bottom = 37.0 +rect_min_size = Vector2( 50, 50 ) +expand = true +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/addons/data_manager/resources/data_manager_addon_settings.gd b/addons/data_manager/resources/data_manager_addon_settings.gd new file mode 100644 index 0000000..2701bc8 --- /dev/null +++ b/addons/data_manager/resources/data_manager_addon_settings.gd @@ -0,0 +1,231 @@ +tool +extends Resource + +class SettingEntry: + var folder : String = "" + var header : String = "" + var name : String = "" + var type : String = "" + +var folders : Array = Array() + +func get_folder_count() -> int: + return folders.size() + +func folder_get(index : int) -> SettingEntry: + return folders[index] + +func folder_get_folder(index : int) -> String: + return folders[index].folder + +func folder_get_header(index : int) -> String: + return folders[index].header + +func folder_get_name(index : int) -> String: + return folders[index].name + +func folder_get_type(index : int) -> String: + return folders[index].type + +func _get(property : StringName): + var sprop : String = property + + if sprop == "folder_count": + return folders.size() + + if sprop.begins_with("folders/"): + var sindex : String = sprop.get_slice("/", 1) + + if sindex == "": + return null + + var index : int = sindex.to_int() + + if index < 0 || index >= folders.size(): + return null + + var p : String = sprop.get_slice("/", 2) + + if p == "folder": + return folders[index].folder + elif p == "header": + return folders[index].header + elif p == "name": + return folders[index].name + elif p == "type": + return folders[index].type + else: + return null + + return null + +func _set(property : StringName, val) -> bool: + var sprop : String = property + + if property == "folder_count": + set_folder_count(val) + return true + + if sprop.begins_with("folders/"): + var sindex : String = sprop.get_slice("/", 1) + + if sindex == "": + return false + + var index : int = sindex.to_int() + + if index < 0: + return false + + if index >= folders.size(): + return false + + var p : String = sprop.get_slice("/", 2) + + if p == "folder": + folders[index].folder = val + return true + elif p == "header": + folders[index].header = val + return true + elif p == "name": + folders[index].name = val + return true + elif p == "type": + folders[index].type = val + return true + + return false + +func _get_property_list() -> Array: + var props : Array = Array() + + props.append({ + "name": "save", + "type": TYPE_NIL, + "hint": PROPERTY_HINT_BUTTON, + "hint_string": "save_to_project_settings", + }) + +# props.append({ +# "name": "convert_to_json", +# "type": TYPE_NIL, +# "hint": PROPERTY_HINT_BUTTON, +# "hint_string": "convert_to_json", +# }) +# +# props.append({ +# "name": "convert_from_json", +# "type": TYPE_NIL, +# "hint": PROPERTY_HINT_BUTTON, +# "hint_string": "convert_from_json", +# }) + + props.append({ + "name": "folder_count", + "type": TYPE_INT, + }) + + for i in range(folders.size()): + props.append({ + "name": "folders/" + str(i) + "/folder", + "type": TYPE_STRING, + }) + props.append({ + "name": "folders/" + str(i) + "/header", + "type": TYPE_STRING, + }) + props.append({ + "name": "folders/" + str(i) + "/name", + "type": TYPE_STRING, + }) + props.append({ + "name": "folders/" + str(i) + "/type", + "type": TYPE_STRING, + }) + + return props + +func apply_folder_size(val : int) -> void: + folders.resize(val) + + for i in range(folders.size()): + if !folders[i]: + folders[i] = SettingEntry.new() + +func set_folder_count(val : int) -> void: + apply_folder_size(val) + + emit_changed() + property_list_changed_notify() + +func convert_to_json() -> void: + var f : File = File.new() + + f.open("res://addons/data_manager/_data/settings.json", File.WRITE) + f.store_string(get_as_json()) + f.close() + + PLogger.log_message("Saved settings to res://addons/data_manager/_data/settings.json") + +func convert_from_json() -> void: + var f : File = File.new() + + if (!f.file_exists("res://addons/data_manager/_data/settings.json")): + PLogger.log_message("File res://addons/data_manager/_data/settings.json doesn't exist!") + return + + f.open("res://addons/data_manager/_data/settings.json", File.READ) + set_from_json(f.get_as_text()) + f.close() + + PLogger.log_message("Loaded settings from res://addons/data_manager/_data/settings.json") + +func get_as_json() -> String: + var arr : Array + + for i in range(folders.size()): + var s : SettingEntry = folders[i] + + var dict : Dictionary + + dict["folder"] = s.folder + dict["header"] = s.header + dict["name"] = s.name + dict["type"] = s.type + + arr.push_back(dict) + + return to_json(arr); + +func set_from_json(data : String) -> void: + var jpr : JSONParseResult = JSON.parse(data) + + if jpr.error != OK: + PLogger.log_message("DataManagerAddonSettings: set_from_json: Couldn't load data!"); + return + + var arr = jpr.result + + for i in range(arr.size()): + var dict : Dictionary = arr[i] + + var s : SettingEntry = SettingEntry.new() + + s.folder = dict["folder"] + s.header = dict["header"] + s.name = dict["name"] + s.type = dict["type"] + + folders.push_back(s) + +func save_to_project_settings() -> void: + ProjectSettings.set("addons/data_manager/folder_settings", get_as_json()) + +func load_from_project_settings() -> void: + if ProjectSettings.has_setting("addons/data_manager/folder_settings"): + var d : String = ProjectSettings.get("addons/data_manager/folder_settings") + + if d != "": + set_from_json(d) + diff --git a/default_env.tres b/default_env.tres new file mode 100644 index 0000000..4f08e8f --- /dev/null +++ b/default_env.tres @@ -0,0 +1,7 @@ +[gd_resource type="Environment3D" load_steps=2 format=2] + +[sub_resource type="ProceduralSky" id=1] + +[resource] +background_mode = 2 +background_sky = SubResource( 1 ) diff --git a/icon.png b/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..87f1f7549e0489d0758939152cd1f879f1e653b5 GIT binary patch literal 3218 zcmV;D3~lp?P)Px>Oi4sRRCt`-n|p9v)qTf5=iI$}?`o~pW3{W5wUUr5+ZZ>+Ha2kvrbE(n3@r>e z6xz@>Qyxj3Ng!!SGDBuM`Ku++LLq@nT^K`)n@5w-mPttloU|q-HU{G-mStPWl5IU# zZ>{!q?>+rvB_U}a+Lc#+^!wM&{r&Fm{Lb&5^EM0?_ip!zwaziOKi4c#X)IUXr zhJa}U`2Bta{8R|>nair-C4y4wCkpNv8X7`WRaGIS{Gt@%dkYzLUB_dZNKLyOdR{af z+a?x|lS-vBX-e&I9A~GfsHkYxU9O{ZmwkD8Id!2BE|=?)D!g2>F5+YG_y^U)9vBc;47$}R__lvMb9BoYY{$s_2=)Z9m#TtcZ$i1cA#8b(Q$y=7Sp4G&}6HZ^`fZnt|$as~zmxzN)? zGMQv`Yb(`NRTrg~%jLo}jM-Iy5Sv^G5tw0Es-knDl%oB_2{tJW7lQu2e#RRc(#LEO z=sbIt=8*|jYi^XG^KM5cm76LqdTYAf?vD%rb@QYNAu``660ul}H8yyphAt&xmr3wk zFK4^D3VPph9NJHvV$E2TN|%lh0x2YGHJxZQdeQnVoMXv7T`HBrBjz8QKF!72(Misn zIkV{d7kYa5SS*EC&X?iUG-C01Np*$gFo0!|Z6SH2M(ae3;W=UGLfE!V)xa=iGBfVb z5X54!QmP6pg8`IMIfYheE=D@Luq-Ppy|<@_m71QFCWXL`UIhk_QsU&G2_aao>2!5> zXV5ImqAD_il)3$oYZ*e5l81VlreP@u$R0kMQo}bq&XMS`3`IVXg%IE<*>nRqMP0fULgcE!bN|cZIf5y zDP2b?mGg@lQnJzQNjs=z`0BYJh2T2F!?g-DBmcM)%Au?*_m<4-1dW<%l8ZRBbh2{k zCO>yvE#I+8+JSdr<6Wu&{MFU;*qQaTs|87=Fe)nY`lP%DFin$wj~lzhN6)1~cQQdR z5Xj53XdKYo(!vQVv9OeM#Utw2Ow?3n9G45Rr~wSaz-SB;u?q`?t^_!a;*gc3sj+cU z-hyJwU?9L5LnCz+Yz3thZOItn)|Q;X&s-E7T(_)R#fijJLA<^q>wkry%vX*}&z&vK zAf_B9E6b^@s3=Ho!3Ho4gJd4M>Gkp#fByu#J5TX1XWICFR|k(g{~f#qDv}E~Z@-i0 z-`&UeyE^#Ezy+Ro<8{_;{di7(ODT*Zin}FAuiU1|lW+c<+aA0h%`iB8_%LVAc5?F{ zeuk&_?xDx}n`MM+k`mfO;uwP*g}nc2w$ba!|2 z-S0fd4Zrv4jCU%7K_36b&-mJ|7uf#Dmow-afA>?gojf@^c}SPcUwq+3PMt&jF4d zJ3h;Eu_%cF&b7BAr6iCg>Z+{`(sQN*$F_@-*?qD-tGu+#bpNue?PT%FELlY^epX6&xVRXfcn-JPV9T9WHQHXiw~>Pb--*mfBrn< z(>FzwQmLZ0fS|O6kFmi)#s&vVDzjJ=wFSIY6-bv0;kxoJO)1iild9TaQT>CWR)84@ z@aoZzJg?(8?EUdi0XVYvE&4jUXxq1MS*pS_aF>;_^$%{Ne$8rv4GpyX)^#+kUq4IV zxpOCnzWwcjU?nPtcQ#h6 zV8@e>L!K{m?04*YTtqeDXsbapW+6sMI% zLymbY*#`(Ah>eb8c^pQ^Cm223&58fs%NsAg3_$hDI(B_<1h-+3$YFp_{qeorboX}N z{`ddPN^e}Zj!*v4J^XU_4|95(U}FPsz4|IoKe!_+J!M-cf8iNuQCnatPeCL$os{UN zK_W+jvS#xQwEgBcJiFsdS?RSc&Fnn*4sO#R6;EX4@rT14eQR${JuFpR53wjGnAEkL zwZR#Mx7@l7e?u65Ll~*+>5i_J9_C{=-NcFg@8*<0($^0_Wgs})4VEq!-pWe+4Pk;! zP1Lnq!$|)?P8l&}NgPz+;*?cJ|JHDv@M-c$lv|_iSDn9fxy=ugU2vFfSZE zm{-Qh1G$aZWhZIQ(+60Hq72~k`RE>u(5z=#SfKc`mbJL1Gd#CxvZ6YDudlYDk?Oj1 z0&{TBp4T}fQEyqDQmu71?N)fS=^jk?13t|%?1Pw|Se5tZ1CpbAahIfw5 z9HkhuZBC`)#61Sli3!%YJ=DA0xP@G_eO(M}$032D-%iqQr3ls5qG=kP(I{o(lU!?< zxTmk^*12>#$HoeZ2MRWTQi|l{B*HAmavaWENiLW=HK8CaRaNM^PAZimGBm{dBO^>s zPU5m0f-Vjz#ODNBNu?NbY=$ihTi00O_2T!}v&HY9*Y=9X<9yKH zj~N+emCL{-BxB>_ghHX>46xV&o^TxYB%=g_L283R)*Hq=x~}Wgg+kO#4;)VmA$ z-=)^;lA*u9e_pXhDD{r;`FyQzT|X>@n7wCK;qws+g$nAgUk$Kro8G=Y#>dBJpDCrH z$y92CsH&_)lkyQEWkwojxZRi@&$5=dmJ`Zxh{xk||06UDN2xE{w*CCf%!J?Xe@zN; z`=wR!@<2JxYmwpMy8ty4)hLv@Lpjb@l~RRW1Gx&Jl$uhG^A+GurceEOYrCeR0vu;M1& literal 0 HcmV?d00001 diff --git a/icon.png.import b/icon.png.import new file mode 100644 index 0000000..a4c02e6 --- /dev/null +++ b/icon.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.png" +dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/project.pandemonium b/project.pandemonium new file mode 100644 index 0000000..64261d4 --- /dev/null +++ b/project.pandemonium @@ -0,0 +1,24 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=4 + +[application] + +config/name="Data Manager" +config/icon="res://icon.png" + +[physics] + +common/enable_pause_aware_picking=true + +[rendering] + +vram_compression/import_etc=true +vram_compression/import_etc2=false +environment/default_environment="res://default_env.tres"