Hello and good evening / morning. I have an issue which I cannot resolve myself. This has to do with the addon/script which is posted below.
It is taken from Miirkat Druid Portraits .
What the addon does exactly is that it shows class portraits on the target, focus and player portraits but for druids it will replace it in the case of say, bear form it would show the druid bear form icon instead of the normal druid paw. The same is done for cat, flight, swift flight, moonkin, travel and aquatic.
This worked in MoP and almost 99% sure it worked in WoD, however I am not sure when it broke for me, I am assuming sometime during legion or bfa.
I have looked through the API they have listed and I cannot see that anything has changed or maybe I missed it. I used some old sites in hopes of finding someone had updated it or fixed the problem.
I thought that maybe because “DRUID” is used on NA and “Druid” is used on EU that might have been an issue but neither seem to work.
So, I have come to you lovely people, the forum wizards. If anyone would be so kind to get this working again for 8.2 I would be very thankful. However, if you’re able to fix it would you please tell me how and explain why it broke in the first place so I can gain the knowledge or a little bit of insight in how to fix it myself at a later stage?
I have tried using UnitAura instead with “cat form” but that did not seem to work either in the test I did.
Apologies about the formatting, not sure how to do it with code so I did a box instead.
UFP = “UnitFramePortrait_Update”
UICC = “Interface\TargetingFrame\UI-Classes-Circles”
CIT = CLASS_ICON_TCOORDS
hooksecurefunc(UFP, function(self)
if self.portrait then
if select(2,UnitClass(self.unit)) == “DRUID” then
local i, flag=1, false
while UnitBuff(self.unit, i) do
local id = select(11,UnitBuff(self.unit, i))
–cat 768
–bear 5487
–travel 783
–aquatic 1446
–flight 165962
–swift flight 40123
–boomkin 24858
if id == 768 or id == 5487 or id == 783 or id == 1446 or id == 165962 or id == 40123 or id == 24858 then
SetPortraitToTexture(self.portrait, GetSpellTexture(id));
self.portrait:SetTexCoord(0, 1, 0, 1)
flag = true
end
i = i + 1
end
if not flag then
self.portrait:SetTexture(UICC)
self.portrait:SetTexCoord(unpack(CIT.DRUID))
end
else
local t = CIT[select(2,UnitClass(self.unit))]
if t then self.portrait:SetTexture(UICC)
self.portrait:SetTexCoord(unpack(t))
end
end
end
end)
Thanks in advance,
Aikonah
EDIT:
I am trying the AuraUtil but am not entirely sure how to use it. I tried this
while AuraUtil.FindAuraByName(self.unit, i) do
local id = select(11,AuraUtil.FindAuraByName(self.unit, i))
--cat 768
--bear 5487
--travel 783
--aquatic 1446
--flight 165962
--swift flight 40123
--boomkin 24858
--tree 33891
if id == Cat Form or id == Bear Form or id == Travel Form or id == Aquatic Form or id == Flight Form or id == Swift Flight Form or id == Moonkin Form or id == Incarnation: Tree of Life then
SetPortraitToTexture(self.portrait, GetSpellTexture(id));
This however does not work and the portaits don’t display.
Should it be used like this instead:
AuraUtil.FindAuraByName==(i) do
and then the rest of the script?
EDIT2:
Did some more searching, I see that it’s mentioned that you can no longer query id. Do correct me if I am wrong but I would then need to make 3 parts to this for it to work and use I suppose, onUpdate so it always runs through looking for buffs. 1st part playerframe, 2nd for target and 3rd for focus.
I would then need to use i = AuraUtil.FindAuraByName(cat form, player) etc correct, multiple of them to find the form buff? Afterwards I would use a function that calls whatever form it finds and uses a function to replace the portrait icon with the form icon, if nothing is found then use class portrait.