summaryrefslogtreecommitdiff
path: root/formspecs.lua
diff options
context:
space:
mode:
authorbell07 <web.alexander@web.de>2018-03-02 12:50:00 +0100
committerGitHub <noreply@github.com>2018-03-02 12:50:00 +0100
commit5a640bc12da36ac35c33051cffaf72d82fb2cafd (patch)
tree15aacecb3a5edd5d7efb772fba0d7593e0e0d505 /formspecs.lua
parent3abb6aee40dd6159ab4db4c01981e76ef6ad3b90 (diff)
parent4fd927e34eadd1b44a75f7ba3ba5dea3abcc3684 (diff)
Merge pull request #9 from minetest-mods/bugfix_8
Create and get UI-context on demand Closes #8
Diffstat (limited to 'formspecs.lua')
-rw-r--r--formspecs.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/formspecs.lua b/formspecs.lua
index d1174c9..328c2f3 100644
--- a/formspecs.lua
+++ b/formspecs.lua
@@ -1,5 +1,15 @@
local S = skins.S
+function skins.get_formspec_context(player)
+ if player then
+ local playername = player:get_player_name()
+ skins.ui_context[playername] = skins.ui_context[playername] or {}
+ return skins.ui_context[playername]
+ else
+ return {}
+ end
+end
+
-- Show skin info
function skins.get_skin_info_formspec(skin)
local texture = skin:get_texture()