Update sPhone.lua
This commit is contained in:
parent
2fea90bd55
commit
fa2214de5d
1 changed files with 23 additions and 9 deletions
|
@ -165,6 +165,9 @@ local function kernel()
|
||||||
if not fmessage then
|
if not fmessage then
|
||||||
fmessage = ""
|
fmessage = ""
|
||||||
end
|
end
|
||||||
|
if not smessage then
|
||||||
|
smessage = ""
|
||||||
|
end
|
||||||
if not bg then
|
if not bg then
|
||||||
bg = colors.gray
|
bg = colors.gray
|
||||||
end
|
end
|
||||||
|
@ -177,6 +180,7 @@ local function kernel()
|
||||||
if not side then
|
if not side then
|
||||||
side = colors.lightGray
|
side = colors.lightGray
|
||||||
end
|
end
|
||||||
|
if #fmessage >= #smessage then
|
||||||
local w, h = term.getSize
|
local w, h = term.getSize
|
||||||
term.setBackgroundColor(side)
|
term.setBackgroundColor(side)
|
||||||
paintutils.drawBox(11 - math.ceil(#fmessage / 2), 5, 16 + math.ceil(#fmessage / 2), 10, side)
|
paintutils.drawBox(11 - math.ceil(#fmessage / 2), 5, 16 + math.ceil(#fmessage / 2), 10, side)
|
||||||
|
@ -185,7 +189,17 @@ local function kernel()
|
||||||
term.setCursorPos(14 - math.ceil(#fmessage / 2), 7)
|
term.setCursorPos(14 - math.ceil(#fmessage / 2), 7)
|
||||||
term.setTextColor(text)
|
term.setTextColor(text)
|
||||||
write(fmessage)
|
write(fmessage)
|
||||||
if smessage then
|
term.setCursorPos(14 - math.ceil(#smessage / 2), 8)
|
||||||
|
write(smessage)
|
||||||
|
else
|
||||||
|
local w, h = term.getSize
|
||||||
|
term.setBackgroundColor(side)
|
||||||
|
paintutils.drawBox(11 - math.ceil(#smessage / 2), 5, 16 + math.ceil(#smessage / 2), 10, side)
|
||||||
|
term.setBackgroundColor(bg)
|
||||||
|
paintutils.drawFilledBox(12 - math.ceil(#smessage / 2), 6, 15 + math.ceil(#smessage / 2), 9, bg)
|
||||||
|
term.setCursorPos(14 - math.ceil(#fmessage / 2), 7)
|
||||||
|
term.setTextColor(text)
|
||||||
|
write(fmessage)
|
||||||
term.setCursorPos(14 - math.ceil(#smessage / 2), 8)
|
term.setCursorPos(14 - math.ceil(#smessage / 2), 8)
|
||||||
write(smessage)
|
write(smessage)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue