Quantcast

small updates

Steven Jackson [03-15-15 - 23:25]
small updates
Filename
SVUI_!Core/system/_docklets/misc.lua
SVUI_!Core/system/api.lua
SVUI_!Core/system/misc.lua
SVUI_Chat/SVUI_Chat.lua
SVUI_CraftOMatic/components/archaeology.lua
SVUI_Inventory/SVUI_Inventory.lua
SVUI_Skins/components/blizzard/garrison.lua
SVUI_UnitFrames/elements/essentials.lua
diff --git a/SVUI_!Core/system/_docklets/misc.lua b/SVUI_!Core/system/_docklets/misc.lua
index 1718d33..f9977eb 100644
--- a/SVUI_!Core/system/_docklets/misc.lua
+++ b/SVUI_!Core/system/_docklets/misc.lua
@@ -137,8 +137,6 @@ local SetSpecSwapTooltip = function(self)
 	local otherText = "Inactive Spec";
 	if(currentGroup == 1) then
 		otherGroup = 2
-		activeText = "Inactive Spec";
-		otherText = "Active Spec";
 	end
 	local otherSpec = GetSpecialization(false, false, otherGroup);
 	local text2 = otherSpec and select(2, GetSpecializationInfo(otherSpec)) or "None"
diff --git a/SVUI_!Core/system/api.lua b/SVUI_!Core/system/api.lua
index f950325..55ac65f 100644
--- a/SVUI_!Core/system/api.lua
+++ b/SVUI_!Core/system/api.lua
@@ -1601,12 +1601,17 @@ MOD.Concepts["ItemButton"] = function(self, adjustable, frame, adjustedIcon, noS
     end
 end

-MOD.Concepts["PageButton"] = function(self, adjustable, frame, isVertical)
-    if(not frame or (frame and not frame:GetName()) or (frame and frame.Panel)) then return end
+MOD.Concepts["PageButton"] = function(self, adjustable, frame, isVertical, isLeft)
+    if((not frame) or (frame.Panel)) then return end

     local bName = frame:GetName()
-    local testName = bName:lower()
-    local leftDown = ((bName and testName:find('left')) or testName:find('prev') or testName:find('decrement')) or false
+    local leftDown;
+    if(bName) then
+        local testName = bName:lower()
+        leftDown = ((bName and testName:find('left')) or testName:find('prev') or testName:find('decrement')) or false
+    else
+        leftDown = isLeft or false
+    end

     RemoveTextures(frame)

diff --git a/SVUI_!Core/system/misc.lua b/SVUI_!Core/system/misc.lua
index fb09154..f097a17 100644
--- a/SVUI_!Core/system/misc.lua
+++ b/SVUI_!Core/system/misc.lua
@@ -28,6 +28,7 @@ local find          = string.find;
 local match         = string.match;
 local gsub          = string.gsub;
 local math 			= _G.math;
+local min 			= math.min;
 local cos, deg, rad, sin = math.cos, math.deg, math.rad, math.sin;
 local random 		= math.random;
 local wipe          = _G.wipe;
@@ -171,11 +172,20 @@ MERCHANT MAX STACK
 ]]--
 local BuyMaxStack = function(self, ...)
 	if ( IsAltKeyDown() ) then
-		local itemLink = GetMerchantItemLink(self:GetID())
+		local index = self:GetID()
+		local itemLink = GetMerchantItemLink(index)
 		if not itemLink then return end
+		local price = select(3, GetMerchantItemInfo(index))
 		local maxStack = select(8, GetItemInfo(itemLink))
+		local currencyCount = GetMerchantItemCostInfo(index)
 		if ( maxStack and maxStack > 1 ) then
-			BuyMerchantItem(self:GetID(), GetMerchantItemMaxStack(self:GetID()))
+			local maxAllowed = GetMerchantItemMaxStack(index);
+			if(currencyCount == 0) then
+				local canAfford = GetMoney() / maxStack;
+				BuyMerchantItem(index, min(maxAllowed,canAfford));
+			else
+				BuyMerchantItem(index, maxAllowed);
+			end
 		end
 	end
 end
diff --git a/SVUI_Chat/SVUI_Chat.lua b/SVUI_Chat/SVUI_Chat.lua
index a1049fe..a030f2c 100644
--- a/SVUI_Chat/SVUI_Chat.lua
+++ b/SVUI_Chat/SVUI_Chat.lua
@@ -311,7 +311,7 @@ do
 				internalTest = true
 			end

-			if(CHAT_ABBREV) then
+			if((not internalTest) and CHAT_ABBREV) then
 				local channelData, channelID, channelName = message:match(CHANNEL_PATTERN_PLUS)
 				if(channelData) then
 					local shortName = CHANNEL_STRINGS[channelName] or CHANNEL_STRINGS[channelName:lower()] or channelName:sub(1, 2);
diff --git a/SVUI_CraftOMatic/components/archaeology.lua b/SVUI_CraftOMatic/components/archaeology.lua
index 088a623..f5f6782 100644
--- a/SVUI_CraftOMatic/components/archaeology.lua
+++ b/SVUI_CraftOMatic/components/archaeology.lua
@@ -127,11 +127,13 @@ local function UpdateArtifactBars(index)
 		bar["bar"]:SetMinMaxValues(0, potential)
 		bar["bar"]:SetValue(actual)

-		if cache["numKeysockets"] and cache["numKeysockets"] > 0 then
-			bar["solve"].text:SetText(SOLVE.." ["..cache["numKeystones"].."/"..cache["numKeysockets"].."]")
-		else
-			bar["solve"].text:SetText(SOLVE)
+		local solveText = SOLVE
+		if (cache["numKeystones"] and cache["numKeystones"] > 0) then
+			if (cache["numKeysockets"] and cache["numKeysockets"] > 0) then
+				solveText = SOLVE.." ["..cache["numKeystones"] .. "/" .. cache["numKeysockets"].."]"
+			end
 		end
+		bar["solve"].text:SetText(solveText)

 		if keystoneBonus > 0 then
 			bar["progress"]:SetText(format("|cff00c1ea%d|r/%d", cache["progress"] + keystoneBonus, cache["total"]))
@@ -364,14 +366,9 @@ function PLUGIN.Archaeology:Enable()

 	PlaySoundFile("Sound\\Item\\UseSounds\\UseCrinklingPaper.wav")
 	PLUGIN.ModeAlert:SetBackdropColor(0.25, 0.52, 0.1)
-	if(not IsSpellKnown(80451)) then
-		PLUGIN:ModeLootLoader("Archaeology", "WTF is Archaeology?", "You don't know archaeology! \nPicking up a rock and telling everyone that \nyou found a fossil is cute, BUT WRONG!! \nGo find someone who can train you to do this job.");
-		PLUGIN.TitleWindow:Clear();
-		PLUGIN.TitleWindow:AddMessage("WTF is Archaeology?");
-		PLUGIN.LogWindow:Clear();
-		PLUGIN.LogWindow:AddMessage("You don't know archaeology! \nPicking up a rock and telling everyone that \nyou found a fossil is cute, BUT WRONG!! \nGo find someone who can train you to do this job.", 1, 1, 1);
-		PLUGIN.LogWindow:AddMessage(" ", 1, 1, 1);
-	else
+
+	local canArch = IsSpellKnown(80451)
+	if(canArch) then
 		ArchCrafting:Show()
 		local msg = GetTitleAndSkill()
 		if surveyIsKnown and CanScanResearchSite() then
@@ -385,6 +382,13 @@ function PLUGIN.Archaeology:Enable()
 		end
 		PLUGIN.TitleWindow:Clear();
 		PLUGIN.TitleWindow:AddMessage(msg);
+	else
+		PLUGIN:ModeLootLoader("Archaeology", "WTF is Archaeology?", "You don't know archaeology! \nPicking up a rock and telling everyone that \nyou found a fossil is cute, BUT WRONG!! \nGo find someone who can train you to do this job.");
+		PLUGIN.TitleWindow:Clear();
+		PLUGIN.TitleWindow:AddMessage("WTF is Archaeology?");
+		PLUGIN.LogWindow:Clear();
+		PLUGIN.LogWindow:AddMessage("You don't know archaeology! \nPicking up a rock and telling everyone that \nyou found a fossil is cute, BUT WRONG!! \nGo find someone who can train you to do this job.", 1, 1, 1);
+		PLUGIN.LogWindow:AddMessage(" ", 1, 1, 1);
 	end
 	EnableListener()
 	PLUGIN.ModeAlert:Show()
diff --git a/SVUI_Inventory/SVUI_Inventory.lua b/SVUI_Inventory/SVUI_Inventory.lua
index 8949967..f9bca9a 100644
--- a/SVUI_Inventory/SVUI_Inventory.lua
+++ b/SVUI_Inventory/SVUI_Inventory.lua
@@ -387,6 +387,7 @@ local SlotUpdate = function(self, slotID)
 			if(key) then
 				local journal = MOD.public[realmKey]["bags"][nameKey]
 				local id = GetContainerItemID(bagID, slotID)
+				-- GetItemCount(id, true)
 				local bagKey = tostring(bagID)
 				if not journal[bagKey] then
 					journal[bagKey] = {}
diff --git a/SVUI_Skins/components/blizzard/garrison.lua b/SVUI_Skins/components/blizzard/garrison.lua
index e47f454..5544cf7 100644
--- a/SVUI_Skins/components/blizzard/garrison.lua
+++ b/SVUI_Skins/components/blizzard/garrison.lua
@@ -522,6 +522,13 @@ local function LoadGarrisonStyle()
 		GarrisonCapacitiveDisplayFrame.StartWorkOrderButton:RemoveTextures(true)
 		GarrisonCapacitiveDisplayFrame.StartWorkOrderButton:SetStyle("Button")
 	end
+	if(GarrisonCapacitiveDisplayFrame.CreateAllWorkOrdersButton) then
+		GarrisonCapacitiveDisplayFrame.CreateAllWorkOrdersButton:RemoveTextures(true)
+		GarrisonCapacitiveDisplayFrame.CreateAllWorkOrdersButton:SetStyle("Button")
+		SV.API:Set("PageButton", GarrisonCapacitiveDisplayFrame.DecrementButton, false, true)
+		SV.API:Set("EditBox", GarrisonCapacitiveDisplayFrame.Count)
+		SV.API:Set("PageButton", GarrisonCapacitiveDisplayFrame.IncrementButton)
+	end

 	SV.API:Set("ScrollFrame", GarrisonLandingPageReportListListScrollFrameScrollBar)
 	SV.API:Set("ScrollFrame", GarrisonMissionFrameMissionsListScrollFrameScrollBar)
diff --git a/SVUI_UnitFrames/elements/essentials.lua b/SVUI_UnitFrames/elements/essentials.lua
index f2a4958..26e3641 100644
--- a/SVUI_UnitFrames/elements/essentials.lua
+++ b/SVUI_UnitFrames/elements/essentials.lua
@@ -579,10 +579,6 @@ local OverlayHealthUpdate = function(health, unit, min, max)
 		health.animation[1]:SetVertexColor(1, 0.1 * mu, 0, 0.5)
 	end

-	if(bg) then
-		bg:SetVertexColor(0,0,0,0)
-	end
-
 	if(health.overlayAnimation and not invisible) then
 		if(mu <= 0.25) then
 			health.animation[1]:SetAlpha(1)
@@ -596,8 +592,10 @@ end

 local RefreshHealthBar = function(self, overlay)
 	if(overlay) then
+		self.Health.bg:SetVertexColor(0, 0, 0, 0)
 		self.Health.PreUpdate = OverlayHealthUpdate;
 	else
+		self.Health.bg:SetVertexColor(0.4, 0.1, 0.1, 0.8)
 		self.Health.PreUpdate = nil;
 	end
 end