#544 #545 updates to graphics animations, controls, and form elements

This commit is contained in:
Mikayla Fischler 2024-09-21 22:49:36 -04:00
parent b15c60fdab
commit 0daf314918
19 changed files with 111 additions and 134 deletions

View File

@ -460,9 +460,9 @@ local function config_view(display)
TextBox{parent=net_c_4,x=1,y=4,height=6,text="This enables verifying that messages are authentic, so it is intended for security on multiplayer servers. All devices on the same network MUST use the same key if any device has a key. This does result in some extra compution (can slow things down).",fg_bg=g_lg_fg_bg} TextBox{parent=net_c_4,x=1,y=4,height=6,text="This enables verifying that messages are authentic, so it is intended for security on multiplayer servers. All devices on the same network MUST use the same key if any device has a key. This does result in some extra compution (can slow things down).",fg_bg=g_lg_fg_bg}
TextBox{parent=net_c_4,x=1,y=11,text="Facility Auth Key"} TextBox{parent=net_c_4,x=1,y=11,text="Facility Auth Key"}
local key, _, censor = TextField{parent=net_c_4,x=1,y=12,max_len=64,value=ini_cfg.AuthKey,width=32,height=1,fg_bg=bw_fg_bg} local key, _ = TextField{parent=net_c_4,x=1,y=12,max_len=64,value=ini_cfg.AuthKey,width=32,height=1,fg_bg=bw_fg_bg}
local function censor_key(enable) censor(util.trinary(enable, "*", nil)) end local function censor_key(enable) key.censor(util.trinary(enable, "*", nil)) end
local hide_key = CheckBox{parent=net_c_4,x=34,y=12,label="Hide",box_fg_bg=cpair(colors.lightBlue,colors.black),callback=censor_key} local hide_key = CheckBox{parent=net_c_4,x=34,y=12,label="Hide",box_fg_bg=cpair(colors.lightBlue,colors.black),callback=censor_key}

View File

@ -12,10 +12,10 @@ local element = require("graphics.element")
---@field fg_bg? cpair foreground/background colors ---@field fg_bg? cpair foreground/background colors
---@field hidden? boolean true to hide on initial draw ---@field hidden? boolean true to hide on initial draw
-- new waiting animation element -- Create a new waiting animation element.
---@param args waiting_args ---@param args waiting_args
---@return graphics_element element, element_id id ---@return Waiting element, element_id id
local function waiting(args) return function (args)
local state = 0 local state = 0
local run_animation = false local run_animation = false
@ -23,7 +23,7 @@ local function waiting(args)
args.height = 3 args.height = 3
-- create new graphics element base object -- create new graphics element base object
local e = element.new(args) local e = element.new(args --[[@as graphics_args]])
local blit_fg = e.fg_bg.blit_fgd local blit_fg = e.fg_bg.blit_fgd
local blit_bg = e.fg_bg.blit_bkg local blit_bg = e.fg_bg.blit_bkg
@ -103,7 +103,8 @@ local function waiting(args)
e.start_anim() e.start_anim()
return e.complete() ---@class Waiting:graphics_element
end local Waiting, id = e.complete()
return waiting return Waiting, id
end

View File

@ -20,10 +20,10 @@ local MOUSE_CLICK = core.events.MOUSE_CLICK
---@field fg_bg? cpair foreground/background colors ---@field fg_bg? cpair foreground/background colors
---@field hidden? boolean true to hide on initial draw ---@field hidden? boolean true to hide on initial draw
-- new app button -- Create a new 'app' style button control element, like on a phone.
---@param args app_button_args ---@param args app_button_args
---@return graphics_element element, element_id id ---@return App element, element_id id
local function app_button(args) return function (args)
element.assert(type(args.text) == "string", "text is a required field") element.assert(type(args.text) == "string", "text is a required field")
element.assert(type(args.title) == "string", "title is a required field") element.assert(type(args.title) == "string", "title is a required field")
element.assert(type(args.callback) == "function", "callback is a required field") element.assert(type(args.callback) == "function", "callback is a required field")
@ -33,7 +33,7 @@ local function app_button(args)
args.width = 7 args.width = 7
-- create new graphics element base object -- create new graphics element base object
local e = element.new(args) local e = element.new(args --[[@as graphics_args]])
-- draw the app button -- draw the app button
local function draw() local function draw()
@ -123,10 +123,8 @@ local function app_button(args)
draw() draw()
end end
-- initial draw ---@class App:graphics_element
e.redraw() local App, id = e.complete(true)
return e.complete() return App, id
end end
return app_button

View File

@ -15,10 +15,10 @@ local element = require("graphics.element")
---@field fg_bg? cpair foreground/background colors ---@field fg_bg? cpair foreground/background colors
---@field hidden? boolean true to hide on initial draw ---@field hidden? boolean true to hide on initial draw
-- new checkbox control -- Create a new checkbox control element.
---@param args checkbox_args ---@param args checkbox_args
---@return graphics_element element, element_id id ---@return CheckBox element, element_id id
local function checkbox(args) return function (args)
element.assert(type(args.label) == "string", "label is a required field") element.assert(type(args.label) == "string", "label is a required field")
element.assert(type(args.box_fg_bg) == "table", "box_fg_bg is a required field") element.assert(type(args.box_fg_bg) == "table", "box_fg_bg is a required field")
@ -27,7 +27,7 @@ local function checkbox(args)
args.width = 2 + string.len(args.label) args.width = 2 + string.len(args.label)
-- create new graphics element base object -- create new graphics element base object
local e = element.new(args) local e = element.new(args --[[@as graphics_args]])
e.value = args.default == true e.value = args.default == true
@ -112,10 +112,8 @@ local function checkbox(args)
draw_label() draw_label()
end end
-- initial draw ---@class CheckBox:graphics_element
e.redraw() local CheckBox, id = e.complete(true)
return e.complete() return CheckBox, id
end end
return checkbox

View File

@ -18,10 +18,10 @@ local element = require("graphics.element")
---@field fg_bg? cpair foreground/background colors ---@field fg_bg? cpair foreground/background colors
---@field hidden? boolean true to hide on initial draw ---@field hidden? boolean true to hide on initial draw
-- new hazard button -- Create a new hazard button control element.
---@param args hazard_button_args ---@param args hazard_button_args
---@return graphics_element element, element_id id ---@return HazardButton element, element_id id
local function hazard_button(args) return function (args)
element.assert(type(args.text) == "string", "text is a required field") element.assert(type(args.text) == "string", "text is a required field")
element.assert(type(args.accent) == "number", "accent is a required field") element.assert(type(args.accent) == "number", "accent is a required field")
element.assert(type(args.callback) == "function", "callback is a required field") element.assert(type(args.callback) == "function", "callback is a required field")
@ -32,7 +32,7 @@ local function hazard_button(args)
local timeout = args.timeout or 1.5 local timeout = args.timeout or 1.5
-- create new graphics element base object -- create new graphics element base object
local e = element.new(args) local e = element.new(args --[[@as graphics_args]])
-- draw border -- draw border
---@param accent color accent color ---@param accent color accent color
@ -198,10 +198,8 @@ local function hazard_button(args)
draw_border(args.accent) draw_border(args.accent)
end end
-- initial draw ---@class HazardButton:graphics_element
e.redraw() local HazardButton, id = e.complete(true)
return e.complete() return HazardButton, id
end end
return hazard_button

View File

@ -25,10 +25,10 @@ local element = require("graphics.element")
---@field fg_bg? cpair foreground/background colors ---@field fg_bg? cpair foreground/background colors
---@field hidden? boolean true to hide on initial draw ---@field hidden? boolean true to hide on initial draw
-- new multi button (latch selection, exclusively one button at a time) -- Create a new multi button control element (latch selection, exclusively one button at a time).
---@param args multi_button_args ---@param args multi_button_args
---@return graphics_element element, element_id id ---@return MultiButton element, element_id id
local function multi_button(args) return function (args)
element.assert(type(args.options) == "table", "options is a required field") element.assert(type(args.options) == "table", "options is a required field")
element.assert(#args.options > 0, "at least one option is required") element.assert(#args.options > 0, "at least one option is required")
element.assert(type(args.callback) == "function", "callback is a required field") element.assert(type(args.callback) == "function", "callback is a required field")
@ -52,7 +52,7 @@ local function multi_button(args)
args.width = (button_width * #args.options) + #args.options + 1 args.width = (button_width * #args.options) + #args.options + 1
-- create new graphics element base object -- create new graphics element base object
local e = element.new(args) local e = element.new(args --[[@as graphics_args]])
-- button state (convert nil to 1 if missing) -- button state (convert nil to 1 if missing)
e.value = args.default or 1 e.value = args.default or 1
@ -126,10 +126,8 @@ local function multi_button(args)
e.redraw() e.redraw()
end end
-- initial draw ---@class MultiButton:graphics_element
e.redraw() local MultiButton, id = e.complete(true)
return e.complete() return MultiButton, id
end end
return multi_button

View File

@ -25,10 +25,10 @@ local KEY_CLICK = core.events.KEY_CLICK
---@field fg_bg? cpair foreground/background colors ---@field fg_bg? cpair foreground/background colors
---@field hidden? boolean true to hide on initial draw ---@field hidden? boolean true to hide on initial draw
-- new push button -- Create a new push button control element.
---@param args push_button_args ---@param args push_button_args
---@return graphics_element element, element_id id ---@return PushButton element, element_id id
local function push_button(args) return function (args)
element.assert(type(args.text) == "string", "text is a required field") element.assert(type(args.text) == "string", "text is a required field")
element.assert(type(args.callback) == "function", "callback is a required field") element.assert(type(args.callback) == "function", "callback is a required field")
element.assert(type(args.min_width) == "nil" or (type(args.min_width) == "number" and args.min_width > 0), "min_width must be nil or a number > 0") element.assert(type(args.min_width) == "nil" or (type(args.min_width) == "number" and args.min_width > 0), "min_width must be nil or a number > 0")
@ -48,7 +48,7 @@ local function push_button(args)
end end
-- create new graphics element base object -- create new graphics element base object
local e = element.new(args, constrain) local e = element.new(args --[[@as graphics_args]], constrain)
local text_lines = util.strwrap(args.text, e.frame.w) local text_lines = util.strwrap(args.text, e.frame.w)
@ -157,10 +157,8 @@ local function push_button(args)
e.on_focused = show_pressed e.on_focused = show_pressed
e.on_unfocused = show_unpressed e.on_unfocused = show_unpressed
-- initial draw ---@class PushButton:graphics_element
e.redraw() local PushButton, id = e.complete(true)
return e.complete() return PushButton, id
end end
return push_button

View File

@ -23,10 +23,10 @@ local element = require("graphics.element")
---@field fg_bg? cpair foreground/background colors ---@field fg_bg? cpair foreground/background colors
---@field hidden? boolean true to hide on initial draw ---@field hidden? boolean true to hide on initial draw
-- new 2D radio button list (latch selection, exclusively one color at a time) -- Create a new 2D radio button list control element (latch selection, exclusively one color at a time).
---@param args radio_2d_args ---@param args radio_2d_args
---@return graphics_element element, element_id id ---@return Radio2D element, element_id id
local function radio_2d_button(args) return function (args)
element.assert(type(args.options) == "table" and #args.options > 0, "options should be a table with length >= 1") element.assert(type(args.options) == "table" and #args.options > 0, "options should be a table with length >= 1")
element.assert(util.is_int(args.rows) and util.is_int(args.columns), "rows/columns must be integers") element.assert(util.is_int(args.rows) and util.is_int(args.columns), "rows/columns must be integers")
element.assert((args.rows * args.columns) >= #args.options, "rows x columns size insufficient for provided number of options") element.assert((args.rows * args.columns) >= #args.options, "rows x columns size insufficient for provided number of options")
@ -70,7 +70,7 @@ local function radio_2d_button(args)
args.height = max_rows args.height = max_rows
-- create new graphics element base object -- create new graphics element base object
local e = element.new(args) local e = element.new(args --[[@as graphics_args]])
-- selected option (convert nil to 1 if missing) -- selected option (convert nil to 1 if missing)
e.value = args.default or 1 e.value = args.default or 1
@ -194,10 +194,8 @@ local function radio_2d_button(args)
e.on_enabled = e.redraw e.on_enabled = e.redraw
e.on_disabled = e.redraw e.on_disabled = e.redraw
-- initial draw ---@class Radio2D:graphics_element
e.redraw() local Radio2D, id = e.complete(true)
return e.complete() return Radio2D, id
end end
return radio_2d_button

View File

@ -21,10 +21,10 @@ local KEY_CLICK = core.events.KEY_CLICK
---@field fg_bg? cpair foreground/background colors ---@field fg_bg? cpair foreground/background colors
---@field hidden? boolean true to hide on initial draw ---@field hidden? boolean true to hide on initial draw
-- new radio button list (latch selection, exclusively one button at a time) -- Create a new radio button list control element (latch selection, exclusively one button at a time).
---@param args radio_button_args ---@param args radio_button_args
---@return graphics_element element, element_id id ---@return RadioButton element, element_id id
local function radio_button(args) return function (args)
element.assert(type(args.options) == "table", "options is a required field") element.assert(type(args.options) == "table", "options is a required field")
element.assert(#args.options > 0, "at least one option is required") element.assert(#args.options > 0, "at least one option is required")
element.assert(type(args.radio_colors) == "table", "radio_colors is a required field") element.assert(type(args.radio_colors) == "table", "radio_colors is a required field")
@ -49,7 +49,7 @@ local function radio_button(args)
args.height = #args.options -- one line per option args.height = #args.options -- one line per option
-- create new graphics element base object -- create new graphics element base object
local e = element.new(args) local e = element.new(args --[[@as graphics_args]])
local focused_opt = 1 local focused_opt = 1
@ -139,10 +139,8 @@ local function radio_button(args)
e.on_enabled = e.redraw e.on_enabled = e.redraw
e.on_disabled = e.redraw e.on_disabled = e.redraw
-- initial draw ---@class RadioButton:graphics_element
e.redraw() local RadioButton, id = e.complete(true)
return e.complete() return RadioButton, id
end end
return radio_button

View File

@ -17,14 +17,14 @@ local MOUSE_CLICK = core.events.MOUSE_CLICK
---@field fg_bg? cpair foreground/background colors ---@field fg_bg? cpair foreground/background colors
---@field hidden? boolean true to hide on initial draw ---@field hidden? boolean true to hide on initial draw
-- new sidebar tab selector -- Create a new sidebar tab selector control element.
---@param args sidebar_args ---@param args sidebar_args
---@return graphics_element element, element_id id ---@return Sidebar element, element_id id
local function sidebar(args) return function (args)
args.width = 3 args.width = 3
-- create new graphics element base object -- create new graphics element base object
local e = element.new(args) local e = element.new(args --[[@as graphics_args]])
-- default to 1st tab -- default to 1st tab
e.value = 1 e.value = 1
@ -166,9 +166,8 @@ local function sidebar(args)
-- element redraw -- element redraw
e.redraw = draw e.redraw = draw
e.redraw() ---@class Sidebar:graphics_element
local Sidebar, id = e.complete(true)
return e.complete() return Sidebar, id
end end
return sidebar

View File

@ -20,10 +20,10 @@ local element = require("graphics.element")
---@field fg_bg? cpair foreground/background colors ---@field fg_bg? cpair foreground/background colors
---@field hidden? boolean true to hide on initial draw ---@field hidden? boolean true to hide on initial draw
-- new spinbox control (minimum value is 0) -- Create a new spinbox control element (minimum value is 0).
---@param args spinbox_args ---@param args spinbox_args
---@return graphics_element element, element_id id ---@return SpinboxNumeric element, element_id id
local function spinbox(args) return function (args)
-- properties -- properties
local digits = {} local digits = {}
local wn_prec = args.whole_num_precision local wn_prec = args.whole_num_precision
@ -51,7 +51,7 @@ local function spinbox(args)
args.height = 3 args.height = 3
-- create new graphics element base object -- create new graphics element base object
local e = element.new(args) local e = element.new(args --[[@as graphics_args]])
-- set initial value -- set initial value
e.value = args.default or 0 e.value = args.default or 0
@ -179,10 +179,8 @@ local function spinbox(args)
draw_arrows(util.trinary(e.enabled, args.arrow_fg_bg.fgd, args.arrow_disable or colors.lightGray)) draw_arrows(util.trinary(e.enabled, args.arrow_fg_bg.fgd, args.arrow_disable or colors.lightGray))
end end
-- initial draw ---@class SpinboxNumeric:graphics_element
e.redraw() local SpinboxNumeric, id = e.complete(true)
return e.complete() return SpinboxNumeric, id
end end
return spinbox

View File

@ -17,10 +17,10 @@ local element = require("graphics.element")
---@field fg_bg? cpair foreground/background colors ---@field fg_bg? cpair foreground/background colors
---@field hidden? boolean true to hide on initial draw ---@field hidden? boolean true to hide on initial draw
-- new switch button (latch high/low) -- Create a new latching switch button control element.
---@param args switch_button_args ---@param args switch_button_args
---@return graphics_element element, element_id id ---@return SwitchButton element, element_id id
local function switch_button(args) return function (args)
element.assert(type(args.text) == "string", "text is a required field") element.assert(type(args.text) == "string", "text is a required field")
element.assert(type(args.callback) == "function", "callback is a required field") element.assert(type(args.callback) == "function", "callback is a required field")
element.assert(type(args.active_fg_bg) == "table", "active_fg_bg is a required field") element.assert(type(args.active_fg_bg) == "table", "active_fg_bg is a required field")
@ -33,7 +33,7 @@ local function switch_button(args)
args.width = math.max(text_width, args.min_width) args.width = math.max(text_width, args.min_width)
-- create new graphics element base object -- create new graphics element base object
local e = element.new(args) local e = element.new(args --[[@as graphics_args]])
e.value = args.default or false e.value = args.default or false
@ -72,10 +72,8 @@ local function switch_button(args)
e.redraw() e.redraw()
end end
-- initial draw ---@class SwitchButton:graphics_element
e.redraw() local SwitchButton, id = e.complete(true)
return e.complete() return SwitchButton, id
end end
return switch_button

View File

@ -23,10 +23,10 @@ local element = require("graphics.element")
---@field fg_bg? cpair foreground/background colors ---@field fg_bg? cpair foreground/background colors
---@field hidden? boolean true to hide on initial draw ---@field hidden? boolean true to hide on initial draw
-- new tab selector -- Create a new tab selector control element.
---@param args tabbar_args ---@param args tabbar_args
---@return graphics_element element, element_id id ---@return TabBar element, element_id id
local function tabbar(args) return function (args)
element.assert(type(args.tabs) == "table", "tabs is a required field") element.assert(type(args.tabs) == "table", "tabs is a required field")
element.assert(#args.tabs > 0, "at least one tab is required") element.assert(#args.tabs > 0, "at least one tab is required")
element.assert(type(args.callback) == "function", "callback is a required field") element.assert(type(args.callback) == "function", "callback is a required field")
@ -46,7 +46,7 @@ local function tabbar(args)
local button_width = math.max(max_width, args.min_width or 0) local button_width = math.max(max_width, args.min_width or 0)
-- create new graphics element base object -- create new graphics element base object
local e = element.new(args) local e = element.new(args --[[@as graphics_args]])
element.assert(e.frame.w >= (button_width * #args.tabs), "width insufficent to display all tabs") element.assert(e.frame.w >= (button_width * #args.tabs), "width insufficent to display all tabs")
@ -120,10 +120,8 @@ local function tabbar(args)
e.redraw() e.redraw()
end end
-- initial draw ---@class TabBar:graphics_element
e.redraw() local TabBar, id = e.complete(true)
return e.complete() return TabBar, id
end end
return tabbar

View File

@ -27,10 +27,10 @@ local MOUSE_CLICK = core.events.MOUSE_CLICK
---@field fg_bg? cpair foreground/background colors ---@field fg_bg? cpair foreground/background colors
---@field hidden? boolean true to hide on initial draw ---@field hidden? boolean true to hide on initial draw
-- new numeric entry field -- Create a new numeric entry field.
---@param args number_field_args ---@param args number_field_args
---@return graphics_element element, element_id id ---@return NumberField element, element_id id
local function number_field(args) return function (args)
element.assert(args.max_int_digits == nil or (util.is_int(args.max_int_digits) and args.max_int_digits > 0), "max_int_digits must be an integer greater than zero if supplied") element.assert(args.max_int_digits == nil or (util.is_int(args.max_int_digits) and args.max_int_digits > 0), "max_int_digits must be an integer greater than zero if supplied")
element.assert(args.max_frac_digits == nil or (util.is_int(args.max_frac_digits) and args.max_frac_digits > 0), "max_frac_digits must be an integer greater than zero if supplied") element.assert(args.max_frac_digits == nil or (util.is_int(args.max_frac_digits) and args.max_frac_digits > 0), "max_frac_digits must be an integer greater than zero if supplied")
@ -38,7 +38,7 @@ local function number_field(args)
args.can_focus = true args.can_focus = true
-- create new graphics element base object -- create new graphics element base object
local e = element.new(args) local e = element.new(args --[[@as graphics_args]])
local has_decimal = false local has_decimal = false
@ -195,10 +195,8 @@ local function number_field(args)
e.on_disabled = ifield.show e.on_disabled = ifield.show
e.redraw = ifield.show e.redraw = ifield.show
-- initial draw ---@class NumberField:graphics_element
e.redraw() local NumberField, id = e.complete(true)
return e.complete() return NumberField, id
end end
return number_field

View File

@ -19,15 +19,15 @@ local MOUSE_CLICK = core.events.MOUSE_CLICK
---@field fg_bg? cpair foreground/background colors ---@field fg_bg? cpair foreground/background colors
---@field hidden? boolean true to hide on initial draw ---@field hidden? boolean true to hide on initial draw
-- new text entry field -- Create a new text entry field.
---@param args text_field_args ---@param args text_field_args
---@return graphics_element element, element_id id, function censor_ctl ---@return TextField element, element_id id
local function text_field(args) return function (args)
args.height = 1 args.height = 1
args.can_focus = true args.can_focus = true
-- create new graphics element base object -- create new graphics element base object
local e = element.new(args) local e = element.new(args --[[@as graphics_args]])
-- set initial value -- set initial value
e.value = args.value or "" e.value = args.value or ""
@ -95,11 +95,10 @@ local function text_field(args)
e.on_disabled = ifield.show e.on_disabled = ifield.show
e.redraw = ifield.show e.redraw = ifield.show
-- initial draw ---@class TextField:graphics_element
e.redraw() local TextField, id = e.complete(true)
local elem, id = e.complete() TextField.censor = ifield.censor
return elem, id, ifield.censor
return TextField, id
end end
return text_field

View File

@ -282,9 +282,9 @@ local function config_view(display)
TextBox{parent=net_c_4,x=1,y=6,height=6,text="This enables verifying that messages are authentic, so it is intended for security on multiplayer servers.",fg_bg=g_lg_fg_bg} TextBox{parent=net_c_4,x=1,y=6,height=6,text="This enables verifying that messages are authentic, so it is intended for security on multiplayer servers.",fg_bg=g_lg_fg_bg}
TextBox{parent=net_c_4,x=1,y=12,text="Facility Auth Key"} TextBox{parent=net_c_4,x=1,y=12,text="Facility Auth Key"}
local key, _, censor = TextField{parent=net_c_4,x=1,y=13,max_len=64,value=ini_cfg.AuthKey,width=24,height=1,fg_bg=bw_fg_bg} local key, _ = TextField{parent=net_c_4,x=1,y=13,max_len=64,value=ini_cfg.AuthKey,width=24,height=1,fg_bg=bw_fg_bg}
local function censor_key(enable) censor(util.trinary(enable, "*", nil)) end local function censor_key(enable) key.censor(util.trinary(enable, "*", nil)) end
-- declare back first so tabbing makes sense visually -- declare back first so tabbing makes sense visually
PushButton{parent=net_c_4,x=1,y=15,text="\x1b Back",callback=function()net_pane.set_value(3)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} PushButton{parent=net_c_4,x=1,y=15,text="\x1b Back",callback=function()net_pane.set_value(3)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg}

View File

@ -240,9 +240,9 @@ function system.create(tool_ctl, main_pane, cfg_sys, divs, style, exit)
TextBox{parent=net_c_3,x=1,y=4,height=6,text="This enables verifying that messages are authentic, so it is intended for security on multiplayer servers. All devices on the same network MUST use the same key if any device has a key. This does result in some extra compution (can slow things down).",fg_bg=g_lg_fg_bg} TextBox{parent=net_c_3,x=1,y=4,height=6,text="This enables verifying that messages are authentic, so it is intended for security on multiplayer servers. All devices on the same network MUST use the same key if any device has a key. This does result in some extra compution (can slow things down).",fg_bg=g_lg_fg_bg}
TextBox{parent=net_c_3,x=1,y=11,text="Facility Auth Key"} TextBox{parent=net_c_3,x=1,y=11,text="Facility Auth Key"}
local key, _, censor = TextField{parent=net_c_3,x=1,y=12,max_len=64,value=ini_cfg.AuthKey,width=32,height=1,fg_bg=bw_fg_bg} local key, _ = TextField{parent=net_c_3,x=1,y=12,max_len=64,value=ini_cfg.AuthKey,width=32,height=1,fg_bg=bw_fg_bg}
local function censor_key(enable) censor(util.trinary(enable, "*", nil)) end local function censor_key(enable) key.censor(util.trinary(enable, "*", nil)) end
local hide_key = CheckBox{parent=net_c_3,x=34,y=12,label="Hide",box_fg_bg=cpair(colors.lightBlue,colors.black),callback=censor_key} local hide_key = CheckBox{parent=net_c_3,x=34,y=12,label="Hide",box_fg_bg=cpair(colors.lightBlue,colors.black),callback=censor_key}

View File

@ -446,9 +446,9 @@ local function config_view(display)
TextBox{parent=net_c_3,x=1,y=4,height=6,text="This enables verifying that messages are authentic, so it is intended for security on multiplayer servers. All devices on the same network MUST use the same key if any device has a key. This does result in some extra compution (can slow things down).",fg_bg=g_lg_fg_bg} TextBox{parent=net_c_3,x=1,y=4,height=6,text="This enables verifying that messages are authentic, so it is intended for security on multiplayer servers. All devices on the same network MUST use the same key if any device has a key. This does result in some extra compution (can slow things down).",fg_bg=g_lg_fg_bg}
TextBox{parent=net_c_3,x=1,y=11,text="Facility Auth Key"} TextBox{parent=net_c_3,x=1,y=11,text="Facility Auth Key"}
local key, _, censor = TextField{parent=net_c_3,x=1,y=12,max_len=64,value=ini_cfg.AuthKey,width=32,height=1,fg_bg=bw_fg_bg} local key, _ = TextField{parent=net_c_3,x=1,y=12,max_len=64,value=ini_cfg.AuthKey,width=32,height=1,fg_bg=bw_fg_bg}
local function censor_key(enable) censor(tri(enable, "*", nil)) end local function censor_key(enable) key.censor(tri(enable, "*", nil)) end
local hide_key = CheckBox{parent=net_c_3,x=34,y=12,label="Hide",box_fg_bg=cpair(colors.lightBlue,colors.black),callback=censor_key} local hide_key = CheckBox{parent=net_c_3,x=34,y=12,label="Hide",box_fg_bg=cpair(colors.lightBlue,colors.black),callback=censor_key}

View File

@ -710,9 +710,9 @@ local function config_view(display)
TextBox{parent=net_c_4,x=1,y=4,height=6,text="This enables verifying that messages are authentic, so it is intended for security on multiplayer servers. All devices on the same network MUST use the same key if any device has a key. This does result in some extra compution (can slow things down).",fg_bg=g_lg_fg_bg} TextBox{parent=net_c_4,x=1,y=4,height=6,text="This enables verifying that messages are authentic, so it is intended for security on multiplayer servers. All devices on the same network MUST use the same key if any device has a key. This does result in some extra compution (can slow things down).",fg_bg=g_lg_fg_bg}
TextBox{parent=net_c_4,x=1,y=11,text="Facility Auth Key"} TextBox{parent=net_c_4,x=1,y=11,text="Facility Auth Key"}
local key, _, censor = TextField{parent=net_c_4,x=1,y=12,max_len=64,value=ini_cfg.AuthKey,width=32,height=1,fg_bg=bw_fg_bg} local key, _ = TextField{parent=net_c_4,x=1,y=12,max_len=64,value=ini_cfg.AuthKey,width=32,height=1,fg_bg=bw_fg_bg}
local function censor_key(enable) censor(util.trinary(enable, "*", nil)) end local function censor_key(enable) key.censor(util.trinary(enable, "*", nil)) end
local hide_key = CheckBox{parent=net_c_4,x=34,y=12,label="Hide",box_fg_bg=cpair(colors.lightBlue,colors.black),callback=censor_key} local hide_key = CheckBox{parent=net_c_4,x=34,y=12,label="Hide",box_fg_bg=cpair(colors.lightBlue,colors.black),callback=censor_key}