Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added advanced option to lfdRole allowing selection of individual roles #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
suf.tmproj
.DS_Store
.DS_Store
.release
7 changes: 4 additions & 3 deletions modules/indicators.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,14 @@ function Indicators:UpdateLFDRole(frame, event)
role = specID and select(6, GetSpecializationInfoByID(specID))
end

if( role == "TANK" ) then
local lfdRole = ShadowUF.db.profile.units[frame.unitType].indicators.lfdRole
if( role == "TANK" and lfdRole.tank) then
frame.indicators.lfdRole:SetTexCoord(0, 19/64, 22/64, 41/64)
frame.indicators.lfdRole:Show()
elseif( role == "HEALER" ) then
elseif( role == "HEALER" and lfdRole.healer) then
frame.indicators.lfdRole:SetTexCoord(20/64, 39/64, 1/64, 20/64)
frame.indicators.lfdRole:Show()
elseif( role == "DAMAGER" ) then
elseif( role == "DAMAGER" and lfdRole.damage) then
frame.indicators.lfdRole:SetTexCoord(20/64, 39/64, 22/64, 41/64)
frame.indicators.lfdRole:Show()
else
Expand Down
92 changes: 92 additions & 0 deletions options/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4730,6 +4730,98 @@ local function loadUnitOptions()
Config.unitTable.args.indicators.args[indicator] = Config.indicatorTable
end

Config.unitTable.args.indicators.args.lfdRole = {
order = 0,
name = function(info)
if( info[#(info)] == "status" and info[2] == "player" ) then
return L["Combat/resting status"]
end

return getName(info)
end,
desc = function(info) return INDICATOR_DESC[info[#(info)]] end,
type = "group",
hidden = hideRestrictedOption,
args = {
enabled = {
order = 0,
type = "toggle",
name = L["Enable indicator"],
hidden = false,
arg = "indicators.$parent.enabled",
},
sep1 = {
order = 1,
type = "description",
name = "",
width = "full",
hidden = function() return not ShadowUF.db.profile.advanced end,
},
anchorPoint = {
order = 2,
type = "select",
name = L["Anchor point"],
values = positionList,
hidden = false,
arg = "indicators.$parent.anchorPoint",
},
size = {
order = 4,
type = "range",
name = L["Size"],
min = 1, max = 40, step = 1,
hidden = hideAdvancedOption,
arg = "indicators.$parent.size",
},
x = {
order = 5,
type = "range",
name = L["X Offset"],
min = -100, max = 100, step = 1, softMin = -50, softMax = 50,
hidden = false,
arg = "indicators.$parent.x",
},
y = {
order = 6,
type = "range",
name = L["Y Offset"],
min = -100, max = 100, step = 1, softMin = -50, softMax = 50,
hidden = false,
arg = "indicators.$parent.y",
},
roles = {
order = 7,
type = "group",
inline = true,
name = L["ROLE"],
hidden = function() return not ShadowUF.db.profile.advanced end,
args = {
tank = {
order = 1,
type = "toggle",
name = L["TANK"],
hidden = hideAdvancedOption,
arg = "indicators.$parentparent.tank",
},
healer = {
order = 2,
type = "toggle",
name = L["HEALER"],
hidden = hideAdvancedOption,
arg = "indicators.$parentparent.healer",
},
damage = {
order = 3,
type = "toggle",
name = L["DAMAGER"],
hidden = hideAdvancedOption,
arg = "indicators.$parentparent.damage",
},
},
},
},
}

-- Check for unit conflicts
local function hideZoneConflict()
for _, zone in pairs(ShadowUF.db.profile.visibility) do
Expand Down