content menu moved to xml (no icons yet)

This commit is contained in:
MihailRis
2024-04-18 22:15:23 +03:00
parent 49d57b307b
commit 64820020f8
14 changed files with 91 additions and 172 deletions
+2 -1
View File
@@ -204,7 +204,8 @@ end
function gui.template(name, params)
local text = file.read(file.find("layouts/templates/"..name..".xml"))
for k,v in pairs(params) do
text = text:gsub("(%%{"..k.."})", tostring(v))
local arg = tostring(v):gsub("'", "\\'"):gsub('"', '\\"')
text = text:gsub("(%%{"..k.."})", arg)
end
text = text:gsub("if%s*=%s*'%%{%w+}'", "if=''")
text = text:gsub("if%s*=%s*\"%%{%w+}\"", "if=\"\"")