Merge branch 'master' of https://github.com/Pyroxenium/Basalt
This commit is contained in:
@@ -371,7 +371,17 @@ return function(name, parent, pTerm, basalt)
|
|||||||
|
|
||||||
getType = function(self)
|
getType = function(self)
|
||||||
return objectType
|
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)
|
setFocusedObject = function(self, obj)
|
||||||
if(focusedObject~=obj)then
|
if(focusedObject~=obj)then
|
||||||
|
|||||||
@@ -909,7 +909,6 @@ return function(name)
|
|||||||
eventHandler = function(self, event, p1, p2, p3, p4)
|
eventHandler = function(self, event, p1, p2, p3, p4)
|
||||||
local val = eventSystem:sendEvent("other_event", 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
|
if(val~=nil)then return val end
|
||||||
return true
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
getFocusHandler = function(self)
|
getFocusHandler = function(self)
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
local curDir = fs.getDir(table.pack(...)[2]) or ""
|
local curDir = fs.getDir(table.pack(...)[2]) or ""
|
||||||
|
|
||||||
local defaultPath = package.path
|
if not(packed)then
|
||||||
local format = "%s;/%s/?.lua;/%s/?/init.lua"
|
local defaultPath = package.path
|
||||||
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")
|
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")
|
local Basalt = require("main")
|
||||||
package.path = defaultPath
|
package.path = defaultPath
|
||||||
|
|
||||||
|
|||||||
@@ -60,8 +60,9 @@ return function(name)
|
|||||||
|
|
||||||
for n = 1, h do
|
for n = 1, h do
|
||||||
if (n == verticalAlign) then
|
if (n == verticalAlign) then
|
||||||
self.parent:setText(obx, oby + (n - 1), utils.getTextHorizontalAlign(self:getValue(), w, textHorizontalAlign))
|
local val = self:getValue()
|
||||||
self.parent:setFG(obx, oby + (n - 1), utils.getTextHorizontalAlign(tHex[self.fgColor]:rep(self:getValue():len()), w, textHorizontalAlign))
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user