From 4fd927e34eadd1b44a75f7ba3ba5dea3abcc3684 Mon Sep 17 00:00:00 2001
From: Alexander Weber <web.alexander@web.de>
Date: Thu, 1 Mar 2018 21:15:04 +0100
Subject: Bugfix #8 Create and get UI-context on demand

---
 formspecs.lua | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'formspecs.lua')

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()
-- 
cgit v1.2.3