View Single Post
09-05-23, 02:16 PM   #6
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,910
If playerRole is still a table then no.
Whatever is on the left side has to be able to equate to whatever is on the right.

Taking a look at the library,
Code:
local playerRole = LibClassicSpecs.Role
Just returns a table of
Lua Code:
  1. local Role = {
  2.   Damager = "DAMAGER",
  3.   Tank = "TANK",
  4.   Healer = "HEALER"
  5. }

playerRole should be something like a return from GetSpecializationInfo for the characters current classs/spec. ie. a string with "HEALER", "TANK" etc.
Lua Code:
  1. local playerRole = select(6, GetSpecializationInfo(xxx))

Then where you're using playeRole it can just be
Lua Code:
  1. if playerRole == nil then
  2.     --xxx                Text:SetText(hexa.."No Stats"..hexb)
  3. else
  4.     if playerRole == "TANK" then
  5.         UpdateTank(self)
  6.     elseif playerRole == "HEALER" then
  7.         UpdateCaster(self)
  8.     elseif playerRole == "DAMAGER" then
  9.         UpdateDamager(self)
  10.     end
  11. end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 09-05-23 at 02:27 PM.
  Reply With Quote