Wikia

WoWWiki

Collision

Talk0
102,281pages on
this wiki
Addonicon
WoWWiki Hosted AddOn Library Page
Collision
Provides more information about the player's armor durability
Details
TOC2.4.0 (20400)
CategoryLibrary
AuthorJaliborc
Links
HostsGoogle Code
BugtrackerGoogle Code

Collision is a library that tries to provide more information about the player armor durability in a easy and simple way. It was originally developed by Jaliborc for Bongos Durability, but the author encourages any developer to use it too.


Access Collision Edit

To simply get a reference to the library, query LibStub for it:

local Collision = LibStub:GetLibrary("Collision-1.3")
local Collision = LibStub("Collision-3.0")

Or, to embed Collision into your addon object:

 LibStub("Collision-3.0"):Embed(myObject)

API Edit

The following API provides everything you need yo know to use Collision.


:GetArmorDurability(slot, precise) Edit

Returns the durability values of the given armor slot

Arguments Edit

Arg Type Details
slot string or number Slot id or name
precise boolean (Optional) Disables rounding of the percentage

Returns Edit

Return Type Details
current number Current durability of the given slot
max number Max durability of the given slot
percentage number Durability percentage of the given slot. Won't be rounded if precise is set to true


:GetOverallDurability(precise) Edit

Calculates the overall durability percentage

Arguments Edit

Arg Type Details
precise boolean (Optional) Disables rounding of the percentage

Returns Edit

Return Type Details
percentage number Overall durability percentage. Won't be rounded if precise is set to true


:GetRepairCost() Edit

Calculates the repair cost of all armor equipped in the character

Returns Edit

Return Type Details
cost number The cost of repairing all armor


 :PrintRepairCost(tooltip) Edit

Prints the repair cost of all armor equipped in the character to the given tooltip

Arguments Edit

Arg Type Details
tooltip table The tooltip to send the output to


 :IterateDamagedArmor() Edit

Iterates over the damaged armor slots

Iterator Returns Edit

Return Type Details
id number Slot id
name string Slot name


 :IterateBrokenArmor() Edit

Iterates over the broken armor slots

Iterator Returns Edit

Return Type Details
id number Slot id
name string Slot name


More Help Edit

For additional help, contact the author at Jalimods or see Collision in action.

Around Wikia's network

Random Wiki