summaryrefslogtreecommitdiff
path: root/formspecs.lua
diff options
context:
space:
mode:
authorAlexander Weber <web.alexander@web.de>2018-02-14 02:19:15 +0100
committersofar <sofar+github@foo-projects.org>2018-02-19 11:18:18 -0800
commit49620617524b626207fbf025474be6db4404e470 (patch)
treed4940de3e267b30cedbcb51bae47b1e42765b139 /formspecs.lua
parent4704e17dd2a833ebdd8e8f7081e11b05b6cdae4a (diff)
moved the chat- and UI context to ram
Diffstat (limited to 'formspecs.lua')
-rw-r--r--formspecs.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/formspecs.lua b/formspecs.lua
index 0659724..800cb44 100644
--- a/formspecs.lua
+++ b/formspecs.lua
@@ -42,7 +42,8 @@ function skins.get_skin_info_formspec(skin)
return formspec
end
-function skins.get_skin_selection_formspec(context, y_delta)
+function skins.get_skin_selection_formspec(player, context, y_delta)
+ skins.rebuild_formspec_context(player, context)
local page = context.skins_page or 1
local formspec = ""
for i = (page-1)*16+1, page*16 do
@@ -93,10 +94,7 @@ function skins.on_skin_selection_receive_fields(player, context, fields)
for field, _ in pairs(fields) do
local current = string.split(field, "$", 2)
if current[1] == "skins_set" then
- local selected_skin = context.skins_list[tonumber(current[2])]
- setmetatable(selected_skin, skins.skin_class)
-
- skins.set_player_skin(player, selected_skin)
+ skins.set_player_skin(player, context.skins_list[tonumber(current[2])])
return 'set'
elseif current[1] == "skins_page" then
context.skins_page = tonumber(current[2])