So trying to set the position of my raid frames depending on whether the character is a healing spec or not since I like the raid frames under my character when I heal, but not any other time.
I figured using an event would work and while it does I can only seem to watch "PLAYER_ENTERING_WORLD" and while I see the other events fire they don't set the frame position unless I reload the UI.
I can't seem to find a working example either, but that might be me being lazy.
Lua Code:
frame:SetScript("OnEvent", function(self, event, unit)
if event == "PLAYER_SPECIALIZATION_CHANGED" or event == "PLAYER_ENTERING_WORLD" or event == "PLAYER_SPECIALIZATION_CHANGED" then
if (playerClass == "PRIEST" and GetSpecialization() == 1) then
frame:SetPoint(unpack(cfg.group.healposition))
elseif (playerClass == "PRIEST" and GetSpecialization() == 2) then
frame:SetPoint(unpack(cfg.group.healposition))
elseif (playerClass == "PALADIN" and GetSpecialization() == 1) then
frame:SetPoint(unpack(cfg.group.healposition))
elseif (playerClass == "DRUID" and GetSpecialization() == 4) then
frame:SetPoint(unpack(cfg.group.healposition))
elseif (playerClass == "MONK" and GetSpecialization() == 2) then
frame:SetPoint(unpack(cfg.group.healposition))
elseif (playerClass == "SHAMAN" and GetSpecialization() == 3) then
frame:SetPoint(unpack(cfg.group.healposition))
else
frame:SetPoint(unpack(cfg.group.position))
end
end
end)
frame:RegisterEvent("PLAYER_TALENT_UPDATE")
frame:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
Complete Source Code
It is an oUF layout I'm working on, but I figured this was more of a general problem and not an oUF problem