Quantcast

monk and hunter update

Steven Jackson [01-04-15 - 00:50]
monk and hunter update
Filename
Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua
Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua
Interface/AddOns/SVUI/packages/quest/components/popups.lua
diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua
index a6b0025..9641835 100644
--- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua
+++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_DrunkenMaster/oUF_DrunkenMaster.lua
@@ -110,7 +110,7 @@ local function getStaggerAmount()
 end

 local Update = function(self, event, unit)
-	if(self.unit ~= unit) then return end
+	if(unit and unit ~= self.unit) then return end
 	local stagger = self.DrunkenMaster
 	if(stagger.PreUpdate) then
 		stagger:PreUpdate()
@@ -131,7 +131,11 @@ local Update = function(self, event, unit)
 	local staggerPercent = staggerTotal / maxHealth * 100
 	local currentStagger = floor(staggerPercent)
 	stagger:SetMinMaxValues(0, 100)
-	stagger:SetStatusBarColor(unpack(brewColor))
+	if(staggerPercent == 0) then
+		stagger:SetStatusBarColor(unpack(DEFAULT_BREW_COLOR))
+	else
+		stagger:SetStatusBarColor(unpack(brewColor))
+	end
 	stagger:SetValue(staggerPercent)

 	local icon = stagger.icon
@@ -144,59 +148,16 @@ local Update = function(self, event, unit)
 	end
 end

-local UpdateFromLog = function(self, event, ...)
-	local stagger = self.DrunkenMaster
-	local destName = select(9, ...)
-	if destName and UnitIsUnit(destName, "player") then
-		local subevent = select(2, ...)
-		local spellId = select(12, ...)
-		if (subevent:sub(1, 10) == "SPELL_AURA" and STAGGER_DEBUFFS[spellId]) or (subevent == "SPELL_PERIODIC_DAMAGE" and spellId == 124255) then
-			if(stagger.PreUpdate) then
-				stagger:PreUpdate()
-			end
-			local staggering = getStaggerAmount()
-			if staggering == 0 then
-				stagger:SetValue(0)
-				return
-			end
-
-			local health = UnitHealth("player")
-			local maxHealth = UnitHealthMax("player")
-			local staggerTotal = UnitStagger("player")
-			if staggerTotal == 0 and staggering > 0 then
-				staggerTotal = staggering * 10
-			end
-
-			local staggerPercent = staggerTotal / maxHealth * 100
-			local currentStagger = floor(staggerPercent)
-			stagger:SetMinMaxValues(0, 100)
-			stagger:SetStatusBarColor(unpack(brewColor))
-			stagger:SetValue(staggerPercent)
-
-			local icon = stagger.icon
-			if(icon) then
-				icon:SetVertexColor(unpack(staggerColor))
-			end
-
-			if(stagger.PostUpdate) then
-				stagger:PostUpdate(maxHealth, currentStagger, staggerPercent)
-			end
-		end
-	end
-end
-
-local Visibility = function(self, event, ...)
+local Visibility = function(self, ...)
 	if(STANCE_OF_THE_STURY_OX_ID ~= GetShapeshiftFormID() or UnitHasVehiclePlayerFrameUI("player")) then
 		if self.DrunkenMaster:IsShown() then
 			self.DrunkenMaster:Hide()
-			--self:UnregisterEvent('UNIT_AURA', Update)
-			self:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED', UpdateFromLog)
+			self:UnregisterEvent('UNIT_AURA', Update)
 		end
 	else
 		self.DrunkenMaster:Show()
-		--self:RegisterEvent('UNIT_AURA', Update)
-		self:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED', UpdateFromLog)
-		return Update(self, event, ...)
+		self:RegisterEvent('UNIT_AURA', Update)
+		return Update(self, ...)
 	end
 end

@@ -238,8 +199,7 @@ local function Disable(self)
 	local element = self.DrunkenMaster
 	if(element) then
 		element:Hide()
-		--self:UnregisterEvent('UNIT_AURA', Update)
-		self:UnregisterEvent('COMBAT_LOG_EVENT_UNFILTERED', Update)
+		self:UnregisterEvent('UNIT_AURA', Update)
 		self:UnregisterEvent('UNIT_DISPLAYPOWER', Path)
 		self:UnregisterEvent('UPDATE_SHAPESHIFT_FORM', Path)

diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua
index 2b5363d..15fafd8 100644
--- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua
+++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HunterTraps/oUF_HunterTraps.lua
@@ -103,14 +103,14 @@ local Update = function(self, event, ...)
 	end
 	if(spellID) then
 		name = GetSpellInfo(spellID)
-		start = GetSpellCooldown(spellID)
+		start, isReady = GetSpellCooldown(spellID)
 		duration = GetSpellBaseCooldown(spellID)
 	end

 	if bar:IsShown() then
 		for i = 1, 3 do
 			--bar[i]:SetStatusBarColor(unpack(TRAP_COLORS[i]))
-			if(name and TRAP_IDS[i] == name) then
+			if(name and TRAP_IDS[i] == name and isReady == 1) then
 				bar[i]:Show()
 				if((start and start > 0) and (duration and duration > 0)) then
 					bar[i]:SetMinMaxValues(0, duration)
diff --git a/Interface/AddOns/SVUI/packages/quest/components/popups.lua b/Interface/AddOns/SVUI/packages/quest/components/popups.lua
index e0afbd2..ec0df4c 100644
--- a/Interface/AddOns/SVUI/packages/quest/components/popups.lua
+++ b/Interface/AddOns/SVUI/packages/quest/components/popups.lua
@@ -75,9 +75,9 @@ local PopUpButton_OnClick = function(self, button)
 	if(questIndex and (questIndex ~= 0) and self.PopUpType) then
 		local questID = select(8, GetQuestLogTitle(questIndex));
 		if(self.PopUpType == "OFFER") then
-			ShowQuestOffer(questID);
+			ShowQuestOffer(questIndex);
 		else
-			ShowQuestComplete(questID);
+			ShowQuestComplete(questIndex);
 		end
 		MOD.Headers["Popups"]:RemovePopup(questID)
 	end
@@ -102,7 +102,7 @@ local GetPopUpRow = function(self, index)
 		row:SetHeightToScale(LARGE_ROW_HEIGHT);
 		row.Button = CreateFrame("Button", nil, row)
 		row.Button:SetPointToScale("TOPLEFT", row, "TOPLEFT", 0, 0);
-		row.Button:SetPointToScale("BOTTOMRIGHT", row, "BOTTOMRIGHT", 0, 8);
+		row.Button:SetPointToScale("BOTTOMRIGHT", row, "BOTTOMRIGHT", 0, 0);
 		row.Button:SetStylePanel("Framed", "FramedTop")
 		row.Button:SetPanelColor("yellow")
 		row.Button:SetID(0)
@@ -144,6 +144,7 @@ local SetPopupRow = function(self, index, title, popUpType, questID, questLogInd
 	row.Badge.Icon:SetTexture(icon);
 	row.Badge:SetAlpha(1);
 	row.Button:Enable();
+	row.Button.PopUpType = popUpType;
 	row.Button:SetID(questLogIndex);
 	row:SetHeightToScale(LARGE_ROW_HEIGHT);
 	row:FadeIn();