some smaller changes
This commit is contained in:
@@ -7,7 +7,6 @@ local requiredFiles = {
|
||||
"Frame.lua",
|
||||
"Object.lua",
|
||||
"defaultTheme.lua",
|
||||
"minify.lua",
|
||||
"lib/drawHelper.lua",
|
||||
"lib/eventSystem.lua",
|
||||
"lib/process.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)
|
||||
|
||||
@@ -4,4 +4,23 @@ local frames = {}
|
||||
local keyModifier = {}
|
||||
local parentTerminal = term.current()
|
||||
|
||||
local sub = string.sub
|
||||
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",
|
||||
}
|
||||
@@ -146,7 +146,7 @@ local function Image(name)
|
||||
return self
|
||||
end;
|
||||
|
||||
shrinkImage = function(self)
|
||||
shrink = function(self)
|
||||
shrink()
|
||||
imageGotShrinked = true
|
||||
return self
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user