Quantcast

5.4.183

Steven Jackson [01-13-15 - 02:10]
5.4.183
Filename
Interface/AddOns/SVUI/packages/bag/SVBag.lua
Interface/AddOns/SVUI/packages/bar/SVBar.lua
Interface/AddOns/SVUI_ConfigOMatic/components/bar.lua
diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua
index c2e22c5..07371ce 100644
--- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua
+++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua
@@ -49,6 +49,7 @@ local TTIP = SV.SVTip;
 LOCAL VARS
 ##########################################################
 ]]--
+local DEBUG_BAGS = false;
 local CreateFrame = _G.CreateFrame;
 local hooksecurefunc = _G.hooksecurefunc;
 local BLANK_TEXTURE = [[Interface\BUTTONS\WHITE8X8]];
@@ -291,7 +292,7 @@ function MOD:INVENTORY_SEARCH_UPDATE()
 end

 function MOD:SlotUpdate(bagID, slotID)
-	if (self.Bags[bagID] and self.Bags[bagID].numSlots ~= GetContainerNumSlots(bagID)) or not self.Bags[bagID] or not self.Bags[bagID][slotID] then
+	if((not self.Bags[bagID]) or (self.Bags[bagID] and self.Bags[bagID].numSlots ~= GetContainerNumSlots(bagID)) or (not self.Bags[bagID][slotID])) then
 		return;
 	end

@@ -464,10 +465,9 @@ end

 function MOD:RefreshSlots(bagID)
 	if(self.Bags[bagID]) then
-		local bag = self.Bags[bagID]
 		local maxcount = GetContainerNumSlots(bagID)
 		for slotID = 1, maxcount do
-			bag:SlotUpdate(slotID)
+			self.Bags[bagID]:SlotUpdate(slotID)
 		end
 	end
 end
@@ -535,15 +535,17 @@ end

 local ContainerFrame_UpdateCooldowns = function(self)
 	if self.isReagent then return end
-	for bagID, bag in pairs(self.Bags) do
-		for slotID = 1, GetContainerNumSlots(bagID)do
-			local start, duration, enable = GetContainerItemCooldown(bagID, slotID)
-			if(bag[slotID]) then
-				CooldownFrame_SetTimer(bag[slotID].cooldown, start, duration, enable)
-				if duration > 0 and enable == 0 then
-					SetItemButtonTextureVertexColor(bag[slotID], 0.4, 0.4, 0.4)
-				else
-					SetItemButtonTextureVertexColor(bag[slotID], 1, 1, 1)
+	for _, bagID in ipairs(self.BagIDs) do
+		if self.Bags[bagID] then
+			for slotID = 1, GetContainerNumSlots(bagID)do
+				local start, duration, enable = GetContainerItemCooldown(bagID, slotID)
+				if(self.Bags[bagID][slotID]) then
+					CooldownFrame_SetTimer(self.Bags[bagID][slotID].cooldown, start, duration, enable)
+					if duration > 0 and enable == 0 then
+						SetItemButtonTextureVertexColor(self.Bags[bagID][slotID], 0.4, 0.4, 0.4)
+					else
+						SetItemButtonTextureVertexColor(self.Bags[bagID][slotID], 1, 1, 1)
+					end
 				end
 			end
 		end
@@ -638,7 +640,11 @@ local ContainerFrame_UpdateLayout = function(self)
 				end
 				bagSlot.icon:SetAllPointsIn()
 				bagSlot.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
-
+				-- hooksecurefunc(bagSlot.icon, "SetTexture", function(self)
+				-- 	if(DEBUG_BAGS) then
+				-- 		print(self:GetParent():GetName())
+				-- 	end
+				-- end)
 				hooksecurefunc(bagSlot, "UpdateTooltip", BagMenu_OnEnter)
 				bagSlot:HookScript("OnLeave", BagMenu_OnLeave)

@@ -1206,7 +1212,7 @@ local Container_OnEvent = function(self, event, ...)
 	elseif(event == "BAG_UPDATE_COOLDOWN") then
 		self:RefreshCooldowns()
 	elseif(event == "PLAYERBANKSLOTS_CHANGED") then
-		self:RefreshBags()
+		self:RefreshBags();
 	elseif(event == "PLAYERREAGENTBANKSLOTS_CHANGED") then
 		local slotID = ...
 		local container = _G["SVUI_ReagentContainerFrame"]
@@ -1989,6 +1995,8 @@ function MOD:Load()
 	hooksecurefunc("BackpackTokenFrame_Update", self.RefreshTokens)
 	hooksecurefunc("ContainerFrameItemButton_OnModifiedClick", _hook_OnModifiedClick)

+	--hooksecurefunc("BankFrameItemButton_Update", function(button) print(button:GetName()) end)
+
 	self:RegisterEvent("BANKFRAME_OPENED")
 	self:RegisterEvent("BANKFRAME_CLOSED")
 	self:RegisterEvent("INVENTORY_SEARCH_UPDATE")
@@ -1999,4 +2007,5 @@ function MOD:Load()
 	self:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED")

 	StackSplitFrame:SetFrameStrata("DIALOG")
+	DEBUG_BAGS = true;
 end
\ No newline at end of file
diff --git a/Interface/AddOns/SVUI/packages/bar/SVBar.lua b/Interface/AddOns/SVUI/packages/bar/SVBar.lua
index ec57338..d3622a5 100644
--- a/Interface/AddOns/SVUI/packages/bar/SVBar.lua
+++ b/Interface/AddOns/SVUI/packages/bar/SVBar.lua
@@ -450,8 +450,8 @@ function MOD:SetBarConfigData(bar)
 	local thisBinding = bar.binding;
 	local buttonList = bar.buttons;
 	local config = bar.config
-	config.hideElements.macro = db.macrotext;
-	config.hideElements.hotkey = db.hotkeytext;
+	config.hideElements.macro = (not db.macrotext);
+	config.hideElements.hotkey = (not db.hotkeytext);
 	config.showGrid = db.showGrid;
 	config.clickOnDown = db.keyDown;
 	config.colors.range = db.unc
diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/bar.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/bar.lua
index 871029b..29f3444 100644
--- a/Interface/AddOns/SVUI_ConfigOMatic/components/bar.lua
+++ b/Interface/AddOns/SVUI_ConfigOMatic/components/bar.lua
@@ -211,7 +211,8 @@ local function BarConfigLoader()
 							name = L["Restore Defaults"],
 							desc = L["Restore default visibility attributes for this bar"],
 							func = function()
-								SV:ResetData("SVBar", "Bar"..d, "customVisibility")
+								--SV:ResetData("SVBar", "Bar"..d, "customVisibility")
+								SV.db.SVBar["Bar"..d].customVisibility = SV.defaults.SVBar["Bar"..d].customVisibility;
 								MOD:UpdateBarPagingDefaults();
 								MOD:RefreshBar("Bar"..d)
 							end