Skip to content

Commit

Permalink
luacheck
Browse files Browse the repository at this point in the history
  • Loading branch information
y5nw committed Feb 15, 2025
1 parent 236d749 commit b5f3e21
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions builtin/common/settings/components.lua
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,16 @@ function make.key(setting)
self.resettable = core.settings:has(setting.name)
local btn_bind_width = math.max(2.5, avail_w/2)
local value = core.settings:get(setting.name)
local fs = "label[0,0.4;" .. get_label(setting) .. "]" ..
("button_key[%f,0;%f,0.8;%s;%s]"):format(btn_bind_width, btn_bind_width-0.8, btn_bind, core.formspec_escape(value)) ..
("image_button[%f,0;0.8,0.8;%s;%s;]"):format(avail_w - 0.8,
core.formspec_escape(defaulttexturedir .. "clear.png"),
btn_clear)
return fs, 0.8
local fs = {
("label[0,0.4;%s]"):format(get_label(setting)),
("button_key[%f,0;%f,0.8;%s;%s]"):format(
btn_bind_width, btn_bind_width-0.8,
btn_bind, core.formspec_escape(value)),
("image_button[%f,0;0.8,0.8;%s;%s;]"):format(avail_w - 0.8,
core.formspec_escape(defaulttexturedir .. "clear.png"),
btn_clear),
}
return table.concat(fs), 0.8
end,

on_submit = function(self, fields)
Expand Down

0 comments on commit b5f3e21

Please sign in to comment.