FCO ItemSaver
[API / Developers] What functions are there to be used in other addons?
API functions
There are several API functions to check if an item is filtered, is protected, is protected at a special filter panel (bank withdraw, guildbank deposit, mail send, player 2 player trade, etc.).

Please check the file "FCOIS_API.lua" within the addon folder.
The functions are in there and described by their comments.

Attention: If you are using functions at the crafting tables be sure to distinguish normal (smithing/clothier/woodworking) and jewelry API functions for the different crafting types!

Check if the addon is loaded

You can check if FCO ItemSaver is loaded and PlayerActivated event has run by using this code:
Lua Code:
Lua Code:
  1. If FCOIS then
  2.             ---FCO ItemSaver is loaded
  3.             --Now check if PlayerActivated already run for the addon
  4.             If FCOIS.addonVars.gPlayerActivated then
  5.             --Player activated event finished for FCOIS
  6.             end
  7.         end

Or you could use the library "LibLoadedAddons" to check if the addon is loaded properly.
The library entry for FCOIS is added after the PlayerActivated event was fired, not before!
Lua Code:
Lua Code:
  1. local FCOIS_isLoaded, FCOIS_Version = libLoadedAddons:IsAddonLoaded('FCOItemSaver')
  2.         if FCOIS_isLoaded then
  3.             ---FCO ItemSaver is loaded and PlayerActivated was loaded
  4.             d("[FCOItemSaver] is loaded with version " .. tostring(FCOIS_Version))
  5.         end