getChildren util func
This commit is contained in:
parent
b08cca38b7
commit
dcdf9cbd49
13
main.xml
13
main.xml
|
@ -307,6 +307,17 @@
|
||||||
resetOnFrameStartActors[actor.__raw or actor] = bool
|
resetOnFrameStartActors[actor.__raw or actor] = bool
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local actorAssociationTable = {}
|
||||||
|
|
||||||
|
function getChildren(frame)
|
||||||
|
local c = actorAssociationTable[frame]
|
||||||
|
if c then
|
||||||
|
return c
|
||||||
|
else
|
||||||
|
error('uranium: actorframe doesn\'t exist (or isn\'t an actorframe)', 2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- actors
|
-- actors
|
||||||
|
|
||||||
local actorQueue = {}
|
local actorQueue = {}
|
||||||
|
@ -580,6 +591,7 @@
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
actor.__queueRepresentation(actorQueue[#actorQueue])
|
actor.__queueRepresentation(actorQueue[#actorQueue])
|
||||||
|
actorAssociationTable[actor] = {}
|
||||||
return actor
|
return actor
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -705,6 +717,7 @@
|
||||||
error('uranium: trying to add a child to an ActorFrame that isn\'t an actor; please read the first half of \'ActorFrame\'', 2)
|
error('uranium: trying to add a child to an ActorFrame that isn\'t an actor; please read the first half of \'ActorFrame\'', 2)
|
||||||
end
|
end
|
||||||
actorAssociationQueue[actor.__queue] = frame.__queue
|
actorAssociationQueue[actor.__queue] = frame.__queue
|
||||||
|
table.insert(actorAssociationTable[frame], actor)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function transformQueueToTree()
|
local function transformQueueToTree()
|
||||||
|
|
|
@ -87,6 +87,11 @@ function resetOnFrameStart(bool) end
|
||||||
---@param bool boolean | nil
|
---@param bool boolean | nil
|
||||||
function resetActorOnFrameStart(actor, bool) end
|
function resetActorOnFrameStart(actor, bool) end
|
||||||
|
|
||||||
|
-- Gets every child of an ActorFrame. More accurate than :GetChildren()
|
||||||
|
---@param frame ActorFrame
|
||||||
|
---@return Actor[]
|
||||||
|
function getChildren(frame) end
|
||||||
|
|
||||||
---@type number
|
---@type number
|
||||||
--- A simple timer. Ticks upwards at a rate of 1/sec.
|
--- A simple timer. Ticks upwards at a rate of 1/sec.
|
||||||
---
|
---
|
||||||
|
|
Loading…
Reference in New Issue