From 1fccadfebed76a3976c71d383b06363f3bc3aa3e Mon Sep 17 00:00:00 2001 From: Ale2610 Date: Fri, 21 Aug 2015 14:23:38 +0200 Subject: [PATCH] Update installer.lua --- src/installer.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/installer.lua b/src/installer.lua index 79da07a..62d7542 100644 --- a/src/installer.lua +++ b/src/installer.lua @@ -36,9 +36,11 @@ local function clear() term.setTextColor(colors.black) end -local function center(text) +local function center(text, y) local w, h = term.getSize() - local x, y = term.getCursorPos() + if not y then + local x, y = term.getCursorPos() + end term.setCursorPos(math.ceil(w/2), y) write(text) end @@ -58,7 +60,7 @@ timer = nil for i = 1 , tonumber(time) do - center(y, frames[cursor]) + center(frames[cursor], y) timer = os.startTimer(.5)