Quantcast
Download
(8 Kb)
Download
Updated: 02/03/19 08:21 AM
Compatibility:
Wrathstone (4.3)
Murkmire (4.2)
Updated:02/03/19 08:21 AM
Created:01/21/19 10:18 AM
Monthly downloads:885
Total downloads:1,732
Favorites:6
MD5:
4.3
LibSets
Version: 0.0.4
by: Baertram [More]
LibSets
A library to help with item sets, craftable and monster.
It contains:
-Name of a set for the current client language
-SetId of the set
-ItemIt for one of the items of these sets (to build an itemlink from)
-Functions to check if the setId is craftable or a monster set
-Other functions

This library uses SavedVariables and thus needs it's own LibSets.txt manifest file!


Where is the data?
Your instance of LibZone contains 1 table.

1 for the non localized data:
Lua Code:
  1. LibSets.setData[setId] = {
  2.   ["itemId"]      = itemIdOfOneItemOfTheSet,
  3.   ["name"]    = {
  4.     ["de"] = "nameOfTheSetInLanguageDE", -- if your client language is DE
  5.     ["en"] = "nameOfTheSetInLanguageEN", -- if your client language is EN
  6.     ["fr"] = "nameOfTheSetInLanguageFR", -- if your client language is FR
  7.    ...
  8.   }
  9. }

API functions of the library:
Lua Code:
  1. --Global variable of the library to access it:
  2. LibSets
  3.  
  4. --Returns true if the setId provided is a craftable set
  5. --> Parameters: setId number: The set's setId
  6. --> Returns:    boolean isCraftedSet
  7. function LibSets.IsCraftedSet(setId)
  8.  
  9. --Returns true if the setId provided is a monster set
  10. --> Parameters: setId number: The set's setId
  11. --> Returns:    boolean isMonsterSet
  12. function LibSets.IsMonsterSet(setId)
  13.  
  14. --Returns information about the set if the itemId provides is a set item
  15. --> Parameters: itemId number: The item's itemId
  16. --> Returns:    isSet boolean, setName String, setId number, numBonuses number, numEquipped number, maxEquipped number
  17. function LibSets.IsSetByItemId(itemId)
  18.  
  19. --Returns information about the set if the itemlink provides is a set item
  20. --> Parameters: itemLink String/ESO ItemLink: The item's itemLink '|H1:item:itemId...|h|h'
  21. --> Returns:    isSet boolean, setName String, setId number, numBonuses number, numEquipped number, maxEquipped number
  22. function LibSets.IsSetByItemLink(itemLink)
  23.  
  24. --Returns the name as String of the setId provided
  25. --> Parameters: setId number: The set's setId
  26. --> lang String: The language to return the setName in. Can be left empty and the client language will be used then
  27. --> Returns:    String setName
  28. function LibSets.GetSetName(setId, lang)
  29.  
  30. --Returns an itemId of an item of the setId provided
  31. --> Parameters: setId number: The set's setId
  32. --> Returns:    number setItemId
  33. function LibSets.GetSetItemId(setId)
  34.  
  35. --Returns a boolean value, true if the sets of the game were already loaded/ false if not
  36. --> Returns:    boolean areSetsLoaded
  37. function LibSets.AreSetsLoaded()
  38.  
  39. --Returns a boolean value, true if the sets of the game are currently scanned and added/updated/ false if not
  40. --> Returns:    boolean isCurrentlySetsScanning
  41. function LibSets.IsSetsScanning()

API functions to check if sets are currently scanning or if the sets data was scanned and is provided (for other addons:
Check if the library is given and the sets were loaded like this
Code:
if LibSets and LibSets.AreSetsLoaded and LibSets.AreSetsLoaded() then --Sets are provided end
API function to start the scan of the set data again. The function will show a popup dialog afterwards asking you to do a reloadui so the data is saved properly to the SavedVariables!
Lua Code:
  1. --Returns nothing
  2. --> Parameters: override boolean: true - Override the total setData and build it completely new for the given API version; false - Just update the exisitng API version's setData with a new client language (determined automatically and done automatically once the client version changes!)
  3. --> fromAddonName String: Pass your addon's name here so the chat output will show which addon initiated the LoadSets function
  4. LibSets.LoadSets(override, fromAddonName)
0.0.4
Fixed "is scanning" and "is loaded" variables to prevent double scans at teh same time.
Added parameter "addonName" to function LibSets.LoadSets(override, addonName).
If you call the function you should specify the parameter "addonName" and pass your addon's name (String) in there so the chat output is able to show which addon called the LibSets.LoadSets function

0.0.3
Fixed lua error messages after sets were loaded.

0.0.2
Fixed:
-Loading of sets will show the updated counter for existing sets, where the localized name got updated, properly now.
-Loaded sets will be automatically scanned and added + saved to the SavedvAriables for each APIVersion + client language now
-After the sets were loaded (watch the chat for update messages during the set scan process) a dialog will ask you to do a reloadui now. If you click "no" the dialog will re-appear every 10 minutes until you click "Yes" or do a manual reloadui

Added:
API functions to check if sets are currently scanning or if the sets data was scanned and is provided (for other addons:
Check if the library is given and the sets were loaded like this
Code:
if LibSets and LibSets.AreSetsLoaded and LibSets.AreSetsLoaded() then --Sets are provided end
Code:
--Returns a boolean value, true if the sets of the game were already loaded/ false if not
--> Returns:    boolean areSetsLoaded
function LibSets.AreSetsLoaded()

--Returns a boolean value, true if the sets of the game are currently scanned and added/updated/ false if not
--> Returns:    boolean isCurrentlySetsScanning
function LibSets.IsSetsScanning()
Optional Files (0)


Archived Files (3)
File Name
Version
Size
Uploader
Date
0.0.3
7kB
Baertram
02/01/19 10:40 AM
0.0.2
7kB
Baertram
01/30/19 04:11 PM
0.0.1
5kB
01/21/19 10:18 AM


There have been no comments posted to this file.
Be the first to add one.



Category Jump: