#580 supervisor front panel updates for wired modem support
This commit is contained in:
@@ -19,16 +19,14 @@ local ui = {
|
||||
}
|
||||
|
||||
-- try to start the UI
|
||||
---@param wl_modem boolean if there is a separate wireless modem to display the status of
|
||||
---@param theme FP_THEME front panel theme
|
||||
---@param color_mode COLOR_MODE color mode
|
||||
---@param config svr_config configuration
|
||||
---@return boolean success, any error_msg
|
||||
function renderer.try_start_ui(wl_modem, theme, color_mode)
|
||||
function renderer.try_start_ui(config)
|
||||
local status, msg = true, nil
|
||||
|
||||
if ui.display == nil then
|
||||
-- set theme
|
||||
style.set_theme(theme, color_mode)
|
||||
style.set_theme(config.FrontPanelTheme, config.ColorMode)
|
||||
|
||||
-- reset terminal
|
||||
term.setTextColor(colors.white)
|
||||
@@ -42,7 +40,7 @@ function renderer.try_start_ui(wl_modem, theme, color_mode)
|
||||
end
|
||||
|
||||
-- apply color mode
|
||||
local c_mode_overrides = style.theme.color_modes[color_mode]
|
||||
local c_mode_overrides = style.theme.color_modes[config.ColorMode]
|
||||
for i = 1, #c_mode_overrides do
|
||||
term.setPaletteColor(c_mode_overrides[i].c, c_mode_overrides[i].hex)
|
||||
end
|
||||
@@ -50,7 +48,7 @@ function renderer.try_start_ui(wl_modem, theme, color_mode)
|
||||
-- init front panel view
|
||||
status, msg = pcall(function ()
|
||||
ui.display = DisplayBox{window=term.current(),fg_bg=style.fp.root}
|
||||
panel_view(ui.display, wl_modem)
|
||||
panel_view(ui.display, config)
|
||||
end)
|
||||
|
||||
if status then
|
||||
|
||||
Reference in New Issue
Block a user