Quantcast

fixed dock click functions and several bugs

Steven Jackson [06-28-15 - 22:03]
fixed dock click functions and several bugs
Filename
SVUI_!Core/assets/textures/Dock/DOCK-ICON-OPTIONS.blp
SVUI_!Core/assets/textures/Dock/DOCK-ICON-SIZE.blp
SVUI_!Core/system/_docklets/misc.lua
SVUI_!Core/system/dock.lua
SVUI_!Core/system/media.lua
SVUI_!Core/xml/docks.xml
SVUI_Skins/SVUI_Skins.lua
SVUI_Skins/components/blizzard/guild.lua
SVUI_Skins/components/docklet.lua
SVUI_UnitFrames/libs/Plugins/oUF_Necromancy/oUF_Necromancy.lua
diff --git a/SVUI_!Core/assets/textures/Dock/DOCK-ICON-OPTIONS.blp b/SVUI_!Core/assets/textures/Dock/DOCK-ICON-OPTIONS.blp
new file mode 100644
index 0000000..7001882
Binary files /dev/null and b/SVUI_!Core/assets/textures/Dock/DOCK-ICON-OPTIONS.blp differ
diff --git a/SVUI_!Core/assets/textures/Dock/DOCK-ICON-SIZE.blp b/SVUI_!Core/assets/textures/Dock/DOCK-ICON-SIZE.blp
new file mode 100644
index 0000000..ebc44f8
Binary files /dev/null and b/SVUI_!Core/assets/textures/Dock/DOCK-ICON-SIZE.blp differ
diff --git a/SVUI_!Core/system/_docklets/misc.lua b/SVUI_!Core/system/_docklets/misc.lua
index 92336a7..c22b036 100644
--- a/SVUI_!Core/system/_docklets/misc.lua
+++ b/SVUI_!Core/system/_docklets/misc.lua
@@ -153,16 +153,20 @@ local SpecSwap_OnEnter = function(self)
 	GameTooltip:AddDoubleLine(otherText, text2, 1, 0.5, 0, 1, 1, 1)
 end

-local PowerButton_OnClick = function(self, button)
-	if(button == "RightButton" and IsShiftKeyDown()) then
-		Quit()
-	elseif(IsShiftKeyDown()) then
+local PowerButton_OnLeftClick = function(self)
+	if(IsShiftKeyDown()) then
 		ReloadUI()
 	else
 		Logout()
 	end
 end

+local PowerButton_OnRightClick = function(self)
+	if(IsShiftKeyDown()) then
+		Quit()
+	end
+end
+
 local PowerButton_OnEnter = function(self)
 	GameTooltip:AddLine(OTHER .. " " .. OPTIONS_MENU, 1, 1, 0)
 	GameTooltip:AddLine(" ", 1, 1, 1)
@@ -225,7 +229,7 @@ local function LoadMiscTools()
 	-- POWER BUTTON
 	if(SV.db.Dock.dockTools.power) then
 		local power = SV.Dock:SetDockButton("BottomLeft", L["Power Button"], "SVUI_PowerButton", SV.media.dock.powerIcon, PowerButton_OnEnter)
-		power:SetClickCallbacks(PowerButton_OnClick);
+		power:SetClickCallbacks(PowerButton_OnLeftClick, PowerButton_OnRightClick);
 	end

 	MOD.MiscToolsLoaded = true
diff --git a/SVUI_!Core/system/dock.lua b/SVUI_!Core/system/dock.lua
index 0c5dcef..adb6258 100644
--- a/SVUI_!Core/system/dock.lua
+++ b/SVUI_!Core/system/dock.lua
@@ -23,16 +23,17 @@ local format        = string.format;
 local find          = string.find;
 local match         = string.match;
 local gsub          = string.gsub;
-local split 				= string.split;
+local split 		= string.split;
 --TABLE
-local table 			= _G.table;
+local table 		= _G.table;
 local tinsert       = _G.tinsert;
 local tremove       = _G.tremove;
-local wipe 				= _G.wipe;
+local wipe 			= _G.wipe;
+local tsort 		= table.sort;
 --MATH
 local math      	= _G.math;
-local random 			= math.random;
-local min 				= math.min;
+local random 		= math.random;
+local min 			= math.min;
 local floor         = math.floor;
 local ceil          = math.ceil;
 local parsefloat 	= math.parsefloat;
@@ -1195,7 +1196,7 @@ local DockButton_OnEnter = function(self, ...)
 		GameTooltip:AddDoubleLine("Right-Click", "Options", 0, 1, 0, 0.5, 1, 0.5)
 	end
 	GameTooltip:AddDoubleLine("|cff0099FFSHIFT|r + Drag", "Relocate", 0, 1, 0, 0.5, 1, 0.5)
-	GameTooltip:AddDoubleLine("|cff0099FFSHIFT|r + Right-Click", "Hide", 0, 1, 0, 0.5, 1, 0.5)
+	GameTooltip:AddDoubleLine("|cff0099FFALT|r + Right-Click", "Hide", 0, 1, 0, 0.5, 1, 0.5)
 	GameTooltip:Show()
 end

@@ -1216,7 +1217,7 @@ local DockButton_OnClick = function(self, button)
 	end
 	MOD.ButtonSound()
 	if(button and (button == "RightButton")) then
-		if(IsShiftKeyDown()) then
+		if(IsAltKeyDown()) then
 			self.ActiveDocklet = false;
 			self:SetPanelColor("default")
 			if(self.Icon) then
@@ -1226,8 +1227,8 @@ local DockButton_OnClick = function(self, button)
 				local registeredLocation = MOD.private.Locations[self.LocationKey];
 				HideDockletWindow(self, registeredLocation)
 			end
-		elseif(self.PostRightClick) then
-			self:PostRightClick();
+		elseif(self.RightClickCallback) then
+			self:RightClickCallback();
 		elseif((not InCombatLockdown()) and self.ShowDockOptions) then
 			self:ShowDockOptions();
 		end
@@ -1673,20 +1674,6 @@ end
 BUILD/UPDATE
 ##########################################################
 ]]--
-local CornerButton_ShowDockOptions = function(self)
-	local list = {};
-	tinsert(list, { title = "Disabled", divider = true });
-	for name,parent in pairs(MOD.private.Disabled) do
-		local button = _G[name];
-		if(button) then
-			local tipText = button:GetAttribute("tipText")
-			tinsert(list, { text = tipText, func = function() button:SetDocked(true); end });
-		end
-	end
-
-	SV.Dropdown:Open(self, list, "Docklets");
-end
-
 local CornerButton_OnEnter = function(self, ...)
 	MOD:EnterFade()

@@ -1699,9 +1686,6 @@ local CornerButton_OnEnter = function(self, ...)
 	GameTooltip:AddDoubleLine("Left-Click", tipText, 0, 1, 0, 1, 1, 1)
 	local tipExtraText = self:GetAttribute("tipExtraText")
 	GameTooltip:AddDoubleLine("Right-Click", tipExtraText, 0, 1, 0, 1, 1, 1)
-	GameTooltip:AddLine(" ")
-	GameTooltip:AddDoubleLine("|cff0099FFSHIFT|r + Right-Click", "Options", 0, 1, 0, 1, 1, 1)
-	GameTooltip:AddDoubleLine("|cff0099FFAlt|r + Right-Click", "Reset Dock Buttons", 0, 1, 0, 1, 1, 1)
 	GameTooltip:Show()
 end

@@ -1717,15 +1701,65 @@ local CornerButton_OnLeave = function(self, ...)
 end

 local CornerButton_OnClick = function(self, button)
-	if(button and (button == "RightButton") and IsShiftKeyDown()) then
-		if((not InCombatLockdown()) and self.ShowDockOptions) then
-			self:ShowDockOptions();
-		end
+	if(button and IsAltKeyDown() and button == 'RightButton') then
+		SV:StaticPopup_Show('RESETDOCKS_CHECK')
 	else
 		self:ToggleFunc(button)
 	end
 end

+local CornerButton2_OnEnter = function(self, ...)
+	MOD:EnterFade()
+
+	self:SetPanelColor("highlight")
+	self.Icon:SetGradient(unpack(SV.media.gradient.highlight))
+
+	GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4)
+	GameTooltip:ClearLines()
+	GameTooltip:AddDoubleLine("Left-Click", "Enable Docklets", 0, 1, 0, 1, 1, 1)
+	GameTooltip:AddDoubleLine("Right-Click", "Disable Docklets", 0, 1, 0, 1, 1, 1)
+	GameTooltip:AddDoubleLine("|cff0099FFAlt|r + Right-Click", "Reset All Docklets", 0, 1, 0, 1, 1, 1)
+	GameTooltip:Show()
+end
+
+local sort_menu_fn = function(a,b) return a.text < b.text end;
+
+local CornerButton2_OnClick = function(self, button)
+	if(IsAltKeyDown() and button and button == 'RightButton') then
+		SV:StaticPopup_Show('RESETDOCKS_CHECK')
+	else
+		if(InCombatLockdown()) then return end
+		local menu = {};
+		local titleText = "Disabled";
+		if(button and button == 'RightButton') then
+			titleText = "Enabled";
+			for name,parent in pairs(MOD.private.Locations) do
+				if((not MOD.private.Disabled[name]) and _G[name]) then
+					local b = _G[name];
+					local tipText = b:GetAttribute("tipText")
+					if(tipText) then
+						tinsert(menu, { text = tipText, func = function() b:SetDocked(false); end });
+					end
+				end
+			end
+		else
+			for name,parent in pairs(MOD.private.Disabled) do
+				local b = _G[name];
+				if(b) then
+					local tipText = b:GetAttribute("tipText")
+					if(tipText) then
+						tinsert(menu, { text = tipText, func = function() b:SetDocked(true); end });
+					end
+				end
+			end
+		end
+
+		tsort(menu, sort_menu_fn)
+
+		SV.Dropdown:Open(self, menu, titleText);
+	end
+end
+
 function MOD:UpdateLocals()
 	DOCK_WIDTH = SV.db.Dock.dockWidth;
 	DOCK_HEIGHT = SV.db.Dock.dockHeight;
@@ -1959,7 +1993,7 @@ function MOD:Load()
 		if(dock.Bar.Button) then
 	    	dock.Bar.Button:SetSize(buttonsize, buttonsize)
 	    	self:SetButtonTheme(dock.Bar.Button, buttonsize)
-	    	dock.Bar.Button.Icon:SetTexture(SV.media.icon.default)
+	    	dock.Bar.Button.Icon:SetTexture(SV.media.dock.sizeIcon)
 	    	dock.Bar.ToolBar:SetSize(1, buttonsize)
 	    	dock.Bar.ToolBar:SetPoint(barAnchor, dock.Bar.Button, barReverse, (spacing * mod), 0)
 			dock.Bar.Button:SetPanelColor("default")
@@ -1973,7 +2007,6 @@ function MOD:Load()
 			end
 			dock.Bar.Button:SetScript("OnEnter", CornerButton_OnEnter)
 			dock.Bar.Button:SetScript("OnLeave", CornerButton_OnLeave)
-			dock.Bar.Button.ShowDockOptions = CornerButton_ShowDockOptions

 			if(location == "BottomLeft") then
 				dock.Bar.Button.ToggleFunc = ToggleSuperDockLeft;
@@ -1981,6 +2014,29 @@ function MOD:Load()
 				dock.Bar.Button.ToggleFunc = ToggleSuperDockRight;
 			end
 			dock.Bar.Button:SetScript("OnClick", CornerButton_OnClick)
+
+			if(dock.Bar.Button2) then
+		    	dock.Bar.Button2:SetSize(buttonsize, buttonsize)
+		    	self:SetButtonTheme(dock.Bar.Button2, buttonsize)
+		    	dock.Bar.Button2.Icon:SetTexture(SV.media.dock.optionsIcon)
+		    	dock.Bar.ToolBar:SetSize(1, buttonsize)
+		    	dock.Bar.ToolBar:SetPoint(barAnchor, dock.Bar.Button2, barReverse, (spacing * mod), 0)
+				dock.Bar.Button2:SetPanelColor("default")
+				dock.Bar.Button2.Icon:SetGradient(unpack(SV.media.gradient.icon))
+				if(location:find('Left')) then
+					dock.Bar.Button2:SetAttribute("tipText", SHOWORHIDE .. " Left Dock")
+					dock.Bar.Button2:SetAttribute("tipExtraText", MINIMIZEORMAXIMIZE .. " Left Dock")
+				else
+					dock.Bar.Button2:SetAttribute("tipText", SHOWORHIDE .. " Right Dock")
+					dock.Bar.Button2:SetAttribute("tipExtraText", MINIMIZEORMAXIMIZE .. " Right Dock")
+				end
+				dock.Bar.Button2:SetScript("OnEnter", CornerButton2_OnEnter)
+				dock.Bar.Button2:SetScript("OnLeave", CornerButton_OnLeave)
+				dock.Bar.Button2.ShowDockOptions = CornerButton2_OnClick
+
+				dock.Bar.Button2.ToggleFunc = CornerButton2_OnClick;
+				dock.Bar.Button2:SetScript("OnClick", CornerButton_OnClick)
+		    end
 	    else
 	    	dock.Bar.ToolBar:SetSize(1, buttonsize)
 	    	dock.Bar.ToolBar:SetPoint(barAnchor, dock.Bar, barAnchor, 0, 0)
diff --git a/SVUI_!Core/system/media.lua b/SVUI_!Core/system/media.lua
index ea765d7..147fb16 100644
--- a/SVUI_!Core/system/media.lua
+++ b/SVUI_!Core/system/media.lua
@@ -367,6 +367,8 @@ do
 			["durabilityLabel"] 	= [[Interface\AddOns\SVUI_!Core\assets\textures\Dock\LABEL-DUR]],
 			["reputationLabel"] 	= [[Interface\AddOns\SVUI_!Core\assets\textures\Dock\LABEL-REP]],
 			["experienceLabel"] 	= [[Interface\AddOns\SVUI_!Core\assets\textures\Dock\LABEL-XP]],
+			["sizeIcon"] 			= [[Interface\AddOns\SVUI_!Core\assets\textures\Dock\DOCK-ICON-SIZE]],
+			["optionsIcon"] 		= [[Interface\AddOns\SVUI_!Core\assets\textures\Dock\DOCK-ICON-OPTIONS]],
 			["breakStuffIcon"] 		= [[Interface\AddOns\SVUI_!Core\assets\textures\Dock\DOCK-ICON-BREAKSTUFF]],
 			["hearthIcon"] 			= [[Interface\AddOns\SVUI_!Core\assets\textures\Dock\DOCK-ICON-HEARTH]],
 			["raidToolIcon"] 		= [[Interface\AddOns\SVUI_!Core\assets\textures\Dock\DOCK-ICON-RAIDTOOL]],
diff --git a/SVUI_!Core/xml/docks.xml b/SVUI_!Core/xml/docks.xml
index 78a1a29..a91563d 100644
--- a/SVUI_!Core/xml/docks.xml
+++ b/SVUI_!Core/xml/docks.xml
@@ -34,10 +34,35 @@
                     </OnLoad>
                 </Scripts>
             </Button>
+            <Button name="$parentButton2" parentKey="Button2">
+                <Size x="22" y="22"/>
+                <Anchors>
+                    <Anchor point="BOTTOMLEFT" relativeTo="$parentButton" relativePoint="BOTTOMRIGHT" x="4" y="0" />
+                </Anchors>
+                <Attributes>
+                    <Attribute name="tipText" type="string" value="Toggle Left Dock" />
+                    <Attribute name="tipExtraText" type="string" value="Expand Left Dock" />
+                </Attributes>
+                <Layers>
+                    <Layer level="OVERLAY">
+                        <Texture parentKey="Icon" file="Interface\AddOns\SVUI_!Core\assets\textures\EMPTY">
+                            <Anchors>
+                                <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="2" y="-2" />
+                                <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-2" y="2" />
+                            </Anchors>
+                        </Texture>
+                    </Layer>
+                </Layers>
+                <Scripts>
+                    <OnLoad>
+                        self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
+                    </OnLoad>
+                </Scripts>
+            </Button>
             <Frame name="$parentToolBar" parentKey="ToolBar">
                 <Size x="1" y="22"/>
                 <Anchors>
-                    <Anchor point="BOTTOMLEFT" relativeTo="$parentButton" relativePoint="BOTTOMRIGHT" x="4" y="0" />
+                    <Anchor point="BOTTOMLEFT" relativeTo="$parentButton2" relativePoint="BOTTOMRIGHT" x="4" y="0" />
                 </Anchors>
             </Frame>
         </Frames>
@@ -105,10 +130,35 @@
                     </OnLoad>
                 </Scripts>
             </Button>
+            <Button name="$parentButton2" parentKey="Button2">
+                <Size x="22" y="22"/>
+                <Anchors>
+                    <Anchor point="BOTTOMRIGHT" relativeTo="$parentButton" relativePoint="BOTTOMLEFT" x="-4" y="0" />
+                </Anchors>
+                <Attributes>
+                    <Attribute name="tipText" type="string" value="Toggle Right Dock" />
+                    <Attribute name="tipExtraText" type="string" value="Expand Right Dock" />
+                </Attributes>
+                <Layers>
+                    <Layer level="OVERLAY">
+                        <Texture parentKey="Icon" file="Interface\AddOns\SVUI_!Core\assets\textures\EMPTY">
+                            <Anchors>
+                                <Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="2" y="-2" />
+                                <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-2" y="2" />
+                            </Anchors>
+                        </Texture>
+                    </Layer>
+                </Layers>
+                <Scripts>
+                    <OnLoad>
+                        self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
+                    </OnLoad>
+                </Scripts>
+            </Button>
             <Frame name="$parentToolBar" parentKey="ToolBar">
                 <Size x="1" y="22"/>
                 <Anchors>
-                    <Anchor point="BOTTOMRIGHT" relativeTo="$parentButton" relativePoint="BOTTOMLEFT" x="-4" y="0" />
+                    <Anchor point="BOTTOMRIGHT" relativeTo="$parentButton2" relativePoint="BOTTOMLEFT" x="-4" y="0" />
                 </Anchors>
             </Frame>
         </Frames>
diff --git a/SVUI_Skins/SVUI_Skins.lua b/SVUI_Skins/SVUI_Skins.lua
index e08f75c..cef5eae 100644
--- a/SVUI_Skins/SVUI_Skins.lua
+++ b/SVUI_Skins/SVUI_Skins.lua
@@ -326,7 +326,7 @@ function MOD:Load()

 	self.Alert = alert;

-	self.Docklet = SV.Dock:NewDocklet("BottomRight", "SVUI_SkinsDock", self.TitleID, [[Interface\AddOns\SVUI_Skins\artwork\DOCK-ICON-ADDON]]);
+	self.Docklet = SV.Dock:NewDocklet("BottomRight", "SVUI_SkinsDock", "Addon Docklet", [[Interface\AddOns\SVUI_Skins\artwork\DOCK-ICON-ADDON]]);
 	--self.Docklet:SetVisibilityCallbacks(false, false);
 	self.Docklet:SetClickCallbacks(AddonDockletToggle, false, self.GetDockables);

diff --git a/SVUI_Skins/components/blizzard/guild.lua b/SVUI_Skins/components/blizzard/guild.lua
index 2d17c3a..d859573 100644
--- a/SVUI_Skins/components/blizzard/guild.lua
+++ b/SVUI_Skins/components/blizzard/guild.lua
@@ -270,7 +270,7 @@ local _hook_GuildBankFrame_Update = function(self)
 			local r, g, b, a = 0,0,0,1
 			if(itemLink) then
 				local quality = select(3, GetItemInfo(itemLink))
-				if(quality > 1) then
+				if(quality and quality > 1) then
 					r, g, b = GetItemQualityColor(quality)
 				end
 			end
@@ -438,10 +438,7 @@ local function GuildBankStyle()
 	GuildBankPopupNameLeft:Die()
 	GuildBankPopupNameRight:Die()
 	GuildBankPopupNameMiddle:Die()
-	GuildItemSearchBox:RemoveTextures()
-	GuildItemSearchBox:SetStyle("Frame", "Overlay")
-	GuildItemSearchBox.Panel:SetPoint("TOPLEFT", 10, -1)
-	GuildItemSearchBox.Panel:SetPoint("BOTTOMRIGHT", 4, 1)
+	SV.API:Set("EditBox", GuildItemSearchBox)

 	for i = 1, 16 do
 		local btnName = ("GuildBankPopupButton%d"):format(i)
diff --git a/SVUI_Skins/components/docklet.lua b/SVUI_Skins/components/docklet.lua
index 87114d5..f2eba66 100644
--- a/SVUI_Skins/components/docklet.lua
+++ b/SVUI_Skins/components/docklet.lua
@@ -70,9 +70,13 @@ SKADA
 ##########################################################
 ]]--
 local Skada_PointLock = function(self, a1, p, a2, x, y)
-	if((x ~= 0) or (y ~= 0)) then
-		self:ClearAllPoints()
-		self:SetPoint("BOTTOM", p, "BOTTOM", 0, 0)
+	local parent = self:GetParent()
+	if(parent and parent.GetName) then
+		local pname = parent:GetName()
+		if(((x ~= 0) or (y ~= 0)) and pname:find('SVUI')) then
+			self:ClearAllPoints()
+			self:SetPoint("BOTTOM", p, "BOTTOM", 0, 0)
+		end
 	end
 end

@@ -83,60 +87,77 @@ end
 DOCK_EMBEDS["Skada"] = function(self)
 	if((not IsAddOnLoaded("Skada")) or (not _G.Skada)) then return false end

-	local assigned = self:EmbedCheck();
+	local assigned,otherAssigned = self:EmbedCheck();
 	local width = self:GetWidth()
 	local height = SV.Dock.BottomRight.Window:GetHeight();
+	local frameLinked = false;
+
+	for index,window in pairs(Skada:GetWindows()) do
+		if(window) then
+			local wname = window.db.name or "Skada"
+			local key = "SkadaBarWindow" .. wname
+			if(assigned ~= 'None' and (assigned:find(key))) then
+				--Librarian:LockLibrary('LibWindow');
+				local db = window.db
+
+				if(db) then
+					local curHeight = 0
+					if(db.enabletitle) then
+						curHeight = db.title.height
+					end
+					db.barspacing = 1;
+					db.barwidth = width - 10;
+					db.background.height = (height - curHeight) - 8;
+					db.spark = false;
+					db.barslocked = true;
+				end

-	if(assigned) then
-		for index,window in pairs(Skada:GetWindows()) do
-			if(window) then
-				local wname = window.db.name or "Skada"
-				local key = "SkadaBarWindow" .. wname
-				if(assigned:find(key)) then
-					--Librarian:LockLibrary('LibWindow');
-					local db = window.db
-
-					if(db) then
-						local curHeight = 0
-						if(db.enabletitle) then
-							curHeight = db.title.height
-						end
-						db.barspacing = 1;
-						db.barwidth = width - 10;
-						db.background.height = (height - curHeight) - 8;
-						db.spark = false;
-						db.barslocked = true;
+				local parentFrame = window.bargroup:GetParent();
+				if(not window.bargroup.___oldParent) then
+					if(parentFrame ~= self) then
+						window.bargroup.___oldParent = window.bargroup:GetParent()
+					else
+						window.bargroup.___oldParent = UIParent
 					end
+				end

-					window.bargroup:ClearAllPoints()
-					window.bargroup:SetParent(self)
-					window.bargroup:SetSize(width, height)
-					window.bargroup:SetPoint("BOTTOM", self, "BOTTOM", 0, 0)
-					window.bargroup:SetFrameStrata('LOW')
+				window.bargroup:SetParent(self)
+				window.bargroup:ClearAllPoints()
+				window.bargroup:SetSize(width, height)
+				window.bargroup:SetPoint("BOTTOM", self, "BOTTOM", 0, 0)
+				window.bargroup:SetFrameStrata('LOW')

+				if(not window.bargroup.___skinHooked) then
 					hooksecurefunc(window.bargroup, "SetPoint", Skada_PointLock)
+					window.bargroup.___skinHooked = true;
+				end

-					local bgroup = window.bargroup.backdrop;
-					if(bgroup) then
-						bgroup:Show()
-						if(not bgroup.Panel) then
-							bgroup:SetStyle("!_Frame", 'Transparent', true)
-						end
+				local bgroup = window.bargroup.backdrop;
+				if(bgroup) then
+					bgroup:Show()
+					if(not bgroup.Panel) then
+						bgroup:SetStyle("!_Frame", 'Transparent', true)
 					end
+				end

-					self.FrameLink = window;
+				self.FrameLink = window;
+				frameLinked = true;

-					Skada.displays['bar']:ApplySettings(window)
+				Skada.displays['bar']:ApplySettings(window)

-					return true
-				else
-					--Librarian:UnlockLibrary('LibWindow');
-					window.db.barslocked = false;
-				end
+				return true
+			elseif(not otherAssigned:find(key)) then
+				--Librarian:UnlockLibrary('LibWindow');
+				window.db.barslocked = false;
+				window.bargroup:SetParent(window.bargroup.___oldParent or UIParent)
 			end
 		end
 	end

+	if(not frameLinked) then
+		self.FrameLink = nil;
+	end
+
 	return false
 end
 --[[
@@ -307,6 +328,7 @@ DOCK EMBED METHODS
 ]]--
 local DOCK_EmbedAddon = function(self, request)
 	if(not request) then return false end
+
 	for addon,fn in pairs(DOCK_EMBEDS) do
 		if(request:find(addon)) then
 			local activated = fn(self)
@@ -319,11 +341,9 @@ local DOCK_EmbedAddon = function(self, request)
 end

 local DOCK_EmbedCheck = function(self, ...)
-	local data = SV.private.Docks[self.EmbedKey]
-	if(data and (data ~= "None")) then
-		return data
-	end
-	return false
+	local data1 = SV.private.Docks[self.EmbedKey] or 'None';
+	local data2 = SV.private.Docks[self.EmbedOther] or 'None';
+	return data1,data2
 end

 local PARENT_IsEmbedded = function(self, request)
@@ -359,16 +379,28 @@ end
 CORE FUNCTIONS
 ##########################################################
 ]]--
+function MOD:FindDockables()
+	local test = false;
+	for addon,_ in pairs(DOCK_EMBEDS) do
+		if IsAddOnLoaded(addon) then
+			test = true;
+		end
+	end
+	return test;
+end
+
 function MOD:SetEmbedHandlers()
 	MOD.Docklet.UpdateEmbeds     = PARENT_UpdateEmbeds;
 	MOD.Docklet.IsEmbedded       = PARENT_IsEmbedded;

 	MOD.Docklet.Dock1.EmbedKey   = "Embed1";
+	MOD.Docklet.Dock1.EmbedOther = "Embed2";
 	MOD.Docklet.Dock1.Embedded   = "NONE";
 	MOD.Docklet.Dock1.EmbedAddon = DOCK_EmbedAddon;
 	MOD.Docklet.Dock1.EmbedCheck = DOCK_EmbedCheck;

 	MOD.Docklet.Dock2.EmbedKey   = "Embed2";
+	MOD.Docklet.Dock2.EmbedOther = "Embed1";
 	MOD.Docklet.Dock2.Embedded   = "NONE";
 	MOD.Docklet.Dock2.EmbedAddon = DOCK_EmbedAddon;
 	MOD.Docklet.Dock2.EmbedCheck = DOCK_EmbedCheck;
@@ -395,6 +427,10 @@ function MOD:RegisterAddonDocklets()
 			self.Docklet.Dock1:SetWidth(0.1)
 		end

+		self.Docklet.Dock2:ClearAllPoints()
+		self.Docklet.Dock2:SetPoint('TOPLEFT', self.Docklet.Dock1, 'TOPRIGHT', 0, 0);
+		self.Docklet.Dock2:SetPoint('BOTTOMRIGHT', self.Docklet, 'BOTTOMRIGHT', 1, -1);
+
 		active2, addon2 = self.Docklet.Dock2:EmbedAddon(embed2)

 		if(not active2) then
@@ -406,8 +442,13 @@ function MOD:RegisterAddonDocklets()
 		active1, addon1 = self.Docklet.Dock1:EmbedAddon(embed1)
 	end

-	if(active1 or active2) then
+	if(self:FindDockables()) then
 		self.Docklet:Enable();
+	else
+		self.Docklet:Disable();
+	end
+
+	if(active1 or active2) then
 		if(active2) then
 			extraTip = TIP_RIGHT_PATTERN:format(addon2)
 			self.Docklet.Dock1:Show()
@@ -421,33 +462,77 @@ function MOD:RegisterAddonDocklets()
 	else
 		self.Docklet.Dock1:Hide()
 		self.Docklet.Dock2:Hide()
-		self.Docklet:Disable()
 	end
 end

 function MOD:GetDockables()
-	local test = SV.private.Docks.Embed1;
+	local t = {};

-	local t = {
-		{ title = "Docked Addon", divider = true },
-		{text = "Remove All", func = function() SV.private.Docks.Embed1 = "None"; MOD:RegisterAddonDocklets() end}
-	};
+	local test1 = SV.private.Docks.Embed1 or 'None';
+	local test2 = SV.private.Docks.Embed2 or 'None';
+	local allowed1, allowed2 = false,false;

 	for addon,_ in pairs(DOCK_EMBEDS) do
-		if (not test or (test and not test:find(addon))) then
-			if(addon:find("Skada") and _G.Skada) then
-				for index,window in pairs(_G.Skada:GetWindows()) do
-					local keyName = window.db.name
-				    local key = "SkadaBarWindow" .. keyName
+		if(addon:find("Skada") and _G.Skada) then
+			for index,window in pairs(_G.Skada:GetWindows()) do
+				local keyName = window.db.name
+			    local key = "SkadaBarWindow" .. keyName
+			    if ((not test1:find(key)) and (not test2:find(key))) then
 				    local name = (keyName == "Skada") and "Skada - Main" or "Skada - " .. keyName;
+				    if(not allowed1) then
+				    	tinsert(t,{ title = "Set Primary", divider = true });
+				    	allowed1 = true;
+				    end
 				    tinsert(t,{text = name, func = function() SV.private.Docks.Embed1 = key; MOD:RegisterAddonDocklets() end});
 				end
-			else
-				if IsAddOnLoaded(addon) or IsAddOnLoaded(addon) then
-					tinsert(t,{text = addon, func = function() SV.private.Docks.Embed1 = addon; MOD:RegisterAddonDocklets() end});
+			end
+		else
+			if(IsAddOnLoaded(addon) and (not test1:find(key)) and (not test2:find(key))) then
+				if(not allowed1) then
+			    	tinsert(t,{ title = "Set Primary", divider = true });
+			    	allowed1 = true;
+			    end
+				tinsert(t,{text = addon, func = function() SV.private.Docks.Embed1 = addon; MOD:RegisterAddonDocklets() end});
+			end
+		end
+	end
+
+	for addon,_ in pairs(DOCK_EMBEDS) do
+		if(addon:find("Skada") and _G.Skada) then
+			for index,window in pairs(_G.Skada:GetWindows()) do
+				local keyName = window.db.name
+			    local key = "SkadaBarWindow" .. keyName;
+			    if ((not test1:find(key)) and (not test2:find(key))) then
+				    local name = (keyName == "Skada") and "Skada - Main" or "Skada - " .. keyName;
+				    if(not allowed2) then
+				    	tinsert(t,{ title = "Set Secondary", divider = true });
+				    	allowed2 = true;
+				    end
+				    tinsert(t,{text = name, func = function() SV.private.Docks.Embed2 = key; MOD:RegisterAddonDocklets() end});
 				end
 			end
+		else
+			if(IsAddOnLoaded(addon) and (not test1:find(key)) and (not test2:find(key))) then
+				if(not allowed2) then
+			    	tinsert(t,{ title = "Set Secondary", divider = true });
+			    	allowed2 = true;
+			    end
+				tinsert(t,{text = addon, func = function() SV.private.Docks.Embed2 = addon; MOD:RegisterAddonDocklets() end});
+			end
 		end
 	end
+
+	local canRemove1 = (test1 and test1 ~= 'None') or false;
+	local canRemove2 = (test2 and test2 ~= 'None') or false;
+	if(canRemove1 or canRemove2) then
+		tinsert(t,{ title = "Remove", divider = true });
+		if canRemove1 then
+			tinsert(t,{text = "Primary", func = function() SV.private.Docks.Embed1 = "None"; MOD:RegisterAddonDocklets() end});
+		end
+		if canRemove2 then
+			tinsert(t,{text = "Secondary", func = function() SV.private.Docks.Embed2 = "None"; MOD:RegisterAddonDocklets() end});
+		end
+	end
+
 	return t;
-end
+end
\ No newline at end of file
diff --git a/SVUI_UnitFrames/libs/Plugins/oUF_Necromancy/oUF_Necromancy.lua b/SVUI_UnitFrames/libs/Plugins/oUF_Necromancy/oUF_Necromancy.lua
index 1cc3b91..544af9e 100644
--- a/SVUI_UnitFrames/libs/Plugins/oUF_Necromancy/oUF_Necromancy.lua
+++ b/SVUI_UnitFrames/libs/Plugins/oUF_Necromancy/oUF_Necromancy.lua
@@ -43,6 +43,7 @@ local UpdateRune = function(self, event, rid)
 	local rune = self.Necromancy[runemap[rid]]
 	if(rune) then
 		local start, duration, runeReady = GetRuneCooldown(rid)
+		start = start or 0;
 		if(runeReady) then
 			rune.bar:SetMinMaxValues(0, 1)
 			rune.bar:SetValue(1)