You refer to the global function [FONT="Courier New"]cdTextUpdate [/FONT]but you declare it on the RIA table. You should probably just put the eventhandler back on the RIA table so you can refer to it via self or RIA since it looks like there will only ever be one RIA table anyways.
[PHP]-- OnUpdate to count down RIA.cooldown counts
function RIA:cdTextUpdate(rune)
local start, duration, runeReady = GetRuneCooldown(rune)
if (RIADB.cdtext == "1") then
local apply, time = self:cooldownUpdate(rune, start, duration, runeReady)
if (apply) then
self:ccCount(rune, time)
end
end
if (runeReady) then
cdFrame[rune]:SetScript("OnUpdate", nil)
end
end[/PHP]
There's no special correspondence between "declaration" and "call" syntax in Lua. (Functions aren't really "declared" as in imperative languages, there's no function signature here.)
More or less everything I said here was in response to this. There is a "declared" "signature" of a function in terms of its parameters. There is a correspondence between "declaration" and "call" in that if you don't declare the parameters, you can't receive them.
I thought Farmbuyer was telling me something I didn't know, and it turned out s/he wasn't :).
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
[PHP]cdFrame[rune]:SetScript("OnUpdate", function() cdTextUpdate(rune) end)[/PHP]
You refer to the global function [FONT="Courier New"]cdTextUpdate [/FONT]but you declare it on the RIA table. You should probably just put the eventhandler back on the RIA table so you can refer to it via self or RIA since it looks like there will only ever be one RIA table anyways.
[PHP]-- OnUpdate to count down RIA.cooldown counts
function RIA:cdTextUpdate(rune)
local start, duration, runeReady = GetRuneCooldown(rune)
if (RIADB.cdtext == "1") then
local apply, time = self:cooldownUpdate(rune, start, duration, runeReady)
if (apply) then
self:ccCount(rune, time)
end
end
if (runeReady) then
cdFrame[rune]:SetScript("OnUpdate", nil)
end
end[/PHP]
More or less everything I said here was in response to this. There is a "declared" "signature" of a function in terms of its parameters. There is a correspondence between "declaration" and "call" in that if you don't declare the parameters, you can't receive them.
I thought Farmbuyer was telling me something I didn't know, and it turned out s/he wasn't :).