some smaller changes
This commit is contained in:
@@ -7,7 +7,6 @@ local requiredFiles = {
|
|||||||
"Frame.lua",
|
"Frame.lua",
|
||||||
"Object.lua",
|
"Object.lua",
|
||||||
"defaultTheme.lua",
|
"defaultTheme.lua",
|
||||||
"minify.lua",
|
|
||||||
"lib/drawHelper.lua",
|
"lib/drawHelper.lua",
|
||||||
"lib/eventSystem.lua",
|
"lib/eventSystem.lua",
|
||||||
"lib/process.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)
|
local function getTextHorizontalAlign(text, width, textAlign)
|
||||||
text = string.sub(text, 1, width)
|
text = string.sub(text, 1, width)
|
||||||
local offset = width - string.len(text)
|
local offset = width - string.len(text)
|
||||||
|
|||||||
@@ -4,4 +4,23 @@ local frames = {}
|
|||||||
local keyModifier = {}
|
local keyModifier = {}
|
||||||
local parentTerminal = term.current()
|
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
|
return self
|
||||||
end;
|
end;
|
||||||
|
|
||||||
shrinkImage = function(self)
|
shrink = function(self)
|
||||||
shrink()
|
shrink()
|
||||||
imageGotShrinked = true
|
imageGotShrinked = true
|
||||||
return self
|
return self
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ local function Label(name)
|
|||||||
return self
|
return self
|
||||||
end;
|
end;
|
||||||
|
|
||||||
setSize = function(self, width, h)
|
setSize = function(self, width, height)
|
||||||
self.width, self.height = width, h
|
self.width, self.height = width, height
|
||||||
autoWidth = false
|
autoWidth = false
|
||||||
return self
|
return self
|
||||||
end;
|
end;
|
||||||
@@ -31,7 +31,9 @@ local function Label(name)
|
|||||||
if (base.draw(self)) then
|
if (base.draw(self)) then
|
||||||
if (self.parent ~= nil) then
|
if (self.parent ~= nil) then
|
||||||
local obx, oby = self:getAnchorPosition()
|
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
|
end
|
||||||
end;
|
end;
|
||||||
|
|||||||
Reference in New Issue
Block a user