i3/tests/test_tabs.lua

34 lines
596 B
Lua
Raw Normal View History

i3.new_tab("test1", {
2021-01-21 19:28:54 +01:00
description = "Test 1 Test 1",
2021-01-16 01:46:26 +01:00
image = "i3_heart.png",
formspec = function(player, data, fs)
fs("label[3,1;Test 1]")
end,
})
2021-01-16 01:46:26 +01:00
i3.new_tab("test2", {
2021-01-16 01:46:26 +01:00
description = "Test 2",
image = "i3_mesepick.png",
formspec = function(player, data, fs)
fs("label[3,1;Test 2]")
end,
})
2021-01-16 01:46:26 +01:00
2022-03-21 00:06:51 +01:00
i3.new_tab("test_creative", {
description = "Test creative",
2021-01-16 01:46:26 +01:00
access = function(player, data)
local name = player:get_player_name()
2022-03-21 00:06:51 +01:00
return core.is_creative_enabled(name)
2021-01-16 01:46:26 +01:00
end,
formspec = function(player, data, fs)
2022-03-21 00:06:51 +01:00
fs("label[3,1;Creative enabled]")
2021-01-16 01:46:26 +01:00
end,
2022-03-21 00:06:51 +01:00
fields = i3.set_fs,
})
2021-01-28 21:00:08 +01:00