diff --git a/source/compiler.lua b/source/compiler.lua index c2184d6..934d87a 100644 --- a/source/compiler.lua +++ b/source/compiler.lua @@ -7,7 +7,6 @@ local requiredFiles = { "Frame.lua", "Object.lua", "defaultTheme.lua", - "minify.lua", "lib/drawHelper.lua", "lib/eventSystem.lua", "lib/process.lua", diff --git a/source/lib/utils.lua b/source/lib/utils.lua index dc987b7..94a38f4 100644 --- a/source/lib/utils.lua +++ b/source/lib/utils.lua @@ -1,22 +1,3 @@ -local tHex = { -- copy paste is a very important feature - [colors.white] = "0", - [colors.orange] = "1", - [colors.magenta] = "2", - [colors.lightBlue] = "3", - [colors.yellow] = "4", - [colors.lime] = "5", - [colors.pink] = "6", - [colors.gray] = "7", - [colors.lightGray] = "8", - [colors.cyan] = "9", - [colors.purple] = "a", - [colors.blue] = "b", - [colors.brown] = "c", - [colors.green] = "d", - [colors.red] = "e", - [colors.black] = "f", -} - local function getTextHorizontalAlign(text, width, textAlign) text = string.sub(text, 1, width) local offset = width - string.len(text) diff --git a/source/mainTop.lua b/source/mainTop.lua index 62ac9ee..b245e1c 100644 --- a/source/mainTop.lua +++ b/source/mainTop.lua @@ -4,4 +4,23 @@ local frames = {} local keyModifier = {} local parentTerminal = term.current() -local sub = string.sub \ No newline at end of file +local sub = string.sub + +local tHex = { -- copy paste is a very important feature + [colors.white] = "0", + [colors.orange] = "1", + [colors.magenta] = "2", + [colors.lightBlue] = "3", + [colors.yellow] = "4", + [colors.lime] = "5", + [colors.pink] = "6", + [colors.gray] = "7", + [colors.lightGray] = "8", + [colors.cyan] = "9", + [colors.purple] = "a", + [colors.blue] = "b", + [colors.brown] = "c", + [colors.green] = "d", + [colors.red] = "e", + [colors.black] = "f", +} \ No newline at end of file diff --git a/source/objects/Image.lua b/source/objects/Image.lua index 1726541..e7c7b98 100644 --- a/source/objects/Image.lua +++ b/source/objects/Image.lua @@ -146,7 +146,7 @@ local function Image(name) return self end; - shrinkImage = function(self) + shrink = function(self) shrink() imageGotShrinked = true return self diff --git a/source/objects/Label.lua b/source/objects/Label.lua index 105454e..e85af28 100644 --- a/source/objects/Label.lua +++ b/source/objects/Label.lua @@ -21,8 +21,8 @@ local function Label(name) return self end; - setSize = function(self, width, h) - self.width, self.height = width, h + setSize = function(self, width, height) + self.width, self.height = width, height autoWidth = false return self end; @@ -31,7 +31,9 @@ local function Label(name) if (base.draw(self)) then if (self.parent ~= nil) then local obx, oby = self:getAnchorPosition() - self.parent:writeText(obx, oby, self:getValue(), self.bgColor, self.fgColor) + self.parent:setBackground(obx, oby, self.width, self.height, self.bgColor) + self.parent:setForeground(obx, oby, self.width, self.height, self.fgColor) + self.parent:writeText(obx, oby, self:getValue():sub(1, self.width), self.bgColor, self.fgColor) end end end;