diff options
author | rubenwardy <rw@rubenwardy.com> | 2018-09-13 17:39:52 +0100 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2018-09-13 17:39:52 +0100 |
commit | 805720b4af80d55edb8a87a1f8672d09ae2930ad (patch) | |
tree | 95a6d48551c74400e675357294b91ea1c8b16a12 | |
parent | 29a1b97b3849daaf07e2d3789b54817101e9061c (diff) |
Fix sfinv page not updating on award unlock
-rw-r--r-- | src/gui.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui.lua b/src/gui.lua index cfc82af..948a152 100644 --- a/src/gui.lua +++ b/src/gui.lua @@ -254,6 +254,22 @@ if minetest.get_modpath("sfinv") then end end }) + + local function check_and_reshow(name) + local player = minetest.get_player_by_name(name) + if not player then + return + end + + local context = sfinv.get_or_create_context(player) + if context.page ~= "awards:awards" then + return + end + + sfinv.set_player_inventory_formspec(player, context) + end + + awards.register_on_unlock(check_and_reshow) end if minetest.get_modpath("unified_inventory") ~= nil then |