#118 graphics cleanup
This commit is contained in:
@@ -12,6 +12,7 @@ local element = require("graphics.element")
|
||||
---@field fg_bg? cpair foreground/background colors
|
||||
|
||||
-- new root display box
|
||||
---@nodiscard
|
||||
---@param args displaybox_args
|
||||
local function displaybox(args)
|
||||
-- create new graphics element base object
|
||||
|
||||
@@ -13,6 +13,7 @@ local element = require("graphics.element")
|
||||
---@field fg_bg? cpair foreground/background colors
|
||||
|
||||
-- new div element
|
||||
---@nodiscard
|
||||
---@param args div_args
|
||||
---@return graphics_element element, element_id id
|
||||
local function div(args)
|
||||
|
||||
@@ -20,6 +20,7 @@ local flasher = require("graphics.flasher")
|
||||
---@field fg_bg? cpair foreground/background colors
|
||||
|
||||
-- new alarm indicator light
|
||||
---@nodiscard
|
||||
---@param args alarm_indicator_light
|
||||
---@return graphics_element element, element_id id
|
||||
local function alarm_indicator_light(args)
|
||||
|
||||
@@ -14,6 +14,7 @@ local element = require("graphics.element")
|
||||
---@field y? integer 1 if omitted
|
||||
|
||||
-- new core map box
|
||||
---@nodiscard
|
||||
---@param args core_map_args
|
||||
---@return graphics_element element, element_id id
|
||||
local function core_map(args)
|
||||
|
||||
@@ -19,6 +19,7 @@ local element = require("graphics.element")
|
||||
---@field fg_bg? cpair foreground/background colors
|
||||
|
||||
-- new data indicator
|
||||
---@nodiscard
|
||||
---@param args data_indicator_args
|
||||
---@return graphics_element element, element_id id
|
||||
local function data(args)
|
||||
|
||||
@@ -17,6 +17,7 @@ local element = require("graphics.element")
|
||||
---@field fg_bg? cpair foreground/background colors
|
||||
|
||||
-- new horizontal bar
|
||||
---@nodiscard
|
||||
---@param args hbar_args
|
||||
---@return graphics_element element, element_id id
|
||||
local function hbar(args)
|
||||
|
||||
@@ -20,6 +20,7 @@ local element = require("graphics.element")
|
||||
---@field fg_bg? cpair foreground/background colors
|
||||
|
||||
-- new icon indicator
|
||||
---@nodiscard
|
||||
---@param args icon_indicator_args
|
||||
---@return graphics_element element, element_id id
|
||||
local function icon(args)
|
||||
|
||||
@@ -18,6 +18,7 @@ local flasher = require("graphics.flasher")
|
||||
---@field fg_bg? cpair foreground/background colors
|
||||
|
||||
-- new indicator light
|
||||
---@nodiscard
|
||||
---@param args indicator_light_args
|
||||
---@return graphics_element element, element_id id
|
||||
local function indicator_light(args)
|
||||
|
||||
@@ -18,6 +18,7 @@ local element = require("graphics.element")
|
||||
---@field fg_bg? cpair foreground/background colors
|
||||
|
||||
-- new power indicator
|
||||
---@nodiscard
|
||||
---@param args power_indicator_args
|
||||
---@return graphics_element element, element_id id
|
||||
local function power(args)
|
||||
|
||||
@@ -19,6 +19,7 @@ local element = require("graphics.element")
|
||||
---@field fg_bg? cpair foreground/background colors
|
||||
|
||||
-- new radiation indicator
|
||||
---@nodiscard
|
||||
---@param args rad_indicator_args
|
||||
---@return graphics_element element, element_id id
|
||||
local function rad(args)
|
||||
|
||||
@@ -20,6 +20,7 @@ local element = require("graphics.element")
|
||||
---@field fg_bg? cpair foreground/background colors
|
||||
|
||||
-- new state indicator
|
||||
---@nodiscard
|
||||
---@param args state_indicator_args
|
||||
---@return graphics_element element, element_id id
|
||||
local function state_indicator(args)
|
||||
|
||||
@@ -20,6 +20,7 @@ local flasher = require("graphics.flasher")
|
||||
---@field fg_bg? cpair foreground/background colors
|
||||
|
||||
-- new tri-state indicator light
|
||||
---@nodiscard
|
||||
---@param args tristate_indicator_light_args
|
||||
---@return graphics_element element, element_id id
|
||||
local function tristate_indicator_light(args)
|
||||
|
||||
@@ -15,6 +15,7 @@ local element = require("graphics.element")
|
||||
---@field fg_bg? cpair foreground/background colors
|
||||
|
||||
-- new vertical bar
|
||||
---@nodiscard
|
||||
---@param args vbar_args
|
||||
---@return graphics_element element, element_id id
|
||||
local function vbar(args)
|
||||
|
||||
@@ -144,7 +144,7 @@ local function rectangle(args)
|
||||
e.window.blit(spaces, blit_fg, blit_bg_top_bot)
|
||||
end
|
||||
else
|
||||
if (args.thin == true) then
|
||||
if args.thin == true then
|
||||
e.window.blit(p_s, blit_fg_sides, blit_bg_sides)
|
||||
else
|
||||
e.window.blit(p_s, blit_fg, blit_bg_sides)
|
||||
|
||||
@@ -60,7 +60,7 @@ local function tiling(args)
|
||||
-- create pattern
|
||||
for y = start_y, inner_height + (start_y - 1) do
|
||||
e.window.setCursorPos(start_x, y)
|
||||
for x = 1, inner_width do
|
||||
for _ = 1, inner_width do
|
||||
if alternator then
|
||||
if even then
|
||||
e.window.blit(" ", "00", fill_a .. fill_a)
|
||||
|
||||
Reference in New Issue
Block a user