2020-12-30 14:48:51 +00:00
|
|
|
local M = { }
|
|
|
|
|
|
|
|
function M.drawSection(section, separator)
|
2021-01-03 19:11:22 +00:00
|
|
|
local status = {}
|
|
|
|
for _, statusFunction in pairs(section) do
|
2020-12-30 14:48:51 +00:00
|
|
|
local localstatus = statusFunction()
|
2021-01-03 19:11:22 +00:00
|
|
|
if #localstatus > 0 then
|
|
|
|
table.insert(status, localstatus)
|
2020-12-30 14:48:51 +00:00
|
|
|
end
|
|
|
|
end
|
2021-01-03 19:11:22 +00:00
|
|
|
if #status == 0 then
|
|
|
|
return ''
|
|
|
|
end
|
|
|
|
local sep = ' '
|
|
|
|
if #separator > 0 then
|
|
|
|
sep = ' ' .. separator .. ' '
|
2020-12-30 14:48:51 +00:00
|
|
|
end
|
2021-01-03 19:11:22 +00:00
|
|
|
return ' ' .. table.concat(status, sep) .. ' '
|
2020-12-30 14:48:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|