awards: patch awards resizing formspec elements
parent
36c75ed649
commit
7479ded96b
|
@ -3,11 +3,15 @@ if not minetest.get_modpath("awards") then
|
|||
end
|
||||
|
||||
local function awards_callback(state)
|
||||
state:label(3, 1, "lbl_header", "Awards")
|
||||
|
||||
local codebox = state:element("code", { name = "code", code = "", playername = state.location.rootState.location.player })
|
||||
codebox:onBuild(function(self)
|
||||
self.data.code = "container[3,2]".. awards.getFormspec(self.data.playername, self.data.playername, self.data.awards_idx or 1).."container_end[]"
|
||||
local formspec = awards.getFormspec(self.data.playername, self.data.playername, self.data.awards_idx or 1)
|
||||
|
||||
-- patch elememt sizes and positions
|
||||
formspec = formspec:gsub('textarea%[0.25,3.75;3.9,4.2', 'textarea[-0.75,3.75;5.9,4.2')
|
||||
formspec = formspec:gsub('box%[%-0.05,3.75;3.9,4.2', 'box[-1.05,3.75;5.9,4.2')
|
||||
formspec = formspec:gsub('textlist%[4,0;3.8,8.6', 'textlist[6,0;6.8,8.6')
|
||||
self.data.code = "container[3,0]".. formspec .."container_end[]"
|
||||
end)
|
||||
|
||||
state:onInput(function(state, fields, player)
|
||||
|
|
Loading…
Reference in New Issue