From 5e76b8b00ac668768f5295ac4b2cb7c79c71ee36 Mon Sep 17 00:00:00 2001 From: Ninjune Date: Fri, 18 Nov 2022 16:05:16 -0600 Subject: v1.6.2 Bug fixes --- render/timerGui.js | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'render/timerGui.js') diff --git a/render/timerGui.js b/render/timerGui.js index a46451f..87171ff 100644 --- a/render/timerGui.js +++ b/render/timerGui.js @@ -2,47 +2,36 @@ import settings from "../settings"; import constants from "../util/constants"; -const timerMove = new Gui(), - timerGui = new Display() - -timerGui.setBackgroundColor(Renderer.color(0, 0, 0, 50)); -timerGui.setBackground("full"); +const timerGui = new Gui() export function openTimerGui() { - timerMove.open() + timerGui.open() } register("dragged", (dx, dy, x, y) => { - if (!timerMove.isOpen()) return + if (!timerGui.isOpen()) return constants.timerdata.x = x constants.timerdata.y = y constants.timerdata.save() }); register("renderOverlay", () => { - timerGui.setShouldRender(false) - timerGui.clearLines() - timerGui.setRenderLoc(constants.timerdata.x, constants.timerdata.y) - - if (timerMove.isOpen()) + if (timerGui.isOpen()) { - let txt = "Click anywhere to move!" + let txt = "Drag to move." Renderer.drawStringWithShadow(txt, Renderer.screen.getWidth()/2 - Renderer.getStringWidth(txt)/2, Renderer.screen.getHeight()/2) - timerGui.addLines([`&aTimer: &b0h 0m`]) - timerGui.setShouldRender(true) - return } - - if(!settings.timerVisible) return - timerGui.setShouldRender(true) - let timerHr = Math.floor(constants.timerdata.timer/60/60) + if (!settings.timerVisible) return + let timerHr = Math.floor(constants.timerdata.timer/60/60), message if(timerHr >= 1) - timerGui.addLine(`&aTimer: &b${timerHr}h ${Math.floor(constants.timerdata.timer/60) - timerHr*60}m`) + message = `&aTimer: &b${timerHr}h ${Math.floor(constants.timerdata.timer/60) - timerHr*60}m` else - timerGui.addLine(`&aTimer: &b${Math.floor(constants.timerdata.timer/60)}m ${Math.floor(constants.timerdata.timer%60)}s`) + message = `&aTimer: &b${Math.floor(constants.timerdata.timer/60)}m ${Math.floor(constants.timerdata.timer%60)}s` + + Renderer.drawStringWithShadow(message, constants.timerdata.x, constants.timerdata.y) }) register('worldLoad', () => { -- cgit