Update config, BasaltLS definitions, bundle and changelog

This commit is contained in:
github-actions[bot]
2025-07-27 14:02:04 +00:00
parent af085e75f9
commit 543d19842c
3 changed files with 3825 additions and 3750 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,422 +1,422 @@
return {
["metadata"] = {
["generated"] = "Thu Jul 17 09:13:02 2025",
["version"] = "2.0",
},
["categories"] = {
["libraries"] = {
["description"] = "Libraries",
["files"] = {
["utils"] = {
["path"] = "libraries/utils.lua",
["size"] = 2661,
["default"] = true,
["description"] = "",
["expect"] = {
["path"] = "libraries/expect.lua",
["size"] = 846,
["requires"] = {
},
["description"] = "",
["default"] = true,
},
["colorHex"] = {
["path"] = "libraries/colorHex.lua",
["size"] = 132,
["default"] = true,
["description"] = "",
["requires"] = {
},
["description"] = "",
["default"] = true,
},
["expect"] = {
["path"] = "libraries/expect.lua",
["size"] = 846,
["default"] = true,
["description"] = "",
["requires"] = {
},
},
},
},
["core"] = {
["description"] = "Core Files",
["files"] = {
["propertySystem"] = {
["path"] = "propertySystem.lua",
["size"] = 15524,
["default"] = true,
["description"] = "",
["requires"] = {
},
},
["main"] = {
["path"] = "main.lua",
["size"] = 11941,
["default"] = true,
["description"] = "",
["requires"] = {
},
},
["elementManager"] = {
["path"] = "elementManager.lua",
["size"] = 6297,
["default"] = true,
["description"] = "",
["requires"] = {
},
},
["init"] = {
["path"] = "init.lua",
["size"] = 622,
["default"] = true,
["description"] = "",
["requires"] = {
},
},
["log"] = {
["path"] = "log.lua",
["size"] = 3142,
["default"] = true,
["description"] = "",
["requires"] = {
},
},
["render"] = {
["path"] = "render.lua",
["size"] = 12422,
["default"] = true,
["description"] = "",
["requires"] = {
},
},
["errorManager"] = {
["path"] = "errorManager.lua",
["size"] = 3789,
["default"] = true,
["description"] = "",
["utils"] = {
["path"] = "libraries/utils.lua",
["size"] = 2661,
["requires"] = {
},
["description"] = "",
["default"] = true,
},
},
["description"] = "Libraries",
},
["elements"] = {
["description"] = "UI Elements",
["files"] = {
["Frame"] = {
["path"] = "elements/Frame.lua",
["size"] = 6508,
["default"] = true,
["description"] = "A frame element that serves as a grouping container for other elements.",
["requires"] = {
[1] = "Container",
},
},
["VisualElement"] = {
["path"] = "elements/VisualElement.lua",
["size"] = 17936,
["default"] = true,
["description"] = "The Visual Element class which is the base class for all visual UI elements",
["requires"] = {
[1] = "BaseElement",
},
},
["BaseFrame"] = {
["path"] = "elements/BaseFrame.lua",
["size"] = 8466,
["default"] = true,
["description"] = "This is the base frame class. It is the root element of all elements and the only element without a parent.",
["requires"] = {
[1] = "Container",
},
},
["Container"] = {
["path"] = "elements/Container.lua",
["size"] = 25373,
["description"] = "This is the base frame class. It is the root element of all elements and the only element without a parent.",
["default"] = true,
["description"] = "The container class. It is a visual element that can contain other elements. It is the base class for all containers",
["requires"] = {
[1] = "VisualElement",
},
},
["Label"] = {
["path"] = "elements/Label.lua",
["size"] = 3092,
["default"] = true,
["description"] = "A simple text display element that automatically resizes its width based on the text content.",
["requires"] = {
[1] = "VisualElement",
},
},
["Image"] = {
["path"] = "elements/Image.lua",
["size"] = 15125,
["default"] = false,
["description"] = "An element that displays an image in bimg format",
["requires"] = {
[1] = "VisualElement",
},
},
["Display"] = {
["path"] = "elements/Display.lua",
["size"] = 4243,
["default"] = false,
["description"] = "The Display is a special element which uses the cc window API which you can use.",
["requires"] = {
[1] = "VisualElement",
},
},
["Button"] = {
["path"] = "elements/Button.lua",
["size"] = 1656,
["default"] = true,
["description"] = "",
["requires"] = {
[1] = "VisualElement",
},
},
["Table"] = {
["path"] = "elements/Table.lua",
["size"] = 9628,
["default"] = true,
["description"] = "",
["requires"] = {
[1] = "VisualElement",
},
},
["Dropdown"] = {
["path"] = "elements/Dropdown.lua",
["size"] = 6359,
["default"] = false,
["requires"] = {
[1] = "List",
},
["description"] = "A dropdown menu that shows a list of selectable items",
["requires"] = {
[1] = "List",
},
},
["Menu"] = {
["path"] = "elements/Menu.lua",
["size"] = 4679,
["default"] = true,
["description"] = "A horizontal menu bar with selectable items.",
["requires"] = {
[1] = "List",
},
},
["BigFont"] = {
["path"] = "elements/BigFont.lua",
["size"] = 20951,
["default"] = false,
["description"] = "",
["requires"] = {
[1] = "VisualElement",
},
},
["BarChart"] = {
["path"] = "elements/BarChart.lua",
["size"] = 3190,
["default"] = false,
["description"] = "",
["requires"] = {
},
},
["Slider"] = {
["path"] = "elements/Slider.lua",
["size"] = 4977,
["default"] = true,
["description"] = "",
["requires"] = {
[1] = "VisualElement",
},
},
["TextBox"] = {
["path"] = "elements/TextBox.lua",
["size"] = 11316,
["default"] = false,
["description"] = "A multi-line text editor component with cursor support and text manipulation features",
["requires"] = {
[1] = "VisualElement",
},
},
["Tree"] = {
["path"] = "elements/Tree.lua",
["size"] = 7941,
["default"] = true,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "",
["requires"] = {
[1] = "VisualElement",
},
},
["Flexbox"] = {
["path"] = "elements/Flexbox.lua",
["size"] = 32431,
["default"] = true,
["description"] = "A flexbox container that arranges its children in a flexible layout.",
["requires"] = {
[1] = "Container",
},
},
["Input"] = {
["path"] = "elements/Input.lua",
["size"] = 9558,
["default"] = true,
["description"] = "A text input field with various features",
["requires"] = {
[1] = "VisualElement",
},
},
["Graph"] = {
["path"] = "elements/Graph.lua",
["size"] = 6989,
["default"] = false,
["description"] = "A point based graph element",
["requires"] = {
},
},
["Checkbox"] = {
["path"] = "elements/Checkbox.lua",
["size"] = 2928,
["default"] = true,
["description"] = "",
["requires"] = {
[1] = "VisualElement",
},
},
["Switch"] = {
["path"] = "elements/Switch.lua",
["size"] = 1378,
["default"] = true,
["description"] = "",
["requires"] = {
[1] = "VisualElement",
},
},
["LineChart"] = {
["path"] = "elements/LineChart.lua",
["size"] = 3227,
["default"] = false,
["description"] = "",
["requires"] = {
},
["default"] = true,
},
["List"] = {
["path"] = "elements/List.lua",
["size"] = 8758,
["default"] = true,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "A scrollable list of selectable items",
["requires"] = {
[1] = "VisualElement",
},
},
["Scrollbar"] = {
["path"] = "elements/Scrollbar.lua",
["size"] = 9548,
["default"] = true,
["description"] = "",
["requires"] = {
[1] = "VisualElement",
},
},
["ProgressBar"] = {
["path"] = "elements/ProgressBar.lua",
["size"] = 3397,
["default"] = true,
["description"] = "",
["requires"] = {
[1] = "VisualElement",
},
},
["Program"] = {
["path"] = "elements/Program.lua",
["size"] = 11430,
["default"] = true,
["description"] = "",
["requires"] = {
[1] = "VisualElement",
},
},
["BaseElement"] = {
["path"] = "elements/BaseElement.lua",
["size"] = 9686,
["default"] = true,
["description"] = "The base class for all UI elements in Basalt.",
["requires"] = {
},
},
["Timer"] = {
["path"] = "elements/Timer.lua",
["size"] = 2914,
["default"] = true,
["description"] = "",
["requires"] = {
[1] = "BaseElement",
},
["description"] = "",
["default"] = true,
},
["Menu"] = {
["path"] = "elements/Menu.lua",
["size"] = 4679,
["requires"] = {
[1] = "List",
},
["description"] = "A horizontal menu bar with selectable items.",
["default"] = true,
},
["Button"] = {
["path"] = "elements/Button.lua",
["size"] = 1656,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "",
["default"] = true,
},
["BarChart"] = {
["path"] = "elements/BarChart.lua",
["size"] = 3190,
["requires"] = {
},
["description"] = "",
["default"] = false,
},
["Flexbox"] = {
["path"] = "elements/Flexbox.lua",
["size"] = 32431,
["requires"] = {
[1] = "Container",
},
["description"] = "A flexbox container that arranges its children in a flexible layout.",
["default"] = true,
},
["Label"] = {
["path"] = "elements/Label.lua",
["size"] = 3092,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "A simple text display element that automatically resizes its width based on the text content.",
["default"] = true,
},
["Scrollbar"] = {
["path"] = "elements/Scrollbar.lua",
["size"] = 9548,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "",
["default"] = true,
},
["Slider"] = {
["path"] = "elements/Slider.lua",
["size"] = 4977,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "",
["default"] = true,
},
["VisualElement"] = {
["path"] = "elements/VisualElement.lua",
["size"] = 18564,
["requires"] = {
[1] = "BaseElement",
},
["description"] = "The Visual Element class which is the base class for all visual UI elements",
["default"] = true,
},
["TextBox"] = {
["path"] = "elements/TextBox.lua",
["size"] = 11316,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "A multi-line text editor component with cursor support and text manipulation features",
["default"] = false,
},
["Graph"] = {
["path"] = "elements/Graph.lua",
["size"] = 6989,
["requires"] = {
},
["description"] = "A point based graph element",
["default"] = false,
},
["Image"] = {
["path"] = "elements/Image.lua",
["size"] = 15125,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "An element that displays an image in bimg format",
["default"] = false,
},
["Table"] = {
["path"] = "elements/Table.lua",
["size"] = 16214,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "",
["default"] = true,
},
["Container"] = {
["path"] = "elements/Container.lua",
["size"] = 25373,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "The container class. It is a visual element that can contain other elements. It is the base class for all containers",
["default"] = true,
},
["Program"] = {
["path"] = "elements/Program.lua",
["size"] = 11430,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "",
["default"] = true,
},
["BigFont"] = {
["path"] = "elements/BigFont.lua",
["size"] = 20951,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "",
["default"] = false,
},
["Input"] = {
["path"] = "elements/Input.lua",
["size"] = 9558,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "A text input field with various features",
["default"] = true,
},
["Frame"] = {
["path"] = "elements/Frame.lua",
["size"] = 6508,
["requires"] = {
[1] = "Container",
},
["description"] = "A frame element that serves as a grouping container for other elements.",
["default"] = true,
},
["LineChart"] = {
["path"] = "elements/LineChart.lua",
["size"] = 3227,
["requires"] = {
},
["description"] = "",
["default"] = false,
},
["Checkbox"] = {
["path"] = "elements/Checkbox.lua",
["size"] = 2928,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "",
["default"] = true,
},
["Display"] = {
["path"] = "elements/Display.lua",
["size"] = 4243,
["requires"] = {
[1] = "VisualElement",
},
["description"] = "The Display is a special element which uses the cc window API which you can use.",
["default"] = false,
},
["BaseElement"] = {
["path"] = "elements/BaseElement.lua",
["size"] = 9686,
["requires"] = {
},
["description"] = "The base class for all UI elements in Basalt.",
["default"] = true,
},
},
["description"] = "UI Elements",
},
["core"] = {
["files"] = {
["log"] = {
["path"] = "log.lua",
["size"] = 3142,
["requires"] = {
},
["description"] = "",
["default"] = true,
},
["main"] = {
["path"] = "main.lua",
["size"] = 11941,
["requires"] = {
},
["description"] = "",
["default"] = true,
},
["elementManager"] = {
["path"] = "elementManager.lua",
["size"] = 6297,
["requires"] = {
},
["description"] = "",
["default"] = true,
},
["init"] = {
["path"] = "init.lua",
["size"] = 622,
["requires"] = {
},
["description"] = "",
["default"] = true,
},
["propertySystem"] = {
["path"] = "propertySystem.lua",
["size"] = 15524,
["requires"] = {
},
["description"] = "",
["default"] = true,
},
["render"] = {
["path"] = "render.lua",
["size"] = 12422,
["requires"] = {
},
["description"] = "",
["default"] = true,
},
["errorManager"] = {
["path"] = "errorManager.lua",
["size"] = 3789,
["requires"] = {
},
["description"] = "",
["default"] = true,
},
},
["description"] = "Core Files",
},
["plugins"] = {
["description"] = "Plugins",
["files"] = {
["canvas"] = {
["path"] = "plugins/canvas.lua",
["size"] = 7873,
["default"] = true,
["description"] = "",
["debug"] = {
["path"] = "plugins/debug.lua",
["size"] = 6250,
["requires"] = {
},
},
["reactive"] = {
["path"] = "plugins/reactive.lua",
["size"] = 7580,
["default"] = true,
["description"] = "",
["requires"] = {
},
["default"] = true,
},
["theme"] = {
["path"] = "plugins/theme.lua",
["size"] = 7042,
["default"] = true,
["description"] = "",
["requires"] = {
},
},
["debug"] = {
["path"] = "plugins/debug.lua",
["size"] = 6250,
["default"] = true,
["description"] = "",
["requires"] = {
},
["default"] = true,
},
["animation"] = {
["path"] = "plugins/animation.lua",
["size"] = 15795,
["default"] = true,
["description"] = "",
["requires"] = {
},
["description"] = "",
["default"] = true,
},
["xml"] = {
["path"] = "plugins/xml.lua",
["size"] = 9901,
["default"] = true,
["description"] = "",
["requires"] = {
},
["description"] = "",
["default"] = true,
},
["canvas"] = {
["path"] = "plugins/canvas.lua",
["size"] = 7873,
["requires"] = {
},
["description"] = "",
["default"] = true,
},
["benchmark"] = {
["path"] = "plugins/benchmark.lua",
["size"] = 12581,
["default"] = true,
["description"] = "",
["requires"] = {
[1] = "VisualElement",
},
["description"] = "",
["default"] = true,
},
["state"] = {
["path"] = "plugins/state.lua",
["size"] = 6896,
["default"] = true,
["description"] = "",
["requires"] = {
[1] = "Container",
},
["description"] = "",
["default"] = true,
},
["reactive"] = {
["path"] = "plugins/reactive.lua",
["size"] = 7580,
["requires"] = {
},
["description"] = "",
["default"] = true,
},
},
["description"] = "Plugins",
},
},
["metadata"] = {
["version"] = "2.0",
["generated"] = "Sun Jul 27 14:02:01 2025",
},
}

View File

@@ -640,9 +640,10 @@ project["elements/Table.lua"] = function(...) local d=require("elements/VisualEl
local _a=require("libraries/colorHex")local aa=setmetatable({},d)aa.__index=aa
aa.defineProperty(aa,"columns",{default={},type="table",canTriggerRender=true,setter=function(ba,ca)local da={}
for _b,ab in
ipairs(ca)do if type(ab)=="string"then da[_b]={name=ab,width=#ab+1}elseif type(ab)=="table"then
ipairs(ca)do
if type(ab)=="string"then da[_b]={name=ab,width=#ab+1}elseif type(ab)=="table"then
da[_b]={name=
ab.name or"",width=ab.width or#ab.name+1}end end;return da end})
ab.name or"",width=ab.width,minWidth=ab.minWidth or 3,maxWidth=ab.maxWidth or nil}end end;return da end})
aa.defineProperty(aa,"data",{default={},type="table",canTriggerRender=true,setter=function(ba,ca)ba.set("scrollOffset",0)
ba.set("selectedRow",nil)ba.set("sortColumn",nil)
ba.set("sortDirection","asc")return ca end})
@@ -652,7 +653,8 @@ aa.defineProperty(aa,"selectedColor",{default=colors.lightBlue,type="color"})
aa.defineProperty(aa,"gridColor",{default=colors.gray,type="color"})
aa.defineProperty(aa,"sortColumn",{default=nil,type="number",canTriggerRender=true})
aa.defineProperty(aa,"sortDirection",{default="asc",type="string",canTriggerRender=true})
aa.defineProperty(aa,"scrollOffset",{default=0,type="number",canTriggerRender=true})aa.defineEvent(aa,"mouse_click")
aa.defineProperty(aa,"scrollOffset",{default=0,type="number",canTriggerRender=true})
aa.defineProperty(aa,"customSortFunction",{default={},type="table"})aa.defineEvent(aa,"mouse_click")
aa.defineEvent(aa,"mouse_scroll")function aa.new()local ba=setmetatable({},aa):__init()
ba.class=aa;ba.set("width",30)ba.set("height",10)ba.set("z",5)
return ba end
@@ -661,22 +663,62 @@ d.init(self,ba,ca)self.set("type","Table")return self end
function aa:addColumn(ba,ca)local da=self.get("columns")
table.insert(da,{name=ba,width=ca})self.set("columns",da)return self end;function aa:addData(...)local ba=self.get("data")table.insert(ba,{...})
self.set("data",ba)return self end
function aa:sortData(ba,ca)
local da=self.get("data")local _b=self.get("sortDirection")
if not ca then
table.sort(da,function(ab,bb)if _b=="asc"then return
ab[ba]<bb[ba]else return ab[ba]>bb[ba]end end)else
table.sort(da,function(ab,bb)return ca(ab[ba],bb[ba])end)end;return self end
function aa:setColumnSortFunction(ba,ca)
local da=self.get("customSortFunction")da[ba]=ca;self.set("customSortFunction",da)return self end
function aa:setFormattedData(ba,ca)local da={}for _b,ab in ipairs(ba)do local bb={}for cb,db in ipairs(ab)do bb[cb]=db end;if ca and
ca[_b]then bb._sortValues=ca[_b]end
table.insert(da,bb)end
self.set("data",da)return self end
function aa:setData(ba,ca)if not ca then self.set("data",ba)return self end
local da={}
for _b,ab in ipairs(ba)do local bb={}for cb,db in ipairs(ab)do
if ca[cb]then bb[cb]=ca[cb](db)else bb[cb]=db end end;table.insert(da,bb)end;return self:setFormattedData(da,ba)end
function aa:calculateColumnWidths(ba,ca)local da={}local _b=ca;local ab={}local bb=0
for db,_c in ipairs(ba)do
da[db]={name=_c.name,width=_c.width,minWidth=_c.minWidth or 3,maxWidth=_c.maxWidth}
if type(_c.width)=="number"then
da[db].visibleWidth=math.max(_c.width,da[db].minWidth)if da[db].maxWidth then
da[db].visibleWidth=math.min(da[db].visibleWidth,da[db].maxWidth)end
_b=_b-da[db].visibleWidth;bb=bb+da[db].visibleWidth elseif type(_c.width)=="string"and
_c.width:match("%%$")then
local ac=tonumber(_c.width:match("(%d+)%%"))
if ac then da[db].visibleWidth=math.floor(ca*ac/100)
da[db].visibleWidth=math.max(da[db].visibleWidth,da[db].minWidth)if da[db].maxWidth then
da[db].visibleWidth=math.min(da[db].visibleWidth,da[db].maxWidth)end
_b=_b-da[db].visibleWidth;bb=bb+da[db].visibleWidth else table.insert(ab,db)end else table.insert(ab,db)end end
if#ab>0 and _b>0 then local db=math.floor(_b/#ab)
for _c,ac in ipairs(ab)do
da[ac].visibleWidth=math.max(db,da[ac].minWidth)if da[ac].maxWidth then
da[ac].visibleWidth=math.min(da[ac].visibleWidth,da[ac].maxWidth)end end end;local cb=0
for db,_c in ipairs(da)do cb=cb+ (_c.visibleWidth or 0)end;if cb>ca then local db=ca/cb
for _c,ac in ipairs(da)do if ac.visibleWidth then
ac.visibleWidth=math.max(1,math.floor(ac.visibleWidth*db))end end end
return da end
function aa:sortData(ba,ca)local da=self.get("data")
local _b=self.get("sortDirection")local ab=self.get("customSortFunction")local bb=ca or ab[ba]
if bb then
table.sort(da,function(cb,db)return
bb(cb,db,_b)end)else
table.sort(da,function(cb,db)if not cb or not db then return false end;local _c,ac
if cb._sortValues and
cb._sortValues[ba]then _c=cb._sortValues[ba]else _c=cb[ba]end;if db._sortValues and db._sortValues[ba]then ac=db._sortValues[ba]else
ac=db[ba]end
if type(_c)=="number"and
type(ac)=="number"then if _b=="asc"then return _c<ac else return _c>ac end else local bc=tostring(
_c or"")local cc=tostring(ac or"")if _b=="asc"then
return bc<cc else return bc>cc end end end)end;return self end
function aa:mouse_click(ba,ca,da)
if not d.mouse_click(self,ba,ca,da)then return false end;local _b,ab=self:getRelativePosition(ca,da)
if ab==1 then local bb=1
for cb,db in
ipairs(self.get("columns"))do
if _b>=bb and _b<bb+db.width then
if self.get("sortColumn")==cb then
if ab==1 then
local bb=self.get("columns")local cb=self.get("width")
local db=self:calculateColumnWidths(bb,cb)local _c=1
for ac,bc in ipairs(db)do
local cc=bc.visibleWidth or bc.width or 10
if _b>=_c and _b<_c+cc then
if self.get("sortColumn")==ac then
self.set("sortDirection",
self.get("sortDirection")=="asc"and"desc"or"asc")else self.set("sortColumn",cb)
self.set("sortDirection","asc")end;self:sortData(cb)break end;bb=bb+db.width end end
self.get("sortDirection")=="asc"and"desc"or"asc")else self.set("sortColumn",ac)
self.set("sortDirection","asc")end;self:sortData(ac)break end;_c=_c+cc end end
if ab>1 then local bb=ab-2 +self.get("scrollOffset")if bb>=0 and bb<#
self.get("data")then
self.set("selectedRow",bb+1)end end;return true end
@@ -688,25 +730,25 @@ self.get("scrollOffset")+ba))self.set("scrollOffset",db)return true end;return f
function aa:render()d.render(self)local ba=self.get("columns")
local ca=self.get("data")local da=self.get("selectedRow")
local _b=self.get("sortColumn")local ab=self.get("scrollOffset")local bb=self.get("height")
local cb=self.get("width")local db=0;local _c=#ba
for bc,cc in ipairs(ba)do
if db+cc.width>cb then if bc==1 then cc.visibleWidth=cb else cc.visibleWidth=cb-
db;_c=bc end;break end;cc.visibleWidth=cc.width;db=db+cc.width end;local ac=1
for bc,cc in ipairs(ba)do if bc>_c then break end;local dc=cc.name;if bc==_b then
dc=dc.. (
local cb=self.get("width")local db=self:calculateColumnWidths(ba,cb)local _c=0;local ac=#db;for cc,dc in
ipairs(db)do if _c+dc.visibleWidth>cb then ac=cc-1;break end
_c=_c+dc.visibleWidth end;local bc=1
for cc,dc in ipairs(db)do
if cc>ac then break end;local _d=dc.name;if cc==_b then
_d=_d.. (
self.get("sortDirection")=="asc"and"\30"or"\31")end
self:textFg(ac,1,dc:sub(1,cc.visibleWidth),self.get("headerColor"))ac=ac+cc.visibleWidth end
for y=2,bb do local bc=y-2 +ab;local cc=ca[bc+1]
if cc and(bc+1)<=#ca then ac=1
local dc=(bc+1)==da and
self:textFg(bc,1,_d:sub(1,dc.visibleWidth),self.get("headerColor"))bc=bc+dc.visibleWidth end
for y=2,bb do local cc=y-2 +ab;local dc=ca[cc+1]
if dc and(cc+1)<=#ca then bc=1
local _d=(cc+1)==da and
self.get("selectedColor")or self.get("background")
for _d,ad in ipairs(ba)do if _d>_c then break end;local bd=tostring(cc[_d]or"")local cd=bd..string.rep(" ",
ad.visibleWidth-#bd)if
_d<_c then
cd=string.sub(cd,1,ad.visibleWidth-1).." "end
local dd=string.sub(cd,1,ad.visibleWidth)
local __a=string.rep(_a[self.get("foreground")],ad.visibleWidth)local a_a=string.rep(_a[dc],ad.visibleWidth)
self:blit(ac,y,dd,__a,a_a)ac=ac+ad.visibleWidth end else
for ad,bd in ipairs(db)do if ad>ac then break end;local cd=tostring(dc[ad]or"")local dd=cd..string.rep(" ",
bd.visibleWidth-#cd)if
ad<ac then
dd=string.sub(dd,1,bd.visibleWidth-1).." "end
local __a=string.sub(dd,1,bd.visibleWidth)
local a_a=string.rep(_a[self.get("foreground")],bd.visibleWidth)local b_a=string.rep(_a[_d],bd.visibleWidth)
self:blit(bc,y,__a,a_a,b_a)bc=bc+bd.visibleWidth end else
self:blit(1,y,string.rep(" ",self.get("width")),string.rep(_a[self.get("foreground")],self.get("width")),string.rep(_a[self.get("background")],self.get("width")))end end end;return aa end
project["elements/Menu.lua"] = function(...) local _a=require("elements/VisualElement")
local aa=require("elements/List")local ba=require("libraries/colorHex")
@@ -1471,7 +1513,17 @@ _b.registerEventCallback(_b,"Char","char")_b.registerEventCallback(_b,"KeyUp","k
local ab,bb=math.max,math.min;function _b.new()local cb=setmetatable({},_b):__init()
cb.class=_b;return cb end
function _b:init(cb,db)
ca.init(self,cb,db)self.set("type","VisualElement")end
ca.init(self,cb,db)self.set("type","VisualElement")
self:observe("x",function()if self.parent then
self.parent.set("childrenSorted",false)end end)
self:observe("y",function()if self.parent then
self.parent.set("childrenSorted",false)end end)
self:observe("width",function()if self.parent then
self.parent.set("childrenSorted",false)end end)
self:observe("height",function()if self.parent then
self.parent.set("childrenSorted",false)end end)
self:observe("visible",function()if self.parent then
self.parent.set("childrenSorted",false)end end)end
function _b:multiBlit(cb,db,_c,ac,bc,cc,dc)local _d,ad=self:calculatePosition()cb=cb+_d-1
db=db+ad-1;self.parent:multiBlit(cb,db,_c,ac,bc,cc,dc)end
function _b:textFg(cb,db,_c,ac)local bc,cc=self:calculatePosition()cb=cb+bc-1
@@ -1486,11 +1538,10 @@ function _b:drawBg(cb,db,_c)local ac,bc=self:calculatePosition()cb=cb+ac-1
db=db+bc-1;self.parent:drawBg(cb,db,_c)end
function _b:blit(cb,db,_c,ac,bc)local cc,dc=self:calculatePosition()cb=cb+cc-1
db=db+dc-1;self.parent:blit(cb,db,_c,ac,bc)end
function _b:isInBounds(cb,db)if cb==nil or db==nil then return false end
local _c,ac=self.get("x"),self.get("y")local bc,cc=self.get("width"),self.get("height")if
(self.get("ignoreOffset"))then
if(self.parent)then cb=cb-self.parent.get("offsetX")db=
db-self.parent.get("offsetY")end end;return
function _b:isInBounds(cb,db)local _c,ac=self.get("x"),self.get("y")
local bc,cc=self.get("width"),self.get("height")if(self.get("ignoreOffset"))then
if(self.parent)then
cb=cb-self.parent.get("offsetX")db=db-self.parent.get("offsetY")end end;return
cb>=_c and cb<=
_c+bc-1 and db>=ac and db<=ac+cc-1 end
function _b:mouse_click(cb,db,_c)if self:isInBounds(db,_c)then self.set("clicked",true)