Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ShadowedUnitFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ function ShadowUF:LoadUnitDefaults()
self.defaults.profile.units.player.xpBar = {enabled = false}
self.defaults.profile.units.player.fader = {enabled = false}
self.defaults.profile.units.player.comboPoints = {enabled = true, isBar = true}
self.defaults.profile.units.player.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0}
table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true})
table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true})
table.insert(self.defaults.profile.units.player.text, {enabled = true, text = "", anchorTo = "", anchorPoint = "C", size = 0, x = 0, y = 0, default = true})
Expand All @@ -396,6 +397,7 @@ function ShadowUF:LoadUnitDefaults()
self.defaults.profile.units.focustarget.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60}
-- TARGET
self.defaults.profile.units.target.enabled = true
self.defaults.profile.units.target.indicators.lfdRole = {enabled = false, size = 0, x = 0, y = 0}
self.defaults.profile.units.target.indicators.questBoss = {enabled = true, size = 0, x = 0, y = 0}
self.defaults.profile.units.target.comboPoints = {enabled = false, isBar = true}
self.defaults.profile.units.target.auras.buffs.approximateEnemyData = true
Expand All @@ -408,6 +410,7 @@ function ShadowUF:LoadUnitDefaults()
self.defaults.profile.units.party.auras.buffs.maxRows = 1
self.defaults.profile.units.party.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60}
self.defaults.profile.units.party.combatText.enabled = false
self.defaults.profile.units.party.indicators.lfdRole = {enabled = true, size = 0, x = 0, y = 0}
self.defaults.profile.units.party.indicators.phase = {enabled = true, size = 0, x = 0, y = 0}
-- ARENA
self.defaults.profile.units.arena.enabled = false
Expand Down
1 change: 1 addition & 0 deletions modules/defaultlayout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ function ShadowUF:LoadDefaultLayout(useMerge)
ready = {anchorTo = "$parent", anchorPoint = "LC", size = 24, x = 35, y = 0},
role = {anchorTo = "$parent", anchorPoint = "TL", size = 14, x = 30, y = -11},
status = {anchorTo = "$parent", anchorPoint = "LB", size = 16, x = 12, y = -2},
lfdRole = {enabled = true, anchorPoint = "BR", size = 14, x = 3, y = 14, anchorTo = "$parent"}
},
highlight = {size = 10},
combatText = {anchorTo = "$parent", anchorPoint = "C", x = 0, y = 0},
Expand Down
38 changes: 36 additions & 2 deletions modules/indicators.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local Indicators = {list = {"status", "pvp", "leader", "resurrect", "masterLoot", "raidTarget", "ready", "role", "class", "phase", "happiness" }}
local Indicators = {list = {"status", "pvp", "leader", "resurrect", "masterLoot", "raidTarget", "ready", "role", "lfdRole", "class", "phase", "happiness" }}

ShadowUF:RegisterModule(Indicators, "indicators", ShadowUF.L["Indicators"])

Expand Down Expand Up @@ -98,6 +98,7 @@ end
function Indicators:GroupRosterUpdate(frame)
self:UpdateMasterLoot(frame)
self:UpdateRole(frame)
self:UpdateLFDRole(frame)
self:UpdateLeader(frame)
end

Expand All @@ -118,6 +119,31 @@ function Indicators:UpdatePVPFlag(frame)
end
end

function Indicators:UpdateLFDRole(frame, event)
if( not frame.indicators.lfdRole or not frame.indicators.lfdRole.enabled ) then return end

local role
if( frame.unitType ~= "arena" ) then
role = UnitGroupRolesAssigned(frame.unitOwner)
else
local specID = GetArenaOpponentSpec(frame.unitID)
role = specID and select(6, GetSpecializationInfoByID(specID))
end

if( role == "TANK" ) then
frame.indicators.lfdRole:SetTexCoord(0, 19/64, 22/64, 41/64)
frame.indicators.lfdRole:Show()
elseif( role == "HEALER" ) then
frame.indicators.lfdRole:SetTexCoord(20/64, 39/64, 1/64, 20/64)
frame.indicators.lfdRole:Show()
elseif( role == "DAMAGER" ) then
frame.indicators.lfdRole:SetTexCoord(20/64, 39/64, 22/64, 41/64)
frame.indicators.lfdRole:Show()
else
frame.indicators.lfdRole:Hide()
end
end

-- Non-player units do not give events when they enter or leave combat, so polling is necessary
local function combatMonitor(self, elapsed)
self.timeElapsed = self.timeElapsed + elapsed
Expand Down Expand Up @@ -340,6 +366,14 @@ function Indicators:OnEnable(frame)
frame.indicators.ready = frame.indicators.ready or frame.indicators:CreateTexture(nil, "OVERLAY")
end

if( config.indicators.lfdRole and config.indicators.lfdRole.enabled ) then
frame:RegisterNormalEvent("PLAYER_ROLES_ASSIGNED", self, "UpdateLFDRole")
frame:RegisterUpdateFunc(self, "UpdateLFDRole")

frame.indicators.lfdRole = frame.indicators.lfdRole or frame.indicators:CreateTexture(nil, "OVERLAY")
frame.indicators.lfdRole:SetTexture("Interface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES")
end

if( config.indicators.happiness and config.indicators.happiness.enabled ) then
frame:RegisterUnitEvent("UNIT_HAPPINESS", self, "UpdateHappiness")
frame:RegisterUpdateFunc(self, "UpdateHappiness")
Expand All @@ -349,7 +383,7 @@ function Indicators:OnEnable(frame)
end

-- As they all share the function, register it as long as one is active
if( frame.indicators.leader or frame.indicators.masterLoot or frame.indicators.role ) then
if( frame.indicators.leader or frame.indicators.masterLoot or frame.indicators.role or ( frame.unit ~= "player" and frame.indicators.lfdRole ) ) then
frame:RegisterNormalEvent("GROUP_ROSTER_UPDATE", self, "GroupRosterUpdate")
end
end
Expand Down
4 changes: 2 additions & 2 deletions options/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ local PAGE_DESC = {
["tags"] = L["Advanced tag management, allows you to add your own custom tags."],
["filter"] = L["Simple aura filtering by whitelists and blacklists."],
}
local INDICATOR_NAMES = {["leader"] = L["Leader / Assist"], ["masterLoot"] = L["Master Looter"], ["pvp"] = L["PvP Flag"], ["raidTarget"] = L["Raid Target"], ["ready"] = L["Ready Status"], ["role"] = L["Raid Role"], ["status"] = L["Combat Status"], ["class"] = L["Class Icon"], ["resurrect"] = L["Resurrect Status"], ["phase"] = L["Other Party/Phase Status"], ["happiness"] = L["Pet Happiness"]}
local INDICATOR_NAMES = {["leader"] = L["Leader / Assist"], ["lfdRole"] = L["Class Role"], ["masterLoot"] = L["Master Looter"], ["pvp"] = L["PvP Flag"], ["raidTarget"] = L["Raid Target"], ["ready"] = L["Ready Status"], ["role"] = L["Raid Role"], ["status"] = L["Combat Status"], ["class"] = L["Class Icon"], ["resurrect"] = L["Resurrect Status"], ["phase"] = L["Other Party/Phase Status"], ["happiness"] = L["Pet Happiness"]}
local AREA_NAMES = {["arena"] = L["Arenas"],["none"] = L["Everywhere else"], ["party"] = L["Party instances"], ["pvp"] = L["Battleground"], ["raid"] = L["Raid instances"]}
local INDICATOR_DESC = {
["leader"] = L["Crown indicator for group leader or assistants."],
["leader"] = L["Crown indicator for group leader or assistants."], ["lfdRole"] = L["Role the unit is playing."],
["masterLoot"] = L["Bag indicator for master looters."], ["pvp"] = L["PVP flag indicator, Horde for Horde flagged pvpers and Alliance for Alliance flagged pvpers."],
["raidTarget"] = L["Raid target indicator."], ["ready"] = L["Ready status of group members."], ["phase"] = L["Shows when a party member is in a different phase or another group."],
["role"] = L["Raid role indicator, adds a shield indicator for main tanks and a sword icon for main assists."], ["status"] = L["Status indicator, shows if the unit is currently in combat. For the player it will also show if you are rested."], ["class"] = L["Class icon for players."],
Expand Down