Quantcast

* set version number to 4.0v10 (yes, I skipped a version)

ckaotik [02-09-11 - 08:23]
* set version number to 4.0v10 (yes, I skipped a version)
* fixed lua error in constants.lua. This was caused by Blizzard removing the old totem/sigil/libram/relic item categories.
* this version is actually a big remake of the Loot Manager. I just hope it works decently, as I can't really test it
* the most important change: BG_LM will now look at all the loot in the loot window, not just one at a time. So it *should* make smarter decisions.
Filename
Broker_Garbage-Config/Broker_Garbage-Config.toc
Broker_Garbage-LootManager/Broker_Garbage-LootManager.toc
Broker_Garbage-LootManager/core.lua
Broker_Garbage-LootManager/readme.txt
Broker_Garbage/Broker_Garbage.toc
Broker_Garbage/constants.lua
Broker_Garbage/readme.txt
diff --git a/Broker_Garbage-Config/Broker_Garbage-Config.toc b/Broker_Garbage-Config/Broker_Garbage-Config.toc
index 12741a1..a0b233f 100644
--- a/Broker_Garbage-Config/Broker_Garbage-Config.toc
+++ b/Broker_Garbage-Config/Broker_Garbage-Config.toc
@@ -4,7 +4,7 @@

 ## Title: Broker_Garbage-Config
 ## Author: ckaotik
-## Version: 4.0v8
+## Version: 4.0v10

 ## LoadOnDemand: 1
 ## LoadManagers: AddonLoader, Addon Control Panel
diff --git a/Broker_Garbage-LootManager/Broker_Garbage-LootManager.toc b/Broker_Garbage-LootManager/Broker_Garbage-LootManager.toc
index e535361..207279c 100644
--- a/Broker_Garbage-LootManager/Broker_Garbage-LootManager.toc
+++ b/Broker_Garbage-LootManager/Broker_Garbage-LootManager.toc
@@ -5,7 +5,7 @@

 ## Title: Broker_Garbage-LootManager
 ## Author: ckaotik
-## Version: 4.0v8
+## Version: 4.0v10
 ## Notes: Plugin for Broker_Garbage. Selective looting and more!
 ## Notes-deDE: Plugin für Broker_Garbage. Selektives Plündern und mehr!

diff --git a/Broker_Garbage-LootManager/core.lua b/Broker_Garbage-LootManager/core.lua
index ea4a47b..facd010 100644
--- a/Broker_Garbage-LootManager/core.lua
+++ b/Broker_Garbage-LootManager/core.lua
@@ -24,23 +24,7 @@ local function eventHandler(self, event, arg1, ...)

 	elseif event == "LOOT_OPENED" then
 		-- restack inventory
-		if BGLM_GlobalDB.restackInventory then
-			local numSlots = 0
-			local justStacked = {}
-
-			for container = 0, 4 do
-				numSlots = GetContainerNumSlots(container)
-				if numSlots then
-					for slot = 1, numSlots do
-						local itemID = GetContainerItemID(container,slot)
-						if itemID and not BGLM:Find(justStacked, itemID) then
-							BGLM:Restack(itemID)
-							table.insert(justStacked, itemID)
-						end
-					end
-				end
-			end
-		end
+		BGLM.DoFullRestack()

 		-- looting
 		local disable = Broker_Garbage:GetVariable("disableKey")
@@ -81,6 +65,27 @@ frame:RegisterEvent("LOOT_OPENED")
 frame:SetScript("OnEvent", eventHandler)

 -- ---------------------------------------------------------
+-- initialize full inventory restacking, if the settings allow for it
+function BGLM.DoFullRestack()
+	if BGLM_GlobalDB.restackInventory then
+		local numSlots = 0
+		local justStacked = {}
+
+		for container = 0, 4 do
+			numSlots = GetContainerNumSlots(container)
+			if numSlots then
+				for slot = 1, numSlots do
+					local itemID = GetContainerItemID(container,slot)
+					if itemID and not BGLM:Find(justStacked, itemID) then
+						BGLM:Restack(itemID)
+						table.insert(justStacked, itemID)
+					end
+				end
+			end
+		end
+	end
+end
+
 -- restacks items so when deleting you lose as few items as possible
 function BGLM.Restack(itemID)
 	if BGLM.currentRestackItems then
@@ -153,7 +158,7 @@ function BGLM:DeletePartialStack(itemID, num)
 	end
 end

--- returns true if the requested mob is skinnable with our skill
+-- returns true if the requested mob is skinnable with our skinning skill
 function BGLM:CanSkin(mobLevel)
 	local skinning = Broker_Garbage:GetProfessionSkill(8613)
 	if not skinning then return false end
diff --git a/Broker_Garbage-LootManager/readme.txt b/Broker_Garbage-LootManager/readme.txt
index ae31b06..b17fa5e 100644
--- a/Broker_Garbage-LootManager/readme.txt
+++ b/Broker_Garbage-LootManager/readme.txt
@@ -5,7 +5,7 @@ Broker_Garbage - Loot Manager

 Author: ckaotik
 Version: 4.0v8
-WoW Version: 4.0.3
+WoW Version: 4.0.6

 WoWInterface: http://www.wowinterface.com/downloads/info15531-Broker_Garbage.html
 Curse:        http://wow.curse.com/downloads/wow-addons/details/broker_garbage.aspx
diff --git a/Broker_Garbage/Broker_Garbage.toc b/Broker_Garbage/Broker_Garbage.toc
index a3733e5..758acd5 100644
--- a/Broker_Garbage/Broker_Garbage.toc
+++ b/Broker_Garbage/Broker_Garbage.toc
@@ -6,7 +6,7 @@

 ## Title: Broker_Garbage
 ## Author: ckaotik
-## Version: 4.0v8
+## Version: 4.0v10
 ## Notes: Full bags no more! Distinguish between junk and treasure, find items to drop quickly.
 ## Notes-deDE: Unterscheide Trödel von Schätzen und finde billigen Müll zum Platzschaffen.

diff --git a/Broker_Garbage/constants.lua b/Broker_Garbage/constants.lua
index 664cbdf..61e9158 100644
--- a/Broker_Garbage/constants.lua
+++ b/Broker_Garbage/constants.lua
@@ -134,11 +134,7 @@ BG.usableGear = {
 	[armorTypes[4]] = {"DEATHKNIGHT", "HUNTER", "PALADIN", "SHAMAN", "WARRIOR"},		-- mail
 	[armorTypes[5]] = {"DEATHKNIGHT", "PALADIN", "WARRIOR"},		-- plate
 	[armorTypes[6]] = {"PALADIN", "SHAMAN", "WARRIOR"},		-- shields
-	[armorTypes[7]] = {"PALADIN"},		-- [old] librams
-	[armorTypes[8]] = {"DRUID"},		-- [old] relic
-	[armorTypes[9]] = {"SHAMAN"},		-- [old] totems
-	[armorTypes[10]] = {"DEATHKNIGHT"},	-- [old] seal
-	[armorTypes[11]] = {"DEATHKNIGHT", "DRUID", "PALADIN", "SHAMAN"},	-- [new] relic
+	[armorTypes[7]] = {"DEATHKNIGHT", "DRUID", "PALADIN", "SHAMAN"},	-- relic

 	[weaponTypes[1]] = {"DEATHKNIGHT", "HUNTER", "PALADIN", "ROGUE", "SHAMAN", "WARRIOR"},	-- 1H axes
 	[weaponTypes[2]] = {"DEATHKNIGHT", "HUNTER", "PALADIN", "SHAMAN", "WARRIOR"},	-- 2H axes
diff --git a/Broker_Garbage/readme.txt b/Broker_Garbage/readme.txt
index b3cc5ea..150b275 100644
--- a/Broker_Garbage/readme.txt
+++ b/Broker_Garbage/readme.txt
@@ -2,7 +2,7 @@ Broker_Garbage
 ==============
 Author: ckaotik
 Version: 4.0v8
-WoW Version: 4.0.3
+WoW Version: 4.0.6

 WoWInterface: http://www.wowinterface.com/downloads/info15531-Broker_Garbage.html
 Curse:        http://wow.curse.com/downloads/wow-addons/details/broker_garbage.aspx