mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 21:41:50 +00:00
remove settings-related functions from core
This commit is contained in:
parent
5260062181
commit
a6301c8837
14 changed files with 119 additions and 120 deletions
|
|
@ -1,12 +1,12 @@
|
|||
function create_setting(id, name, step, postfix, tooltip, changeonrelease)
|
||||
local info = core.get_setting_info(id)
|
||||
local info = app.get_setting_info(id)
|
||||
postfix = postfix or ""
|
||||
tooltip = tooltip or ""
|
||||
changeonrelease = changeonrelease or ""
|
||||
document.root:add(gui.template("track_setting", {
|
||||
id=id,
|
||||
name=gui.str(name, "settings"),
|
||||
value=core.get_setting(id),
|
||||
value=app.get_setting(id),
|
||||
min=info.min,
|
||||
max=info.max,
|
||||
step=step,
|
||||
|
|
@ -14,15 +14,15 @@ function create_setting(id, name, step, postfix, tooltip, changeonrelease)
|
|||
tooltip=tooltip,
|
||||
changeonrelease=changeonrelease
|
||||
}))
|
||||
update_setting(core.get_setting(id), id, name, postfix)
|
||||
update_setting(app.get_setting(id), id, name, postfix)
|
||||
end
|
||||
|
||||
function update_setting(x, id, name, postfix)
|
||||
-- updating label
|
||||
document[id..".L"].text = string.format(
|
||||
"%s: %s%s",
|
||||
gui.str(name, "settings"),
|
||||
core.str_setting(id),
|
||||
"%s: %s%s",
|
||||
gui.str(name, "settings"),
|
||||
app.str_setting(id),
|
||||
postfix
|
||||
)
|
||||
end
|
||||
|
|
@ -30,8 +30,8 @@ end
|
|||
function create_checkbox(id, name, tooltip)
|
||||
tooltip = tooltip or ''
|
||||
document.root:add(string.format(
|
||||
"<checkbox consumer='function(x) core.set_setting(\"%s\", x) end' checked='%s' tooltip='%s'>%s</checkbox>",
|
||||
id, core.str_setting(id), gui.str(tooltip, "settings"), gui.str(name, "settings")
|
||||
"<checkbox consumer='function(x) app.set_setting(\"%s\", x) end' checked='%s' tooltip='%s'>%s</checkbox>",
|
||||
id, app.str_setting(id), gui.str(tooltip, "settings"), gui.str(name, "settings")
|
||||
))
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue