View Single Post
12-17-17, 10:10 AM   #3
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
You can't prevent an addon from loading from within its own code.

jeruku's solution may somewhat work, but it ultimately uses the built-in addon enable/disable feature anyway, and you'd need the user to click to confirm reload ui at login anyway so it wouldn't even be done silently (unless you had the addon stay loaded on first use and then unloaded ever after, but I don't think that's what you want.)

If your addon is only ever intented to work for one class, then your solution is the best you can get short of just marking it disabled for non-rogue characters on character select.
If you had multiple different features in your addon for different classes, what you could do is have a main addon core, with child addons that are class specific and load on demand only when logging into a character of that class.
  Reply With Quote