diff options
author | Alexander Weber <web.alexander@web.de> | 2018-03-01 21:15:04 +0100 |
---|---|---|
committer | Alexander Weber <web.alexander@web.de> | 2018-03-01 21:15:04 +0100 |
commit | 4fd927e34eadd1b44a75f7ba3ba5dea3abcc3684 (patch) | |
tree | 15aacecb3a5edd5d7efb772fba0d7593e0e0d505 /formspecs.lua | |
parent | 3abb6aee40dd6159ab4db4c01981e76ef6ad3b90 (diff) |
Bugfix #8 Create and get UI-context on demand
Diffstat (limited to 'formspecs.lua')
-rw-r--r-- | formspecs.lua | 10 |
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() |