mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
some luacheck fixes
This commit is contained in:
parent
7e33f22577
commit
8064b33a36
@ -18,11 +18,15 @@ local iocontrol = {}
|
|||||||
---@class ioctl
|
---@class ioctl
|
||||||
local io = {}
|
local io = {}
|
||||||
|
|
||||||
|
-- luacheck push ignore
|
||||||
|
|
||||||
-- placeholder acknowledge function for type hinting
|
-- placeholder acknowledge function for type hinting
|
||||||
---@param success boolean
|
---@param success boolean
|
||||||
---@diagnostic disable-next-line: unused-local
|
---@diagnostic disable-next-line: unused-local
|
||||||
local function __generic_ack(success) end
|
local function __generic_ack(success) end
|
||||||
|
|
||||||
|
-- luacheck pop
|
||||||
|
|
||||||
-- initialize the coordinator IO controller
|
-- initialize the coordinator IO controller
|
||||||
---@param conf facility_conf configuration
|
---@param conf facility_conf configuration
|
||||||
---@param comms coord_comms comms reference
|
---@param comms coord_comms comms reference
|
||||||
|
@ -141,9 +141,7 @@ local function hazard_button(args)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- handle mouse interaction
|
-- handle mouse interaction
|
||||||
---@param event mouse_interaction mouse event
|
function e.handle_mouse(_)
|
||||||
---@diagnostic disable-next-line: unused-local
|
|
||||||
function e.handle_mouse(event)
|
|
||||||
if e.enabled then
|
if e.enabled then
|
||||||
-- change text color to indicate clicked
|
-- change text color to indicate clicked
|
||||||
e.window.setTextColor(args.accent)
|
e.window.setTextColor(args.accent)
|
||||||
|
@ -48,9 +48,7 @@ local function push_button(args)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- handle mouse interaction
|
-- handle mouse interaction
|
||||||
---@param event mouse_interaction mouse event
|
function e.handle_mouse(_)
|
||||||
---@diagnostic disable-next-line: unused-local
|
|
||||||
function e.handle_mouse(event)
|
|
||||||
if e.enabled then
|
if e.enabled then
|
||||||
if args.active_fg_bg ~= nil then
|
if args.active_fg_bg ~= nil then
|
||||||
-- show as pressed
|
-- show as pressed
|
||||||
|
@ -63,9 +63,7 @@ local function switch_button(args)
|
|||||||
draw_state()
|
draw_state()
|
||||||
|
|
||||||
-- handle mouse interaction
|
-- handle mouse interaction
|
||||||
---@param event mouse_interaction mouse event
|
function e.handle_mouse(_)
|
||||||
---@diagnostic disable-next-line: unused-local
|
|
||||||
function e.handle_mouse(event)
|
|
||||||
if e.enabled then
|
if e.enabled then
|
||||||
-- toggle state
|
-- toggle state
|
||||||
e.value = not e.value
|
e.value = not e.value
|
||||||
|
@ -113,6 +113,8 @@ end
|
|||||||
---@return table lines
|
---@return table lines
|
||||||
function util.strwrap(str, limit) return cc_strings.wrap(str, limit) end
|
function util.strwrap(str, limit) return cc_strings.wrap(str, limit) end
|
||||||
|
|
||||||
|
-- luacheck push no unused varargs
|
||||||
|
|
||||||
-- concatenation with built-in to string
|
-- concatenation with built-in to string
|
||||||
---@nodiscard
|
---@nodiscard
|
||||||
---@vararg any
|
---@vararg any
|
||||||
@ -136,6 +138,8 @@ function util.sprintf(format, ...)
|
|||||||
return string.format(format, table.unpack(arg))
|
return string.format(format, table.unpack(arg))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- luacheck pop
|
||||||
|
|
||||||
-- format a number string with commas as the thousands separator<br>
|
-- format a number string with commas as the thousands separator<br>
|
||||||
-- subtracts from spaces at the start if present for each comma used
|
-- subtracts from spaces at the start if present for each comma used
|
||||||
---@nodiscard
|
---@nodiscard
|
||||||
|
Loading…
x
Reference in New Issue
Block a user