]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - games/devtest/mods/testformspec/formspec.lua
FormSpec: Add list spacing, slot size, and noclip (#10083)
[dragonfireclient.git] / games / devtest / mods / testformspec / formspec.lua
index 87a05fc96859ed8970ea8dae3cdb34e54fa19c73..0eef859a9c2a030637c24de821ae3de617341455 100644 (file)
@@ -33,6 +33,15 @@ local tabheaders_fs = [[
        tabheader[8,6;10,1.5;tabs_size2;Height=1.5;1;false;false]
 ]]
 
+local inv_style_fs = [[
+       style_type[list;noclip=true]
+       list[current_player;main;-1.125,-1.125;2,2]
+       style_type[list;spacing=.25,.125;size=.75,.875]
+       list[current_player;main;3,.5;3,3]
+       style_type[list;spacing=0;size=1]
+       list[current_player;main;.5,4;8,4]
+]]
+
 local hypertext_basic = [[
 <bigger>Normal test</bigger>
 This is a normal text.
@@ -310,6 +319,10 @@ local pages = {
                "size[12,13]real_coordinates[true]" ..
                "container[0.5,1.5]" .. tabheaders_fs .. "container_end[]",
 
+               -- Inv
+               "size[12,13]real_coordinates[true]" ..
+               "container[0.5,1.5]" .. inv_style_fs .. "container_end[]",
+
        -- Animation
                [[
                        formspec_version[3]
@@ -327,6 +340,10 @@ Number]
                        animated_image[3,4.25;1,1;;testformspec_animation.png;4;0;3]
                        animated_image[5.5,0.5;5,2;;testformspec_animation.png;4;100]
                        animated_image[5.5,2.75;5,2;;testformspec_animation.jpg;4;100]
+
+                       style[m1;bgcolor=black]
+                       model[0.5,6;4,4;m1;testformspec_character.b3d;testformspec_character.png]
+                       model[5,6;4,4;m2;testformspec_chest.obj;default_chest_top.png,default_chest_top.png,default_chest_side.png,default_chest_side.png,default_chest_front.png,default_chest_inside.png;30,1;true;true]
                ]],
 
        -- Scroll containers
@@ -337,7 +354,7 @@ Number]
 local function show_test_formspec(pname, page_id)
        page_id = page_id or 2
 
-       local fs = pages[page_id] .. "tabheader[0,0;8,0.65;maintabs;Real Coord,Styles,Noclip,Hypertext,Tabs,Anim,ScrollC;" .. page_id .. ";false;false]"
+       local fs = pages[page_id] .. "tabheader[0,0;8,0.65;maintabs;Real Coord,Styles,Noclip,Hypertext,Tabs,Invs,Anim,ScrollC;" .. page_id .. ";false;false]"
 
        minetest.show_formspec(pname, "testformspec:formspec", fs)
 end