changeset 112:619ee0a1ff3b

[mq]: QAManagerIntegration
author Asa Ayers <Asa.Ayers@Gmail.com>
date Wed, 01 Sep 2010 23:21:44 -0700
parents 1cb0027da35c
children 52e8cad9ccc4
files CHANGELOG.txt Core.lua Modules/QuickAuctions.lua
diffstat 3 files changed, 47 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGELOG.txt	Mon Aug 30 19:52:41 2010 -0700
+++ b/CHANGELOG.txt	Wed Sep 01 23:21:44 2010 -0700
@@ -1,3 +1,7 @@
+2010-09-01  Asa Ayers  <Asa.Ayers@Gmail.com>
+
+- Made some changes to begin migrating some QA functionality to QAManager (http://www.wowace.com/addons/qa-manager/)
+
 2010-08-30  Asa Ayers  <Asa.Ayers@Gmail.com>
 
 - Updated Total Cost in /ia crafting to include the AH cut based on the price column. This will also reduce the profit column to consider the additional cost.
--- a/Core.lua	Mon Aug 30 19:52:41 2010 -0700
+++ b/Core.lua	Wed Sep 01 23:21:44 2010 -0700
@@ -100,6 +100,8 @@
 		self.db.char.crafting_threshold = nil
 	end
 
+	ItemAuditor:IsQACompatible()
+
 	--@debug@
 		-- ItemAuditor_DebugFrame:Show()
 		-- self:CreateFrame('tab_crafting')
@@ -507,6 +509,7 @@
 	
 	if realLink ~= nil then
 		ItemAuditor:UpdateQAThreshold(realLink)
+		self:SendMessage("IA_COST_CHANGED", realLink, unpack({ItemAuditor:GetItemCost(realLink)}))
 	end
 	UpdateInvestedData()
 end
--- a/Modules/QuickAuctions.lua	Mon Aug 30 19:52:41 2010 -0700
+++ b/Modules/QuickAuctions.lua	Wed Sep 01 23:21:44 2010 -0700
@@ -27,6 +27,25 @@
 
 
 function ItemAuditor:IsQACompatible()
+	local qam = GetAddOnInfo('QAManager')
+	if qam then
+		ItemAuditor.Options.args.qa_options.disabled = true
+		if ItemAuditor.db.char.use_quick_auctions then
+			ItemAuditor.db.char.use_quick_auctions = false
+			StaticPopupDialogs["ItemAuditor_QAOptionsReplaced"] = {
+				text = "The ability to have ItemAuditor adjust your QA thresholds is being moved to QAManager. If you have to use the options within ItemAuditor you can disable QAManager to restore them for now, but this option will change in the future.",
+				button1 = "OK",
+				timeout = 0,
+				whileDead = true,
+				hideOnEscape = true,
+				OnAccept = function()
+					-- StaticPopupDialogs["ItemAuditor_QAOptionsReplaced"] = nil
+				end,
+			}
+			StaticPopup_Show('ItemAuditor_QAOptionsReplaced')
+		end
+		return false
+	 end
 	return (QAAPI ~= nil and QAAPI.GetGroupConfig ~= nil)
 end
 
@@ -120,7 +139,27 @@
 	end
 	return 0
 end
-Crafting.RegisterCraftingDecider('IA QuickAuctions', isProfitable)
+
+local QADeciderOptions = {
+	extra = {
+		type = "range",
+		name = "Create Extra",
+		desc = "This is the amount of an item that should be created above what you sell in one post in QuickAuctions."..
+			"If you sell 4 stacks of 5 of an item and your extra is 25%, it will queue enough for you to have 25 of that item.",
+		min = 0.0,
+		max = 1.0,
+		step = 0.01,
+		isPercent = true,
+		get = function() return ItemAuditor.db.char.qa_extra end,
+		set = function(info, value)
+			ItemAuditor.db.char.qa_extra = value
+		end,
+		handler = ItemAuditor,
+		disabled = 'IsQACompatible',
+		order = 10,
+	},
+}
+Crafting.RegisterCraftingDecider('IA QuickAuctions', isProfitable, QADeciderOptions)
 
 
 function ItemAuditor:Queue()
@@ -256,26 +295,6 @@
 			disabled = 'IsQADisabled',
 			order = 4,
 		},
-		header = {
-			type = 'header',
-			name = '',
-			order = 9,
-		},
-		extra = {
-			type = "range",
-			name = "Create Extra",
-			desc = "This is the amount of an item that should be created above what you sell in one post in QuickAuctions."..
-				"If you sell 4 stacks of 5 of an item and your extra is 25%, it will queue enough for you to have 25 of that item.",
-			min = 0.0,
-			max = 1.0,
-			isPercent = true,
-			get = function() return ItemAuditor.db.char.qa_extra end,
-			set = function(info, value)
-				ItemAuditor.db.char.qa_extra = value
-			end,
-			disabled = 'IsQADisabled',
-			order = 10,
-		},
 		refresh_qa = {
 			type = "execute",
 			name = "Refresh QA Thresholds",