Overriding stuff mixed in
I'm trying to prevent the pvp match results scoreboard from showing
PVPMatchResults:SetScript("OnEvent", onevents); even with this though - the event that triggers it is still firing on the original blizzard ui code and the frame is showing Both my function and the original are called is SetScript supposed to replace a handler or add one? I've also tried SetScript("OnEvent", nil) --original still called maybe it is because the original frame is using a mixin for its handlers? how do I overwrite or nil out a mixin's callbacks? |
Try:
Code:
PVPMatchResults.Onevent = onevents Code:
PVPMatchResults:SetScript("OnEvent", onevents); |
Quote:
I tested the assignment method today and that seems to produce the effect I wanted. I also noticed something yesterday -- the code I had originally (SetScript) *was* working; it just wasn't working in my test harness. I was using a macro Code:
PVPMatchResults:OnEvent("PVP_MATCH_COMPLETE") |
The mixin created the method on the frame ie.
function frame:OnEvent(self, event, ...) -- OnEvent code end the xml frames OnEvent <Script> tag tells it to use the frame method. What I posted replaces the mixin method that gets applied to the frame with your new one ie. it just overrides the old function with the new. Code:
PVPMatchResults:OnEvent("PVP_MATCH_COMPLETE") Code:
PVPMatchResults:GetScript("OnEvent")(PVPMatchResults, "PVP_MATCH_COMPLETE") |
Quote:
|
All times are GMT -6. The time now is 12:37 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI