From 45c430867f993b8b828761e8ac8953538e2a7b9b Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Mon, 19 Sep 2022 21:04:26 +0200 Subject: [PATCH] Very small fixes - Visual border fix - Fix with :setSize (if you are creating a dynamic value and after that you just want to add a number to it, it would crash) --- Basalt/Object.lua | 42 ++++++++++++++++++------------------ Basalt/objects/Animation.lua | 4 ++-- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Basalt/Object.lua b/Basalt/Object.lua index ceffb6b..98f9dff 100644 --- a/Basalt/Object.lua +++ b/Basalt/Object.lua @@ -273,10 +273,10 @@ return function(name) setSize = function(self, width, height, rel) if(type(width)=="number")then - self.width = rel and self.width+width or width + self.width = rel and self:getWidth()+width or width end if(type(height)=="number")then - self.height = rel and self.height+height or height + self.height = rel and self:getHeight()+height or height end if(self.parent~=nil)then if(type(width)=="string")then @@ -439,29 +439,29 @@ return function(name) self.parent:drawForegroundBox(x, y, 1, 1, borderColors["left"]) end if(borderColors["right"]~=false)then - self.parent:drawTextBox(x+w, y, 1, h, "\149") - if(bgCol~=false)then self.parent:drawForegroundBox(x+w, y, 1, h, self.bgColor) end - self.parent:drawBackgroundBox(x+w, y, 1, h, borderColors["right"]) - end - if(borderColors["top"]~=false)and(borderColors["right"]~=false)then - self.parent:drawTextBox(x+w, y, 1, 1, "\148") - if(bgCol~=false)then self.parent:drawForegroundBox(x+w, y, 1, 1, self.bgColor) end - self.parent:drawBackgroundBox(x+w, y, 1, 1, borderColors["right"]) - end - if(borderColors["right"]~=false)and(borderColors["bottom"]~=false)then - self.parent:drawTextBox(x+w, y+h, 1, 1, "\133") - if(bgCol~=false)then self.parent:drawForegroundBox(x+w, y+h, 1, 1, self.bgColor) end - self.parent:drawBackgroundBox(x+w, y+h, 1, 1, borderColors["right"]) + self.parent:drawTextBox(x+w-1, y, 1, h, "\149") + if(bgCol~=false)then self.parent:drawForegroundBox(x+w-1, y, 1, h, self.bgColor) end + self.parent:drawBackgroundBox(x+w-1, y, 1, h, borderColors["right"]) end if(borderColors["bottom"]~=false)then - self.parent:drawTextBox(x, y+h, w, 1, "\143") - if(bgCol~=false)then self.parent:drawForegroundBox(x, y+h, w, 1, self.bgColor) end - self.parent:drawBackgroundBox(x, y+h, w, 1, borderColors["bottom"]) + self.parent:drawTextBox(x, y+h-1, w, 1, "\143") + if(bgCol~=false)then self.parent:drawForegroundBox(x, y+h-1, w, 1, self.bgColor) end + self.parent:drawBackgroundBox(x, y+h-1, w, 1, borderColors["bottom"]) + end + if(borderColors["top"]~=false)and(borderColors["right"]~=false)then + self.parent:drawTextBox(x+w-1, y, 1, 1, "\148") + if(bgCol~=false)then self.parent:drawForegroundBox(x+w-1, y, 1, 1, self.bgColor) end + self.parent:drawBackgroundBox(x+w-1, y, 1, 1, borderColors["right"]) + end + if(borderColors["right"]~=false)and(borderColors["bottom"]~=false)then + self.parent:drawTextBox(x+w-1, y+h-1, 1, 1, "\133") + if(bgCol~=false)then self.parent:drawForegroundBox(x+w-1, y+h-1, 1, 1, self.bgColor) end + self.parent:drawBackgroundBox(x+w-1, y+h-1, 1, 1, borderColors["right"]) end if(borderColors["bottom"]~=false)and(borderColors["left"]~=false)then - self.parent:drawTextBox(x, y+h, 1, 1, "\138") - if(bgCol~=false)then self.parent:drawForegroundBox(x-1, y+h, 1, 1, self.bgColor) end - self.parent:drawBackgroundBox(x, y+h, 1, 1, borderColors["left"]) + self.parent:drawTextBox(x, y+h-1, 1, 1, "\138") + if(bgCol~=false)then self.parent:drawForegroundBox(x-1, y+h-1, 1, 1, self.bgColor) end + self.parent:drawBackgroundBox(x, y+h-1, 1, 1, borderColors["left"]) end end draw = false diff --git a/Basalt/objects/Animation.lua b/Basalt/objects/Animation.lua index 48d9d97..08a9b2c 100644 --- a/Basalt/objects/Animation.lua +++ b/Basalt/objects/Animation.lua @@ -362,9 +362,9 @@ return function(name) return self end, - add = function(self, func, wait) + add = function(self, func, timer) lastFunc = func - addAnimationPart((wait or nextWaitTimer) + (animations[#animations]~=nil and animations[#animations].t or 0), func) + addAnimationPart((timer or nextWaitTimer) + (animations[#animations]~=nil and animations[#animations].t or 0), func) return self end;