From aafae6b744dc81a5c186b2795e75bc7f635a3cf2 Mon Sep 17 00:00:00 2001 From: MisterE Date: Sat, 13 Aug 2022 13:42:44 -0400 Subject: [PATCH] give the inventory formspec a background and make the armor tab have a 3d model --- mods/ITEMS/3d_armor/3d_armor/api.lua | 18 ++++++++++++++++-- mods/{MTG => PLAYER}/sfinv/README.txt | 0 mods/{MTG => PLAYER}/sfinv/api.lua | 2 +- mods/{MTG => PLAYER}/sfinv/init.lua | 2 ++ mods/{MTG => PLAYER}/sfinv/license.txt | 0 mods/{MTG => PLAYER}/sfinv/locale/sfinv.de.tr | 0 mods/{MTG => PLAYER}/sfinv/locale/sfinv.es.tr | 0 mods/{MTG => PLAYER}/sfinv/locale/sfinv.fr.tr | 0 mods/{MTG => PLAYER}/sfinv/locale/sfinv.id.tr | 0 mods/{MTG => PLAYER}/sfinv/locale/sfinv.it.tr | 0 mods/{MTG => PLAYER}/sfinv/locale/sfinv.ms.tr | 0 mods/{MTG => PLAYER}/sfinv/locale/sfinv.ru.tr | 0 mods/{MTG => PLAYER}/sfinv/locale/sfinv.se.tr | 0 .../sfinv/locale/sfinv.zh_CN.tr | 0 .../sfinv/locale/sfinv.zh_TW.tr | 0 .../{MTG => PLAYER}/sfinv/locale/template.txt | 0 mods/{MTG => PLAYER}/sfinv/mod.conf | 0 mods/PLAYER/sfinv/textures/sfinv_bg.png | Bin 0 -> 1613 bytes .../sfinv/textures/sfinv_crafting_arrow.png | Bin 19 files changed, 19 insertions(+), 3 deletions(-) rename mods/{MTG => PLAYER}/sfinv/README.txt (100%) rename mods/{MTG => PLAYER}/sfinv/api.lua (98%) rename mods/{MTG => PLAYER}/sfinv/init.lua (88%) rename mods/{MTG => PLAYER}/sfinv/license.txt (100%) rename mods/{MTG => PLAYER}/sfinv/locale/sfinv.de.tr (100%) rename mods/{MTG => PLAYER}/sfinv/locale/sfinv.es.tr (100%) rename mods/{MTG => PLAYER}/sfinv/locale/sfinv.fr.tr (100%) rename mods/{MTG => PLAYER}/sfinv/locale/sfinv.id.tr (100%) rename mods/{MTG => PLAYER}/sfinv/locale/sfinv.it.tr (100%) rename mods/{MTG => PLAYER}/sfinv/locale/sfinv.ms.tr (100%) rename mods/{MTG => PLAYER}/sfinv/locale/sfinv.ru.tr (100%) rename mods/{MTG => PLAYER}/sfinv/locale/sfinv.se.tr (100%) rename mods/{MTG => PLAYER}/sfinv/locale/sfinv.zh_CN.tr (100%) rename mods/{MTG => PLAYER}/sfinv/locale/sfinv.zh_TW.tr (100%) rename mods/{MTG => PLAYER}/sfinv/locale/template.txt (100%) rename mods/{MTG => PLAYER}/sfinv/mod.conf (100%) create mode 100644 mods/PLAYER/sfinv/textures/sfinv_bg.png rename mods/{MTG => PLAYER}/sfinv/textures/sfinv_crafting_arrow.png (100%) diff --git a/mods/ITEMS/3d_armor/3d_armor/api.lua b/mods/ITEMS/3d_armor/3d_armor/api.lua index d562d61..04b3c6e 100644 --- a/mods/ITEMS/3d_armor/3d_armor/api.lua +++ b/mods/ITEMS/3d_armor/3d_armor/api.lua @@ -34,7 +34,8 @@ armor = { elements = {"head", "torso", "legs", "feet"}, physics = {"jump", "speed", "gravity"}, attributes = {"heal", "fire", "water"}, - formspec = "image[2.5,0;2,4;armor_preview]".. + formspec = "model[2.5,0;2,4;armor_preview]" .. + -- "image[2.5,0;2,4;armor_preview]".. default.gui_bg.. default.gui_bg_img.. default.gui_slots.. @@ -525,7 +526,20 @@ armor.get_armor_formspec = function(self, name, listring) formspec = formspec.."listring[current_player;main]".. "listring[detached:"..name.."_armor;armor]" end - formspec = formspec:gsub("armor_preview", armor.textures[name].preview) + -- formspec = formspec:gsub("armor_preview", armor.textures[name].preview) + local player = minetest.get_player_by_name(name) + local anim = player:get_local_animation() + local player_model = table.concat({ + "player_model_"..name, + player:get_properties().mesh, + table.concat(player:get_properties().textures,","), + table.concat({0,-150},","), + "false", + "true", + table.concat({anim.x,anim.y},","), + "30" + },";") + formspec = formspec:gsub("armor_preview",player_model) formspec = formspec:gsub("armor_level", armor.def[name].level) for _, attr in pairs(self.attributes) do formspec = formspec:gsub("armor_attr_"..attr, armor.def[name][attr]) diff --git a/mods/MTG/sfinv/README.txt b/mods/PLAYER/sfinv/README.txt similarity index 100% rename from mods/MTG/sfinv/README.txt rename to mods/PLAYER/sfinv/README.txt diff --git a/mods/MTG/sfinv/api.lua b/mods/PLAYER/sfinv/api.lua similarity index 98% rename from mods/MTG/sfinv/api.lua rename to mods/PLAYER/sfinv/api.lua index 1dbc44a..ba17910 100644 --- a/mods/MTG/sfinv/api.lua +++ b/mods/PLAYER/sfinv/api.lua @@ -35,7 +35,6 @@ function sfinv.get_nav_fs(player, context, nav, current_idx) return "" end end - local theme_inv = [[ image[0,5.2;1,1;gui_hb_bg.png] image[1,5.2;1,1;gui_hb_bg.png] @@ -52,6 +51,7 @@ local theme_inv = [[ function sfinv.make_formspec(player, context, content, show_inv, size) local tmp = { size or "size[8,9.1]", + "background9[-2,-2;12,13.1;sfinv_bg.png;false;64,96]", sfinv.get_nav_fs(player, context, context.nav_titles, context.nav_idx), show_inv and theme_inv or "", content diff --git a/mods/MTG/sfinv/init.lua b/mods/PLAYER/sfinv/init.lua similarity index 88% rename from mods/MTG/sfinv/init.lua rename to mods/PLAYER/sfinv/init.lua index 71e9ee7..81e7f45 100644 --- a/mods/MTG/sfinv/init.lua +++ b/mods/PLAYER/sfinv/init.lua @@ -7,8 +7,10 @@ local S = minetest.get_translator("sfinv") sfinv.register_page("sfinv:crafting", { title = S("Crafting"), + icon = "crafting_icon.png", get = function(self, player, context) return sfinv.make_formspec(player, context, [[ + style_type[list;size=1,spacing=.5] list[current_player;craft;1.75,0.5;3,3;] list[current_player;craftpreview;5.75,1.5;1,1;] image[4.75,1.5;1,1;sfinv_crafting_arrow.png] diff --git a/mods/MTG/sfinv/license.txt b/mods/PLAYER/sfinv/license.txt similarity index 100% rename from mods/MTG/sfinv/license.txt rename to mods/PLAYER/sfinv/license.txt diff --git a/mods/MTG/sfinv/locale/sfinv.de.tr b/mods/PLAYER/sfinv/locale/sfinv.de.tr similarity index 100% rename from mods/MTG/sfinv/locale/sfinv.de.tr rename to mods/PLAYER/sfinv/locale/sfinv.de.tr diff --git a/mods/MTG/sfinv/locale/sfinv.es.tr b/mods/PLAYER/sfinv/locale/sfinv.es.tr similarity index 100% rename from mods/MTG/sfinv/locale/sfinv.es.tr rename to mods/PLAYER/sfinv/locale/sfinv.es.tr diff --git a/mods/MTG/sfinv/locale/sfinv.fr.tr b/mods/PLAYER/sfinv/locale/sfinv.fr.tr similarity index 100% rename from mods/MTG/sfinv/locale/sfinv.fr.tr rename to mods/PLAYER/sfinv/locale/sfinv.fr.tr diff --git a/mods/MTG/sfinv/locale/sfinv.id.tr b/mods/PLAYER/sfinv/locale/sfinv.id.tr similarity index 100% rename from mods/MTG/sfinv/locale/sfinv.id.tr rename to mods/PLAYER/sfinv/locale/sfinv.id.tr diff --git a/mods/MTG/sfinv/locale/sfinv.it.tr b/mods/PLAYER/sfinv/locale/sfinv.it.tr similarity index 100% rename from mods/MTG/sfinv/locale/sfinv.it.tr rename to mods/PLAYER/sfinv/locale/sfinv.it.tr diff --git a/mods/MTG/sfinv/locale/sfinv.ms.tr b/mods/PLAYER/sfinv/locale/sfinv.ms.tr similarity index 100% rename from mods/MTG/sfinv/locale/sfinv.ms.tr rename to mods/PLAYER/sfinv/locale/sfinv.ms.tr diff --git a/mods/MTG/sfinv/locale/sfinv.ru.tr b/mods/PLAYER/sfinv/locale/sfinv.ru.tr similarity index 100% rename from mods/MTG/sfinv/locale/sfinv.ru.tr rename to mods/PLAYER/sfinv/locale/sfinv.ru.tr diff --git a/mods/MTG/sfinv/locale/sfinv.se.tr b/mods/PLAYER/sfinv/locale/sfinv.se.tr similarity index 100% rename from mods/MTG/sfinv/locale/sfinv.se.tr rename to mods/PLAYER/sfinv/locale/sfinv.se.tr diff --git a/mods/MTG/sfinv/locale/sfinv.zh_CN.tr b/mods/PLAYER/sfinv/locale/sfinv.zh_CN.tr similarity index 100% rename from mods/MTG/sfinv/locale/sfinv.zh_CN.tr rename to mods/PLAYER/sfinv/locale/sfinv.zh_CN.tr diff --git a/mods/MTG/sfinv/locale/sfinv.zh_TW.tr b/mods/PLAYER/sfinv/locale/sfinv.zh_TW.tr similarity index 100% rename from mods/MTG/sfinv/locale/sfinv.zh_TW.tr rename to mods/PLAYER/sfinv/locale/sfinv.zh_TW.tr diff --git a/mods/MTG/sfinv/locale/template.txt b/mods/PLAYER/sfinv/locale/template.txt similarity index 100% rename from mods/MTG/sfinv/locale/template.txt rename to mods/PLAYER/sfinv/locale/template.txt diff --git a/mods/MTG/sfinv/mod.conf b/mods/PLAYER/sfinv/mod.conf similarity index 100% rename from mods/MTG/sfinv/mod.conf rename to mods/PLAYER/sfinv/mod.conf diff --git a/mods/PLAYER/sfinv/textures/sfinv_bg.png b/mods/PLAYER/sfinv/textures/sfinv_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..da97d020a3dbe0ec60a7a59f02c8561c0ae4da4b GIT binary patch literal 1613 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|G$5xn)7d$|)7e>}peR2rGbfdS zL1SX=L|c!;4l+mMgO4id%Dz!hnzWFsi8WBreXWzA)|9A)q3n~r_b>2tp7iLE#tt!= zKM`xJc38ZA^+1cGNnWAP&#y}_=+Xa4PTdmxeZN1xyZ88=tb&P_kLm7XjG>!*N|f}{ zidQF{*Jk2S>4nJ=qZCRW5rVY zGN2%PiKnkC`!fz+K_-nWTMo$pg(OQ{BTAg}b8}PkN*J7rQWHy3QxwWGOEMJPJ$(bh z8~MZ;7+B0aT^vIyZoR#0AEe|ca^T@iU8ZJEPF^0{7WWSZa;=9eSoj<>96T%bGHi8z{ZJIC$e1i~f0k`Fn0vTdVK(d)NJ~|HH8`o{52p zVFqJO@_BpT@_VkkOwYgXp2r!%*r3axz|bJ+aCYARI_paDm)Aa;=vS#Furh38XkcK7 zy?Nzd`=xpI?>g80{WHPyPpxg+`s0#O+h#V1GTeZectxX@FY0ei8q=B#wStU4)f<=? zSQrEt6fW~9y!$CHzs>i2d4=`d|ILyN5sW}5a4<|rVhaeeGC%PA56~74pzQ~&(il|N zUgu|614`{I3@0p^JD&6H*scK8u%SoN;m+asIp^bl)E(dgn(e^Qka~vU&BurHEtpT2 z={slxMHmdPW)hO%5^s4?V9k*g1e}fr+?(f(l{$>Y*k@cRr=j4t* zj)F!vC{*FW3uf$S^8F_M;zm6*ejaFDn!7sZ{P|f&UNie#zI*d=WnF&NziY2~p{ds) z-0U9H58J}?^65;f-*3NsQ#fbl)pIOs7!HU5v{u6)x+1zeE#9W5#S&T=Lm*)T7sd;6` zkJ?f_i2ViD$=}2!-j~Pi%Cq{Sa!%k;EnC_8-xr}NeCZhmpi?hQzGb@~=DGuuj?QHG jvZM@_rWt@>LsdQFLccxJ1!v!02jY9W`njxgN@xNAe1t2d literal 0 HcmV?d00001 diff --git a/mods/MTG/sfinv/textures/sfinv_crafting_arrow.png b/mods/PLAYER/sfinv/textures/sfinv_crafting_arrow.png similarity index 100% rename from mods/MTG/sfinv/textures/sfinv_crafting_arrow.png rename to mods/PLAYER/sfinv/textures/sfinv_crafting_arrow.png