View Single Post
05-13-09, 10:23 AM   #2
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 103
Ok very nice, thanks for implementing cargBags_Anywhere.

Question : Can i run a function on the bag data before the bags are populated?

I want to change the types on some of the items before they get filtered by any potential filters that may exist.

ie "Wind-Up Train Wrecker" is listed as consumable when i want it treated as Miscellaneous, and "Fate Rune of Unsurpassed Vigor" is listed as quest when i want it treated as a Consumable.

Code:
local itemConversions = {
	["Wind-Up Train Wrecker"] = {
		type = "Miscellaneous ",
		subtype = "Other"
	},
	["Toy Train Set"] = {
		type = "Miscellaneous ", 
		subtype = "Other"
	},
	["Worn Troll Dice"] = {
		type = "Miscellaneous ",
		subtype = "Other"
	},
	["Fate Rune of Unsurpassed Vigor"] = {
		type = "Consumable ",
		subtype = "Consumable"
	},
	["Fate Rune of Primal Energy"] = {
		type = "Consumable ",
		subtype = "Consumable"
	},
	["Fate Rune of Baneful Intent"] = {
		type = "Consumable ",
		subtype = "Consumable"
	},
}

local function PostBagDBInit(item,name,link)
	ConvertedItem = itemConversions[item.name]
	if(ConvertedItem)then
		item.type = ConvertedItem.type
	end

end
  Reply With Quote