mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#63 use util.strrep where appropriate
This commit is contained in:
parent
d8bbe4b459
commit
bc844d21bd
@ -28,9 +28,7 @@ local function hbar(args)
|
|||||||
assert(bar_width > 0, "graphics.elements.hbar: too small for bar")
|
assert(bar_width > 0, "graphics.elements.hbar: too small for bar")
|
||||||
|
|
||||||
-- set background blit string
|
-- set background blit string
|
||||||
for _ = 1, bar_width do
|
bkg = util.strrep(args.bar_fg_bg.blit_bkg, bar_width)
|
||||||
bkg = bkg .. args.bar_fg_bg.blit_bkg
|
|
||||||
end
|
|
||||||
|
|
||||||
-- handle data changes
|
-- handle data changes
|
||||||
function e.on_update(fraction)
|
function e.on_update(fraction)
|
||||||
|
@ -38,11 +38,9 @@ local function rectangle(args)
|
|||||||
assert(border_width_h * 2 <= e.frame.h, "graphics.elements.rectangle: border too thick for height")
|
assert(border_width_h * 2 <= e.frame.h, "graphics.elements.rectangle: border too thick for height")
|
||||||
|
|
||||||
-- form the basic and top/bottom blit strings
|
-- form the basic and top/bottom blit strings
|
||||||
for _ = 1, e.frame.w do
|
spaces = util.strrep(" ", e.frame.w)
|
||||||
spaces = spaces .. " "
|
blit_fg = util.strrep(e.fg_bg.blit_fgd, e.frame.w)
|
||||||
blit_fg = blit_fg .. e.fg_bg.blit_fgd
|
blit_bg_top_bot = util.strrep(border_blit, e.frame.w)
|
||||||
blit_bg_top_bot = blit_bg_top_bot .. border_blit
|
|
||||||
end
|
|
||||||
|
|
||||||
-- form the body blit strings (sides are border, inside is normal)
|
-- form the body blit strings (sides are border, inside is normal)
|
||||||
for x = 1, e.frame.w do
|
for x = 1, e.frame.w do
|
||||||
|
Loading…
Reference in New Issue
Block a user