From 653966f4db8f71d4c7861262b25fd6d9273c4a42 Mon Sep 17 00:00:00 2001 From: cron Date: Sat, 10 Oct 2020 17:26:10 +0000 Subject: [PATCH] devtest: weird texture additions? --- .../dirt_with_grass/default_grass.png | Bin 0 -> 829 bytes .../dirt_with_grass/default_grass_side.png | Bin 0 -> 796 bytes .../textures/dirt_with_grass/info.txt | 3 ++ .../textures/testnodes_height_pyramid.png | Bin 0 -> 90 bytes .../testnodes_height_pyramid_normal.png | Bin 0 -> 239 bytes .../textures/testnodes_parallax_extruded.png | Bin 0 -> 591 bytes .../testnodes_parallax_extruded_normal.png | Bin 0 -> 143 bytes games/devtest/mods/testtools/light.lua | 22 +++++++++ .../textures/testtools_lighttool.png | Bin 0 -> 1659 bytes .../mods/unittests/itemdescription.lua | 44 ++++++++++++++++++ 10 files changed, 69 insertions(+) create mode 100644 games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass.png create mode 100644 games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass_side.png create mode 100644 games/devtest/mods/basenodes/textures/dirt_with_grass/info.txt create mode 100644 games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png create mode 100644 games/devtest/mods/testtools/light.lua create mode 100644 games/devtest/mods/testtools/textures/testtools_lighttool.png create mode 100644 games/devtest/mods/unittests/itemdescription.lua diff --git a/games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass.png b/games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass.png new file mode 100644 index 0000000000000000000000000000000000000000..29fde6b26a7689e0091c92f49355ab7072b7c056 GIT binary patch literal 829 zcmV-D1H$}?P)+ajpshR{=5W`0H1vO`a^tn z^HmA((KjzhfEz!)^)S)UHv!<<2ft&20N}#aXNn>Qfc>9duElEayO*wC{B{5P7vm}i zfG>V{Q@MEUoa>pc5p+$F7hLwxwD9=GnM}r65ueH&GYKIICc4=-gI+FmhfF5ibEvhZ5uK&W ziu3!yrfPY*M4Zlm$EDS*d+vqq7kWB$?XncF2BUlR@p5efxZ6R$t%2REYRDb^U zFU#9IcaMWjb$u(que|XX6D`pjj8)sFUP!4%_!3&#=wKU$2@S7$u}D^kVnP+X^OS%5 zAjcZEJ-tZk<+N-Y>DVq(tNX_@F2w0Gep%Mh&~^+rNwfa}tdL}?X}J{Q00000NkvXX Hu0mjfO)-U1 literal 0 HcmV?d00001 diff --git a/games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass_side.png b/games/devtest/mods/basenodes/textures/dirt_with_grass/default_grass_side.png new file mode 100644 index 0000000000000000000000000000000000000000..04770b6f659cab9fb6e146a093c9d2447bbfa274 GIT binary patch literal 796 zcmV+%1LOROP)9;n+h7p>B+Crpq|D58fu5lEZimbKn4c+**;X~vp`T%QbrgsAONU7ds;3&y zwW*tqw?BA^p_}l9OEu3tKHrlB9xrWQG5$5z7b$Y{YRn{OP!5M=Pl&^tFE8*N#qI4g zT{-f2TaY~-sp}Cpw0W+t$d3&|Es^Wp24xGX=K;@hdGr0(X-wm!CoB`6ou%wvGz+7V zGHogImSnkRx!)771JqD~bfj@k3_2rm%usehD~T^GHnGn`S|LMaASFx_q$Ym6XsPQS zd7s{po5U;x%`k9#m(%M3#}B!`t9k2#JxSLzlqn%(n~F?L*7T5W@&p z7dh2wVz*o1YLBV=Xju$JVf5S3%Op|MBHCf)$G?#2%vi z8Rwq1hQNt<^YtC|G+6vTu14xsv0ne5@Fc7@F->8y2^_|wCW`iy znae}k^8FA0QkNrt{d0rigWanetZ%=2jk+6A-hgGsEz15MZQ&U~~oxG9vh=Ksi-Ja-z zF6Uhfc!H`Hh$XG#`4Y}!e@IZs$-&^{X6x;I|F{;~J-lZ8BChUq+zxrhT}cw zf(=X36e=`Ma6IrxXz>ro?Z~NPnl5~lZ`vBp9Wt6ci6>(Yr1}?dc^_lavu5(%utdDz m=BEv;-gb_^tyj-;{LVim+=bh?|GX^F2MnIBelF{r5}E+pj#X#? literal 0 HcmV?d00001 diff --git a/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png new file mode 100644 index 0000000000000000000000000000000000000000..7e1c323987597e8555e4a74bb637d4705dd2d88c GIT binary patch literal 591 zcmV-V0}3b3I7v6KL@mH@Gv0J4(+ zvY!gFpboR10JM`7w50>JnEaTizT*oMt54M&9ww4jLmKe5|6SkNDwwN2XnFF?&54M>YwwW5XngF(% z0k)bBwwn*OoB+0+0JfbNww?gCpB}cM1mNJ{;^N}t=;-R|>g((4 z?Ck9A?d|XH@AC5U^Yiod_4W4l_V@Sq`uh6&`}_X>{{R2~TWLV^0002qNkl^sfqHC|*%qp+DVE=OwVRQ){8H6qCzBsS8yv zPRFw}Lh#+euxuqHJ@M{BSj%s0U5{ImH6K%b5WcLPhH}i6bL6b*zS!G)=k53BV?k;A zhA%NScwb}y(Q7v+LYiT3v*4umb5tc)Ny6*)Do9HP*a)$tQh_ZQFmV{{z(k#HXqvCy dU*zKm`454QOBEGnk`Vv^002ovPDHLkV1i>NAjALw literal 0 HcmV?d00001 diff --git a/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..b134699d0c82621f7ba10fcbf177f93a74ce7456 GIT binary patch literal 143 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;TYyi9YeU0-AX089Hv)<288*EP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+SOKDvg0ZY{MRaG2_OLy%fURVW(RlqBQWu?bDY?j zGe0+!4HiObx@8=w|NU<8OMi$c;5ELw2`g8IJ#k<6`A;RMXSHs`7Gq2W)v{u*MB^Q*@Fe}Qy zgPp!c9T%mX#4Q6%8%LeZzKWWff?i5)g z8&`@8d*v#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8NzH);>-j zfHZZLya5glfw3ZGuY0_^r?an0U60WO;~d-o7e1-RLBt&={?ZX#e6zRbe%kztQDBP)|5LF^%}=d-j{iRZi~l5np8R>8|NGV^2O|3kaNXYA6WtrQzNscirN002ovPDHLk FV1hb0459!4 literal 0 HcmV?d00001 diff --git a/games/devtest/mods/unittests/itemdescription.lua b/games/devtest/mods/unittests/itemdescription.lua new file mode 100644 index 000000000..1d0826545 --- /dev/null +++ b/games/devtest/mods/unittests/itemdescription.lua @@ -0,0 +1,44 @@ +local full_description = "Colorful Pickaxe\nThe best pick." +minetest.register_tool("unittests:colorful_pick", { + description = full_description, + inventory_image = "basetools_mesepick.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=3, + groupcaps={ + cracky={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3}, + crumbly={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3}, + snappy={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3} + }, + damage_groups = {fleshy=4}, + }, +}) + +minetest.register_chatcommand("item_description", { + param = "", + description = "Show the short and full description of the wielded item.", + func = function(name) + local player = minetest.get_player_by_name(name) + local item = player:get_wielded_item() + return true, string.format("short_description: %s\ndescription: %s", + item:get_short_description(), item:get_description()) + end +}) + +function unittests.test_short_desc() + local stack = ItemStack("unittests:colorful_pick") + assert(stack:get_short_description() == "Colorful Pickaxe") + assert(stack:get_short_description() == minetest.registered_items["unittests:colorful_pick"].short_description) + assert(stack:get_description() == full_description) + assert(stack:get_description() == minetest.registered_items["unittests:colorful_pick"].description) + + stack:get_meta():set_string("description", "Hello World") + assert(stack:get_short_description() == "Colorful Pickaxe") + assert(stack:get_description() == "Hello World") + + stack:get_meta():set_string("short_description", "Foo Bar") + assert(stack:get_short_description() == "Foo Bar") + assert(stack:get_description() == "Hello World") + + return true +end