diff options
author | the lemons <citrons@mondecitronne.com> | 2022-02-11 15:48:48 -0600 |
---|---|---|
committer | the lemons <citrons@mondecitronne.com> | 2022-02-11 15:48:48 -0600 |
commit | 501d6cf055d9297f957eb440987101d8c670b943 (patch) | |
tree | e4dbb5c40f3b91e966f0b5a52e3376020659d36b /mods/vzxv_inv/init.lua | |
parent | 1426ccdea5c0f89b4410bce8f091cc6665a58f2f (diff) |
begin inventory things
Diffstat (limited to 'mods/vzxv_inv/init.lua')
-rw-r--r-- | mods/vzxv_inv/init.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mods/vzxv_inv/init.lua b/mods/vzxv_inv/init.lua new file mode 100644 index 0000000..e513d5c --- /dev/null +++ b/mods/vzxv_inv/init.lua @@ -0,0 +1,32 @@ + +local function formspec(template) + return function(t) + return template:gsub("([%%%$])([%w%-]+)", function(prefix,k) + if prefix == '%' then + return t[k] + else + return minetest.formspec_escape(tostring(t[k])) + end + end) + end +end + +local inventory = formspec [[ + formspec_version[4] + size[2,2] + label[0.375,0.5;$text] +]] + +minetest.register_on_joinplayer(function(player) + player:set_inventory_formspec(inventory { + text = "bee you" + }) +end) + +minetest.register_on_player_receive_fields(function(player, formname, fields) + if formname ~= "" then return end + + for k,v in pairs(fields) do +-- print(k,v) + end +end) |