mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
graphics elements comments
This commit is contained in:
parent
1bf21564f9
commit
70d9da847e
@ -92,6 +92,8 @@ local function data(args)
|
||||
end
|
||||
end
|
||||
|
||||
-- set the value
|
||||
---@param val any new value
|
||||
function e.set_value(val) e.on_update(val) end
|
||||
|
||||
-- initial value draw
|
||||
|
@ -41,6 +41,7 @@ local function hbar(args)
|
||||
end
|
||||
|
||||
-- handle data changes
|
||||
---@param fraction number 0.0 to 1.0
|
||||
function e.on_update(fraction)
|
||||
e.value = fraction
|
||||
|
||||
@ -109,6 +110,8 @@ local function hbar(args)
|
||||
e.on_update(e.value)
|
||||
end
|
||||
|
||||
-- set the percentage value
|
||||
---@param val number 0.0 to 1.0
|
||||
function e.set_value(val) e.on_update(val) end
|
||||
|
||||
-- initialize to 0
|
||||
|
@ -60,6 +60,8 @@ local function icon(args)
|
||||
e.window.blit(blit_cmd.text, blit_cmd.fgd, blit_cmd.bkg)
|
||||
end
|
||||
|
||||
-- set indicator state
|
||||
---@param val integer indicator state
|
||||
function e.set_value(val) e.on_update(val) end
|
||||
|
||||
-- initial icon draw
|
||||
|
@ -40,6 +40,8 @@ local function indicator_light(args)
|
||||
end
|
||||
end
|
||||
|
||||
-- set indicator state
|
||||
---@param val boolean indicator state
|
||||
function e.set_value(val) e.on_update(val) end
|
||||
|
||||
-- write label and initial indicator light
|
||||
|
@ -66,6 +66,8 @@ local function state_indicator(args)
|
||||
e.window.blit(blit_cmd.text, blit_cmd.fgd, blit_cmd.bkg)
|
||||
end
|
||||
|
||||
-- set indicator state
|
||||
---@param val integer indicator state
|
||||
function e.set_value(val) e.on_update(val) end
|
||||
|
||||
-- initial draw
|
||||
|
@ -51,6 +51,8 @@ local function tristate_indicator_light(args)
|
||||
end
|
||||
end
|
||||
|
||||
-- set indicator state
|
||||
---@param val integer indicator state
|
||||
function e.set_value(val) e.on_update(val) end
|
||||
|
||||
-- write label and initial indicator light
|
||||
|
@ -32,6 +32,7 @@ local function vbar(args)
|
||||
local two_thirds = util.strrep("\x83", e.frame.w)
|
||||
|
||||
-- handle data changes
|
||||
---@param fraction number 0.0 to 1.0
|
||||
function e.on_update(fraction)
|
||||
e.value = fraction
|
||||
|
||||
@ -91,6 +92,8 @@ local function vbar(args)
|
||||
e.on_update(e.value)
|
||||
end
|
||||
|
||||
-- set the percentage value
|
||||
---@param val number 0.0 to 1.0
|
||||
function e.set_value(val) e.on_update(val) end
|
||||
|
||||
return e.get()
|
||||
|
Loading…
Reference in New Issue
Block a user