From 954b839efabb58294a2e41fa2c71cea17c35d746 Mon Sep 17 00:00:00 2001 From: mint Date: Fri, 7 May 2021 15:12:22 -0400 Subject: [PATCH] modifications to the close button for longer named songs --- rhythmblock.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rhythmblock.lua b/rhythmblock.lua index 29f3a7c..35063e9 100644 --- a/rhythmblock.lua +++ b/rhythmblock.lua @@ -110,10 +110,10 @@ function renderEjectButton() -- Renders the Eject button end function renderCloseButton() -- Renders the Close button - term.setCursorPos(width, 1) + term.setCursorPos(width - 1, 1) term.setTextColor(textColor) term.setBackgroundColor(backgroundColor) - term.write("x") + term.write(" x") end function buttonRender(play) -- Render some buttons depending if the computer is advanced or not @@ -142,6 +142,9 @@ status = defaultStatus -- Setting the value to the default while true do statusRender(status) -- Renders the status + if term.isColour() then -- Renders the close button (if the song title is too long, the close button kind of disappears + renderCloseButton() + end local eventData = {os.pullEvent()} local event = eventData[1]