#Spec symbol not showing correclty

19 messages · Page 1 of 1 (latest)

fast zenith
#

I want to display the details damage meter as a Weakaura; I made it work in general (with ChatGPT), but when trying to get a class-based symbol, each player gets the paladin symbol (my class) instead of the respective class one.

The code I'm using is shown in the image (due to post length)

Any idea how to adjust the code so the respective class spec symbols are showin instead of only the players' one?

#

Ingame example

heavy zodiac
#

A name is not a unit. And I would be quite surprised if you have elune or nazgrel in your group.

#

Also, linking the aura is very much preferred to reading a screenshot

fast zenith
#

the names are generated by details when creating a test group (but the problem is the same with real players in the group, tested it)

#

Code:

function()
local GetDpsForUnit = function(unitName)
return Details.UnitDamage(unitName) / Details.SegmentElapsedTime()
end

local GetDpsTable = function(unitNames)
    local dpsTable = {}

    for _, unitName in ipairs(unitNames) do
        local dps = GetDpsForUnit(unitName)
        table.insert(dpsTable, {name=unitName, dps=dps})
    end

    table.sort(dpsTable, function(a, b) return a.dps > b.dps end)

    return dpsTable
end

local RoundDps = function(dps)
    local roundedDps
    if dps >= 1000 then
        local numDecimalPlaces = 1
        local mult = 10 ^ numDecimalPlaces
        roundedDps = math.floor((dps / 1000) * mult + 0.5) / mult
    else
        roundedDps = math.floor(dps)
    end
    return roundedDps
end

local BuildGroupDpsText = function(dpsTable)
    local text = ""

    for rank, tableEntry in ipairs(dpsTable) do
        local roundedDps = RoundDps(tableEntry.dps)
        local dpsString = roundedDps
        if tableEntry.dps >= 1000 then
            dpsString = dpsString .. "K"
        end

        -- Hardcode the class icon for testing
        local classIcon = "|TInterface\\Icons\\ClassIcon_Paladin:16:16|t" -- Test icon here
        text = text .. rank .. ". " .. classIcon .. " " .. tableEntry.name .. ": " .. dpsString .. "\n"
    end

    return text
end

if not aura_env.last or aura_env.last < GetTime() - 0.5 then
    aura_env.last = GetTime()
    aura_env.cachedText = "No data"

    local unitNames = Details.SegmentDamagingUnits()

    if #unitNames > 0 then
        local dpsTable = GetDpsTable(unitNames)
        aura_env.cachedText = BuildGroupDpsText(dpsTable)
    end
end

return aura_env.cachedText

end

heavy zodiac
#

That is not the same code.

#

And not a link.

fast zenith
#

u mean a wago link?

heavy zodiac
#

Did you ask details if they have a text only display mode?

#

Yes.

fast zenith
#

it's not about the text-only mode; i want to include the details damage info in another weakaura which is why i want it to be a weakaura

#

and regarding the wago link; is there a "test mode" one can publish? I dont want to upload an unfinished WA

heavy zodiac
#

When you upload you can choose how.

fast zenith
#

(disclaimer: i have no idea of coding; this is solely made with ChatGP)

heavy zodiac
#

That is quite different from the screenshot above. Do you see the part where it says hardcode icon so it's always the same?

fast zenith
#

oh yes, let me check if i can find the right one (there are a lot now :D)

#

well, i dont know why, but after using an old one, it now works (fml)