I have a Unit frames Addon on Curse, and im trying to get the Hots to Display and function exactly like Blizzard, Ive tried everything i can think of, but i cant make them disapear, or line up properly from the RightCorner, moving to the left. The code in question and a Link to the most recent build is here. Please help if you can. Starts at line 820 HotSpot ver. 1.0.6 https://www.curseforge.com/wow/addons/hotspot/files/all
function HotSpot:UnitButtonSetAura( unitID, theHarmfulAura, theHelpfulName, theHelpfulIcon, theHelpfulDuration, theHelpfulExpirationTime, theHelpfulAura, currentSlot)
local b = HotSpot:GetButtonFromUnitID( unitID )
--
--
-- Get Helpful Aura -- Show my Hots on players
--
-- B R O K E N !!!!!
--
--print ("DESTINATION: theHelpfulName = ",theHelpfulName," theHelpfulDuration = ",theHelpfulDuration," TheHelfulexpirationTime = ", theHelpfulExpirationTime," theHelpfulIcon = ",theHelpfulIcon," theHelpfulAura = ", theHelpfulAura," currentSlot = ",currentSlot)
if (b) then
if ( theHelpfulExpirationTime ) then
local ICON_WIDTH = 10
local ICON_HEIGHT = 10
local myFrame = CreateFrame("Frame", nil, b)-- Create a mini IconFrame Within the ButtonFrame
local AuraTexture = myFrame:CreateTexture(nil, "ARTWORK")
if ( theHelpfulExpirationTime and theHelpfulExpirationTime ~= 0 ) then
local startTime = theHelpfulExpirationTime - theHelpfulDuration;
-- create and position unitbuttons anchored to the parent
myFrame.unitButtons = {}
for i=1,currentSlot do
myFrame.unitButtons[i] = myFrame
myFrame.unitButtons[i]:SetSize(ICON_WIDTH,ICON_HEIGHT)
if currentSlot == 1 then
myFrame.unitButtons[i]:SetPoint("BOTTOMRIGHT",(0),0) -- (position,hoizontal,verticle)
else
myFrame.unitButtons[i]:SetPoint("BOTTOMRIGHT",(-i*ICON_WIDTH),0) -- (position,hoizontal,verticle)
end
end
AuraTexture:SetAllPoints()
--
-- ENABLE THIS TO TEST IT AGAIN....
--AuraTexture:SetTexture(theHelpfulIcon);-- I HAVE THIS DISABLED UNTIL FIXED!
else
--
-- IM TRYING TO GET THIS PART WORKING, IT SHOULD ERASE THE ICON FRAMES --
--
--print ("B Tryng to Clear",theHelpfulIcon," myFrame.unitButtons = ",myFrame.unitButtons)
--myFrame.unitButtons:Hide()
--myFrame:Hide();
--for theHelpfulAura, display in pairs(dispellableDebuffTypes or {}) do
-- if ( display ) then
-- frame["myFrame"..theHelpfulAura] = false;
-- end
--end
--AuraTexture:SetAllPoints()
--AuraTexture:SetTexture(nil);
end
end
end