Quantcast

updates

Steven Jackson [05-15-15 - 01:29]
updates
Filename
SVUI_!Core/setup/presets.lua
SVUI_!Core/system/_reports/friends.lua
SVUI_QuestTracker/components/achievements.lua
diff --git a/SVUI_!Core/setup/presets.lua b/SVUI_!Core/setup/presets.lua
index 429ccc3..90f7866 100644
--- a/SVUI_!Core/setup/presets.lua
+++ b/SVUI_!Core/setup/presets.lua
@@ -942,7 +942,7 @@ local function LoadPageData()
 			["REQUIRED"] = "UnitFrames",
 			["SubTitle"] = AURAS.." "..SETTINGS,

-			["Desc1"] = L["Select an aura layout. \"Icons\" will display only icons and aurabars won't be used. \"Bars\" will display only aurabars and icons won't be used (duh). \"The Works!\" does just what it says.... icons, bars and awesomeness."],
+			["Desc1"] = L["Select an aura layout. \"Icons\" will display only icons and aurabars won't be used. \"Bars\" will display only aurabars and icons won't be used (duh)."],
 			["Desc2"] = L["If you have an aura that you don't want to display simply hold down shift and right click the icon for it to suffer a painful death."],
 			["Desc3"] = L["CHOOSE_OR_DIE"],

diff --git a/SVUI_!Core/system/_reports/friends.lua b/SVUI_!Core/system/_reports/friends.lua
index 16e20b0..8e661bf 100644
--- a/SVUI_!Core/system/_reports/friends.lua
+++ b/SVUI_!Core/system/_reports/friends.lua
@@ -31,7 +31,7 @@ local gmatch, gsub = string.gmatch, string.gsub;
 --[[ MATH METHODS ]]--
 local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round;  -- Basic
 --[[ TABLE METHODS ]]--
-local wipe, sort = table.wipe, table.sort;
+local wipe, tsort = table.wipe, table.sort;
 --[[
 ##########################################################
 GET ADDON DATA
@@ -99,7 +99,7 @@ do
   	end
   end

-  local function _update(COUNT_GENERAL, COUNT_BNET)
+  local function _update()
     local generalUpdated, bnetUpdated = false, false;

     if(COUNT_GENERAL and (COUNT_GENERAL > 0)) then
@@ -387,7 +387,6 @@ Report.OnEnter = function(self)
 		UPDATE_REQUIRED = false;
 	end

-	local DATA = FRIEND_DATA;
 	if(ONLINE_TOTAL == 0) then return end

 	local zonec, classc, levelc, realmc;
@@ -398,7 +397,7 @@ Report.OnEnter = function(self)
 	local currentRealm = GetRealmName();

 	if(ONLINE_GENERAL > 0) then
-		local cache, addSpacer = DATA.General, false;
+		local cache, addSpacer = FRIEND_DATA.General, false;

 		for i = 1, #cache do
 			local friend = cache[i];
@@ -422,7 +421,7 @@ Report.OnEnter = function(self)

 	if(ONLINE_BNET > 0) then

-		for client, cache in pairs(DATA) do
+		for client, cache in pairs(FRIEND_DATA) do
 			local GROUP_LABEL = BATTLENET_LABELS[client];

 			if(GROUP_LABEL and (#cache > 0)) then
diff --git a/SVUI_QuestTracker/components/achievements.lua b/SVUI_QuestTracker/components/achievements.lua
index eb92427..774234d 100644
--- a/SVUI_QuestTracker/components/achievements.lua
+++ b/SVUI_QuestTracker/components/achievements.lua
@@ -32,24 +32,6 @@ local CreateFrame           = _G.CreateFrame;
 local InCombatLockdown      = _G.InCombatLockdown;
 local GameTooltip           = _G.GameTooltip;
 local hooksecurefunc        = _G.hooksecurefunc;
-local IsAltKeyDown          = _G.IsAltKeyDown;
-local IsShiftKeyDown        = _G.IsShiftKeyDown;
-local IsControlKeyDown      = _G.IsControlKeyDown;
-local IsModifiedClick       = _G.IsModifiedClick;
-local PlaySound             = _G.PlaySound;
-local PlaySoundFile         = _G.PlaySoundFile;
-local PlayMusic             = _G.PlayMusic;
-local StopMusic             = _G.StopMusic;
-local GetTime               = _G.GetTime;
-local C_Timer               = _G.C_Timer;
-local GetAchievementInfo 	= _G.GetAchievementInfo;
-local GetAchievementLink 	= _G.GetAchievementLink;
-local GetTrackedAchievements  		= _G.GetTrackedAchievements;
-local GetAchievementNumCriteria  	= _G.GetAchievementNumCriteria;
-local GetAchievementCriteriaInfo  	= _G.GetAchievementCriteriaInfo;
-local CRITERIA_TYPE_ACHIEVEMENT  	= _G.CRITERIA_TYPE_ACHIEVEMENT;
-local TRACKER_HEADER_ACHIEVEMENTS  	= _G.TRACKER_HEADER_ACHIEVEMENTS;
-local EVALUATION_TREE_FLAG_PROGRESS_BAR = _G.EVALUATION_TREE_FLAG_PROGRESS_BAR;
 --[[
 ##########################################################
 GET ADDON DATA
@@ -84,7 +66,9 @@ SCRIPT HANDLERS
 local RowButton_OnEnter = function(self, ...)
 	GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT", 0, ROW_HEIGHT)
 	GameTooltip:ClearLines()
-	GameTooltip:AddLine("View this in the achievements window.")
+	GameTooltip:AddDoubleLine("[Left-Click]", "View this in the achievements window.", 0, 1, 0, 1, 1, 1)
+	GameTooltip:AddLine(" ")
+	GameTooltip:AddDoubleLine("[Right-Click]", "Remove this achievement from the tracker.", 0, 1, 0, 1, 1, 1)
 	GameTooltip:Show()
 end

@@ -105,7 +89,7 @@ local ViewButton_OnClick = function(self, button)
 			if(not AchievementFrame ) then
 				AchievementFrame_LoadUI();
 			end
-			if(IsModifiedClick("QUESTWATCHTOGGLE") ) then
+			if(IsModifiedClick("QUESTWATCHTOGGLE") or (button and button == "RightButton")) then
 				AchievementObjectiveTracker_UntrackAchievement(self, achievementID);
 			elseif(not AchievementFrame:IsShown()) then
 				AchievementFrame_ToggleAchievementFrame();
@@ -120,6 +104,35 @@ local ViewButton_OnClick = function(self, button)
 		end
 	end
 end
+
+local BadgeButton_OnClick = function(self, button)
+	local achievementID = self.Link:GetID();
+	if(achievementID and (achievementID ~= 0)) then
+		if(IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow()) then
+			local achievementLink = GetAchievementLink(achievementID);
+			if(achievementLink) then
+				ChatEdit_InsertLink(achievementLink);
+			end
+		else
+			CloseDropDownMenus();
+			if(not AchievementFrame ) then
+				AchievementFrame_LoadUI();
+			end
+			if(IsModifiedClick("QUESTWATCHTOGGLE") or (button and button == "RightButton")) then
+				AchievementObjectiveTracker_UntrackAchievement(self.Link, achievementID);
+			elseif(not AchievementFrame:IsShown()) then
+				AchievementFrame_ToggleAchievementFrame();
+				AchievementFrame_SelectAchievement(achievementID);
+			else
+				if(AchievementFrameAchievements.selection ~= achievementID) then
+					AchievementFrame_SelectAchievement(achievementID);
+				else
+					AchievementFrame_ToggleAchievementFrame();
+				end
+			end
+		end
+	end
+end
 --[[
 ##########################################################
 TRACKER FUNCTIONS
@@ -150,6 +163,15 @@ local GetAchievementRow = function(self, index)
 		row.Badge.Icon:SetAllPoints(row.Badge);
 		row.Badge.Icon:SetTexture(LINE_ACHIEVEMENT_ICON)
 		row.Badge.Icon:SetTexCoord(unpack(_G.SVUI_ICON_COORDS))
+		row.Badge.Button = CreateFrame("Button", nil, row.Badge)
+		row.Badge.Button:SetAllPoints(row.Badge);
+		row.Badge.Button:SetStyle("LiteButton")
+		row.Badge.Button:SetID(0)
+		row.Badge.Button.Icon = row.Badge.Icon;
+		row.Badge.Button:RegisterForClicks("LeftButtonUp", "RightButtonUp")
+		row.Badge.Button:SetScript("OnClick", BadgeButton_OnClick)
+		row.Badge.Button:SetScript("OnEnter", RowButton_OnEnter)
+		row.Badge.Button:SetScript("OnLeave", RowButton_OnLeave)

 		row.Header = CreateFrame("Frame", nil, row)
 		row.Header:SetPoint("TOPLEFT", row.Badge, "TOPRIGHT", 2, 0);
@@ -172,6 +194,8 @@ local GetAchievementRow = function(self, index)
 		row.Button:SetScript("OnEnter", RowButton_OnEnter)
 		row.Button:SetScript("OnLeave", RowButton_OnLeave)

+		row.Badge.Button.Link = row.Button
+
 		row.Objectives = MOD:NewObjectiveHeader(row);
 		row.Objectives:SetPoint("TOPLEFT", row, "BOTTOMLEFT", 0, 0);
 		row.Objectives:SetPoint("TOPRIGHT", row, "BOTTOMRIGHT", 0, 0);