further actorframe cleanup
This commit is contained in:
parent
e7d49fa562
commit
d8056408f4
|
@ -32,6 +32,6 @@
|
||||||
<Layer Condition="oat._actor.recurse()" File="actors.xml" InitCommand="%oat._actor.endRecurse" />
|
<Layer Condition="oat._actor.recurse()" File="actors.xml" InitCommand="%oat._actor.endRecurse" />
|
||||||
<Layer Condition="oat._actor.recurse()" File="actors.xml" InitCommand="%oat._actor.endRecurse" />
|
<Layer Condition="oat._actor.recurse()" File="actors.xml" InitCommand="%oat._actor.endRecurse" />
|
||||||
<Layer Condition="oat._actor.recurse()" File="actors.xml" InitCommand="%oat._actor.endRecurse" />
|
<Layer Condition="oat._actor.recurse()" File="actors.xml" InitCommand="%oat._actor.endRecurse" />
|
||||||
<Layer Condition="oat._actor.recurse()" File="actors.xml" InitCommand="%oat._actor.endRecurse" />
|
<Layer Condition="oat._actor.recurseLast()" File="actors.xml" InitCommand="%oat._actor.endRecurse" />
|
||||||
|
|
||||||
</children></ActorFrame>
|
</children></ActorFrame>
|
16
main.xml
16
main.xml
|
@ -323,35 +323,33 @@
|
||||||
local function nextActor()
|
local function nextActor()
|
||||||
local new, idx = findFirstActor(currentPath)
|
local new, idx = findFirstActor(currentPath)
|
||||||
if not new then
|
if not new then
|
||||||
print('no actor!')
|
|
||||||
currentActor = nil
|
currentActor = nil
|
||||||
else
|
else
|
||||||
print('adding new actor')
|
|
||||||
currentActor = new
|
currentActor = new
|
||||||
table.remove(currentPath, idx)
|
table.remove(currentPath, idx)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function oat._actor.recurse()
|
function oat._actor.recurse(forceActor)
|
||||||
local newFrame, idx = findFirstActorFrame(currentPath)
|
local newFrame, idx = findFirstActorFrame(currentPath)
|
||||||
if newFrame then
|
if newFrame and not (currentActor and forceActor) then
|
||||||
table.insert(pastPaths, currentPath)
|
table.insert(pastPaths, currentPath)
|
||||||
currentPath = currentPath[idx]
|
currentPath = currentPath[idx]
|
||||||
table.remove(pastPaths[#pastPaths], idx)
|
table.remove(pastPaths[#pastPaths], idx)
|
||||||
print('recursing: ' .. #pastPaths)
|
|
||||||
return true
|
return true
|
||||||
elseif currentActor then
|
elseif currentActor then
|
||||||
table.insert(pastPaths, currentPath)
|
table.insert(pastPaths, currentPath)
|
||||||
print('recursing (actor): ' .. #pastPaths)
|
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
print('no actor or actorframe!')
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function oat._actor.recurseLast()
|
||||||
|
return oat._actor.recurse(true)
|
||||||
|
end
|
||||||
|
|
||||||
function oat._actor.endRecurse()
|
function oat._actor.endRecurse()
|
||||||
print('heading back: ' .. #pastPaths)
|
|
||||||
currentPath = table.remove(pastPaths, #pastPaths)
|
currentPath = table.remove(pastPaths, #pastPaths)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -395,7 +393,6 @@
|
||||||
end
|
end
|
||||||
|
|
||||||
function oat._actor.initFrame(self)
|
function oat._actor.initFrame(self)
|
||||||
print('initializing an actorframe')
|
|
||||||
self:removecommand('Init')
|
self:removecommand('Init')
|
||||||
self:SetDrawFunction(function()
|
self:SetDrawFunction(function()
|
||||||
for i = 1, self:GetNumChildren() do
|
for i = 1, self:GetNumChildren() do
|
||||||
|
@ -407,7 +404,6 @@
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if currentPath.init then
|
if currentPath.init then
|
||||||
print('found init function, calling')
|
|
||||||
currentPath.init(self)
|
currentPath.init(self)
|
||||||
currentPath.init = nil
|
currentPath.init = nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue