mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 22:11:51 +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,25 +1,25 @@
|
|||
function create_setting(id, name, step, postfix)
|
||||
local info = core.get_setting_info(id)
|
||||
local info = app.get_setting_info(id)
|
||||
postfix = postfix 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,
|
||||
postfix=postfix
|
||||
}))
|
||||
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)
|
||||
core.set_setting(id, x)
|
||||
app.set_setting(id, x)
|
||||
-- updating label
|
||||
document[id..".L"].text = string.format(
|
||||
"%s: %s%s",
|
||||
gui.str(name, "settings"),
|
||||
core.str_setting(id),
|
||||
app.str_setting(id),
|
||||
postfix
|
||||
)
|
||||
end
|
||||
|
|
@ -54,7 +54,7 @@ function on_open()
|
|||
create_setting("audio.volume-music", "Music", 0.01)
|
||||
document.root:add("<label context='settings'>@Microphone</label>")
|
||||
document.root:add("<select id='input_device_select' "..
|
||||
"onselect='function(opt) core.set_setting(\"audio.input-device\", opt) end'/>")
|
||||
"onselect='function(opt) app.set_setting(\"audio.input-device\", opt) end'/>")
|
||||
document.root:add("<container id='input_volume_outer' color='#000000' size='4'>"
|
||||
.."<container id='input_volume_inner' color='#00FF00FF' pos='1' size='2'/>"
|
||||
.."</container>")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue