2023-02-01 02:44:14 +01:00
|
|
|
local SWITCH
|
|
|
|
|
2021-11-14 21:39:48 +01:00
|
|
|
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)
|
2023-02-01 02:44:14 +01:00
|
|
|
fs("button", 3, 4, 3, 0.8, "test", "Click here")
|
2022-11-12 19:40:06 +01:00
|
|
|
fs("label", 3, 1, "Just a test")
|
2023-02-01 02:44:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
if SWITCH then
|
|
|
|
fs"label[3,2;Button clicked]"
|
|
|
|
else
|
|
|
|
fs"label[3,2;Lorem Ipsum]"
|
|
|
|
end
|
2021-01-16 01:46:26 +01:00
|
|
|
end,
|
2023-02-01 02:44:14 +01:00
|
|
|
|
|
|
|
fields = function(player, data, fields)
|
|
|
|
if fields.test then
|
|
|
|
SWITCH = true
|
|
|
|
end
|
|
|
|
end
|
2021-11-14 21:39:48 +01:00
|
|
|
})
|
2021-01-16 01:46:26 +01:00
|
|
|
|
2021-11-14 21:39:48 +01:00
|
|
|
i3.new_tab("test2", {
|
2021-01-16 01:46:26 +01:00
|
|
|
description = "Test 2",
|
|
|
|
image = "i3_mesepick.png",
|
2023-02-01 02:44:14 +01:00
|
|
|
slots = true,
|
2021-01-16 01:46:26 +01:00
|
|
|
|
|
|
|
formspec = function(player, data, fs)
|
|
|
|
fs("label[3,1;Test 2]")
|
|
|
|
end,
|
2021-11-14 21:39:48 +01:00
|
|
|
})
|
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-11-14 21:39:48 +01:00
|
|
|
})
|
2021-01-28 21:00:08 +01:00
|
|
|
|