Quantcast

New Storyline support, also fixed issues with shared private data on embeds

failcoder [08-27-15 - 04:21]
New Storyline support, also fixed issues with shared private data on embeds
Filename
SVUI_!Core/system/api.lua
SVUI_!Core/system/dock.lua
SVUI_CraftOMatic/SVUI_CraftOMatic.lua
SVUI_QuestTracker/SVUI_QuestTracker.lua
SVUI_QuestTracker/components/active.lua
SVUI_QuestTracker/components/popups.lua
SVUI_Skins/components/addons/Storyline.lua
SVUI_UnitFrames/elements/essentials.lua
diff --git a/SVUI_!Core/system/api.lua b/SVUI_!Core/system/api.lua
index 781945e..a50fcaf 100644
--- a/SVUI_!Core/system/api.lua
+++ b/SVUI_!Core/system/api.lua
@@ -242,6 +242,14 @@ local SetSecurePoint = function(self, anchor1, parent, anchor2, x, y)
     end
     self:SetPoint(anchor1, UIParent, anchor2, pX, pY);
 end
+
+local SetAllSecurePoints = function(self, parent)
+    local pX,pY = FIND_EDGES["TOPLEFT"](parent, 0, 0);
+    local w,h = parent:GetSize();
+    self:ClearAllPoints();
+    self:SetPoint("TOPLEFT", UIParent, "TOPLEFT", pX, pY);
+    self:SetSize(w,h);
+end
 --[[
 ##########################################################
 APPENDED DESTROY METHODS
@@ -1474,6 +1482,7 @@ local function AppendFrameMethods(OBJECT)
         if not OBJECT.SetPanelColor then META.SetPanelColor = SetPanelColor end
         if not OBJECT.ModSize then META.ModSize = ModSize end
         if not OBJECT.SetSecurePoint then META.SetSecurePoint = SetSecurePoint end
+        if not OBJECT.SetAllSecurePoints then META.SetAllSecurePoints = SetAllSecurePoints end
         if not OBJECT.WrapPoints then META.WrapPoints = WrapPoints end
         if not OBJECT.InsetPoints then META.InsetPoints = InsetPoints end
         if not OBJECT.Die then META.Die = Die end
@@ -1489,6 +1498,7 @@ local function AppendTextureMethods(OBJECT)
     local META = getmetatable(OBJECT).__index
     if not OBJECT.ModSize then META.ModSize = ModSize end
     if not OBJECT.SetSecurePoint then META.SetSecurePoint = SetSecurePoint end
+    if not OBJECT.SetAllSecurePoints then META.SetAllSecurePoints = SetAllSecurePoints end
     if not OBJECT.WrapPoints then META.WrapPoints = WrapPoints end
     if not OBJECT.InsetPoints then META.InsetPoints = InsetPoints end
     if not OBJECT.Die then META.Die = Die end
@@ -1501,6 +1511,7 @@ local function AppendFontStringMethods(OBJECT)
     local META = getmetatable(OBJECT).__index
     if not OBJECT.ModSize then META.ModSize = ModSize end
     if not OBJECT.SetSecurePoint then META.SetSecurePoint = SetSecurePoint end
+    if not OBJECT.SetAllSecurePoints then META.SetAllSecurePoints = SetAllSecurePoints end
     if not OBJECT.WrapPoints then META.WrapPoints = WrapPoints end
     if not OBJECT.InsetPoints then META.InsetPoints = InsetPoints end
 end
diff --git a/SVUI_!Core/system/dock.lua b/SVUI_!Core/system/dock.lua
index cdf9a03..ab8a1fa 100644
--- a/SVUI_!Core/system/dock.lua
+++ b/SVUI_!Core/system/dock.lua
@@ -1508,8 +1508,7 @@ local DockAlert_Activate = function(self, child, newHeight)
 	local size = newHeight or fallbackHeight;
 	self:SetHeight(size);
 	if(child) then
-		child:ClearAllPoints()
-		child:SetAllPoints(self)
+		child:SetAllSecurePoints(self)
 	end
 end

@@ -2102,6 +2101,7 @@ function MOD:Load()
 		dock.Alert:ClearAllPoints()
 		dock.Alert:SetSize(width, 1)
 		dock.Alert:SetPoint(anchor, dock, anchor, 0, 0)
+		dock.Alert:SetParent(UIParent)

 		dock.Window:ClearAllPoints()
 		dock.Window:SetSize(width, height)
diff --git a/SVUI_CraftOMatic/SVUI_CraftOMatic.lua b/SVUI_CraftOMatic/SVUI_CraftOMatic.lua
index 753a638..bfa9e13 100644
--- a/SVUI_CraftOMatic/SVUI_CraftOMatic.lua
+++ b/SVUI_CraftOMatic/SVUI_CraftOMatic.lua
@@ -323,9 +323,9 @@ local ModeCapture_EventHandler = function(self, event, ...)
 	end
 end

-local Handler = CreateFrame("Frame")
+local Handler = CreateFrame("Frame", nil, UIParent)
 Handler:SetPoint("LEFT", UIParent, "RIGHT", 10000, 0)
-local ModeCapture = CreateFrame("Button", "SVUI_ModeCaptureWindow", Handler, "SecureActionButtonTemplate")
+local ModeCapture = CreateFrame("Button", "SVUI_ModeCaptureWindow", UIParent, "SecureActionButtonTemplate")
 ModeCapture.Handler = Handler
 ModeCapture:EnableMouse(true)
 ModeCapture:RegisterForClicks("RightButtonUp")
@@ -635,8 +635,8 @@ function PLUGIN:Load()
 	tool1:SetScript('OnLeave', ModeButton_OnLeave)
 	tool1:SetScript('OnMouseDown', ModeButton_OnMouseDown)

-	local ModeAlert = CreateFrame("Frame", nil, self.Docklet)
-	ModeAlert:SetAllPoints(self.Docklet.Parent.Alert)
+	local ModeAlert = CreateFrame("Frame", nil, SV.Screen)
+	ModeAlert:SetAllSecurePoints(self.Docklet.Parent.Alert)
 	ModeAlert:SetBackdrop(SV.media.backdrop.button)

 	ModeAlert:SetBackdropBorderColor(0,0,0,1)
diff --git a/SVUI_QuestTracker/SVUI_QuestTracker.lua b/SVUI_QuestTracker/SVUI_QuestTracker.lua
index 4557801..66a6acc 100644
--- a/SVUI_QuestTracker/SVUI_QuestTracker.lua
+++ b/SVUI_QuestTracker/SVUI_QuestTracker.lua
@@ -360,9 +360,9 @@ function MOD:UpdateDimensions()
 	local scrollWidth = MOD.Docklet.ScrollFrame:GetWidth();

 	for headerName, headerFrame in pairs(MOD.Headers) do
-		if(headerName == 'Active') then
+		if(headerName == 'Active' or headerName == 'Popups') then
 			totalHeight = totalHeight - headerFrame:GetHeight()
-		elseif(headerName ~= 'Popups') then
+		else
 			totalHeight = totalHeight + headerFrame:GetHeight()
 		end
 		headerFrame:SetWidth(scrollWidth)
@@ -421,6 +421,7 @@ function MOD:Load()
 	self.Headers = {}
 	self.Docklet = SV.Dock:NewDocklet("BottomRight", "SVUI_QuestTracker", "Quest Tracker", MOD.media.dockIcon);

+	self:InitializePopups()
 	self:InitializeActive()

 	local scrollFrame = CreateFrame("ScrollFrame", "SVUI_QuestTrackerScrollFrame", self.Docklet);
@@ -473,7 +474,6 @@ function MOD:Load()
 	self.ClosestQuest = 0;
 	self.CurrentQuest = 0;

-	self:InitializePopups()
 	self:InitializeScenarios()
 	--self:InitializeQuestItem()
 	self:InitializeBonuses()
diff --git a/SVUI_QuestTracker/components/active.lua b/SVUI_QuestTracker/components/active.lua
index c63a80f..c8012fd 100644
--- a/SVUI_QuestTracker/components/active.lua
+++ b/SVUI_QuestTracker/components/active.lua
@@ -319,8 +319,9 @@ end

 function MOD:InitializeActive()
 	local active = CreateFrame("Frame", nil, self.Docklet)
-    active:SetPoint("TOPLEFT", self.Docklet, "TOPLEFT");
-    active:SetPoint("TOPRIGHT", self.Docklet, "TOPRIGHT");
+    active:SetPoint("TOPLEFT", self.Headers["Popups"] , "BOTTOMLEFT", 0, -6);
+    active:SetPoint("TOPRIGHT", self.Headers["Popups"] , "BOTTOMRIGHT", 0, -6);
+    active:SetHeight(1);

 	local block = CreateFrame("Frame", nil, active)
 	block:SetPoint("TOPLEFT", active, "TOPLEFT", 2, -4);
diff --git a/SVUI_QuestTracker/components/popups.lua b/SVUI_QuestTracker/components/popups.lua
index 79bb2c7..9da7d16 100644
--- a/SVUI_QuestTracker/components/popups.lua
+++ b/SVUI_QuestTracker/components/popups.lua
@@ -168,8 +168,8 @@ local AddAutoPopUp = function(self, questID, popUpType, noCheck)
 		self:Reset()
 		self:Refresh();
 		MOD:UpdateDimensions();
-		PlaySound("UI_AutoQuestComplete");
-		MOD.Docklet.Parent.Alert:Activate(self,self.CurrentHeight)
+		PlaySound("UI_AutoQuestComplete")
+		self:SetHeight(self.CurrentHeight)
 	end
 end

@@ -179,8 +179,8 @@ local RemoveAutoPopUp = function(self, questID, noRemove)
 	end
 	self:Reset();
 	self:Refresh();
+	self:SetHeight(1);
 	MOD:UpdateDimensions();
-	MOD.Docklet.Parent.Alert:Deactivate();
 end

 local _hook_AddAutoPopUpQuests = function(questID, popUpType)
@@ -200,7 +200,7 @@ function TEST_AUTOPOPUPS()
 	local self = MOD.Headers["Popups"];
 	self:SetPopup(0, 'Testing', 'TEST', 1, 1);
 	PlaySound("UI_AutoQuestComplete");
-	MOD.Docklet.Parent.Alert:Activate(self,50)
+	self:SetHeight(22)
 	self:FadeIn();
 end

@@ -215,7 +215,9 @@ end

 function MOD:InitializePopups()
 	local popups = CreateFrame("Frame", nil, self.Docklet)
-    popups:SetAllPoints(self.Docklet.Parent.Alert);
+	popups:SetPoint("TOPLEFT", self.Docklet, "TOPLEFT");
+    popups:SetPoint("TOPRIGHT", self.Docklet, "TOPRIGHT");
+    popups:SetHeight(1);
 	popups.Rows = {};

 	popups.GetPopup = GetPopUpRow;
diff --git a/SVUI_Skins/components/addons/Storyline.lua b/SVUI_Skins/components/addons/Storyline.lua
index 839a6f8..b5d9010 100644
--- a/SVUI_Skins/components/addons/Storyline.lua
+++ b/SVUI_Skins/components/addons/Storyline.lua
@@ -34,24 +34,6 @@ local bubbleBackdrop = {
 STYLE (IN DEVELOPMENT)
 ##########################################################
 ]]--
-local function SetCalloutStyle(frame)
-	frame:RemoveTextures()
-	--frame:SetStyle("!_Frame", 'Transparent')
-	local callout = CreateFrame("Frame", nil, frame)
-	callout:SetPoint("TOPLEFT",  frame, "TOPLEFT", 0, 15)
-	callout:SetPoint("BOTTOMRIGHT",  frame, "BOTTOMRIGHT", 0, -15)
-	callout:SetBackdrop(bubbleBackdrop)
-
-	local tail = callout:CreateTexture(nil, 'OVERLAY')
-	tail:SetSize(20,20)
-	tail:SetPoint("RIGHT", callout, "LEFT", 2, 0)
-	tail:SetTexture([[Interface\AddOns\SVUI_!Core\assets\textures\CHATBUBBLE-TAIL-LEFT]])
-
-	local level = frame:GetFrameLevel()
-	callout:SetFrameLevel(level)
-	frame:SetFrameLevel(level + 2)
-end
-
 local function StyleStoryline()
 	assert(_G.Storyline_NPCFrame, "AddOn Not Loaded");

@@ -108,9 +90,25 @@ local function StyleStoryline()
 	tail0:SetPoint("BOTTOMRIGHT", Storyline_NPCFrameChat, "TOPRIGHT", -60, -2)
 	tail0:SetTexture([[Interface\AddOns\SVUI_!Core\assets\textures\CHATBUBBLE-TAIL-UP]])

-	SetCalloutStyle(Storyline_NPCFrameChatOption1)
-	SetCalloutStyle(Storyline_NPCFrameChatOption2)
-	SetCalloutStyle(Storyline_NPCFrameChatOption3)
+	Storyline_NPCFrameChatOption1:RemoveTextures()
+	Storyline_NPCFrameChatOption2:RemoveTextures()
+	Storyline_NPCFrameChatOption3:RemoveTextures()
+	--frame:SetStyle("!_Frame", 'Transparent')
+	local callout = CreateFrame("Frame", nil, Storyline_NPCFrameChatOption1)
+	callout:SetPoint("TOPLEFT",  Storyline_NPCFrameChatOption1, "TOPLEFT", 0, 15)
+	callout:SetPoint("BOTTOMRIGHT",  Storyline_NPCFrameChatOption3, "BOTTOMRIGHT", 0, -15)
+	callout:SetBackdrop(bubbleBackdrop)
+
+	local tail = callout:CreateTexture(nil, 'OVERLAY')
+	tail:SetSize(20,20)
+	tail:SetPoint("RIGHT", callout, "LEFT", 2, 0)
+	tail:SetTexture([[Interface\AddOns\SVUI_!Core\assets\textures\CHATBUBBLE-TAIL-LEFT]])
+
+	local level = Storyline_NPCFrameChatOption1:GetFrameLevel()
+	callout:SetFrameLevel(level)
+	Storyline_NPCFrameChatOption1:SetFrameLevel(level + 2)
+	Storyline_NPCFrameChatOption2:SetFrameLevel(level + 2)
+	Storyline_NPCFrameChatOption3:SetFrameLevel(level + 2)

 	Storyline_NPCFrameChatPrevious:RemoveTextures()
 	Storyline_NPCFrameChatPrevious:SetSize(18,18)
diff --git a/SVUI_UnitFrames/elements/essentials.lua b/SVUI_UnitFrames/elements/essentials.lua
index b883c2f..f10435b 100644
--- a/SVUI_UnitFrames/elements/essentials.lua
+++ b/SVUI_UnitFrames/elements/essentials.lua
@@ -590,7 +590,7 @@ local OverlayHealthUpdate = function(health, unit, min, max)
 		local t = oUF_SVUI.colors.health
 		health:SetStatusBarColor(t[1], t[2], t[3], 0.9)
 	else
-		health:SetStatusBarColor(1-(0.65 * mu), 0.9 * mu, 0, 0.85)
+		health:SetStatusBarColor(1-(0.65 * mu), 0.15 * mu, 0, 0.85)
 		health.animation[1]:SetVertexColor(1, 0.1 * mu, 0, 0.5)
 	end