mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add gui.process_template, vc.get_setting,vc.get_setting_str, vc.get_setting_info
This commit is contained in:
parent
b307b5c93b
commit
411021052e
2 changed files with 12 additions and 5 deletions
|
|
@ -319,9 +319,8 @@ function console.chat(...)
|
|||
events.emit("core:chat", ...)
|
||||
end
|
||||
|
||||
function gui.template(name, params)
|
||||
local text = file.read(file.find("layouts/templates/"..name..".xml"))
|
||||
text = text:gsub("%%{([^}]+)}", function(n)
|
||||
function gui.process_template(source, params)
|
||||
local text = source:gsub("%%{([^}]+)}", function(n)
|
||||
local s = params[n]
|
||||
if s == nil then
|
||||
return
|
||||
|
|
@ -341,6 +340,11 @@ function gui.template(name, params)
|
|||
return text
|
||||
end
|
||||
|
||||
function gui.template(name, params)
|
||||
local text = file.read(file.find("layouts/templates/"..name..".xml"))
|
||||
return gui.process_template(text, params)
|
||||
end
|
||||
|
||||
session = require "core:internal/session"
|
||||
stdcomp = require "core:internal/stdcomp"
|
||||
entities.get = stdcomp.get_Entity
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue