Small coroutine fix
This commit is contained in:
@@ -6,7 +6,7 @@ local split = require("libraries/utils").split
|
|||||||
---@configDescription The container class. It is a visual element that can contain other elements. It is the base class for all containers
|
---@configDescription The container class. It is a visual element that can contain other elements. It is the base class for all containers
|
||||||
---@configDefault true
|
---@configDefault true
|
||||||
|
|
||||||
--- The Container class serves as a fundamental building block for organizing UI elements. It acts as a parent element that can hold and manage child elements, providing layout management, event propagation, and rendering capabilities. Used as base class for Frames, Windows, and other container-like elements.
|
--- The Container class serves as a fundamental building block for organizing UI elements. It acts as a parent element that can hold and manage child elements.
|
||||||
--- @usage local container = basalt.getMainFrame()
|
--- @usage local container = basalt.getMainFrame()
|
||||||
--- @usage container:addButton() -- Add a child element
|
--- @usage container:addButton() -- Add a child element
|
||||||
---@class Container : VisualElement
|
---@class Container : VisualElement
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ end
|
|||||||
--- @param bgCol number The background color of the series
|
--- @param bgCol number The background color of the series
|
||||||
--- @param fgCol number The foreground color of the series
|
--- @param fgCol number The foreground color of the series
|
||||||
--- @param pointCount number The number of points in the series
|
--- @param pointCount number The number of points in the series
|
||||||
|
--- @return Graph self The graph instance
|
||||||
function Graph:addSeries(name, symbol, bgCol, fgCol, pointCount)
|
function Graph:addSeries(name, symbol, bgCol, fgCol, pointCount)
|
||||||
local series = self.get("series")
|
local series = self.get("series")
|
||||||
table.insert(series, {
|
table.insert(series, {
|
||||||
|
|||||||
14
src/main.lua
14
src/main.lua
@@ -238,13 +238,15 @@ local function updateEvent(event, ...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
for _, func in ipairs(basalt._schedule) do
|
for _, func in ipairs(basalt._schedule) do
|
||||||
if(event==func.filter)or(func.filter==nil)then
|
if(coroutine.status(func.coroutine)=="suspended")then
|
||||||
local ok, result = coroutine.resume(func.coroutine, event, ...)
|
if(event==func.filter)or(func.filter==nil)then
|
||||||
if(not ok)then
|
local ok, result = coroutine.resume(func.coroutine, event, ...)
|
||||||
errorManager.header = "Basalt Schedule Error"
|
if(not ok)then
|
||||||
errorManager.error(result)
|
errorManager.header = "Basalt Schedule Error"
|
||||||
|
errorManager.error(result)
|
||||||
|
end
|
||||||
|
func.filter = result
|
||||||
end
|
end
|
||||||
func.filter = result
|
|
||||||
end
|
end
|
||||||
if(coroutine.status(func.coroutine)=="dead")then
|
if(coroutine.status(func.coroutine)=="dead")then
|
||||||
basalt.removeSchedule(func.coroutine)
|
basalt.removeSchedule(func.coroutine)
|
||||||
|
|||||||
@@ -39,9 +39,6 @@ end
|
|||||||
|
|
||||||
---@splitClass
|
---@splitClass
|
||||||
|
|
||||||
--- This is the benchmark plugin. It provides performance measurement tools for elements and methods,
|
|
||||||
--- with support for hierarchical profiling and detailed statistics.
|
|
||||||
--- The following methods are available for BaseElement
|
|
||||||
---@class BaseElement
|
---@class BaseElement
|
||||||
local BaseElement = {}
|
local BaseElement = {}
|
||||||
|
|
||||||
@@ -298,8 +295,10 @@ function Container:stopContainerBenchmark(methodName)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Benchmark API methods
|
--- This is the benchmark plugin. It provides performance measurement tools for elements and methods,
|
||||||
---@class BenchmarkAPI
|
--- with support for hierarchical profiling and detailed statistics. The plugin is meant to be used for very big projects
|
||||||
|
--- where performance is critical. It allows you to measure the time taken by specific methods and log the results.
|
||||||
|
---@class Benchmark
|
||||||
local API = {}
|
local API = {}
|
||||||
|
|
||||||
--- Starts a custom benchmark
|
--- Starts a custom benchmark
|
||||||
|
|||||||
@@ -195,6 +195,10 @@ end)
|
|||||||
|
|
||||||
--- This module provides reactive functionality for elements, it adds no new functionality for elements.
|
--- This module provides reactive functionality for elements, it adds no new functionality for elements.
|
||||||
--- It is used to evaluate expressions in property values and update the element when the expression changes.
|
--- It is used to evaluate expressions in property values and update the element when the expression changes.
|
||||||
|
--- @usage local button = main:addButton({text="Exit"})
|
||||||
|
--- @usage button:setX("{parent.x - 12}")
|
||||||
|
--- @usage button:setBackground("{self.clicked and colors.red or colors.green}")
|
||||||
|
--- @usage button:setWidth("{self.text:len() + 2}")
|
||||||
---@class Reactive
|
---@class Reactive
|
||||||
local BaseElement = {}
|
local BaseElement = {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user