mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
fixed up types/names for hazard button
This commit is contained in:
parent
9d60777223
commit
d4da6a7f3a
@ -16,7 +16,7 @@ local config = require("coordinator.config")
|
|||||||
local coordinator = require("coordinator.coordinator")
|
local coordinator = require("coordinator.coordinator")
|
||||||
local renderer = require("coordinator.renderer")
|
local renderer = require("coordinator.renderer")
|
||||||
|
|
||||||
local COORDINATOR_VERSION = "alpha-v0.5.1"
|
local COORDINATOR_VERSION = "alpha-v0.5.2"
|
||||||
|
|
||||||
local print = util.print
|
local print = util.print
|
||||||
local println = util.println
|
local println = util.println
|
||||||
|
@ -21,11 +21,10 @@ local element = {}
|
|||||||
|
|
||||||
---@alias graphics_args graphics_args_generic
|
---@alias graphics_args graphics_args_generic
|
||||||
---|waiting_args
|
---|waiting_args
|
||||||
|
---|hazard_button_args
|
||||||
---|multi_button_args
|
---|multi_button_args
|
||||||
---|push_button_args
|
---|push_button_args
|
||||||
---|scram_button_args
|
|
||||||
---|spinbox_args
|
---|spinbox_args
|
||||||
---|start_button_args
|
|
||||||
---|switch_button_args
|
---|switch_button_args
|
||||||
---|core_map_args
|
---|core_map_args
|
||||||
---|data_indicator_args
|
---|data_indicator_args
|
||||||
|
@ -5,7 +5,7 @@ local tcd = require("scada-common.tcallbackdsp")
|
|||||||
local core = require("graphics.core")
|
local core = require("graphics.core")
|
||||||
local element = require("graphics.element")
|
local element = require("graphics.element")
|
||||||
|
|
||||||
---@class scram_button_args
|
---@class hazard_button_args
|
||||||
---@field text string text to show on button
|
---@field text string text to show on button
|
||||||
---@field accent color accent color for hazard border
|
---@field accent color accent color for hazard border
|
||||||
---@field callback function function to call on touch
|
---@field callback function function to call on touch
|
||||||
@ -15,10 +15,10 @@ local element = require("graphics.element")
|
|||||||
---@field y? integer 1 if omitted
|
---@field y? integer 1 if omitted
|
||||||
---@field fg_bg? cpair foreground/background colors
|
---@field fg_bg? cpair foreground/background colors
|
||||||
|
|
||||||
-- new scram button
|
-- new hazard button
|
||||||
---@param args scram_button_args
|
---@param args hazard_button_args
|
||||||
---@return graphics_element element, element_id id
|
---@return graphics_element element, element_id id
|
||||||
local function scram_button(args)
|
local function hazard_button(args)
|
||||||
assert(type(args.text) == "string", "graphics.elements.controls.hazard_button: text is a required field")
|
assert(type(args.text) == "string", "graphics.elements.controls.hazard_button: text is a required field")
|
||||||
assert(type(args.accent) == "number", "graphics.elements.controls.hazard_button: accent is a required field")
|
assert(type(args.accent) == "number", "graphics.elements.controls.hazard_button: accent is a required field")
|
||||||
assert(type(args.callback) == "function", "graphics.elements.controls.hazard_button: callback is a required field")
|
assert(type(args.callback) == "function", "graphics.elements.controls.hazard_button: callback is a required field")
|
||||||
@ -77,4 +77,4 @@ local function scram_button(args)
|
|||||||
return e.get()
|
return e.get()
|
||||||
end
|
end
|
||||||
|
|
||||||
return scram_button
|
return hazard_button
|
||||||
|
Loading…
Reference in New Issue
Block a user