DevTest: Add test for supertip formspec element

This commit is contained in:
Wuzzy 2024-06-04 22:47:41 +02:00
parent 46bc0d5ca0
commit 4fa1b479a6

@ -468,6 +468,43 @@ mouse control = true]
background9[0,0;0,0;testformspec_bg_9slice.png;true;4,6]
background[1,1;0,0;testformspec_bg.png;true]
]],
-- Tooltip
[[
formspec_version[7]
size[12,13]
label[1,0.5;Hover a red box for a tooltip.]
box[1,1;1,1;#ff000080]
tooltip[1,1;1,1;Normal tooltip]
box[1,3;1,1;#ff000080]
box[2.4,3.4;0.2,0.2;#ffffff80]
supertip[1,3;1,1;2.5,3.5;5;supertip_static;<big>Simple supertip (<i>static</i>)</big>
This one should always appear at the tiny white square.]
box[1,5;1,1;#ff000080]
supertip[1,5;1,1;5;supertip_dynamic;<big>Simple supertip (<i>dynamic</i>)</big>
This should appear at the cursor.]
box[1,7;1,1;#ff000080]
supertip[1,7;1,1;5;supertip_dynamic_complex;]]..minetest.formspec_escape([[<big>Complex supertip (<i>dynamic</i>)</big>
<img name=testformspec_node.png float=right width=64 height=64>
<left>Left align</left>
<center>Right align</center>
<right>Right align</right>
<b>Bold</b> <i>Italic</i> <u>Underline</u> <mono>Mono</mono>
Item:
<item name=testformspec:node>]])..[[]
box[1,9;1,1;#ff000080]
supertip[1,9;1,1;5;supertip_stone;]]..minetest.formspec_escape([[<global color=#333 background=#aaa margin=20>
<item name=testformspec:node float=left width=64 height=64>
<big><b><center>Formspec Test Node</center></b></big>
The <b>Formspec Test Node</b> is a dummy node to display an item in the <mono>testformspec</mono> mod.
<b>Max. stack size:</b> 99
<b>Drops:</b> <i>itself</i> <item name=testformspec:node width=32 height=32>]])..
"]"
}
local page_id = 2
@ -477,7 +514,7 @@ local function show_test_formspec(pname)
page = page()
end
local fs = page .. "tabheader[0,0;11,0.65;maintabs;Real Coord,Styles,Noclip,Hypertext,Tabs,Invs,Window,Anim,Model,ScrollC,Sound,Background,Unsized;" .. page_id .. ";false;false]"
local fs = page .. "tabheader[0,0;11,0.65;maintabs;Real Coord,Styles,Noclip,Hypertext,Tabs,Invs,Window,Anim,Model,ScrollC,Sound,Background,Unsized,Tooltip;" .. page_id .. ";false;false]"
minetest.show_formspec(pname, "testformspec:formspec", fs)
end