redundancy reduced

This commit is contained in:
MihailRis
2024-04-30 14:49:55 +03:00
parent 8c86bcae54
commit 9b843817f8
10 changed files with 136 additions and 146 deletions
+2 -5
View File
@@ -1,8 +1,5 @@
function create_setting(id, name, step, postfix)
local info = core.get_setting_info(id)
if postfix == nil then
postfix = ""
end
document.settings_panel:add(gui.template("track_setting", {
id=id,
name=gui.str(name, "settings"),
@@ -10,7 +7,7 @@ function create_setting(id, name, step, postfix)
min=info.min,
max=info.max,
step=step,
postfix=postfix
postfix=postfix or ""
}))
end
@@ -41,6 +38,6 @@ function on_open()
create_checkbox("camera.shaking", "Camera Shaking")
document.langs_btn.text = string.format(
"%s: %s", gui.str("Language", "settings"),
gui.get_locales_info()[gui.get_locale()].name
gui.get_locales_info()[core.get_setting("ui.language")].name
)
end