Update config, LuaLS definitions, bundle and changelog
This commit is contained in:
264
config.lua
264
config.lua
@@ -1,152 +1,152 @@
|
||||
return {
|
||||
["files"] = {
|
||||
["src/elements/Container.lua"] = {
|
||||
["name"] = "Container",
|
||||
["path"] = "elements/Container.lua",
|
||||
},
|
||||
["src/main.lua"] = {
|
||||
["name"] = "main",
|
||||
["path"] = "main.lua",
|
||||
},
|
||||
["src/elements/Checkbox.lua"] = {
|
||||
["name"] = "Checkbox",
|
||||
["path"] = "elements/Checkbox.lua",
|
||||
},
|
||||
["src/plugins/benchmark.lua"] = {
|
||||
["name"] = "benchmark",
|
||||
["path"] = "plugins/benchmark.lua",
|
||||
},
|
||||
["src/plugins/xml.lua"] = {
|
||||
["name"] = "xml",
|
||||
["path"] = "plugins/xml.lua",
|
||||
},
|
||||
["src/elements/Table.lua"] = {
|
||||
["name"] = "Table",
|
||||
["path"] = "elements/Table.lua",
|
||||
},
|
||||
["src/elementManager.lua"] = {
|
||||
["name"] = "elementManager",
|
||||
["path"] = "elementManager.lua",
|
||||
},
|
||||
["src/elements/ProgressBar.lua"] = {
|
||||
["name"] = "ProgressBar",
|
||||
["path"] = "elements/ProgressBar.lua",
|
||||
},
|
||||
["src/elements/BaseElement.lua"] = {
|
||||
["name"] = "BaseElement",
|
||||
["path"] = "elements/BaseElement.lua",
|
||||
},
|
||||
["src/errorManager.lua"] = {
|
||||
["name"] = "errorManager",
|
||||
["path"] = "errorManager.lua",
|
||||
},
|
||||
["src/elements/Button.lua"] = {
|
||||
["name"] = "Button",
|
||||
["path"] = "elements/Button.lua",
|
||||
},
|
||||
["src/propertySystem.lua"] = {
|
||||
["name"] = "propertySystem",
|
||||
["path"] = "propertySystem.lua",
|
||||
},
|
||||
["src/plugins/state.lua"] = {
|
||||
["name"] = "state",
|
||||
["path"] = "plugins/state.lua",
|
||||
["name"] = "main",
|
||||
},
|
||||
["src/LuaLS.lua"] = {
|
||||
["name"] = "LuaLS",
|
||||
["path"] = "LuaLS.lua",
|
||||
},
|
||||
["src/elements/BaseFrame.lua"] = {
|
||||
["name"] = "BaseFrame",
|
||||
["path"] = "elements/BaseFrame.lua",
|
||||
},
|
||||
["src/elements/Slider.lua"] = {
|
||||
["name"] = "Slider",
|
||||
["path"] = "elements/Slider.lua",
|
||||
},
|
||||
["src/elements/Flexbox.lua"] = {
|
||||
["name"] = "Flexbox",
|
||||
["path"] = "elements/Flexbox.lua",
|
||||
},
|
||||
["src/plugins/debug.lua"] = {
|
||||
["name"] = "debug",
|
||||
["path"] = "plugins/debug.lua",
|
||||
},
|
||||
["src/log.lua"] = {
|
||||
["name"] = "log",
|
||||
["path"] = "log.lua",
|
||||
},
|
||||
["src/plugins/reactive.lua"] = {
|
||||
["name"] = "reactive",
|
||||
["path"] = "plugins/reactive.lua",
|
||||
},
|
||||
["src/plugins/animation.lua"] = {
|
||||
["name"] = "animation",
|
||||
["path"] = "plugins/animation.lua",
|
||||
},
|
||||
["src/render.lua"] = {
|
||||
["name"] = "render",
|
||||
["path"] = "render.lua",
|
||||
},
|
||||
["src/elements/Dropdown.lua"] = {
|
||||
["name"] = "Dropdown",
|
||||
["path"] = "elements/Dropdown.lua",
|
||||
},
|
||||
["src/init.lua"] = {
|
||||
["name"] = "init",
|
||||
["path"] = "init.lua",
|
||||
},
|
||||
["src/elements/Tree.lua"] = {
|
||||
["name"] = "Tree",
|
||||
["path"] = "elements/Tree.lua",
|
||||
},
|
||||
["src/plugins/theme.lua"] = {
|
||||
["name"] = "theme",
|
||||
["path"] = "plugins/theme.lua",
|
||||
},
|
||||
["src/libraries/colorHex.lua"] = {
|
||||
["name"] = "colorHex",
|
||||
["path"] = "libraries/colorHex.lua",
|
||||
},
|
||||
["src/libraries/utils.lua"] = {
|
||||
["name"] = "utils",
|
||||
["path"] = "libraries/utils.lua",
|
||||
},
|
||||
["src/libraries/expect.lua"] = {
|
||||
["name"] = "expect",
|
||||
["path"] = "libraries/expect.lua",
|
||||
},
|
||||
["src/elements/List.lua"] = {
|
||||
["name"] = "List",
|
||||
["path"] = "elements/List.lua",
|
||||
},
|
||||
["src/elements/VisualElement.lua"] = {
|
||||
["name"] = "VisualElement",
|
||||
["path"] = "elements/VisualElement.lua",
|
||||
["name"] = "LuaLS",
|
||||
},
|
||||
["src/elements/Program.lua"] = {
|
||||
["name"] = "Program",
|
||||
["path"] = "elements/Program.lua",
|
||||
["name"] = "Program",
|
||||
},
|
||||
["src/elements/Frame.lua"] = {
|
||||
["name"] = "Frame",
|
||||
["path"] = "elements/Frame.lua",
|
||||
["src/elements/BaseFrame.lua"] = {
|
||||
["path"] = "elements/BaseFrame.lua",
|
||||
["name"] = "BaseFrame",
|
||||
},
|
||||
["src/plugins/pluginTemplate.lua"] = {
|
||||
["name"] = "pluginTemplate",
|
||||
["path"] = "plugins/pluginTemplate.lua",
|
||||
["src/libraries/colorHex.lua"] = {
|
||||
["path"] = "libraries/colorHex.lua",
|
||||
["name"] = "colorHex",
|
||||
},
|
||||
["src/elements/Menu.lua"] = {
|
||||
["name"] = "Menu",
|
||||
["path"] = "elements/Menu.lua",
|
||||
["src/plugins/debug.lua"] = {
|
||||
["path"] = "plugins/debug.lua",
|
||||
["name"] = "debug",
|
||||
},
|
||||
["src/elements/Label.lua"] = {
|
||||
["name"] = "Label",
|
||||
["path"] = "elements/Label.lua",
|
||||
["src/plugins/state.lua"] = {
|
||||
["path"] = "plugins/state.lua",
|
||||
["name"] = "state",
|
||||
},
|
||||
["src/elements/Flexbox.lua"] = {
|
||||
["path"] = "elements/Flexbox.lua",
|
||||
["name"] = "Flexbox",
|
||||
},
|
||||
["src/render.lua"] = {
|
||||
["path"] = "render.lua",
|
||||
["name"] = "render",
|
||||
},
|
||||
["src/elements/Slider.lua"] = {
|
||||
["path"] = "elements/Slider.lua",
|
||||
["name"] = "Slider",
|
||||
},
|
||||
["src/elements/ProgressBar.lua"] = {
|
||||
["path"] = "elements/ProgressBar.lua",
|
||||
["name"] = "ProgressBar",
|
||||
},
|
||||
["src/elements/Dropdown.lua"] = {
|
||||
["path"] = "elements/Dropdown.lua",
|
||||
["name"] = "Dropdown",
|
||||
},
|
||||
["src/init.lua"] = {
|
||||
["path"] = "init.lua",
|
||||
["name"] = "init",
|
||||
},
|
||||
["src/errorManager.lua"] = {
|
||||
["path"] = "errorManager.lua",
|
||||
["name"] = "errorManager",
|
||||
},
|
||||
["src/elements/Checkbox.lua"] = {
|
||||
["path"] = "elements/Checkbox.lua",
|
||||
["name"] = "Checkbox",
|
||||
},
|
||||
["src/plugins/xml.lua"] = {
|
||||
["path"] = "plugins/xml.lua",
|
||||
["name"] = "xml",
|
||||
},
|
||||
["src/elements/Button.lua"] = {
|
||||
["path"] = "elements/Button.lua",
|
||||
["name"] = "Button",
|
||||
},
|
||||
["src/elements/Input.lua"] = {
|
||||
["name"] = "Input",
|
||||
["path"] = "elements/Input.lua",
|
||||
["name"] = "Input",
|
||||
},
|
||||
["src/propertySystem.lua"] = {
|
||||
["path"] = "propertySystem.lua",
|
||||
["name"] = "propertySystem",
|
||||
},
|
||||
["src/elements/List.lua"] = {
|
||||
["path"] = "elements/List.lua",
|
||||
["name"] = "List",
|
||||
},
|
||||
["src/log.lua"] = {
|
||||
["path"] = "log.lua",
|
||||
["name"] = "log",
|
||||
},
|
||||
["src/elements/Tree.lua"] = {
|
||||
["path"] = "elements/Tree.lua",
|
||||
["name"] = "Tree",
|
||||
},
|
||||
["src/plugins/pluginTemplate.lua"] = {
|
||||
["path"] = "plugins/pluginTemplate.lua",
|
||||
["name"] = "pluginTemplate",
|
||||
},
|
||||
["src/libraries/utils.lua"] = {
|
||||
["path"] = "libraries/utils.lua",
|
||||
["name"] = "utils",
|
||||
},
|
||||
["src/elementManager.lua"] = {
|
||||
["path"] = "elementManager.lua",
|
||||
["name"] = "elementManager",
|
||||
},
|
||||
["src/elements/Container.lua"] = {
|
||||
["path"] = "elements/Container.lua",
|
||||
["name"] = "Container",
|
||||
},
|
||||
["src/plugins/animation.lua"] = {
|
||||
["path"] = "plugins/animation.lua",
|
||||
["name"] = "animation",
|
||||
},
|
||||
["src/plugins/theme.lua"] = {
|
||||
["path"] = "plugins/theme.lua",
|
||||
["name"] = "theme",
|
||||
},
|
||||
["src/elements/Label.lua"] = {
|
||||
["path"] = "elements/Label.lua",
|
||||
["name"] = "Label",
|
||||
},
|
||||
["src/plugins/benchmark.lua"] = {
|
||||
["path"] = "plugins/benchmark.lua",
|
||||
["name"] = "benchmark",
|
||||
},
|
||||
["src/elements/Menu.lua"] = {
|
||||
["path"] = "elements/Menu.lua",
|
||||
["name"] = "Menu",
|
||||
},
|
||||
["src/libraries/expect.lua"] = {
|
||||
["path"] = "libraries/expect.lua",
|
||||
["name"] = "expect",
|
||||
},
|
||||
["src/elements/Frame.lua"] = {
|
||||
["path"] = "elements/Frame.lua",
|
||||
["name"] = "Frame",
|
||||
},
|
||||
["src/elements/Table.lua"] = {
|
||||
["path"] = "elements/Table.lua",
|
||||
["name"] = "Table",
|
||||
},
|
||||
["src/elements/VisualElement.lua"] = {
|
||||
["path"] = "elements/VisualElement.lua",
|
||||
["name"] = "VisualElement",
|
||||
},
|
||||
["src/plugins/reactive.lua"] = {
|
||||
["path"] = "plugins/reactive.lua",
|
||||
["name"] = "reactive",
|
||||
},
|
||||
["src/elements/BaseElement.lua"] = {
|
||||
["path"] = "elements/BaseElement.lua",
|
||||
["name"] = "BaseElement",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -974,10 +974,6 @@ if _d and not ad then _d.set("focused",true,true)if dc.parent then
|
||||
dc.parent:setFocusedChild(dc)end end;return _d end})
|
||||
_c.defineProperty(_c,"visibleChildren",{default={},type="table"})
|
||||
_c.defineProperty(_c,"visibleChildrenEvents",{default={},type="table"})
|
||||
function _c:isChildVisible(dc)local _d,ad=dc.get("x"),dc.get("y")
|
||||
local bd,cd=dc.get("width"),dc.get("height")local dd,__a=self.get("width"),self.get("height")
|
||||
return
|
||||
_d<=dd and ad<=__a and _d+bd>0 and ad+cd>0 end
|
||||
for dc,_d in pairs(_b:getElementList())do
|
||||
local ad=dc:sub(1,1):upper()..dc:sub(2)
|
||||
if ad~="BaseFrame"then
|
||||
@@ -987,6 +983,10 @@ _c["addDelayed"..ad]=function(bd,cd)bb(1,bd,"table")
|
||||
local dd=bd.basalt.create(dc,cd,true,bd)return dd end end end
|
||||
function _c.new()local dc=setmetatable({},_c):__init()return dc end
|
||||
function _c:init(dc,_d)ab.init(self,dc,_d)self.set("type","Container")end
|
||||
function _c:isChildVisible(dc)local _d,ad=dc.get("x"),dc.get("y")
|
||||
local bd,cd=dc.get("width"),dc.get("height")local dd,__a=self.get("width"),self.get("height")
|
||||
return
|
||||
_d<=dd and ad<=__a and _d+bd>0 and ad+cd>0 end
|
||||
function _c:addChild(dc)
|
||||
if dc==self then error("Cannot add container to itself")end;table.insert(self._values.children,dc)
|
||||
dc.parent=self;self.set("childrenSorted",false)
|
||||
@@ -1000,26 +1000,26 @@ local __a=ad[dd].get("z")if __a>cd then ad[dd+1]=ad[dd]dd=dd-1 else break end en
|
||||
function _c:clear()self.set("children",{})
|
||||
self.set("childrenEvents",{})self.set("visibleChildren",{})
|
||||
self.set("visibleChildrenEvents",{})self.set("childrenSorted",true)
|
||||
self.set("childrenEventsSorted",true)end
|
||||
self.set("childrenEventsSorted",true)return self end
|
||||
function _c:sortChildren()
|
||||
self.set("visibleChildren",ac(self,self._values.children))self.set("childrenSorted",true)end
|
||||
self.set("visibleChildren",ac(self,self._values.children))self.set("childrenSorted",true)return self end
|
||||
function _c:sortChildrenEvents(dc)if self._values.childrenEvents[dc]then
|
||||
self._values.visibleChildrenEvents[dc]=ac(self,self._values.childrenEvents[dc])end
|
||||
self.set("childrenEventsSorted",true)end
|
||||
self.set("childrenEventsSorted",true)return self end
|
||||
function _c:registerChildrenEvents(dc)if(dc._registeredEvents==nil)then return end
|
||||
for _d in
|
||||
pairs(dc._registeredEvents)do self:registerChildEvent(dc,_d)end end
|
||||
pairs(dc._registeredEvents)do self:registerChildEvent(dc,_d)end;return self end
|
||||
function _c:registerChildEvent(dc,_d)
|
||||
if not self._values.childrenEvents[_d]then
|
||||
self._values.childrenEvents[_d]={}self._values.eventListenerCount[_d]=0;if self.parent then
|
||||
self.parent:registerChildEvent(self,_d)end end;for ad,bd in ipairs(self._values.childrenEvents[_d])do
|
||||
if bd==dc then return end end
|
||||
if bd==dc then return self end end
|
||||
self.set("childrenEventsSorted",false)
|
||||
table.insert(self._values.childrenEvents[_d],dc)self._values.eventListenerCount[_d]=
|
||||
self._values.eventListenerCount[_d]+1 end
|
||||
function _c:removeChildrenEvents(dc)if(dc._registeredEvents==nil)then return end
|
||||
self._values.eventListenerCount[_d]+1;return self end
|
||||
function _c:removeChildrenEvents(dc)if(dc._registeredEvents==nil)then return self end
|
||||
for _d in
|
||||
pairs(dc._registeredEvents)do self:unregisterChildEvent(dc,_d)end end
|
||||
pairs(dc._registeredEvents)do self:unregisterChildEvent(dc,_d)end;return self end
|
||||
function _c:unregisterChildEvent(dc,_d)
|
||||
if self._values.childrenEvents[_d]then
|
||||
for ad,bd in
|
||||
@@ -1030,7 +1030,7 @@ self._values.eventListenerCount[_d]-1
|
||||
if
|
||||
self._values.eventListenerCount[_d]<=0 then
|
||||
self._values.childrenEvents[_d]=nil;self._values.eventListenerCount[_d]=nil;if self.parent then
|
||||
self.parent:unregisterChildEvent(self,_d)end end;break end end end end
|
||||
self.parent:unregisterChildEvent(self,_d)end end;break end end end;return self end
|
||||
function _c:removeChild(dc)
|
||||
for _d,ad in ipairs(self._values.children)do if ad==dc then
|
||||
table.remove(self._values.children,_d)dc.parent=nil;break end end;self:removeChildrenEvents(dc)return self end
|
||||
@@ -1183,7 +1183,7 @@ function d:init(_a,aa)c.init(self,_a,aa)self.set("type","Checkbox")end
|
||||
function d:mouse_click(_a,aa,ba)
|
||||
if c.mouse_click(self,_a,aa,ba)then
|
||||
self.set("checked",not self.get("checked"))
|
||||
self:fireEvent("change",self.get("checked"))return true end end
|
||||
self:fireEvent("change",self.get("checked"))return true end;return false end
|
||||
function d:render()c.render(self)local _a=
|
||||
self.get("checked")and self.get("symbol")or" "
|
||||
self:textFg(1,1,"[".._a.."]",self.get("foreground"))local aa=self.get("text")if#aa>0 then
|
||||
|
||||
152
src/LuaLS.lua
152
src/LuaLS.lua
@@ -115,8 +115,160 @@ end
|
||||
|
||||
|
||||
---@class Container
|
||||
---@field children table
|
||||
---@field childrenSorted boolean
|
||||
---@field childrenEventsSorted boolean
|
||||
---@field childrenEvents table
|
||||
---@field eventListenerCount table
|
||||
---@field focusedChild table
|
||||
---@field visibleChildren table
|
||||
---@field visibleChildrenEvents table
|
||||
local Container = {}
|
||||
|
||||
--- Gets the The children of the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@return table
|
||||
function Container:getChildren()
|
||||
return self.children
|
||||
end
|
||||
|
||||
--- Sets the The children of the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@param children table
|
||||
---@return Element
|
||||
function Container:setChildren(children)
|
||||
self.children = children
|
||||
return self
|
||||
end
|
||||
|
||||
--- Gets the Whether the children are sorted
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@return boolean
|
||||
function Container:getChildrenSorted()
|
||||
return self.childrenSorted
|
||||
end
|
||||
|
||||
--- Sets the Whether the children are sorted
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@param childrenSorted boolean
|
||||
---@return Element
|
||||
function Container:setChildrenSorted(childrenSorted)
|
||||
self.childrenSorted = childrenSorted
|
||||
return self
|
||||
end
|
||||
|
||||
--- Gets the Whether the children events are sorted
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@return boolean
|
||||
function Container:getChildrenEventsSorted()
|
||||
return self.childrenEventsSorted
|
||||
end
|
||||
|
||||
--- Sets the Whether the children events are sorted
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@param childrenEventsSorted boolean
|
||||
---@return Element
|
||||
function Container:setChildrenEventsSorted(childrenEventsSorted)
|
||||
self.childrenEventsSorted = childrenEventsSorted
|
||||
return self
|
||||
end
|
||||
|
||||
--- Gets the The children events of the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@return table
|
||||
function Container:getChildrenEvents()
|
||||
return self.childrenEvents
|
||||
end
|
||||
|
||||
--- Sets the The children events of the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@param childrenEvents table
|
||||
---@return Element
|
||||
function Container:setChildrenEvents(childrenEvents)
|
||||
self.childrenEvents = childrenEvents
|
||||
return self
|
||||
end
|
||||
|
||||
--- Gets the The event listener count of the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@return table
|
||||
function Container:getEventListenerCount()
|
||||
return self.eventListenerCount
|
||||
end
|
||||
|
||||
--- Sets the The event listener count of the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@param eventListenerCount table
|
||||
---@return Element
|
||||
function Container:setEventListenerCount(eventListenerCount)
|
||||
self.eventListenerCount = eventListenerCount
|
||||
return self
|
||||
end
|
||||
|
||||
--- Gets the The focused child of the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@return table
|
||||
function Container:getFocusedChild()
|
||||
return self.focusedChild
|
||||
end
|
||||
|
||||
--- Sets the The focused child of the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@param focusedChild table
|
||||
---@return Element
|
||||
function Container:setFocusedChild(focusedChild)
|
||||
self.focusedChild = focusedChild
|
||||
return self
|
||||
end
|
||||
|
||||
--- Gets the The visible children of the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@return table
|
||||
function Container:getVisibleChildren()
|
||||
return self.visibleChildren
|
||||
end
|
||||
|
||||
--- Sets the The visible children of the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@param visibleChildren table
|
||||
---@return Element
|
||||
function Container:setVisibleChildren(visibleChildren)
|
||||
self.visibleChildren = visibleChildren
|
||||
return self
|
||||
end
|
||||
|
||||
--- Gets the The visible children events of the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@return table
|
||||
function Container:getVisibleChildrenEvents()
|
||||
return self.visibleChildrenEvents
|
||||
end
|
||||
|
||||
--- Sets the The visible children events of the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
---@param visibleChildrenEvents table
|
||||
---@return Element
|
||||
function Container:setVisibleChildrenEvents(visibleChildrenEvents)
|
||||
self.visibleChildrenEvents = visibleChildrenEvents
|
||||
return self
|
||||
end
|
||||
|
||||
--- Adds a new Button to the container
|
||||
---@generic Element: Container
|
||||
---@param self Element
|
||||
|
||||
Reference in New Issue
Block a user