03-29-17, 08:05 PM | #1 |
Nameplate addon after 7.2
So with the changes in how nameplates are allowed to be accessed in 7.2 when you are in a dungeon or raid, my nameplate addon no longer functions, throwing a crapton of errors and screwing them over.
All my addon did was reskin the statusbar itself and use raid icons specially made to fit the rest of my UI, but, yknow, blizzard's too lazy to stop us from anchoring things to nameplates so they just make it so we can do nothing with them in dungeons. *shrug* I need a way of determining if the player is in a dungeon or raid (or if the nameplates are turned into a protected object) so that my addon doesn't throw abunch of errors. I do distinctly remembering blizz saying "these changes won't break existing addons, they will simple "stop working" when they enter a dungeon. Welp, it breaks my addon, not only causing LUA errors but also royally fucking over the default nameplates somehow. (not sure, don't ask *shrug*) |
|
03-30-17, 05:30 AM | #2 |
I've tried registering the PLAYER_ENTERING_WORLD event and checking for the instanceType with IsInInstance() with this:
Code:
s:RegisterEvent("PLAYER_ENTERING_WORLD") s:SetScript("OnEvent", function(s, event, ...) if select(2, IsInInstance()) == "party" then return end end) Last edited by Joker119 : 03-30-17 at 05:32 AM. |
|
03-30-17, 05:55 AM | #3 |
I was able to solve this myself afterall.
in my addon I had Code:
for i, group in next, groups do for key, value in next, options do _G["DefaultCompactNamePlate"..group.."FrameOptions"][key] = value end Code:
local groups = { "Enemy", "Friendly", } Code:
h:RegisterEvent("PLAYER_ENTERING_WORLD") h:SetScript("OnEvent", function(h, event, ...) if select(2, IsInInstance()) == "party" or select(2, IsInInstance()) == "raid" then local groups = { "Enemy",} else local groups = { "Enemy", "Friendly", } end for i, group in next, groups do for key, value in next, options do _G["DefaultCompactNamePlate"..group.."FrameOptions"][key] = value end end end) |
|
03-30-17, 06:14 AM | #4 |
TBH, I didn't need to change anything to make nameplates work in oUF.
The only way to "stumble upon" so-called forbidden nameplates is to intentionally call `C_NamePlate.GetNamePlateForUnit` w/ necessary argument. Lua Code:
You probably should review the way you handle nameplates. I really hope that you don't do it by iterating through `WorldFrame`'s children, that's been unnecessary since 7.0. Last edited by lightspark : 03-30-17 at 06:20 AM. |
|
03-30-17, 07:22 AM | #5 |
I don't use oUF for nameplates, and I don't iterate through world frame's children either, funny enough, the error is actually coming from the blizzard default nameplates xml, not my addon, but it refers to trying to access a forbidden function that "has been tainted by an addon"
Lua Code:
|
|
03-30-17, 07:34 AM | #6 |
Almost no one uses oUF for nameplates atm, cuz it's in dev branch, future release, you know
As for your code, try adding `:IsForbidden()` checks to all your hooks. Lua Code:
There are other issues w/ your code, but this thread isn't about them... Last edited by lightspark : 03-30-17 at 07:59 AM. |
|
03-30-17, 10:22 PM | #7 |
Awesome thanks for that, and I would be interested in that the other issues would be.. >.>
|
|
03-30-17, 11:25 PM | #8 | |
Lua Code:
You hook the same function multiple times That's the most obvious one, sorry, I'm a bit busy atm to look through the rest T_T |
||
WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Nameplate addon after 7.2 |
«
Previous Thread
|
Next Thread
»
|
Thread Tools | |
Display Modes | |
|
|