WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   KGPanels not registering "worldboss" event (https://www.wowinterface.com/forums/showthread.php?t=57084)

bender1453 03-27-19 06:10 AM

KGPanels not registering "worldboss" event
 
I tested with multiple scripts many times. Elite frames work wonderfully, but as soon as I try to set a boss ("worldboss") perimeter it stops working. Basically I just want the panel to show for Raid, Dungeon and World Bosses (in other word all types of boss mobs).

Can someone please help?

Terenna 03-27-19 07:30 AM

Post your code

bender1453 03-27-19 08:11 AM

OnLoad

self:RegisterEvent("PLAYER_TARGET_CHANGED")
self:Hide()

OnEvent

if ( UnitClassification("target") == "worldboss" ) then
self:Show()
else
self:Hide()
end

As soon as I change worldboss with elite, it starts working, well, for every elite target. Tried it with sample scripts from the wiki as well. Also tried "boss" "raidboss" and some other combinations to test it. No luck.

Fizzlemizz 03-27-19 09:47 AM

Above your IF statement add

Code:

print(UnitClassification("target"))
see what it is actually returning rather than just guessing what it should be.

bender1453 03-27-19 10:20 AM

Fizzlemizz thank you very much mate. Tried your method, it showed "rareelite" for a Legion World Boss and "elite" for Siege of Orgrimmar Raid Boss. That must be the problem. So how can I set a perimeter for Dungeon and World Bosses? Seems difficult now...

Fizzlemizz 03-27-19 08:29 PM

Blizzard still believe they have (may have) actual World Bosses, from TargetFrame.lua

Lua Code:
  1. elseif ( classification == "minus" ) then
  2.     self.borderTexture:SetTexture("Interface\\TargetingFrame\\UI-TargetingFrame-Minus");
  3.     self.nameBackground:Hide();
  4.     self.manabar.pauseUpdates = true;
  5.     self.manabar:Hide();
  6.     self.manabar.TextString:Hide();
  7.     self.manabar.LeftText:Hide();
  8.     self.manabar.RightText:Hide();
  9.     forceNormalTexture = true;
  10. elseif ( classification == "worldboss" or classification == "elite" ) then
  11.     self.borderTexture:SetTexture("Interface\\TargetingFrame\\UI-TargetingFrame-Elite");
  12. elseif ( classification == "rareelite" ) then
  13.     self.borderTexture:SetTexture("Interface\\TargetingFrame\\UI-TargetingFrame-Rare-Elite");
  14. elseif ( classification == "rare" ) then
  15.     self.borderTexture:SetTexture("Interface\\TargetingFrame\\UI-TargetingFrame-Rare");
  16. else
  17.     self.borderTexture:SetTexture("Interface\\TargetingFrame\\UI-TargetingFrame");
  18.     forceNormalTexture = true;
  19. end

bender1453 03-28-19 03:41 AM

All of the classifications above work except worldboss for some reason. If it's not working maybe I can try an alternative script. Other than being coded as "boss" what difference do bosses have? Higher level? For example a Level 60 raid will contain a Level 63 boss? Feel free to correct me.

Tim 03-28-19 12:14 PM

The way classifications are these days you may have to create your own table and poll through it for a name with your own hard coded classification to make things work the way you want.

bender1453 03-28-19 12:47 PM

I'm not a programmer unfortunately. I may change some codes in lua file but that's it. I guess I'll have to pass on this one as it seems way too difficult for me to manage.

Thanks for the help everyone.


All times are GMT -6. The time now is 03:48 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI