Quantcast

fixed castbar

Steven Jackson [08-27-14 - 00:57]
fixed castbar
Filename
Interface/AddOns/SVUI/libs/oUF/elements/castbar.lua
Interface/AddOns/SVUI/packages/unit/elements/castbar.lua
diff --git a/Interface/AddOns/SVUI/libs/oUF/elements/castbar.lua b/Interface/AddOns/SVUI/libs/oUF/elements/castbar.lua
index 2cf77a2..99d819b 100644
--- a/Interface/AddOns/SVUI/libs/oUF/elements/castbar.lua
+++ b/Interface/AddOns/SVUI/libs/oUF/elements/castbar.lua
@@ -5,7 +5,7 @@
 ]]
 local parent, ns = ...
 local oUF = ns.oUF
-
+local SuperVillain = SVUI[1]
 local updateSafeZone = function(self)
 	local sz = self.SafeZone
 	local width = self:GetWidth()
@@ -51,7 +51,7 @@ local UNIT_SPELLCAST_START = function(self, event, unit, spell)
 			castbar.duration = start
 		else
 			castbar.recipecount = castbar.recipecount or 1
-			castbar.maxrecipe = castbar.maxrecipe or 1
+			castbar.maxrecipe = castbar.maxrecipe or repeatCount
 			castbar.duration = castbar.duration or start
 		end
 	else
@@ -76,7 +76,7 @@ local UNIT_SPELLCAST_START = function(self, event, unit, spell)

 	if(castbar.Text) then castbar.Text:SetText(text) end
 	if(castbar.Icon) then castbar.Icon:SetTexture(texture) end
-	if(castbar.Time) then castbar.Time:SetText(repeatCount) end
+	if(castbar.Time) then castbar.Time:SetText() end

 	local shield = castbar.Shield
 	if(shield and interrupt) then
@@ -98,7 +98,8 @@ local UNIT_SPELLCAST_START = function(self, event, unit, spell)
 		castbar:PostCastStart(unit, name, castid)
 	end

-	castbar:Show()
+	--castbar:Show()
+	SuperVillain:SecureFadeIn(castbar, 0.5, 0.5, 1)
 end

 local UNIT_SPELLCAST_FAILED = function(self, event, unit, spellname, _, castid)
@@ -192,22 +193,11 @@ end

 local UNIT_SPELLCAST_STOP = function(self, event, unit, spellname, _, castid)
 	if (self.unit ~= unit) or not unit then return end
-
 	local castbar = self.Castbar
 	if (castbar.castid ~= castid) then return end

 	if(castbar.tradeskill and castbar.recipecount and castbar.recipecount >= 0) then
 		castbar.recipecount = castbar.recipecount + 1
-		if(castbar.recipecount > castbar.maxrecipe) then
-			castbar.previous = nil
-			castbar.casting = nil
-			castbar.interrupt = nil
-			castbar.tradeskill = nil
-			castbar.recipecount = nil
-			castbar.maxrecipe = nil
-			castbar:SetValue(0)
-			castbar:Hide()
-		end
 	else
 		castbar.previous = nil
 		castbar.casting = nil
@@ -216,9 +206,10 @@ local UNIT_SPELLCAST_STOP = function(self, event, unit, spellname, _, castid)
 		castbar.recipecount = nil
 		castbar.maxrecipe = nil
 		castbar:SetValue(0)
-		castbar:Hide()
 	end

+	SuperVillain:SecureFadeOut(castbar, 4, 1, 0, true)
+
 	if(castbar.PostCastStop) then
 		return castbar:PostCastStop(unit, spellname, castid)
 	end
@@ -279,7 +270,8 @@ local UNIT_SPELLCAST_CHANNEL_START = function(self, event, unit, spellname)
 	end

 	if(castbar.PostChannelStart) then castbar:PostChannelStart(unit, name) end
-	castbar:Show()
+	--castbar:Show()
+	SuperVillain:SecureFadeIn(castbar, 0.2, 0, 1)
 end

 local UNIT_SPELLCAST_CHANNEL_UPDATE = function(self, event, unit, spellname)
diff --git a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua
index da4cdfb..f5ab9a0 100644
--- a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua
+++ b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua
@@ -281,8 +281,9 @@ end

 local CustomCastTimeUpdate = function(self, duration)
 	if(self.recipecount and self.maxrecipe and self.maxrecipe > 0) then
-		self.Time:SetText(self.recipecount .. "/" .. self.maxrecipe)
-	elseif(self.Time) then
+		self.Text:SetText(self.recipecount .. "/" .. self.maxrecipe .. ": " .. self.previous)
+	end
+	if(self.Time) then
 		if(self.delay ~= 0) then
 			if(self.CustomDelayText) then
 				self:CustomDelayText(duration)
@@ -500,6 +501,7 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss)

 	local iconHolder = CreateFrame("Frame", nil, castbar)
 	iconHolder:SetFixedPanelTemplate("Inset", false)
+	iconHolder:SetFrameStrata("HIGH")
 	local buttonIcon = iconHolder:CreateTexture(nil, "BORDER")
 	buttonIcon:FillInner()
 	buttonIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
@@ -512,7 +514,10 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss)
 	castbar.Shield = shieldIcon;

 	castbar.Time = iconHolder:CreateFontString(nil, "OVERLAY")
-	castbar.Text = castbar:CreateFontString(nil, "OVERLAY")
+	castbar.Time:SetDrawLayer("OVERLAY", 7)
+	castbar.Text = iconHolder:CreateFontString(nil, "OVERLAY")
+	castbar.Text:SetDrawLayer("OVERLAY", 7)
+

 	local bgFrame = CreateFrame("Frame", nil, castbar)
 	local hadouken = CreateFrame("Frame", nil, castbar)
@@ -520,8 +525,8 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss)
 	if ryu then
 		castbar.Time:SetFont(SuperVillain.Media.font.numbers, 12, "OUTLINE")
 		castbar.Time:SetShadowOffset(1, -1)
-		castbar.Time:SetTextColor(1, 1, 1, 0.9)
-		castbar.Text:SetFont(SuperVillain.Media.font.alert, 13)
+		castbar.Time:SetTextColor(1, 1, 1)
+		castbar.Text:SetFont(SuperVillain.Media.font.alert, 13, "OUTLINE")
 		castbar.Text:SetShadowOffset(1, -1)
 		castbar.Text:SetTextColor(1, 1, 1)