Quantcast

5.4.157

Steven Jackson [01-06-15 - 06:26]
5.4.157
Filename
Interface/AddOns/SVUI/framework/widgets/widget_superbutton.lua
Interface/AddOns/SVUI/packages/bar/SVBar.lua
Interface/AddOns/SVUI/packages/chat/SVChat.lua
Interface/AddOns/SVUI/packages/quest/components/active.lua
Interface/AddOns/SVUI/packages/quest/components/button.lua
Interface/AddOns/SVUI/packages/quest/components/quests.lua
diff --git a/Interface/AddOns/SVUI/framework/widgets/widget_superbutton.lua b/Interface/AddOns/SVUI/framework/widgets/widget_superbutton.lua
index c199135..3e53e88 100644
--- a/Interface/AddOns/SVUI/framework/widgets/widget_superbutton.lua
+++ b/Interface/AddOns/SVUI/framework/widgets/widget_superbutton.lua
@@ -109,17 +109,17 @@ local SuperItemButton_OnEnter = function(self)
 end

 local SuperButton_OnShow = function(self)
-	SuperButton.isActive = true;
+	self:FadeIn()
 	if(self.Artwork) then
-		self.Artwork:SetAlpha(1)
+		self.Artwork:SetTexture(self.ArtFile or [[Interface\ExtraButton\Smash]]);
+		self.Artwork:FadeIn()
 	end
-	self:FadeIn()
 end

 local SuperButton_OnHide = function(self)
-	SuperButton.isActive = false;
 	if(self.Artwork) then
-		self.Artwork:SetAlpha(0)
+		self.Artwork:FadeOut()
+		self.Artwork:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\EMPTY]]);
 	end
 end

diff --git a/Interface/AddOns/SVUI/packages/bar/SVBar.lua b/Interface/AddOns/SVUI/packages/bar/SVBar.lua
index bc9dd84..e544d50 100644
--- a/Interface/AddOns/SVUI/packages/bar/SVBar.lua
+++ b/Interface/AddOns/SVUI/packages/bar/SVBar.lua
@@ -86,12 +86,20 @@ end

 local Bar_OnEnter = function(self)
 	if(self._fade) then
+		for i=1, self.maxButtons do
+			self.buttons[i].cd:SetSwipeColor(0, 0, 0, 1)
+			self.buttons[i].cd:SetDrawBling(true)
+		end
 		self:FadeIn(0.2, self:GetAlpha(), self._alpha)
 	end
 end

 local Bar_OnLeave = function(self)
 	if(self._fade) then
+		for i=1, self.maxButtons do
+			self.buttons[i].cd:SetSwipeColor(0, 0, 0, 0)
+			self.buttons[i].cd:SetDrawBling(false)
+		end
 		self:FadeOut(1, self:GetAlpha(), 0)
 	end
 end
@@ -160,6 +168,8 @@ local function SaveActionButton(parent)
 	local button = parent:GetName()
 	local cooldown = _G[button.."Cooldown"]
 	cooldown.SizeOverride = SV.db.SVBar.cooldownSize
+	-- cooldown:SetSwipeColor(0, 0, 0, 0)
+	-- cooldown:SetDrawBling(false)
 	if(not parent.cd) then
 		parent.cd = cooldown;
 	end
@@ -272,7 +282,6 @@ local function ModifyActionButton(parent)
 	end
 	if icon then
 		icon:SetTexCoord(.1,.9,.1,.9)
-		--icon:SetGradient("VERTICAL",.5,.5,.5,1,1,1)
 		icon:SetAllPointsIn(button)
 	end
 	if shine then shine:SetAllPoints()end
@@ -284,9 +293,7 @@ local function ModifyActionButton(parent)
     	hotkey:SetJustifyV("TOP")
 		hotkey:SetShadowOffset(1,-1)
 	end
-	-- if parent.style then
-	-- 	parent.style:SetDrawLayer('BACKGROUND',-7)
-	-- end
+
 	parent.FlyoutUpdateFunc = SetFlyoutButton;
 	MOD:FixKeybindText(parent)
 end
@@ -536,23 +543,15 @@ do
 	local Button_OnEnter = function(self)
 		local parent = self:GetParent()
 		if parent and parent._fade then
-			if(self.cd) then
-				self.cd:SetSwipeColor(0, 0, 0, 1)
-				self.cd:SetDrawBling(true)
-			end
-			parent:FadeIn(0.2, parent:GetAlpha(), parent._alpha)
+			Bar_OnEnter(parent)
 		end
 	end

 	local Button_OnLeave = function(self)
-		local parent = self:GetParent()
 		GameTooltip:Hide()
+		local parent = self:GetParent()
 		if parent and parent._fade then
-			if(self.cd) then
-				self.cd:SetSwipeColor(0, 0, 0, 0)
-				self.cd:SetDrawBling(false)
-			end
-			parent:FadeOut(1, parent:GetAlpha(), 0)
+			Bar_OnLeave(parent)
 		end
 	end

@@ -562,6 +561,7 @@ do
 		local hideByScale = id == "Pet" and true or false;
 		local isStance = id == "Stance" and true or false;
 		local button,lastButton,lastRow;
+
 		for i=1, max do
 			button = bar.buttons[i]
 			lastButton = bar.buttons[i - 1]
@@ -575,18 +575,6 @@ do
 				button:SetAttribute("unit2", "player")
 			end

-			if(bar._fade) then
-				if button.cd then
-					button.cd:SetSwipeColor(0, 0, 0, 0)
-					button.cd:SetDrawBling(false)
-				end
-			else
-				if button.cd then
-					button.cd:SetSwipeColor(0, 0, 0, 1)
-					button.cd:SetDrawBling(true)
-				end
-			end
-
 			if(not button._hookFade) then
 				button:HookScript('OnEnter', Button_OnEnter)
 				button:HookScript('OnLeave', Button_OnLeave)
@@ -656,7 +644,9 @@ do
 	      		ModifyActionButton(button);
 	      		SaveActionButton(button);
 	    	end
-		end
+		end
+
+		if(bar._fade) then Bar_OnLeave(bar) end
 	end

 	local function _getPage(bar, defaultPage, condition)
@@ -701,7 +691,7 @@ do

 		if max < cols then cols = max end
 		if rows < 1 then rows = 1 end
-
+		bar.maxButtons = max;
 		bar:SetWidthToScale(space  +  (size  *  cols)  +  ((space  *  (cols - 1))  +  space));
 		bar:SetHeightToScale((space  +  (size  *  rows))  +  ((space  *  (rows - 1))  +  space));
 		bar.backdrop:ClearAllPoints()
@@ -715,11 +705,8 @@ do
 			bar.backdrop:Hide()
 		end

-		if(not bar._hookFade) then
-			bar:HookScript('OnEnter', Bar_OnEnter)
-			bar:HookScript('OnLeave', Bar_OnLeave)
-			bar._hookFade = true;
-		end
+		bar:SetScript('OnEnter', Bar_OnEnter)
+		bar:SetScript('OnLeave', Bar_OnLeave)

 		if(db.mouseover == true) then
 			bar:SetAlpha(0)
diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua
index bdb0c98..9421d81 100644
--- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua
+++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua
@@ -291,7 +291,12 @@ do
 		if not internalTest then text = text:gsub("(%s?)([%w_-]+%.?[%w_-]+%.[%w_-]+:%d%d%d?%d?%d?)(%s?)", _parse) end
 		if not internalTest then text = text:gsub("(%s?)(%a+://[%w_/%.%?%%=~&-'%-]+)(%s?)", _parse) end
 		if not internalTest then text = text:gsub("(%s?)(www%.[%w_/%.%?%%=~&-'%-]+)(%s?)", _parse) end
-		if not internalTest then text = text:gsub("(%s?)([_%w-%.~-]+@[_%w-]+%.[_%w-%.]+)(%s?)", _parse) end
+		if not internalTest then text = text:gsub("(%s?)([_%w-%.~-]+@[_%w-]+%.[_%w-%.]+)(%s?)", _parse) end
+		if(self.___isFaded) then
+			for i=1, 8 do
+				text = text:gsub("|TInterface\\TargetingFrame\\UI%-RaidTargetingIcon_"..i..":0|t", "")
+			end
+		end
 		self.TempAddMessage(self, _concatTimeStamp(text), ...)
 	end

@@ -1071,6 +1076,29 @@ local function removeIconFromLine(text)
 	return text
 end

+function MOD:FadeLines(frame)
+	for i = select("#", frame:GetRegions()), 1, -1 do
+		local region = select(i, frame:GetRegions())
+		if region:GetObjectType() == "FontString" then
+			local line = tostring(region:GetText())
+			local newtext = removeIconFromLine(line)
+			region:SetText(newtext)
+			region:SetAlpha(0)
+		end
+	end
+	frame.___isFaded = true;
+end
+
+function MOD:ShowLines(frame)
+	for i = select("#", frame:GetRegions()), 1, -1 do
+		local region = select(i, frame:GetRegions())
+		if region:GetObjectType() == "FontString" then
+			region:SetAlpha(1)
+		end
+	end
+	frame.___isFaded = nil;
+end
+
 function MOD:GetLines(...)
 	local index = 1
 	for i = select("#", ...), 1, -1 do
@@ -1086,13 +1114,9 @@ end

 function MOD:CopyChat(frame)
 	if not SVUI_CopyChatFrame:IsShown() then
-		--local _, fontSize = FCF_GetChatWindowInfo(frame:GetID());
-		--if fontSize < 10 then fontSize = 12 end
-		--FCF_SetChatWindowFontSize(frame, frame, 0.01)
 		SVUI_CopyChatFrame:Show()
 		local lineCt = self:GetLines(frame:GetRegions())
 		local text = tconcat(COPY_LINES, "\n", 1, lineCt)
-		--FCF_SetChatWindowFontSize(frame, frame, fontSize)
 		SVUI_CopyChatFrameEditBox:SetText(text)
 	else
 		SVUI_CopyChatFrame:Hide()
@@ -1101,12 +1125,14 @@ end

 local function DockFadeInChat()
 	local activeChatFrame = FCFDock_GetSelectedWindow(GENERAL_CHAT_DOCK)
+	MOD:ShowLines(activeChatFrame)
 	activeChatFrame:FadeIn(0.2, activeChatFrame:GetAlpha(), 1)
 end
 SV.Events:On("DOCKS_FADE_IN", "DockFadeInChat", DockFadeInChat);

 local function DockFadeOutChat()
 	local activeChatFrame = FCFDock_GetSelectedWindow(GENERAL_CHAT_DOCK)
+	MOD:FadeLines(activeChatFrame)
 	activeChatFrame:FadeOut(2, activeChatFrame:GetAlpha(), 0, true)
 end
 SV.Events:On("DOCKS_FADE_OUT", "DockFadeOutChat", DockFadeOutChat);
diff --git a/Interface/AddOns/SVUI/packages/quest/components/active.lua b/Interface/AddOns/SVUI/packages/quest/components/active.lua
index cc53584..e540c5f 100644
--- a/Interface/AddOns/SVUI/packages/quest/components/active.lua
+++ b/Interface/AddOns/SVUI/packages/quest/components/active.lua
@@ -171,6 +171,11 @@ local UnsetActiveData = function(self, bypass)
 	self:SetHeight(1);
 	block:SetAlpha(0);
 	self:SetAlpha(0);
+	if(MOD.QuestItem and MOD.QuestItem:IsShown()) then
+		MOD.QuestItem.CurrentQuest = 0;
+		MOD.QuestItem.Artwork:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\EMPTY]]);
+		MOD.QuestItem:RemoveAbility();
+	end
 	if(not bypass and MOD.Headers["Quests"]) then
 		MOD:UpdateObjectives('FORCED_UPDATE')
 	end
diff --git a/Interface/AddOns/SVUI/packages/quest/components/button.lua b/Interface/AddOns/SVUI/packages/quest/components/button.lua
index 95f90a9..aa97152 100644
--- a/Interface/AddOns/SVUI/packages/quest/components/button.lua
+++ b/Interface/AddOns/SVUI/packages/quest/components/button.lua
@@ -114,10 +114,9 @@ local UpdateButton = function(self)
 	if(closestLink) then
 		self.CurrentQuest = closestIndex;
 		self:SetAbility(closestLink, closestTexture, closestQuest, closestLevel, closestTexture, closestID, closestIndex, closestCount, closestDuration, closestExpiration, closestComplete);
-		self.Artwork:SetTexture([[Interface\ExtraButton\Smash]]);
+		self.ArtFile = [[Interface\ExtraButton\Smash]];
 	elseif(self:IsShown() and (self.CurrentQuest ~= MOD.CurrentQuest)) then
 		self.CurrentQuest = 0;
-		self.Artwork:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\EMPTY]]);
 		self:RemoveAbility();
 	end
 end
diff --git a/Interface/AddOns/SVUI/packages/quest/components/quests.lua b/Interface/AddOns/SVUI/packages/quest/components/quests.lua
index a938b9b..f1a123f 100644
--- a/Interface/AddOns/SVUI/packages/quest/components/quests.lua
+++ b/Interface/AddOns/SVUI/packages/quest/components/quests.lua
@@ -117,18 +117,12 @@ local function UpdateCachedQuests(needsSorting)
 		if(questID) then  -- and (not USED_QUESTIDS[questID])
 			local distanceSq, onContinent = GetDistanceSqToQuest(questLogIndex)
 			local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle(questLogIndex)
+			local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questLogIndex)
 			if(not CACHED_QUESTS[questID]) then
-				local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questLogIndex)
-				-- local mapID, floorNumber = 0,0
-				-- if(not WorldMapFrame:IsShown()) then
-				-- 	mapID, floorNumber = GetQuestWorldMapAreaID(questID)
-				-- else
-				-- 	WORLDMAP_UPDATE = true;
-				-- end
-
 				CACHED_QUESTS[questID] = {i, title, level, texture, questID, questLogIndex, numObjectives, duration, elapsed, completed, questType, link};
 			else
-				CACHED_QUESTS[questID][1] = i;	            -- args: quest objective count
+				CACHED_QUESTS[questID][1] = i;	            -- args: quest watch index
+				CACHED_QUESTS[questID][4] = texture;	    -- args: quest item icon
 				CACHED_QUESTS[questID][7] = numObjectives;	-- args: quest objective count
 				CACHED_QUESTS[questID][8] = duration;		-- args: quest timer duration
 				CACHED_QUESTS[questID][9] = elapsed;		-- args: quest timer elapsed