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
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
|