WowAce.com
Home
Addons
Authors
Forums
Knowledge base
Paste
Site issues
Sign in
LibPeriodicTable-3.1
Overview
Files
Tickets
Pages
Repository
Subscriptions
Curse
Usage
r12
Source
Markup:
*
*[[Main]] *[[Editing]] *[[API]] *[[http://forums.wowace.com/showthread.php?t=12498|Forum]] \\ ---- ==<MyMod>.toc file== <<code lua>> ... ## OptionalDeps: ..., LibPeriodicTable-3.1, ... ## X-Embeds: ..., LibPeriodicTable-3.1, ... ... # Libraries embeds.xml ... <</code>> \\ ---- ==embeds.xml== *Include LibPeriodicTable-3.1 *Include 1 or more of the split up files like LibPeriodicTable-3.1-Consumable <<code lua>> <Ui xmlns="http://www.blizzard.com/wow/ui/"> <Script file="libs\LibStub\LibStub.lua"/> <Script file="libs\CallBackHandler-1.0\CallbackHandler-1.0.lua"/> ... <Script file="libs\LibPeriodicTable-3.1\LibPeriodicTable-3.1.lua"/> <Script file="libs\LibPeriodicTable-3.1-Consumable\LibPeriodicTable-3.1-Consumable.lua"/> ... </Ui> <</code>> \\ ---- ==<MyMod>.lua== *Use LibStub to get the most up to date version of LibPeriodicTable *Use the LibPeriodicTable [[API]] functions <<code lua>> local PT = LibStub("LibPeriodicTable-3.1") ... -- Add items from set to rawList function MyMod:RawItemsAdd(rawList, set, priority) if (not rawList) then rawList = {} end if (set) then local cacheSet = PT:GetSetTable(set) if (cacheSet) then local index = # rawList + 1 for itemId, value in PT:IterateSet(set) do if (not value or type(value) == "boolean") then value = 0; end value = tonumber(value) rawList[index] = {itemId, value, priority} index = index + 1 end else print("MyMod could not find the PT3.1 set ", set, ". Make sure you have all the libraries MyMod needs to function.") end end return rawList end ... rawList = self:RawItemsAdd(rawList, "Consumable.Food.Edible.Meat.Basic", true) <</code>> \\ ---- ==.pkgmeta== <<code lua>> package-as: <MyMod> externals: libs/LibStub: svn://svn.wowace.com/wow/libstub/mainline/tags/1.0 libs/CallbackHandler-1.0: svn://svn.wowace.com/wow/callbackhandler/mainline/tags/1.0.3/CallbackHandler-1.0 ... libs/LibPeriodicTable-3.1: svn://svn.wowace.com/wow/libperiodictable-3-1/mainline/trunk/LibPeriodicTable-3.1 libs/LibPeriodicTable-3.1-Consumable: svn://svn.wowace.com/wow/libperiodictable-3-1/mainline/trunk/LibPeriodicTable-3.1-Consumable <</code>>
Markup Type:
*
The type of markup for this entry.
Click here for details
.
WikiCreole
BBCode
Safe HTML
Plain Text
Markdown
Textile
Curse Wiki (Deprecated)