minetest-mods / i3

:rocket: A next-generation inventory for Minetest 5.6+
Other
41 stars 26 forks source link

Page registered using `i3.new_page` doesn't work #80

Closed AFCMS closed 1 year ago

AFCMS commented 1 year ago

Describe the bug

Tried the following code:

i3.new_tab("minify", {
    description = "Minify",
    image = "default_stone.png",

    access = function(player, data)
        return true
    end,

    formspec = function(player, data, fs)
        fs("label[3,1;This is just a test]")
        return fs
    end,

    fields = function(player, data, fields)

    end,
})

I get this by opening my inventory:

image

But then I click the "Minify" tab it does nothing.

Additional context

kilbith commented 1 year ago

The fields function must return i3.set_fs(player)

AFCMS commented 1 year ago

Oh OK

kilbith commented 1 year ago

Or just remove the function fields if you don't need it.

kilbith commented 1 year ago

Also you don't need to add return fs in the formspec function.