From 8acb673f74cf4d6f7844d5dbbc9b74ccd8779b5b Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Fri, 4 Nov 2022 21:18:32 +0100 Subject: [PATCH 1/4] small hotfix for source project --- Basalt/init.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Basalt/init.lua b/Basalt/init.lua index bb8e6b0..0f36267 100644 --- a/Basalt/init.lua +++ b/Basalt/init.lua @@ -1,10 +1,17 @@ local curDir = fs.getDir(table.pack(...)[2]) or "" -local defaultPath = package.path -local format = "%s;/%s/?.lua;/%s/?/init.lua" -package.path = string.format(format, package.path, curDir,curDir)..string.format(format, package.path, curDir.."/libraries",curDir.."/libraries")..string.format(format, package.path, curDir.."/objects",curDir.."/objects") +if not(packed)then + local defaultPath = package.path + local format = "path;/path/?.lua;/path/?/init.lua;" + local main = format:gsub("path", curDir) + local objFolder = format:gsub("path", curDir.."/objects") + local libFolder = format:gsub("path", curDir.."/libraries") + + + package.path = main..objFolder..libFolder..defaultPath +end local Basalt = require("main") package.path = defaultPath -return Basalt \ No newline at end of file +return Basalt From 15d8cb378111f9486db465f54f25ab898f8e4c70 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Mon, 14 Nov 2022 06:13:23 +0100 Subject: [PATCH 2/4] Update Object.lua cancels other events - should never have been there --- Basalt/Object.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Basalt/Object.lua b/Basalt/Object.lua index 51214d0..44bc11a 100644 --- a/Basalt/Object.lua +++ b/Basalt/Object.lua @@ -909,7 +909,6 @@ return function(name) eventHandler = function(self, event, p1, p2, p3, p4) local val = eventSystem:sendEvent("other_event", self, event, p1, p2, p3, p4) if(val~=nil)then return val end - return true end; getFocusHandler = function(self) @@ -944,4 +943,4 @@ return function(name) object.__index = object return object -end \ No newline at end of file +end From 8f2e191fe32ac3c2b537f696dde247f1e2929235 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Mon, 21 Nov 2022 06:23:13 +0100 Subject: [PATCH 3/4] Border Bugfix for Buttons Small visual fix for buttons, when using borders --- Basalt/objects/Button.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Basalt/objects/Button.lua b/Basalt/objects/Button.lua index 6ae68b1..5e84122 100644 --- a/Basalt/objects/Button.lua +++ b/Basalt/objects/Button.lua @@ -60,8 +60,9 @@ return function(name) for n = 1, h do if (n == verticalAlign) then - self.parent:setText(obx, oby + (n - 1), utils.getTextHorizontalAlign(self:getValue(), w, textHorizontalAlign)) - self.parent:setFG(obx, oby + (n - 1), utils.getTextHorizontalAlign(tHex[self.fgColor]:rep(self:getValue():len()), w, textHorizontalAlign)) + local val = self:getValue() + self.parent:setText(obx + (w/2-val:len()/2), oby + (n - 1), utils.getTextHorizontalAlign(val, val:len(), textHorizontalAlign)) + self.parent:setFG(obx + (w/2-val:len()/2), oby + (n - 1), utils.getTextHorizontalAlign(tHex[self.fgColor]:rep(val:len()), val:len(), textHorizontalAlign)) end end end @@ -70,4 +71,4 @@ return function(name) } return setmetatable(object, base) -end \ No newline at end of file +end From 37dde881ad73d03e2461fbbf1d3ec22016d53a63 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Tue, 22 Nov 2022 18:28:03 +0100 Subject: [PATCH 4/4] Small bugfix for frames Small bugfix for frames when using setZIndex after objects got added. Reason was because the frame didn't add the events to it's parent. --- Basalt/Frame.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Basalt/Frame.lua b/Basalt/Frame.lua index 7b5ea76..863e42d 100644 --- a/Basalt/Frame.lua +++ b/Basalt/Frame.lua @@ -371,7 +371,17 @@ return function(name, parent, pTerm, basalt) getType = function(self) return objectType - end; + end, + + setZIndex = function(self, newIndex) + base.setZIndex(self, newIndex) + for k,v in pairs(activeEvents)do + if(v)then + self.parent:addEvent(k, self) + end + end + return self + end, setFocusedObject = function(self, obj) if(focusedObject~=obj)then