Update config, LuaLS definitions, bundle and changelog
This commit is contained in:
561
config.lua
561
config.lua
@@ -1,351 +1,360 @@
|
||||
return {
|
||||
["metadata"] = {
|
||||
["generated"] = "Mon Feb 24 19:52:36 2025",
|
||||
["version"] = "2.0",
|
||||
["generated"] = "Sun Feb 23 11:20:35 2025",
|
||||
},
|
||||
["categories"] = {
|
||||
["elements"] = {
|
||||
["description"] = "UI Elements",
|
||||
["plugins"] = {
|
||||
["files"] = {
|
||||
["pluginTemplate"] = {
|
||||
["size"] = 695,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "plugins/pluginTemplate.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["xml"] = {
|
||||
["size"] = 6371,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "plugins/xml.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["benchmark"] = {
|
||||
["size"] = 12515,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "plugins/benchmark.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["state"] = {
|
||||
["size"] = 5867,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "plugins/state.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["theme"] = {
|
||||
["size"] = 5879,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "plugins/theme.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["animation"] = {
|
||||
["size"] = 14116,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "plugins/animation.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["debug"] = {
|
||||
["size"] = 6175,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "plugins/debug.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["reactive"] = {
|
||||
["size"] = 6989,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "plugins/reactive.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
},
|
||||
["description"] = "Plugins",
|
||||
},
|
||||
["libraries"] = {
|
||||
["files"] = {
|
||||
["utils"] = {
|
||||
["size"] = 2661,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "libraries/utils.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["colorHex"] = {
|
||||
["size"] = 132,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "libraries/colorHex.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["expect"] = {
|
||||
["size"] = 880,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "libraries/expect.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
},
|
||||
["description"] = "Libraries",
|
||||
},
|
||||
["elements"] = {
|
||||
["files"] = {
|
||||
["BaseElement"] = {
|
||||
["size"] = 8733,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "elements/BaseElement.lua",
|
||||
["default"] = true,
|
||||
["description"] = "The base class for all UI elements in Basalt.",
|
||||
},
|
||||
["Slider"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["size"] = 4767,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["path"] = "elements/Slider.lua",
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["size"] = 4465,
|
||||
},
|
||||
["Label"] = {
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "elements/Label.lua",
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["size"] = 2848,
|
||||
},
|
||||
["Tree"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "elements/Tree.lua",
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["size"] = 7284,
|
||||
},
|
||||
["Button"] = {
|
||||
["description"] = "Standard button element with click handling and state management",
|
||||
["default"] = true,
|
||||
["path"] = "elements/Button.lua",
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["size"] = 1837,
|
||||
},
|
||||
["Flexbox"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "elements/Flexbox.lua",
|
||||
["requires"] = {
|
||||
[1] = "Container",
|
||||
},
|
||||
["size"] = 10132,
|
||||
},
|
||||
["Menu"] = {
|
||||
["description"] = "A horizontal menu bar with selectable",
|
||||
["default"] = true,
|
||||
["path"] = "elements/Menu.lua",
|
||||
["size"] = 4721,
|
||||
["requires"] = {
|
||||
[1] = "List",
|
||||
},
|
||||
["size"] = 4714,
|
||||
},
|
||||
["Program"] = {
|
||||
["description"] = "",
|
||||
["path"] = "elements/Menu.lua",
|
||||
["default"] = true,
|
||||
["path"] = "elements/Program.lua",
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["size"] = 5589,
|
||||
["description"] = "A horizontal menu bar with selectable items.",
|
||||
},
|
||||
["Checkbox"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "elements/Checkbox.lua",
|
||||
["Flexbox"] = {
|
||||
["size"] = 11685,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
[1] = "Container",
|
||||
},
|
||||
["size"] = 2874,
|
||||
["path"] = "elements/Flexbox.lua",
|
||||
["default"] = true,
|
||||
["description"] = "A flexbox container that arranges its children in a flexible layout.",
|
||||
},
|
||||
["VisualElement"] = {
|
||||
["description"] = "The Visual Element class which is the base class for all visual UI elements",
|
||||
["default"] = true,
|
||||
["path"] = "elements/VisualElement.lua",
|
||||
["size"] = 14506,
|
||||
["requires"] = {
|
||||
[1] = "BaseElement",
|
||||
},
|
||||
["size"] = 14456,
|
||||
},
|
||||
["Table"] = {
|
||||
["description"] = "",
|
||||
["path"] = "elements/VisualElement.lua",
|
||||
["default"] = true,
|
||||
["path"] = "elements/Table.lua",
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["size"] = 8475,
|
||||
["description"] = "The Visual Element class which is the base class for all visual UI elements",
|
||||
},
|
||||
["Input"] = {
|
||||
["description"] = "A text input field with various features",
|
||||
["default"] = true,
|
||||
["path"] = "elements/Input.lua",
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["size"] = 7180,
|
||||
},
|
||||
["BaseFrame"] = {
|
||||
["description"] = "This is the base frame class. It is the root element of all elements and the only element without a parent.",
|
||||
["default"] = true,
|
||||
["path"] = "elements/BaseFrame.lua",
|
||||
["Frame"] = {
|
||||
["size"] = 1147,
|
||||
["requires"] = {
|
||||
[1] = "Container",
|
||||
},
|
||||
["size"] = 5188,
|
||||
["path"] = "elements/Frame.lua",
|
||||
["default"] = true,
|
||||
["description"] = "A frame element that serves as a grouping container for other elements.",
|
||||
},
|
||||
["Tree"] = {
|
||||
["size"] = 7902,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["path"] = "elements/Tree.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["Input"] = {
|
||||
["size"] = 7157,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["path"] = "elements/Input.lua",
|
||||
["default"] = true,
|
||||
["description"] = "A text input field with various features",
|
||||
},
|
||||
["Checkbox"] = {
|
||||
["size"] = 2942,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["path"] = "elements/Checkbox.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["Label"] = {
|
||||
["size"] = 2964,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["path"] = "elements/Label.lua",
|
||||
["default"] = true,
|
||||
["description"] = "A simple text display element that automatically resizes its width based on the text content.",
|
||||
},
|
||||
["Image"] = {
|
||||
["size"] = 5638,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["path"] = "elements/Image.lua",
|
||||
["default"] = false,
|
||||
["description"] = "An element that displays an image in bimg format",
|
||||
},
|
||||
["ProgressBar"] = {
|
||||
["size"] = 2348,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["path"] = "elements/ProgressBar.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["TextBox"] = {
|
||||
["description"] = "A multi-line text editor component with cursor support and text manipulation features",
|
||||
["default"] = false,
|
||||
["size"] = 10931,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["path"] = "elements/TextBox.lua",
|
||||
["default"] = false,
|
||||
["description"] = "A multi-line text editor component with cursor support and text manipulation features",
|
||||
},
|
||||
["Program"] = {
|
||||
["size"] = 6687,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["size"] = 8976,
|
||||
},
|
||||
["Container"] = {
|
||||
["description"] = "The container class. It is a visual element that can contain other elements. It is the base class for all containers",
|
||||
["path"] = "elements/Program.lua",
|
||||
["default"] = true,
|
||||
["path"] = "elements/Container.lua",
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["size"] = 21768,
|
||||
},
|
||||
["Scrollbar"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "elements/Scrollbar.lua",
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["size"] = 7793,
|
||||
},
|
||||
["Dropdown"] = {
|
||||
["description"] = "A dropdown menu that shows a list of selectable items",
|
||||
["default"] = false,
|
||||
["path"] = "elements/Dropdown.lua",
|
||||
["size"] = 5975,
|
||||
["requires"] = {
|
||||
[1] = "List",
|
||||
},
|
||||
["size"] = 5976,
|
||||
["path"] = "elements/Dropdown.lua",
|
||||
["default"] = false,
|
||||
["description"] = "A dropdown menu that shows a list of selectable items",
|
||||
},
|
||||
["Frame"] = {
|
||||
["description"] = "",
|
||||
["List"] = {
|
||||
["size"] = 8382,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["path"] = "elements/List.lua",
|
||||
["default"] = true,
|
||||
["path"] = "elements/Frame.lua",
|
||||
["description"] = "A scrollable list of selectable items",
|
||||
},
|
||||
["Container"] = {
|
||||
["size"] = 23200,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["path"] = "elements/Container.lua",
|
||||
["default"] = true,
|
||||
["description"] = "The container class. It is a visual element that can contain other elements. It is the base class for all containers",
|
||||
},
|
||||
["Table"] = {
|
||||
["size"] = 7673,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["path"] = "elements/Table.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["Button"] = {
|
||||
["size"] = 1846,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["path"] = "elements/Button.lua",
|
||||
["default"] = true,
|
||||
["description"] = "Standard button element with click handling and state management",
|
||||
},
|
||||
["BaseFrame"] = {
|
||||
["size"] = 5212,
|
||||
["requires"] = {
|
||||
[1] = "Container",
|
||||
},
|
||||
["size"] = 1053,
|
||||
},
|
||||
["BaseElement"] = {
|
||||
["description"] = "The base class for all UI elements in Basalt",
|
||||
["path"] = "elements/BaseFrame.lua",
|
||||
["default"] = true,
|
||||
["path"] = "elements/BaseElement.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 8969,
|
||||
["description"] = "This is the base frame class. It is the root element of all elements and the only element without a parent.",
|
||||
},
|
||||
["ProgressBar"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "elements/ProgressBar.lua",
|
||||
["Scrollbar"] = {
|
||||
["size"] = 9281,
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["size"] = 2348,
|
||||
},
|
||||
["List"] = {
|
||||
["description"] = "A scrollable list of selectable items",
|
||||
["path"] = "elements/Scrollbar.lua",
|
||||
["default"] = true,
|
||||
["path"] = "elements/List.lua",
|
||||
["requires"] = {
|
||||
[1] = "VisualElement",
|
||||
},
|
||||
["size"] = 8413,
|
||||
},
|
||||
},
|
||||
},
|
||||
["plugins"] = {
|
||||
["description"] = "Plugins",
|
||||
["files"] = {
|
||||
["state"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "plugins/state.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 5867,
|
||||
},
|
||||
["xml"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "plugins/xml.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 6371,
|
||||
},
|
||||
["animation"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "plugins/animation.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 14116,
|
||||
},
|
||||
["pluginTemplate"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "plugins/pluginTemplate.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 695,
|
||||
},
|
||||
["reactive"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "plugins/reactive.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 6989,
|
||||
},
|
||||
["benchmark"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "plugins/benchmark.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 12515,
|
||||
},
|
||||
["theme"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "plugins/theme.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 5879,
|
||||
},
|
||||
["debug"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "plugins/debug.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 6175,
|
||||
["description"] = "",
|
||||
},
|
||||
},
|
||||
["description"] = "UI Elements",
|
||||
},
|
||||
["core"] = {
|
||||
["description"] = "Core Files",
|
||||
["files"] = {
|
||||
["errorManager"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "errorManager.lua",
|
||||
["main"] = {
|
||||
["size"] = 7849,
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 3789,
|
||||
},
|
||||
["propertySystem"] = {
|
||||
["description"] = "",
|
||||
["path"] = "main.lua",
|
||||
["default"] = true,
|
||||
["path"] = "propertySystem.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 15220,
|
||||
},
|
||||
["elementManager"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "elementManager.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 6290,
|
||||
},
|
||||
["log"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "log.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 3142,
|
||||
},
|
||||
["render"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "render.lua",
|
||||
["size"] = 10919,
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 10919,
|
||||
["path"] = "render.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["init"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "init.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 519,
|
||||
},
|
||||
["main"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "main.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 7849,
|
||||
},
|
||||
},
|
||||
},
|
||||
["libraries"] = {
|
||||
["description"] = "Libraries",
|
||||
["files"] = {
|
||||
["colorHex"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "libraries/colorHex.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 132,
|
||||
},
|
||||
["expect"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "libraries/expect.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 880,
|
||||
},
|
||||
["utils"] = {
|
||||
["description"] = "",
|
||||
["default"] = true,
|
||||
["path"] = "libraries/utils.lua",
|
||||
["requires"] = {
|
||||
},
|
||||
["size"] = 2661,
|
||||
["path"] = "init.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["elementManager"] = {
|
||||
["size"] = 6290,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "elementManager.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["errorManager"] = {
|
||||
["size"] = 3789,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "errorManager.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["log"] = {
|
||||
["size"] = 3142,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "log.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
["propertySystem"] = {
|
||||
["size"] = 15220,
|
||||
["requires"] = {
|
||||
},
|
||||
["path"] = "propertySystem.lua",
|
||||
["default"] = true,
|
||||
["description"] = "",
|
||||
},
|
||||
},
|
||||
["description"] = "Core Files",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -21,6 +21,7 @@ minified_elementDirectory["Frame"] = {}
|
||||
minified_elementDirectory["Button"] = {}
|
||||
minified_elementDirectory["Program"] = {}
|
||||
minified_elementDirectory["Label"] = {}
|
||||
minified_elementDirectory["Image"] = {}
|
||||
minified_elementDirectory["Flexbox"] = {}
|
||||
minified_elementDirectory["Container"] = {}
|
||||
minified_elementDirectory["Slider"] = {}
|
||||
@@ -763,11 +764,10 @@ aa.defineEvent(aa,"mouse_scroll")
|
||||
function aa.new()local ba=setmetatable({},aa):__init()
|
||||
ba.set("width",30)ba.set("height",10)ba.set("z",5)return ba end
|
||||
function aa:init(ba,ca)d.init(self,ba,ca)self.set("type","Table")return self end
|
||||
function aa:setColumns(ba)self.set("columns",ba)return self end;function aa:setData(ba)self.set("data",ba)return self end
|
||||
function aa:sortData(ba)
|
||||
local ca=self.get("data")local da=self.get("sortDirection")
|
||||
table.sort(ca,function(_b,ab)if da=="asc"then return
|
||||
_b[ba]<ab[ba]else return _b[ba]>ab[ba]end end)self.set("data",ca)return self end
|
||||
function aa:sortData(ba)local ca=self.get("data")
|
||||
local da=self.get("sortDirection")
|
||||
table.sort(ca,function(_b,ab)
|
||||
if da=="asc"then return _b[ba]<ab[ba]else return _b[ba]>ab[ba]end end)self.set("data",ca)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
|
||||
@@ -827,13 +827,14 @@ cb=string.sub(cb,1 -da)da=1 end
|
||||
self._render:blit(da,_b,ab,bb,cb)end;function ca:setCursor(da,_b,ab,bb)local cb=self.get("term")
|
||||
self._render:setCursor(da,_b,ab,bb)end
|
||||
function ca:mouse_up(da,_b,ab)
|
||||
aa.mouse_up(self,da,_b,ab)aa.mouse_release(self,da,_b,ab)end;function ca:render()
|
||||
aa.mouse_up(self,da,_b,ab)aa.mouse_release(self,da,_b,ab)end
|
||||
function ca:term_resize()local da,_b=self.get("term").getSize()
|
||||
if(da==
|
||||
self.get("width")and _b==self.get("height"))then return end;self.set("width",da)self.set("height",_b)
|
||||
self._render:setSize(da,_b)self._renderUpdate=true end;function ca:render()
|
||||
if(self._renderUpdate)then if self._render~=nil then aa.render(self)
|
||||
self._render:render()self._renderUpdate=false end end end
|
||||
function ca:term_resize()
|
||||
local da,_b=self.get("term").getSize()if
|
||||
(da==self.get("width")and _b==self.get("height"))then return end;self.set("width",da)
|
||||
self.set("height",_b)self._render:setSize(da,_b)self._renderUpdate=true end;return ca end
|
||||
return ca end
|
||||
project["elements/ProgressBar.lua"] = function(...) local c=require("elements/VisualElement")
|
||||
local d=setmetatable({},c)d.__index=d
|
||||
d.defineProperty(d,"progress",{default=0,type="number",canTriggerRender=true})
|
||||
@@ -940,7 +941,7 @@ da.header="Basalt Program Error"da.error(ac)end;return _c,ac end;function ab:sto
|
||||
local cb=setmetatable({},_b):__init()cb.set("z",5)cb.set("width",30)cb.set("height",12)
|
||||
return cb end
|
||||
function _b:init(cb,db)
|
||||
ca.init(self,cb,db)self.set("type","Program")end
|
||||
ca.init(self,cb,db)self.set("type","Program")return self end
|
||||
function _b:execute(cb)self.set("path",cb)self.set("running",true)
|
||||
local db=ab.new()self.set("program",db)
|
||||
db:run(cb,self.get("width"),self.get("height"))self:updateRender()return self end
|
||||
@@ -979,6 +980,53 @@ if
|
||||
(self.get("autoSize"))then self:textFg(1,1,da,self.get("foreground"))else
|
||||
local _b=ba(da,self.get("width"))for ab,bb in ipairs(_b)do
|
||||
self:textFg(1,ab,bb,self.get("foreground"))end end end;return ca end
|
||||
project["elements/Image.lua"] = function(...) local _a=require("elementManager")
|
||||
local aa=_a.getElement("VisualElement")local ba=require("libraries/colorHex")
|
||||
local ca=setmetatable({},aa)ca.__index=ca
|
||||
ca.defineProperty(ca,"bimg",{default={},type="table",canTriggerRender=true})
|
||||
ca.defineProperty(ca,"currentFrame",{default=1,type="number",canTriggerRender=true})
|
||||
ca.defineProperty(ca,"metadata",{default={},type="table"})
|
||||
function ca.new()local da=setmetatable({},ca):__init()return da end;function ca:init(da,_b)aa.init(self,da,_b)self.set("type","Image")
|
||||
return self end
|
||||
function ca:loadBimg(da)
|
||||
if type(da)~="table"then return self end;local _b={}local ab={}for bb,cb in pairs(da)do
|
||||
if type(bb)=="number"then _b[bb]=cb else ab[bb]=cb end end;self.set("bimg",_b)
|
||||
self.set("metadata",ab)
|
||||
if _b[1]and _b[1][1]then
|
||||
self.set("width",#_b[1][1][2])self.set("height",#_b[1])end;return self end
|
||||
function ca:getPixelData(da,_b)
|
||||
local ab=self.get("bimg")[self.get("currentFrame")]if not ab or not ab[_b]then return end;local bb=ab[_b][1]
|
||||
local cb=ab[_b][2]local db=ab[_b][3]
|
||||
if not bb or not cb or not db then return end;local _c=tonumber(cb:sub(da,da),16)
|
||||
local ac=tonumber(db:sub(da,da),16)local bc=bb:sub(da,da)return _c,ac,bc end
|
||||
function ca:setChar(da,_b,ab)
|
||||
if type(ab)~="string"or#ab~=1 then return self end
|
||||
local bb=self.get("bimg")[self.get("currentFrame")]if not bb then bb={{},{},{}}
|
||||
self.get("bimg")[self.get("currentFrame")]=bb end
|
||||
if not bb[_b]then bb[_b]={"","",""}end;local cb=bb[_b][1]while#cb<da do cb=cb.." "end;bb[_b][1]=
|
||||
cb:sub(1,da-1)..ab..cb:sub(da+1)
|
||||
self:updateRender()return self end
|
||||
function ca:setFg(da,_b,ab)if type(ab)~="number"then return self end
|
||||
local bb=self.get("bimg")[self.get("currentFrame")]if not bb then bb={{},{},{}}
|
||||
self.get("bimg")[self.get("currentFrame")]=bb end
|
||||
if not bb[_b]then bb[_b]={"","",""}end;local cb=bb[_b][2]while#cb<da do cb=cb.."f"end;bb[_b][2]=
|
||||
cb:sub(1,da-1)..ba[ab]..cb:sub(da+1)
|
||||
self:updateRender()return self end
|
||||
function ca:setBg(da,_b,ab)if type(ab)~="number"then return self end
|
||||
local bb=self.get("bimg")[self.get("currentFrame")]if not bb then bb={{},{},{}}
|
||||
self.get("bimg")[self.get("currentFrame")]=bb end
|
||||
if not bb[_b]then bb[_b]={"","",""}end;local cb=bb[_b][3]while#cb<da do cb=cb.."f"end;bb[_b][3]=
|
||||
cb:sub(1,da-1)..ba[ab]..cb:sub(da+1)
|
||||
self:updateRender()return self end
|
||||
function ca:setPixel(da,_b,ab,bb,cb)if ab then self:setChar(da,_b,ab)end;if bb then
|
||||
self:setFg(da,_b,bb)end;if cb then self:setBg(da,_b,cb)end;return self end
|
||||
function ca:nextFrame()
|
||||
if not self.get("metadata").animation then return end;local da=self.get("bimg")local _b=self.get("currentFrame")
|
||||
local ab=_b+1;if ab>#da then ab=1 end;self.set("currentFrame",ab)return self end
|
||||
function ca:render()aa.render(self)
|
||||
local da=self.get("bimg")[self.get("currentFrame")]if not da then return end
|
||||
for _b,ab in ipairs(da)do local bb=ab[1]local cb=ab[2]local db=ab[3]if
|
||||
bb and cb and db then self:blit(1,_b,bb,cb,db)end end end;return ca end
|
||||
project["elements/Flexbox.lua"] = function(...) local da=require("elementManager")
|
||||
local _b=da.getElement("Container")local ab=setmetatable({},_b)ab.__index=ab
|
||||
ab.defineProperty(ab,"flexDirection",{default="row",type="string"})
|
||||
@@ -1047,9 +1095,10 @@ bc.set("width",12)bc.set("height",6)
|
||||
bc.set("background",colors.blue)bc.set("z",10)
|
||||
bc:observe("width",function()
|
||||
bc.set("flexUpdateLayout",true)end)
|
||||
bc:observe("height",function()bc.set("flexUpdateLayout",true)end)return bc end
|
||||
function ab:init(bc,cc)_b.init(self,bc,cc)self.set("type","Flexbox")end
|
||||
function ab:addChild(bc)_b.addChild(self,bc)
|
||||
bc:observe("height",function()bc.set("flexUpdateLayout",true)end)return bc end;function ab:init(bc,cc)_b.init(self,bc,cc)self.set("type","Flexbox")
|
||||
return self end
|
||||
function ab:addChild(bc)
|
||||
_b.addChild(self,bc)
|
||||
if(bc~=bb)then
|
||||
bc:instanceProperty("flexGrow",{default=0,type="number"})
|
||||
bc:instanceProperty("flexShrink",{default=0,type="number"})
|
||||
@@ -1419,11 +1468,12 @@ _b.defineProperty(_b,"ignoreOffset",{default=false,type="boolean"})_b.combinePro
|
||||
_b.combineProperties(_b,"size","width","height")
|
||||
_b.combineProperties(_b,"color","foreground","background")_b.defineEvent(_b,"focus")
|
||||
_b.defineEvent(_b,"blur")
|
||||
_b.registerEventCallback(_b,"MouseClick","mouse_click","mouse_up")
|
||||
_b.registerEventCallback(_b,"Click","mouse_click","mouse_up")
|
||||
_b.registerEventCallback(_b,"MouseUp","mouse_up","mouse_click")
|
||||
_b.registerEventCallback(_b,"MouseDrag","mouse_drag","mouse_click","mouse_up")
|
||||
_b.registerEventCallback(_b,"MouseScroll","mouse_scroll")
|
||||
_b.registerEventCallback(_b,"MouseEnter","mouse_enter","mouse_move")_b.registerEventCallback(_b,"Focus","focus","blur")
|
||||
_b.registerEventCallback(_b,"Drag","mouse_drag","mouse_click","mouse_up")
|
||||
_b.registerEventCallback(_b,"Scroll","mouse_scroll")
|
||||
_b.registerEventCallback(_b,"Enter","mouse_enter","mouse_move")
|
||||
_b.registerEventCallback(_b,"LeEave","mouse_leave","mouse_move")_b.registerEventCallback(_b,"Focus","focus","blur")
|
||||
_b.registerEventCallback(_b,"Blur","blur","focus")local ab,bb=math.max,math.min;function _b.new()
|
||||
local cb=setmetatable({},_b):__init()return cb end;function _b:init(cb,db)ca.init(self,cb,db)
|
||||
self.set("type","VisualElement")end;function _b:multiBlit(cb,db,_c,ac,bc,cc,dc)
|
||||
@@ -1510,7 +1560,8 @@ function ca:updateAttachedElement()local ab=self.get("attachedElement")
|
||||
if not ab then return end;local bb=self.get("value")local cb=self.get("minValue")
|
||||
local db=self.get("maxValue")if type(cb)=="function"then cb=cb()end;if type(db)=="function"then
|
||||
db=db()end;local _c=cb+ (bb/100)* (db-cb)ab.set(self.get("attachedProperty"),math.floor(
|
||||
_c+0.5))end;local function da(ab)
|
||||
_c+0.5))
|
||||
return self end;local function da(ab)
|
||||
return
|
||||
ab.get("orientation")=="vertical"and ab.get("height")or ab.get("width")end
|
||||
local function _b(ab,bb,cb)
|
||||
@@ -1600,7 +1651,8 @@ bb and(_b.selectedForeground or self.get("selectedForeground"))or(_b.foreground
|
||||
self:textFg(1,i,ab:sub(1,ca),db)end end end end;return d end
|
||||
project["elements/Tree.lua"] = function(...) local _a=require("elements/VisualElement")local aa=string.sub
|
||||
local ba=setmetatable({},_a)ba.__index=ba
|
||||
ba.defineProperty(ba,"nodes",{default={},type="table",canTriggerRender=true})
|
||||
ba.defineProperty(ba,"nodes",{default={},type="table",canTriggerRender=true,setter=function(da,_b)if#_b>0 then
|
||||
da.get("expandedNodes")[_b[1]]=true end;return _b end})
|
||||
ba.defineProperty(ba,"selectedNode",{default=nil,type="table",canTriggerRender=true})
|
||||
ba.defineProperty(ba,"expandedNodes",{default={},type="table",canTriggerRender=true})
|
||||
ba.defineProperty(ba,"scrollOffset",{default=0,type="number",canTriggerRender=true})
|
||||
@@ -1610,9 +1662,7 @@ ba.defineProperty(ba,"selectedColor",{default=colors.lightBlue,type="number"})ba
|
||||
ba.defineEvent(ba,"mouse_scroll")
|
||||
function ba.new()local da=setmetatable({},ba):__init()
|
||||
da.set("width",30)da.set("height",10)da.set("z",5)return da end
|
||||
function ba:init(da,_b)_a.init(self,da,_b)self.set("type","Tree")return self end
|
||||
function ba:setNodes(da)self.set("nodes",da)if#da>0 then
|
||||
self.get("expandedNodes")[da[1]]=true end;return self end;function ba:expandNode(da)self.get("expandedNodes")[da]=true
|
||||
function ba:init(da,_b)_a.init(self,da,_b)self.set("type","Tree")return self end;function ba:expandNode(da)self.get("expandedNodes")[da]=true
|
||||
self:updateRender()return self end
|
||||
function ba:collapseNode(da)self.get("expandedNodes")[da]=
|
||||
nil;self:updateRender()return self end;function ba:toggleNode(da)if self.get("expandedNodes")[da]then
|
||||
@@ -1688,7 +1738,7 @@ local ac=self.get("cursorY")local bc=self.get("scrollX")local cc=self.get("scrol
|
||||
local dc=self.get("width")local _d=self.get("height")
|
||||
if _c-bc>dc then
|
||||
self.set("scrollX",_c-dc)elseif _c-bc<1 then self.set("scrollX",_c-1)end;if ac-cc>_d then self.set("scrollY",ac-_d)elseif ac-cc<1 then
|
||||
self.set("scrollY",ac-1)end end
|
||||
self.set("scrollY",ac-1)end;return self end
|
||||
function _b:char(_c)if
|
||||
not self.get("editable")or not self.get("focused")then return false end;ab(self,_c)return true end
|
||||
function _b:key(_c)if
|
||||
|
||||
215
src/LuaLS.lua
215
src/LuaLS.lua
@@ -374,6 +374,14 @@ function Container:addFrame()
|
||||
return self
|
||||
end
|
||||
|
||||
--- Adds a new Image to the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@return Image
|
||||
function Container:addImage()
|
||||
return self
|
||||
end
|
||||
|
||||
--- Adds a new Input to the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
@@ -551,6 +559,166 @@ function Dropdown:setDropSymbol(dropSymbol)
|
||||
end
|
||||
|
||||
|
||||
---@class Flexbox
|
||||
---@field flexDirection string
|
||||
---@field flexSpacing number
|
||||
---@field flexJustifyContent string
|
||||
---@field flexWrap boolean
|
||||
---@field flexUpdateLayout boolean
|
||||
local Flexbox = {}
|
||||
|
||||
--- Gets the The direction of the flexbox layout "row" or "column"
|
||||
---@generic Element: Flexbox
|
||||
---@param self Element
|
||||
---@return string
|
||||
function Flexbox:getFlexDirection()
|
||||
return self.flexDirection
|
||||
end
|
||||
|
||||
--- Sets the The direction of the flexbox layout "row" or "column"
|
||||
---@generic Element: Flexbox
|
||||
---@param self Element
|
||||
---@param flexDirection string
|
||||
---@return Element
|
||||
function Flexbox:setFlexDirection(flexDirection)
|
||||
self.flexDirection = flexDirection
|
||||
return self
|
||||
end
|
||||
|
||||
--- Gets the The spacing between flex items
|
||||
---@generic Element: Flexbox
|
||||
---@param self Element
|
||||
---@return number
|
||||
function Flexbox:getFlexSpacing()
|
||||
return self.flexSpacing
|
||||
end
|
||||
|
||||
--- Sets the The spacing between flex items
|
||||
---@generic Element: Flexbox
|
||||
---@param self Element
|
||||
---@param flexSpacing number
|
||||
---@return Element
|
||||
function Flexbox:setFlexSpacing(flexSpacing)
|
||||
self.flexSpacing = flexSpacing
|
||||
return self
|
||||
end
|
||||
|
||||
--- Gets the The alignment of flex items along the main axis
|
||||
---@generic Element: Flexbox
|
||||
---@param self Element
|
||||
---@return string
|
||||
function Flexbox:getFlexJustifyContent()
|
||||
return self.flexJustifyContent
|
||||
end
|
||||
|
||||
--- Sets the The alignment of flex items along the main axis
|
||||
---@generic Element: Flexbox
|
||||
---@param self Element
|
||||
---@param flexJustifyContent string
|
||||
---@return Element
|
||||
function Flexbox:setFlexJustifyContent(flexJustifyContent)
|
||||
self.flexJustifyContent = flexJustifyContent
|
||||
return self
|
||||
end
|
||||
|
||||
--- Gets the Whether to wrap flex items onto multiple lines
|
||||
---@generic Element: Flexbox
|
||||
---@param self Element
|
||||
---@return boolean
|
||||
function Flexbox:getFlexWrap()
|
||||
return self.flexWrap
|
||||
end
|
||||
|
||||
--- Sets the Whether to wrap flex items onto multiple lines
|
||||
---@generic Element: Flexbox
|
||||
---@param self Element
|
||||
---@param flexWrap boolean
|
||||
---@return Element
|
||||
function Flexbox:setFlexWrap(flexWrap)
|
||||
self.flexWrap = flexWrap
|
||||
return self
|
||||
end
|
||||
|
||||
--- Gets the Whether to update the layout of the flexbox
|
||||
---@generic Element: Flexbox
|
||||
---@param self Element
|
||||
---@return boolean
|
||||
function Flexbox:getFlexUpdateLayout()
|
||||
return self.flexUpdateLayout
|
||||
end
|
||||
|
||||
--- Sets the Whether to update the layout of the flexbox
|
||||
---@generic Element: Flexbox
|
||||
---@param self Element
|
||||
---@param flexUpdateLayout boolean
|
||||
---@return Element
|
||||
function Flexbox:setFlexUpdateLayout(flexUpdateLayout)
|
||||
self.flexUpdateLayout = flexUpdateLayout
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
---@class Image
|
||||
---@field bimg table
|
||||
---@field currentFrame number
|
||||
---@field metadata table
|
||||
local Image = {}
|
||||
|
||||
--- Gets the The bimg image data
|
||||
---@generic Element: Image
|
||||
---@param self Element
|
||||
---@return table
|
||||
function Image:getBimg()
|
||||
return self.bimg
|
||||
end
|
||||
|
||||
--- Sets the The bimg image data
|
||||
---@generic Element: Image
|
||||
---@param self Element
|
||||
---@param bimg table
|
||||
---@return Element
|
||||
function Image:setBimg(bimg)
|
||||
self.bimg = bimg
|
||||
return self
|
||||
end
|
||||
|
||||
--- Gets the Current animation frame
|
||||
---@generic Element: Image
|
||||
---@param self Element
|
||||
---@return number
|
||||
function Image:getCurrentFrame()
|
||||
return self.currentFrame
|
||||
end
|
||||
|
||||
--- Sets the Current animation frame
|
||||
---@generic Element: Image
|
||||
---@param self Element
|
||||
---@param currentFrame number
|
||||
---@return Element
|
||||
function Image:setCurrentFrame(currentFrame)
|
||||
self.currentFrame = currentFrame
|
||||
return self
|
||||
end
|
||||
|
||||
--- Gets the Image metadata (version, palette, etc)
|
||||
---@generic Element: Image
|
||||
---@param self Element
|
||||
---@return table
|
||||
function Image:getMetadata()
|
||||
return self.metadata
|
||||
end
|
||||
|
||||
--- Sets the Image metadata (version, palette, etc)
|
||||
---@generic Element: Image
|
||||
---@param self Element
|
||||
---@param metadata table
|
||||
---@return Element
|
||||
function Image:setMetadata(metadata)
|
||||
self.metadata = metadata
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
---@class Input
|
||||
---@field text string
|
||||
---@field cursorPos number
|
||||
@@ -1923,16 +2091,16 @@ function VisualElement:setIgnoreOffset(ignoreOffset)
|
||||
return self
|
||||
end
|
||||
|
||||
--- {button number, x number, y number} Fired on mouse click
|
||||
--- {button, x, y} Fired on mouse click
|
||||
---@generic Element: VisualElement
|
||||
---@param self Element
|
||||
---@param callback function
|
||||
---@return Element
|
||||
function VisualElement:onOnMouseClick(callback)
|
||||
function VisualElement:onOnClick(callback)
|
||||
return self
|
||||
end
|
||||
|
||||
--- {button number, x number, y number} Fired on mouse button release
|
||||
--- {button, x, y} Fired on mouse button release
|
||||
---@generic Element: VisualElement
|
||||
---@param self Element
|
||||
---@param callback function
|
||||
@@ -1941,21 +2109,48 @@ function VisualElement:onOnMouseUp(callback)
|
||||
return self
|
||||
end
|
||||
|
||||
--- {button number, x number, y number} Fired when mouse leaves while clicked
|
||||
--- {button, x, y} Fired when mouse leaves while clicked
|
||||
---@generic Element: VisualElement
|
||||
---@param self Element
|
||||
---@param callback function
|
||||
---@return Element
|
||||
function VisualElement:onOnMouseRelease(callback)
|
||||
function VisualElement:onOnRelease(callback)
|
||||
return self
|
||||
end
|
||||
|
||||
--- {button number, x number, y number} Fired when mouse moves while clicked
|
||||
--- {button, x, y} Fired when mouse moves while clicked
|
||||
---@generic Element: VisualElement
|
||||
---@param self Element
|
||||
---@param callback function
|
||||
---@return Element
|
||||
function VisualElement:onOnMouseDrag(callback)
|
||||
function VisualElement:onOnDrag(callback)
|
||||
return self
|
||||
end
|
||||
|
||||
--- {direction, x, y} Fired on mouse scroll
|
||||
---@generic Element: VisualElement
|
||||
---@param self Element
|
||||
---@param callback function
|
||||
---@return Element
|
||||
function VisualElement:onOnScroll(callback)
|
||||
return self
|
||||
end
|
||||
|
||||
--- {-} Fired when mouse enters element
|
||||
---@generic Element: VisualElement
|
||||
---@param self Element
|
||||
---@param callback function
|
||||
---@return Element
|
||||
function VisualElement:onOnEnter(callback)
|
||||
return self
|
||||
end
|
||||
|
||||
--- {-} Fired when mouse leaves element
|
||||
---@generic Element: VisualElement
|
||||
---@param self Element
|
||||
---@param callback function
|
||||
---@return Element
|
||||
function VisualElement:onOnLeave(callback)
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -1977,7 +2172,7 @@ function VisualElement:onOnBlur(callback)
|
||||
return self
|
||||
end
|
||||
|
||||
--- {key number, code number, isRepeat boolean} Fired on key press
|
||||
--- {key} Fired on key press
|
||||
---@generic Element: VisualElement
|
||||
---@param self Element
|
||||
---@param callback function
|
||||
@@ -1986,7 +2181,7 @@ function VisualElement:onOnKey(callback)
|
||||
return self
|
||||
end
|
||||
|
||||
--- {key number, code number} Fired on key release
|
||||
--- {key} Fired on key release
|
||||
---@generic Element: VisualElement
|
||||
---@param self Element
|
||||
---@param callback function
|
||||
@@ -1995,7 +2190,7 @@ function VisualElement:onOnKeyUp(callback)
|
||||
return self
|
||||
end
|
||||
|
||||
--- {char string} Fired on character input
|
||||
--- {char} Fired on character input
|
||||
---@generic Element: VisualElement
|
||||
---@param self Element
|
||||
---@param callback function
|
||||
|
||||
Reference in New Issue
Block a user