Quantcast

-Updated TOC to 5.2

Xruptor [03-13-13 - 23:16]
-Updated TOC to 5.2
-Added an ability to add a seperator before the BagSync Tooltip Display
Filename
BagSync.lua
BagSync.toc
BagSync_Config.lua
localization/localization.lua
diff --git a/BagSync.lua b/BagSync.lua
index d240849..6ed872e 100644
--- a/BagSync.lua
+++ b/BagSync.lua
@@ -113,6 +113,7 @@ local function StartupDB()
 	if BagSyncOpt.enableAuction == nil then BagSyncOpt.enableAuction = true end
 	if BagSyncOpt.tooltipOnlySearch == nil then BagSyncOpt.tooltipOnlySearch = false end
 	if BagSyncOpt.enableTooltips == nil then BagSyncOpt.enableTooltips = true end
+	if BagSyncOpt.enableTooltipSeperator == nil then BagSyncOpt.enableTooltipSeperator = true end

 	--new format, get rid of old
 	if not BagSyncOpt.dbversion or not tonumber(BagSyncOpt.dbversion) or tonumber(BagSyncOpt.dbversion) < 7 then
@@ -813,6 +814,12 @@ local function AddToTooltip(frame, link)
 	--this is so we don't scan the same guild multiple times
 	local previousGuilds = {}
 	local grandTotal = 0
+
+	--check for seperator
+	if BagSyncOpt.enableTooltipSeperator then
+		frame:AddDoubleLine(" ", " ")
+		table.insert(lastDisplayed, " @ ")
+	end

 	--loop through our characters
 	--k = player, v = stored data for player
@@ -1152,8 +1159,8 @@ end

 function BagSync:BAG_UPDATE(event, bagid)
 	-- -1 happens to be the primary bank slot ;)
-	if bagid < -1 then return end
-	if not(bagid == BANK_CONTAINER or bagid > NUM_BAG_SLOTS) or atBank or atVoidBank then
+	if bagid <= BANK_CONTAINER then return end
+	if not(bagid > NUM_BAG_SLOTS) or atBank or atVoidBank then

 		--this will update the bank/bag slots
 		local bagname
@@ -1162,9 +1169,7 @@ function BagSync:BAG_UPDATE(event, bagid)
 		--so instead I'm using constants :)
 		if bagid < -1 then return end

-		if bagid == BANK_CONTAINER then
-			bagname = 'bank'
-		elseif (bagid >= NUM_BAG_SLOTS + 1) and (bagid <= NUM_BAG_SLOTS + NUM_BANKBAGSLOTS) then
+		if (bagid >= NUM_BAG_SLOTS + 1) and (bagid <= NUM_BAG_SLOTS + NUM_BANKBAGSLOTS) then
 			bagname = 'bank'
 		elseif (bagid >= BACKPACK_CONTAINER) and (bagid <= BACKPACK_CONTAINER + NUM_BAG_SLOTS) then
 			bagname = 'bag'
diff --git a/BagSync.toc b/BagSync.toc
index 4c050d0..cb5b89c 100644
--- a/BagSync.toc
+++ b/BagSync.toc
@@ -1,8 +1,8 @@
-## Interface: 50001
+## Interface: 50200
 ## Title: BagSync
 ## Notes: BagSync tracks your characters items and displays it within tooltips.
 ## Author: Xruptor
-## Version: 7.1
+## Version: 7.3
 ## OptionalDeps: tekDebug
 ## SavedVariables: BagSyncDB, BagSyncOpt, BagSyncGUILD_DB, BagSyncTOKEN_DB, BagSyncCRAFT_DB, BagSyncBLACKLIST_DB

diff --git a/BagSync_Config.lua b/BagSync_Config.lua
index 1a1a7b2..4327b11 100644
--- a/BagSync_Config.lua
+++ b/BagSync_Config.lua
@@ -19,6 +19,7 @@ bgsOpt:SetScript("OnShow", function()
 		BagSyncConfig_AuctionInfo:SetChecked(BagSyncOpt["enableAuction"])
 		BagSyncConfig_TooltipSearchOnly:SetChecked(BagSyncOpt["tooltipOnlySearch"])
 		BagSyncConfig_EnableBagSyncTooltips:SetChecked(BagSyncOpt["enableTooltips"])
+		BagSyncConfig_EnableBagSyncTooltipsSeperator:SetChecked(BagSyncOpt["enableTooltipSeperator"])
 	end
 end)

@@ -226,3 +227,23 @@ end)
 local bgs_EnableBagSyncTooltips_OptText = bgs_EnableBagSyncTooltips_Opt:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
 bgs_EnableBagSyncTooltips_OptText:SetPoint("LEFT", bgs_EnableBagSyncTooltips_Opt, "RIGHT", 0, 1)
 bgs_EnableBagSyncTooltips_OptText:SetText(L["Enable BagSync Tooltips"])
+
+--[[ Toggle for BagSync Tooltip Seperator]]--
+local bgs_EnableBagSyncTooltipsSeperator_Opt = CreateFrame("CheckButton", "BagSyncConfig_EnableBagSyncTooltipsSeperator", bgsOpt, "OptionsBaseCheckButtonTemplate")
+bgs_EnableBagSyncTooltipsSeperator_Opt:SetPoint("TOPLEFT", 16, -325)
+bgs_EnableBagSyncTooltipsSeperator_Opt:SetScript("OnClick", function(frame)
+	if BagSyncOpt then
+		if frame:GetChecked() then
+			PlaySound("igMainMenuOptionCheckBoxOn")
+			BagSyncOpt["enableTooltipSeperator"] = true
+			if BagSync then BagSync:resetTooltip() end
+		else
+			PlaySound("igMainMenuOptionCheckBoxOff")
+			BagSyncOpt["enableTooltipSeperator"] = false
+			if BagSync then BagSync:resetTooltip() end
+		end
+	end
+end)
+local bgs_EnableBagSyncTooltipsSeperator_OptText = bgs_EnableBagSyncTooltipsSeperator_Opt:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
+bgs_EnableBagSyncTooltipsSeperator_OptText:SetPoint("LEFT", bgs_EnableBagSyncTooltipsSeperator_Opt, "RIGHT", 0, 1)
+bgs_EnableBagSyncTooltipsSeperator_OptText:SetText(L["Enable empty line seperator above BagSync tooltip display."])
diff --git a/localization/localization.lua b/localization/localization.lua
index 1607bed..3032043 100644
--- a/localization/localization.lua
+++ b/localization/localization.lua
@@ -68,6 +68,7 @@
 -- ["Display class colors for characters."] = "",
 -- ["Display modified tooltips ONLY in the BagSync Search window."] = "",
 -- ["Enable BagSync Tooltips"] = "",
+-- ["Enable empty line seperator above BagSync tooltip display."] = "",

 BAGSYNC_L = GetLocale() == "zhCN" and {
 	["Bags: %d"] = "背包: %d",