view Plugins/CraftingAddons/Cauldron.lua @ 84:3bec0ea44607

Cleaned the Inventorium folder; moved all classes to classes directory, modules to modules directory and support addons to plugins directory. In addition support addons are now references within XML files rather than inside the TOC. Fixed the default local item count setting, you can now exclude bag and AH data from it. Fixed some mover algorithm bugs. Mover can no longer freeze the game but instead will terminate the process after a 1000 passes. Now reversing the moves table after making it, rather than every single time it is used. Fixed guild bank support. Now displaying the amount of items moved. Scanner now scans all guild bank tabs rather than only the current. Fixed a bug with local item data not being retrieved properly. Disabled ?enterClicksFirstButton? within dialogs as this causes the dialog to consume all keypress. Events are now at the addon object rather than local.
author Zerotorescue
date Thu, 06 Jan 2011 20:05:30 +0100
parents CraftingAddons/Cauldron.lua@2127ab01ed4a
children
line wrap: on
line source
do
	
	local function Queue(tradeSkillIndex, amount)
		local tradeskillName, currentLevel, maxLevel = GetTradeSkillLine();
		
		local link = GetTradeSkillItemLink(tradeSkillIndex);
		local itemName = link and link:match("%[([^%[%]]*)%]");
		
		if not itemName then
			return;
		end
		
		local skillInfo = Cauldron:GetSkillInfo(tradeskillName, itemName);
	
		CauldronQueue:AddItem(Cauldron.db.realm.userdata[Cauldron.vars.playername].queue, skillInfo, amount);
			
		Cauldron:UpdateQueue();
		
		-- update the shopping list
		Cauldron:UpdateShoppingListFromQueue();
		
		Cauldron:UpdateButtons();
		
		return;
	end
	
	local function IsEnabled()
		return (Cauldron and CauldronQueue and CauldronQueue.AddItem);
	end
	
	local function OnSelect()
		local addonName = "|r|cfffed000Cauldron|r|cffff6600";
		
		print("|cffff6600" .. addonName .. " has not yet been tested. Please report any of your experiences.|r");
	end
	
	IMRegisterCraftingAddon("Cauldron", Queue, IsEnabled, OnSelect);
	
end