mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 22:11:51 +00:00
Merge branch 'main' into render-update
This commit is contained in:
commit
b692e8446d
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"))
|
local text = file.read(file.find("layouts/templates/"..name..".xml"))
|
||||||
text = text:gsub("%%{([^}]+)}", function(n)
|
text = text:gsub("%%{([^}]+)}", function(n)
|
||||||
local s = params[n]
|
local s = params[n]
|
||||||
|
if s == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
if type(s) ~= "string" then
|
if type(s) ~= "string" then
|
||||||
return tostring(s)
|
return tostring(s)
|
||||||
end
|
end
|
||||||
if #s == 0 then
|
if #s == 0 then
|
||||||
return
|
return ''
|
||||||
end
|
end
|
||||||
local e = string.escape(s)
|
local e = string.escape(s)
|
||||||
return e:sub(2, #e-1)
|
return e:sub(2, #e-1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue