mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
fix gui.template(...)
This commit is contained in:
parent
ddd09a23d6
commit
1c76870228
1 changed files with 4 additions and 1 deletions
|
|
@ -228,11 +228,14 @@ function gui.template(name, params)
|
|||
local text = file.read(file.find("layouts/templates/"..name..".xml"))
|
||||
text = text:gsub("%%{([^}]+)}", function(n)
|
||||
local s = params[n]
|
||||
if s == nil then
|
||||
return
|
||||
end
|
||||
if type(s) ~= "string" then
|
||||
return tostring(s)
|
||||
end
|
||||
if #s == 0 then
|
||||
return
|
||||
return ''
|
||||
end
|
||||
local e = string.escape(s)
|
||||
return e:sub(2, #e-1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue