From fe590dceab252106002f146d4b586379a1e56f38 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Thu, 4 May 2023 19:24:07 +0200 Subject: [PATCH] Small fixes - Fixed Program Object not sending queued events correctly - Fixed size of error window on smaller screens - Fixed size of debug window on smaller screens --- Basalt/objects/Program.lua | 2 +- Basalt/plugins/betterError.lua | 4 ++-- Basalt/plugins/debug.lua | 16 ++++++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Basalt/objects/Program.lua b/Basalt/objects/Program.lua index 2c2f353..5946e71 100644 --- a/Basalt/objects/Program.lua +++ b/Basalt/objects/Program.lua @@ -498,7 +498,7 @@ return function(name, basalt) if (curProcess ~= nil) then if not (curProcess:isDead()) then if not (paused) then - self:injectEvents(queuedEvent) + self:injectEvents(table.unpack(queuedEvent)) queuedEvent = {} end end diff --git a/Basalt/plugins/betterError.lua b/Basalt/plugins/betterError.lua index bbc2d6c..905c9e5 100644 --- a/Basalt/plugins/betterError.lua +++ b/Basalt/plugins/betterError.lua @@ -13,7 +13,7 @@ return { if(frame==nil)then local mainFrame = basalt.getMainFrame() local w, h = mainFrame:getSize() - frame = mainFrame:addMovableFrame("basaltErrorFrame"):setSize(w-20, h-10):setBackground(colors.lightGray):setForeground(colors.white):setZIndex(500) + frame = mainFrame:addMovableFrame("basaltErrorFrame"):setSize(w-10, h-4):setBackground(colors.lightGray):setForeground(colors.white):setZIndex(500) frame:addPane("titleBackground"):setSize(w, 1):setPosition(1, 1):setBackground(colors.black):setForeground(colors.white) frame:setPosition(w/2-frame:getWidth()/2, h/2-frame:getHeight()/2):setBorder(colors.black) frame:addLabel("title"):setText("Basalt Unexpected Error"):setPosition(2, 1):setBackground(colors.black):setForeground(colors.white) @@ -31,7 +31,7 @@ return { end) end frame:show() - errorList:addItem("--------------------------------------------") + errorList:addItem(("-"):rep(frame:getWidth()-2)) local err = wrapText(err, frame:getWidth()-2) for i=1, #err do errorList:addItem(err[i]) diff --git a/Basalt/plugins/debug.lua b/Basalt/plugins/debug.lua index eda1001..704915d 100644 --- a/Basalt/plugins/debug.lua +++ b/Basalt/plugins/debug.lua @@ -15,17 +15,16 @@ return { local maxW = 99 local maxH = 99 local w, h = mainFrame:getSize() - debugFrame = mainFrame:addMovableFrame("basaltDebuggingFrame"):setSize(w-20, h-10):setBackground(colors.lightGray):setForeground(colors.white):setZIndex(100):hide() + debugFrame = mainFrame:addMovableFrame("basaltDebuggingFrame"):setSize(w-20, h-10):setBackground(colors.gray):setForeground(colors.white):setZIndex(100):hide() debugFrame:addPane():setSize("parent.w", 1):setPosition(1, 1):setBackground(colors.black):setForeground(colors.white) debugFrame:setPosition(-w, h/2-debugFrame:getHeight()/2):setBorder(colors.black) local resizeButton = debugFrame:addButton() :setPosition("parent.w", "parent.h") :setSize(1, 1) :setText("\133") - :setForeground(colors.lightGray) + :setForeground(colors.gray) :setBackground(colors.black) - :onClick(function(self, event, btn, xOffset, yOffset) - end) + :onClick(function() end) :onDrag(function(self, event, btn, xOffset, yOffset) local w, h = debugFrame:getSize() local wOff, hOff = w, h @@ -38,10 +37,15 @@ return { debugFrame:setSize(wOff, hOff) end) - debugExitButton = debugFrame:addButton():setText("Exit"):setPosition("parent.w - 6", 1):setSize(7, 1):setBackground(colors.red):setForeground(colors.white):onClick(function() + debugExitButton = debugFrame:addButton():setText("Close"):setPosition("parent.w - 6", 1):setSize(7, 1):setBackground(colors.red):setForeground(colors.white):onClick(function() debugFrame:animatePosition(-w, h/2-debugFrame:getHeight()/2, 0.5) end) - debugList = debugFrame:addList():setSize("parent.w - 2", "parent.h - 3"):setPosition(2, 3):setBackground(colors.lightGray):setForeground(colors.white):setSelectionColor(colors.lightGray, colors.gray) + debugList = debugFrame:addList() + :setSize("parent.w - 2", "parent.h - 3") + :setPosition(2, 3) + :setBackground(colors.gray) + :setForeground(colors.white) + :setSelectionColor(colors.gray, colors.white) if(debugLabel==nil)then debugLabel = mainFrame:addLabel() :setPosition(1, "parent.h")