Hello. Currently i am working on redesigning the challengemode frame. I noticed something i cant quite get the grip on.
On the challengemodekeystoneframe, you can add a keystone which will trigger this function:
Lua Code:
function ChallengesKeystoneFrameMixin:SetUp(affixInfo)
if (type(affixInfo) == "table") then
local info = affixInfo;
SetPortraitToTexture(self.Portrait, CHALLENGE_MODE_EXTRA_AFFIX_INFO[info.key].texture);
if (info.pct > 999) then
self.Percent:SetFontObject("SystemFont_Shadow_Med1_Outline");
else
self.Percent:SetFontObject("SystemFont_Shadow_Large_Outline");
end
self.Percent:SetText(("+%d%%"):format(info.pct));
self.Percent:Show();
self.info = info;
else
local affixID = affixInfo;
local _, _, filedataid = C_ChallengeMode.GetAffixInfo(affixID);
SetPortraitToTexture(self.Portrait, filedataid);
self.Percent:Hide();
self.affixID = affixID;
end
self:Show();
end
Now since i want to change the look of the icons, i tried to hook into that function like this:
Lua Code:
hooksecurefunc(ChallengesKeystoneFrameAffixMixin,"SetUp",function(self,affixInfo)
print("shot fired")
self.Border:Hide()
self.Portrait:SetTexCoord(0.15, 0.85, 0.15, 0.85)
--m_fontify(self.Percent,"white",miirgui.medium)
end)
THis worked out just fine, except for the very first element it should work for. It just seems to always ignore the first element, no matter how many elements there are
I meanwhile found a workaround by hooking ChallengesKeystoneFrameMixin:OnKeystoneSlotted() by shouldnt hooking the setup function work too?
Blizzard ChallengesUI