View Single Post
12-19-17, 01:01 AM   #7
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by Seerah View Post
Just to be clear...

Lua Code:
  1. local _, class = UnitClass("player")
  2. if class ~= "ROGUE" then
  3.      DisableAddon("YourAddonName")   --you don't need to specify a character here, unless you want to disable for a different character than the one you're on ;)
  4.      return
  5. end
So, am I doing the right thing?

.TOC
Code:
## Title: Title
## Notes: Note
## Extra Tags: Extra Tag Values
## OptionalDeps: LibStub, CallbackHandler-1.0, Ace3, LibSharedMedia-3.0

Loader.lua

lib\load.xml
media\load.xml
locale\load.xml

Core.lua
Loader.lua
Lua Code:
  1. if select(2, UnitClass("player")) ~= "ROGUE" then
  2.      DisableAddon("YourAddonName");
  3.  
  4.      return;
  5. end

Core.lua
Lua Code:
  1. -- Passed class test :)
  2. code
  3. code
  4. code

I Like the idea, but as Ammako stated, wouldn't this require ReloadUI() to take effect?

I'm currently away from my main PC and can't test this

Last edited by Layback_ : 12-19-17 at 01:04 AM.
  Reply With Quote