xconstruct / cargBags

WoW AddOn: Inventory framework

Home | Edit | New

Home

cargBags

cargBags is a lightweight and modular bag framework. It is designed that you can completely focus on how your items are displayed and sorted rather than caring about getting item info, updating your bags or handle interaction with items. You can define how many virtual bags you’d like to have and what items should go into it.

Introduction

This page gives a complete overview over the API of cargBags. A small glossary:

  • Core: The most important part of cargBags – it connects all of the smaller modules and provides the structured virtual bags.
  • Handler: An interface which is called for fetching the item and container data – usually from the Blizzard interface or an internal database (“Anywhere bags”)
  • Layout: The main graphical frontend for the user – controls the display and formatting of the bag object and spawns plugins for use within cargBags
  • Plugin: Graphical and functional elements for the layout, such as money display, bag bar and space indicators.

Default cargBags modules

  • cargBags comes with its own handler, called “Standard”. It provides direct translation of Blizzards container/item functions into cargBags own system. In short, you get your normal bag and bag frame of your current character.
  • Default plugins: bag button bar (“BagBar”), bag space indicator (“Space”), money display (“Money”), Purchase-button

Function and property lists

This doesn’t have to reflect the API of the current version, for a detailed documentation see the headers of the files in cargBags.

Default Item Keys

These are all available values in the item-table. You can access them like “item.key”.
The current item-data is loaded automatically in your filter-functions or the different UpdateButtonX-callbacks.
You can fetch a specific item-table via :GetItemInfo(bagID, slotID).
If you want to modify the data, before it is passed to the various update-/filter-functions, you can use the
:PreCheckFilters()-callback.
You can also provide your own item key by storing a function in cargBags.ItemKeys[“YourItemKey”] – see keys/basic.lua for examples.

  • bagID
  • slotID
  • name
  • count
  • locked – Is the item currently picked up (icon is gray)
  • texture – The item’s icon
  • clink – This is doesn’t have to be a right item link, use item.link instead – it’s for internal purpose
  • link
  • rarity – the item’s quality
  • level – the item level
  • minLevel – required character level
  • type – Localized type like “Armor”, “Consumable”
  • subType – Localized type like “Cloth”, “Sword”
  • stackCount – maximum stack count
  • equipLoc – Something like “HeadSlot”
  • sellValue – new in 3.2: Sell price in copper
  • id – the numeric id of the item, e.g. 1337
  • string – the item string, e.g. “1337:0:0:0”
  • bagType – the type of the bag where the item is in
  • bindOn – one of nil, “equip”, “quest”, “account”, “pickup” or “use”
  • stats – new in 3.2: Table of item stats (from GetItemStats())
Last edited by xconstruct, Sat Aug 01 08:29:18 -0700 2009
Home | Edit | New
Versions: