mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
settings menu update + UINode 'enabled' property
This commit is contained in:
parent
9b843817f8
commit
2380375f3c
15 changed files with 130 additions and 84 deletions
25
res/layouts/pages/settings_controls.xml.lua
Normal file
25
res/layouts/pages/settings_controls.xml.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
function refresh_sensitivity()
|
||||
document.sensitivity_label.text = string.format(
|
||||
"%s: %s",
|
||||
gui.str("Mouse Sensitivity", "settings"),
|
||||
core.str_setting("camera.sensitivity")
|
||||
)
|
||||
end
|
||||
|
||||
function change_sensitivity(val)
|
||||
core.set_setting("camera.sensitivity", val)
|
||||
refresh_sensitivity()
|
||||
end
|
||||
|
||||
function on_open()
|
||||
document.sensitivity_track.value = core.get_setting("camera.sensitivity")
|
||||
refresh_sensitivity()
|
||||
|
||||
local panel = document.bindings_panel
|
||||
local bindings = core.get_bindings()
|
||||
for i,name in ipairs(bindings) do
|
||||
panel:add(gui.template("binding", {
|
||||
id=name, name=gui.str(name)
|
||||
}))
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue