forked from wow/OmicronFrames
Override role as TANK based on MT assignments
This is particularly helpful in fights like High King Maulgar, Illidari Council or Kael'Thas where a DPS player is temporarily made into a tank.
This commit is contained in:
1 parent
949e3686aa
commit
4567bea3f9
2 files changed
+13
-3
No files matched your search
+11
-1
@@ -541,10 +541,20 @@ function UnitFrame:UNIT_POWER_UPDATE()
|
|||||||
self:UpdatePower()
|
self:UpdatePower()
|
||||||
end
|
end
|
||||||
|
|
||||||
function UnitFrame:UpdateRole(role)
|
function UnitFrame:GetRole(role)
|
||||||
if role == nil then
|
if role == nil then
|
||||||
role = UnitGroupRolesAssigned(self.unit)
|
role = UnitGroupRolesAssigned(self.unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if GetPartyAssignment("MAINTANK", self.unit) then
|
||||||
|
role = "TANK"
|
||||||
|
end
|
||||||
|
|
||||||
|
return role
|
||||||
|
end
|
||||||
|
|
||||||
|
function UnitFrame:UpdateRole(role)
|
||||||
|
role = self:GetRole(role)
|
||||||
if role == "HEALER" then
|
if role == "HEALER" then
|
||||||
self:EnablePower(Enum.PowerType.Mana)
|
self:EnablePower(Enum.PowerType.Mana)
|
||||||
elseif role == "TANK" and select(3, UnitClass(self.unit)) == 6 then
|
elseif role == "TANK" and select(3, UnitClass(self.unit)) == 6 then
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ local function UnitFrameDefaultCompare(lhs, rhs)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- tank < healer < damage < ?
|
-- tank < healer < damage < ?
|
||||||
local lrole = RoleValue(UnitGroupRolesAssigned(lunit))
|
local lrole = RoleValue(lhs:GetRole())
|
||||||
local rrole = RoleValue(UnitGroupRolesAssigned(runit))
|
local rrole = RoleValue(rhs:GetRole())
|
||||||
|
|
||||||
if lrole ~= rrole then
|
if lrole ~= rrole then
|
||||||
return lrole < rrole
|
return lrole < rrole
|
||||||
|
|||||||
Reference in new issue
Block a user