From 85988be89203ae3be198305d5ecfac24ae2a79a1 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Fri, 28 Feb 2025 10:18:17 +0100 Subject: [PATCH] Fixed bundler Added :setOffset/:getOffset for Containers --- .gitignore | 1 - src/elements/Container.lua | 3 +++ tools/bundler.lua | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6d5ff3d..fd99e1b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,4 @@ test.xml ascii.lua tests testWorkflows -basaltImage.lua .vscode \ No newline at end of file diff --git a/src/elements/Container.lua b/src/elements/Container.lua index 9dc2c13..8023b07 100644 --- a/src/elements/Container.lua +++ b/src/elements/Container.lua @@ -62,6 +62,9 @@ Container.defineProperty(Container, "offsetY", {default = 0, type = "number", ca return value end}) +---@combinedProperty offset {offsetX offsetY} Combined property for offsetX and offsetY +Container.combineProperties(Container, "offset", "offsetX", "offsetY") + for k, _ in pairs(elementManager:getElementList()) do local capitalizedName = k:sub(1,1):upper() .. k:sub(2) if capitalizedName ~= "BaseFrame" then diff --git a/tools/bundler.lua b/tools/bundler.lua index b02e54d..5187188 100644 --- a/tools/bundler.lua +++ b/tools/bundler.lua @@ -23,7 +23,7 @@ local function bundle() 'local project = {}\n', 'local loadedProject = {}\n', 'local baseRequire = require\n', - 'require = function(path) if(project[path..".lua"])then if(loadedProject[path]==nil)then loadedProject[path] = project[path..".lua"]() end return loadedProject[path] end baseRequire(path) end\n' + 'require = function(path) if(project[path..".lua"])then if(loadedProject[path]==nil)then loadedProject[path] = project[path..".lua"]() end return loadedProject[path] end return baseRequire(path) end\n' } for _, file in ipairs(files) do