This library allows to generate links to ws-armory.github.io pages.
The ws-armory.github.io is used for two things: visualize the equipments and get a short link for sharing purpose.
The library is also available as Curse package.
LibArmory.generatelink(): generate a ws-armory.github.io link to the current equiped items
-
Load the library
local LibArmory = Apollo.GetPackage("Armory:LibArmory-1.0").tPackage
-
Use the
generatelink()functionlocal link = LibArmory.generatelink()
-
Add the library in the toc.xml file
<?xml version="1.0" encoding="UTF-8"?> <Addon Author="Me" APIVersion="..." Name="MyAddon" Description="My awesome addon"> ... <Script Name="libs\LibArmory\LibArmory.lua"/> ... </Addon>
-
If your addon is packaged using Curse, add the library as a dependency in the pkgmeta.yaml file
package-as: MyAddon enable-nolib-creation: no ... externals: libs/LibArmory: url: https://github.com/ws-armory/LibArmory.git tag: 1.0 ...
Wildstar in-game API exposes unique # to reference each objects, information about this objects can be found in different online databases such as Jabbithole.
This addon gather couples of (slot_id, item_id) then generates a link to the website based on this couples.
Information about items are then gathered by the website using the Jabbithole online database (more details about the website internals).
The addon is really simple, it's work only rely on three functions of the GameLib API: PlayerUnit:GetEquippedItems(), Item:GetSlot() and Item:GetItemId().
It pretty much looks like as:
var url = InitUrl()
for key, item in ipairs(GameLib.GetPlayerUnit():GetEquippedItems()) do
AddItemToUrl(url,item:GetSlot(), item:GetItemId())
end
--- generated links are looking like:
--- http://ws-armory.github.io/?0=17830&1=13449&4=13329&5=30459&7=28056&10=28012That's all, as said before, really simple !
More details about the website internals can be found on it's dedicated webpage.
