Originally Posted by
Tueland
*Snip*
I managed to get it to work, by combining the two macros i linked with a macro i found here by Treeston.
I cant get it to work without using 3 macros tho, one execute macro, and the two containing the script itself.
Code:
/run for _,v in ipairs({"ClassPortrait1", "ClassPortrait2"}) do RunScript(GetMacroBody(v)) end;
Code:
UFP="UnitFramePortrait_Update" UICC="Interface\\TargetingFrame\\UI-Classes-Circles" CIT=CLASS_ICON_TCOORDS UC=UnitClass
Code:
hooksecurefunc(UFP,function(s) if s.unit == "player" then return end; local a,t=s.portrait if a then t=CIT[({UnitClass(s.unit)})[2]] if t and UnitIsPlayer(s.unit) then a:SetTexture(UICC) a:SetTexCoord(unpack(t)) else a:SetTexCoord(0,1,0,1) end end end)
The first macro you can name whatever you want, i just called mine "exec". The second macro you HAVE to call ClassPortrait1 and the third ClassPortrait2.
Then you just drag the first macro to your actionbar and press it once, it will run the other two other macros