rgd87 / Aptechka

WoW Addon - Raid Frames
http://www.wowinterface.com/downloads/info14339-Injector.html
33 stars 9 forks source link

Possible to sort raid by TANK, MDPS, RDPS, HEALER #113

Closed Meta-phaze closed 1 year ago

Meta-phaze commented 1 year ago

Currently can sort by TANK, HEALER, DAMAGER; but having MDPS separate from RDPS can be very useful (especially with RSham new 4 set).

I gave it a shot myself, but couldn't quite figure out some of the code. I changed "groupingOrder" to "TANK,MDPS,RDPS,DAMAGER,HEALER,NONE" on ln2322

image

And then in FrameCheckRoles I added a GetInspectSpecialization(unit) to figure out the party member spec, then did a lookup.

image

then set the FrameSetJob for the ROLE. But, it appears that the ROLE attribute isn't directly used in the sortBy? I tried to figure out where the actual sort is happening but wasn't able

    local inspect = GetInspectSpecialization(unit)
    if inspect == 0 then inspect = GetSpecializationInfo(GetSpecialization(), false, false) end
    role_lookup = {
        [250] = "TANK",      --blood
        [251] = "MDPS",      -- front
        [252] = "MDPS",      -- unholy
        [577] = "MDPS",      -- havoc
        [581] = "TANK",      -- vengence
        [102] = "RDPS",      -- balance
        [103] = "MDPS",      -- feral
        [104] = "TANK",      -- guardian
        [105] = "HEALER",    -- resto
        [1467] = "RDPS",     -- devast
        [1468] = "HEALER",   -- pres
        [1473] = "RDPS",     -- augme
        [62] = "RDPS",       -- arcane
        [63] = "RDPS",       -- fire
        [64] = "RDPS",       -- frost
        [268] = "TANK",      -- brew
        [270] = "HEALER",    -- mist
        [269] = "MDPS",      -- ww
        [65] = "HEALER",     -- holy pal
        [66] = "TANK",       -- prot
        [70] = "MDPS",       -- ret
        [256] = "HEALER",    -- disc
        [257] = "HEALER",    -- holy priest
        [258] = "RDPS",      -- shadow
        [259] = "MDPS",      -- ass
        [260] = "MDPS",      -- outlaw
        [261] = "MDPS",      -- sub
        [262] = "RDPS",      -- ele
        [263] = "MDPS",      -- enh
        [264] = "HEALER",    -- resto
        [265] = "RDPS",      -- aff
        [266] = "RDPS",      -- destro
        [71] = "MDPS",       -- arms
        [72] = "MDPS",       -- fury
        [73] = "TANK"        -- prot
    }
    role = role_lookup[inspect]

   if Aptechka.db.global.enableRoles and config.displayRoles then
        local isLeader = UnitIsGroupLeader(unit)
        --local role = UnitGroupRolesAssigned(unit)

        FrameSetJob(self, config.LeaderStatus, isLeader, "LEADER")
        if config.AssistStatus then
            local isAssistant = UnitIsGroupAssistant(unit)
            FrameSetJob(self, config.AssistStatus, isAssistant)
        end

        if role == "HEALER" or role == "TANK" then
            FrameSetJob(self, config.RoleStatus, true, "ROLE", role)
        else
            FrameSetJob(self, config.RoleStatus, false, "ROLE", role)
            --FrameSetJob(self, config.RoleStatus, false)
        end
    end

Any thoughts on how/if this is possible?

d87 commented 1 year ago

It's not possible, because these things are controlled by blizzard code. https://github.com/Gethe/wow-ui-source/blob/live/Interface/FrameXML/SecureGroupHeaders.lua