Phanx was kind enough to help me with this last time.
Trying to set up a new Statistics Stat for my Datapanel.
So far this is what I have
Statisctics.lua
Everything is working good (except that GetVersatility(); is im guessing by the error I get when I use it not in the game yet) but my reason for this thread is I have a playerRoll checker I need some assistance with.
Code:
function nData:UpdatePlayerRole()
if UnitLevel("player") >= 10 then
local spec = GetSpecialization()
local specRole = GetSpecializationRole(spec) -- no need for a giant table that must be maintained by hand
if specRole == "TANK" then
playerRole = "Tank"
elseif specRole == "HEALER" then
playerRole = "Caster"
elseif specRole == "DAMAGER" then
if UnitPowerType("player") == SPELL_POWER_MANA then
playerRole = "Caster"
else
playerRole = "Melee"
end
elseif specRole == nil then
playerRole = nil -- no spec
end
else
return
end
end
The problem is with DAMAGER the above code marks anyone that is a DAMAGER with mana as a Caster, But Paladins and Shamans have Melee DAMAGER with mana. So everytime I switch to the Melee Mana user it pops up my Spell Stat instead of Melee Stat.
Does this mean im going to add yet another separator and go into specs and not just Rolls?
Thanks for any help in advance.
Coke
PS: I Attached a picture of the tooltip for Statistics.