View Single Post
06-22-09, 02:25 PM   #14
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,943
Yeah, I was planning to do a class check on this and unload the addon if it is the wrong class. I think I saw and unloadAddon function somewhere.

Originally Posted by havoxx View Post
Is it possible to have a class check on it? Like the totem bar addons that won't load if you aren't on a shaman?

Believe it's this part of the code(taken from Call Of Elements)
Code:
--[[ ----------------------------------------------------------------
    METHOD: COE:Init
    
    PURPOSE: Loads submodules and initializes data
-------------------------------------------------------------------]]
function COE:Init(self)
    COE:Message( "Call of Elements v" .. COE_VERSION );
    
    -- load only for shamans
    -- ----------------------
    local _, EnglishClass = UnitClass( "player" );
    if( EnglishClass ~= "SHAMAN" ) then
        COE:Message( COESTR_NOTASHAMAN );
        COE.Initialized = false;
    else
        COE.Initialized = true;

        self:RegisterEvent( "VARIABLES_LOADED" );
    
        -- register shell command
        -- -----------------------
        SlashCmdList["COE"] = COEProcessShellCommand;
        SLASH_COE1="/coe";
        
    end

end
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818