mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-15 07:51:50 +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", ...)
|
events.emit("core:chat", ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
function gui.template(name, params)
|
function gui.process_template(source, params)
|
||||||
local text = file.read(file.find("layouts/templates/"..name..".xml"))
|
local text = source:gsub("%%{([^}]+)}", function(n)
|
||||||
text = text:gsub("%%{([^}]+)}", function(n)
|
|
||||||
local s = params[n]
|
local s = params[n]
|
||||||
if s == nil then
|
if s == nil then
|
||||||
return
|
return
|
||||||
|
|
@ -341,6 +340,11 @@ function gui.template(name, params)
|
||||||
return text
|
return text
|
||||||
end
|
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"
|
session = require "core:internal/session"
|
||||||
stdcomp = require "core:internal/stdcomp"
|
stdcomp = require "core:internal/stdcomp"
|
||||||
entities.get = stdcomp.get_Entity
|
entities.get = stdcomp.get_Entity
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,10 @@ vc = {
|
||||||
end,
|
end,
|
||||||
is_client = function()
|
is_client = function()
|
||||||
return not _vc_headless
|
return not _vc_headless
|
||||||
end
|
end,
|
||||||
|
get_setting = __vc_app.get_setting,
|
||||||
|
get_setting_str = __vc_app.get_setting_str,
|
||||||
|
get_setting_info = __vc_app.get_setting_info,
|
||||||
}
|
}
|
||||||
|
|
||||||
local _ffi = ffi
|
local _ffi = ffi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue