Quantcast WoWInterface - View Single Post - Moving a frame depending on spec
View Single Post
08-21-18, 05:21 PM   #4
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 579
Originally Posted by Fizzlemizz View Post
I dont' see a frame:ClearAllPoints()
/doh

Originally Posted by Vrul View Post
You can make that handle future classes better:
Code:
local party = CreateFrame('Frame')
party:SetScript('OnEvent', function(self, event)
    self:UnregisterEvent(event)

    local function UpdatePosition(self)
        local _, _, _, _, role = GetSpecializationInfo(GetSpecialization())
        self:ClearAllPoints()
        self:SetPoint(unpack(cfg.group[role ~= 'HEALER' and "position" or "healposition"]))
    end
    UpdatePosition(self)

    self:SetScript('OnEvent', UpdatePosition)
    self:RegisterUnitEvent('PLAYER_SPECIALIZATION_CHANGED', 'player')
end)
party:RegisterEvent('PLAYER_ENTERING_WORLD')
That definately looks better
__________________
Tweets Facebook YouTube Website
  Reply With Quote