Quantcast

updates

Munglunch [05-18-15 - 17:18]
updates
Filename
SVUITheme_Simple/SVUITheme_Simple.lua
SVUI_!Core/libs/_SVUI_Lib/Registry.lua
SVUI_!Core/setup/installer.lua
SVUI_!Core/system/core.lua
SVUI_!Core/system/dock.lua
SVUI_!Core/system/henchmen.lua
SVUI_Chat/SVUI_Chat.lua
diff --git a/SVUITheme_Simple/SVUITheme_Simple.lua b/SVUITheme_Simple/SVUITheme_Simple.lua
index f0abdc7..d6169a8 100644
--- a/SVUITheme_Simple/SVUITheme_Simple.lua
+++ b/SVUITheme_Simple/SVUITheme_Simple.lua
@@ -73,7 +73,7 @@ local _RefreshZoneText = function(self)
 	end
 end

-local _SetDockStyleTheme = function(frame, isBottom)
+local _SetThemedBackdrop = function(frame, isBottom)
 	local backdrop = CreateFrame("Frame", nil, frame)
 	backdrop:SetAllPoints(frame)
 	backdrop:SetFrameStrata("BACKGROUND")
@@ -157,6 +157,6 @@ function SV:LoadTheme()
 		self.Maps.RefreshZoneText = _RefreshZoneText
 	end

-	self.Dock.SetThemeDockStyle = _SetDockStyleTheme
+	self.Dock.SetThemedBackdrop = _SetThemedBackdrop
 	self.Dock.SetBorderTheme = _SetBorderTheme
 end
diff --git a/SVUI_!Core/libs/_SVUI_Lib/Registry.lua b/SVUI_!Core/libs/_SVUI_Lib/Registry.lua
index f890316..b961436 100644
--- a/SVUI_!Core/libs/_SVUI_Lib/Registry.lua
+++ b/SVUI_!Core/libs/_SVUI_Lib/Registry.lua
@@ -108,7 +108,8 @@ local debugPattern = '|cffFF2F00%s|r [|cff0affff%s|r]|cffFF2F00:|r @|cffFF0000(|
 local playerClass           = select(2,UnitClass("player"));
 local playerRealm           = GetRealmName();
 local playerName            = UnitName("player");
-local DEFAULT_PROFILE_KEY   = ("%s - Default"):format(playerName);
+local OLD_PROFILE_KEY       = ("%s - Default"):format(playerName);
+local DEFAULT_PROFILE_KEY   = ("%s [%s] - Default"):format(playerName, playerRealm);
 local PROFILE_KEY           = DEFAULT_PROFILE_KEY;
 local DEFAULT_THEME_KEY     = "Default";
 local THEME_KEY             = DEFAULT_THEME_KEY;
@@ -498,9 +499,9 @@ function lib:CleanUpData(deep)
         for key,data in pairs(GLOBAL_SV.profiles) do
             sanitize(data, defaults, true)
         end
-        for theme,profile in pairs(MEDIA_SV.profiles) do
+        for theme,realms in pairs(MEDIA_SV.profiles) do
             if(CoreObject.AvailableThemes[theme]) then
-                for key,data in pairs(profile) do
+                for key,data in pairs(MEDIA_SV.profiles[theme]) do
                     if(not GLOBAL_SV.profileKeys[key]) then
                         MEDIA_SV.profiles[theme][key] = nil
                     else
@@ -518,12 +519,28 @@ function lib:CleanUpData(deep)
             end
         end
     else
-        DEEP_CLEAN_REQUESTED = true
+        DEEP_CLEAN_REQUESTED = true;
     end
 end

 --[[ CONSTRUCTORS ]]--

+local function CheckForDeprecated(oldKey)
+  if(GLOBAL_SV.profiles[oldKey]) then
+    local export = GLOBAL_SV.profiles[oldKey];
+    local saved = GLOBAL_SV.profiles[PROFILE_KEY];
+    tablecopy(saved, export);
+    GLOBAL_SV.profiles[oldKey] = nil
+  end
+
+  if(MEDIA_SV.profiles[THEME_KEY][oldKey]) then
+    local export = MEDIA_SV.profiles[THEME_KEY][oldKey];
+    local saved = MEDIA_SV.profiles[THEME_KEY][PROFILE_KEY];
+    tablecopy(saved, export);
+    MEDIA_SV.profiles[THEME_KEY][oldKey] = nil
+  end
+end
+
 local function UpdateProfileSources(newKey)
     local PREVIOUS_PROFILE_KEY = PROFILE_KEY;
     if(PRIVATE_SV.SAFEDATA.DUALSPEC) then
@@ -531,8 +548,10 @@ local function UpdateProfileSources(newKey)
         if(specID) then
             local _, SOURCE_KEY, _, _, _, _ = GetSpecializationInfo(specID);
             if(not SOURCE_KEY) then SOURCE_KEY = "Default" end
-            PROFILE_KEY = ("%s - %s"):format(playerName, SOURCE_KEY)
+            PROFILE_KEY = ("%s [%s] - %s"):format(playerName, playerRealm, SOURCE_KEY)
             PRIVATE_SV.SAFEDATA.CurrentProfile = PROFILE_KEY
+            local oldKey = ("%s - %s"):format(playerName, SOURCE_KEY)
+            CheckForDeprecated(oldKey)
         elseif(newKey) then
             PROFILE_KEY = newKey
             PRIVATE_SV.SAFEDATA.CurrentProfile = newKey
@@ -542,7 +561,6 @@ local function UpdateProfileSources(newKey)
             PROFILE_KEY = DEFAULT_PROFILE_KEY
             PRIVATE_SV.SAFEDATA.CurrentProfile = DEFAULT_PROFILE_KEY
         end
-
         lib.EventManager:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
     else
         if(newKey) then
@@ -554,7 +572,6 @@ local function UpdateProfileSources(newKey)
             PROFILE_KEY = DEFAULT_PROFILE_KEY
             PRIVATE_SV.SAFEDATA.CurrentProfile = DEFAULT_PROFILE_KEY
         end
-
         lib.EventManager:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
     end

@@ -660,6 +677,8 @@ local function CorePreInitialize()
     if(not MEDIA_SV.profiles[THEME_KEY]) then MEDIA_SV.profiles[THEME_KEY] = {} end
     if(not MEDIA_SV.profiles[THEME_KEY][PROFILE_KEY]) then MEDIA_SV.profiles[THEME_KEY][PROFILE_KEY] = {} end

+    CheckForDeprecated(OLD_PROFILE_KEY);
+
     THEME_KEY = PRIVATE_SV.SAFEDATA.THEME;

     for i = 1, GetNumAddOns() do
diff --git a/SVUI_!Core/setup/installer.lua b/SVUI_!Core/setup/installer.lua
index 1248f4a..8ee3885 100644
--- a/SVUI_!Core/setup/installer.lua
+++ b/SVUI_!Core/setup/installer.lua
@@ -279,8 +279,8 @@ function SV.Setup:ChatConfigs(mungs)
 		ChatFrame2:SetMovable(true);
 	end
 	local ChatFrame3 = _G.ChatFrame3;
-	if(ChatFrame3) then
-		ChatFrame3.isUninteractable = false;
+	if(ChatFrame3) then
+		ChatFrame3.isUninteractable = false;
 		ChatFrame3:SetMovable(true);
 	end
 	FCF_ResetChatWindows()
diff --git a/SVUI_!Core/system/core.lua b/SVUI_!Core/system/core.lua
index ec144ca..c01067f 100644
--- a/SVUI_!Core/system/core.lua
+++ b/SVUI_!Core/system/core.lua
@@ -366,6 +366,10 @@ SV.defaults           = {
         ["afk"] = '1',
     },
     ["Dock"] = {
+        ["dockWidth"] = 412,
+        ["dockHeight"] = 224,
+        ["dockOpacity"] = 1,
+        --BEGIN DEPRECATED
         ["dockLeftWidth"] = 412,
         ["dockLeftHeight"] = 224,
         ["dockRightWidth"] = 412,
@@ -374,12 +378,13 @@ SV.defaults           = {
         ["dockTopLeftHeight"] = 224,
         ["dockTopRightWidth"] = 412,
         ["dockTopRightHeight"] = 224,
+        ["leftDockBackdrop"] = true,
+        ["rightDockBackdrop"] = true,
+        --END DEPRECATED
         ["dockCenterWidth"] = defaultCenterWidth,
         ["dockCenterHeight"] = 20,
         ["buttonSize"] = 30,
         ["buttonSpacing"] = 4,
-        ["leftDockBackdrop"] = true,
-        ["rightDockBackdrop"] = true,
         ["topPanel"] = true,
         ["bottomPanel"] = true,
         ["dockTools"] = {
diff --git a/SVUI_!Core/system/dock.lua b/SVUI_!Core/system/dock.lua
index 5637be7..47410ca 100644
--- a/SVUI_!Core/system/dock.lua
+++ b/SVUI_!Core/system/dock.lua
@@ -23,40 +23,22 @@ local format        = string.format;
 local find          = string.find;
 local match         = string.match;
 local gsub          = string.gsub;
+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;
 --MATH
 local math      	= _G.math;
-local random 		= math.random;
-local min 			= math.min;
-local floor         = math.floor
-local ceil          = math.ceil
+local random 			= math.random;
+local min 				= math.min;
+local floor         = math.floor;
+local ceil          = math.ceil;
+local parsefloat 	= math.parsefloat;
 --BLIZZARD API
-local GameTooltip          	= _G.GameTooltip;
 local InCombatLockdown     	= _G.InCombatLockdown;
 local CreateFrame          	= _G.CreateFrame;
-local GetTime         		= _G.GetTime;
-local GetItemCooldown       = _G.GetItemCooldown;
-local GetItemCount         	= _G.GetItemCount;
-local GetItemInfo          	= _G.GetItemInfo;
-local GetSpellInfo         	= _G.GetSpellInfo;
-local IsSpellKnown         	= _G.IsSpellKnown;
-local GetProfessions       	= _G.GetProfessions;
-local GetProfessionInfo    	= _G.GetProfessionInfo;
-local hooksecurefunc     	= _G.hooksecurefunc;
-local ReloadUI              = _G.ReloadUI;
-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 UnitName              = _G.UnitName;
-local ToggleFrame           = _G.ToggleFrame;
-local ERR_NOT_IN_COMBAT     = _G.ERR_NOT_IN_COMBAT;
 --[[
 ##########################################################
 ADDON
@@ -71,7 +53,7 @@ MOD.Border = {};
 LOCALS
 ##########################################################
 ]]--
-local DOCK_CHECK,DRAGGING_TARGET;
+local DOCK_CHECK;
 local ORDER_TEMP, ORDER_TEST, DOCK_REGISTRY, DOCK_DROPDOWN_OPTIONS = {}, {}, {}, {};
 local DOCK_LOCATIONS = {
 	["BottomLeft"] = {1, "LEFT", true, "ANCHOR_TOPLEFT"},
@@ -79,10 +61,18 @@ local DOCK_LOCATIONS = {
 	["TopLeft"] = {1, "LEFT", false, "ANCHOR_BOTTOMLEFT"},
 	["TopRight"] = {-1, "RIGHT", false, "ANCHOR_BOTTOMLEFT"},
 };
---DOCK_DROPDOWN_OPTIONS["BottomLeft"] = { text = "To BottomLeft", func = function(button) button:MoveTo("BottomLeft"); end };
---DOCK_DROPDOWN_OPTIONS["BottomRight"] = { text = "To BottomRight", func = function(button) button:MoveTo("BottomRight"); end };
---DOCK_DROPDOWN_OPTIONS["TopLeft"] = { text = "To TopLeft", func = function(button) button:MoveTo("TopLeft"); end };
---DOCK_DROPDOWN_OPTIONS["TopRight"] = { text = "To TopRight", func = function(button) MOD.TopRight.Bar:Add(button) end };
+--[[
+	Quick explaination of what Im doing with all of these locals...
+	Unlike many of the other modules, Chat has to continuously
+	reference config settings which can start to get sluggish. What
+	I have done is set local variables for every database value
+	that the module can read efficiently. The function "UpdateLocals"
+	is used to refresh these any time a change is made to configs
+	and once when the mod is loaded.
+]]--
+local DOCK_WIDTH = 412;
+local DOCK_HEIGHT = 224;
+local DOCK_ALPHA = 1;
 --[[
 ##########################################################
 THEMEABLE ITEMS
@@ -91,6 +81,18 @@ THEMEABLE ITEMS
 MOD.ButtonSound = SV.Sounds:Blend("DockButton", "Buttons", "Levers");
 MOD.ErrorSound = SV.Sounds:Blend("Malfunction", "Sparks", "Wired");

+local function copyTable(tab)
+	local copy = {};
+	for k, v in pairs(tab) do
+		if ( type(v) == "table" ) then
+			copy[k] = copyTable(v);
+		else
+			copy[k] = v;
+		end
+	end
+	return copy;
+end
+
 local function GetDockDimensions(location)
 	local width, height;
 	local isTop = location:find("Top")
@@ -168,6 +170,60 @@ local dockBarPostSizeFunc = function(self, width, height)
 	MOD:Refresh()
 end

+local function SaveCurrentPosition(button)
+	if((not button) or (not MOD.private.Floating)) then return end
+
+	local name = button:GetName();
+	local anchor1, parent, anchor2, x, y = button:GetPoint();
+	if((not anchor1) or (not anchor2) or (not x) or (not y)) then
+		result = "TBD";
+	end
+
+	local parentName;
+	if(not parent or (parent and (not parent:GetName()))) then
+		parentName = "UIParent"
+	else
+		parentName = parent:GetName()
+	end
+
+	if(button.FrameLink) then
+		local width, height = button:GetSize()
+		if((not width) or (not height)) then
+			width, height = 0, 0
+		end
+		result = ("%s|%s|%s|%d|%d|%d|%d"):format(anchor1, parentName, anchor2, parsefloat(x), parsefloat(y), parsefloat(width), parsefloat(height))
+		if(frame.UpdateBackdrop) then
+			frame:UpdateBackdrop()
+		end
+	else
+		result = ("%s|%s|%s|%d|%d|%d|%d"):format(anchor1, parentName, anchor2, parsefloat(x), parsefloat(y), 0, 0)
+	end
+
+	MOD.private.Floating[name] = result;
+end
+
+local function LoadSavedPosition(button)
+	if((not button) or (not MOD.private.Floating)) then return end
+	local name = button:GetName();
+	local saved = MOD.private.Floating[name];
+	if(saved and (type(saved) == "string") and (saved ~= 'TBD')) then
+		local anchor1, anchorParent, anchor2, xPos, yPos, width, height = split("|", saved)
+		button:ClearAllPoints()
+		button:SetPoint(anchor1, anchorParent, anchor2, xPos, yPos)
+		if(button.FrameLink) then
+			local frame = button.FrameLink;
+			frame:ClearAllPoints();
+			frame:SetPoint("BOTTOMLEFT", button, "TOPLEFT", -3, 6);
+			if(width and height) then
+				frame:SetSize(width, height)
+			end
+			if(frame.UpdateBackdrop) then
+				frame:UpdateBackdrop()
+			end
+		end
+	end
+end
+
 local function ScreenBorderVisibility()
 	if SV.db.Dock.bottomPanel then
 		SVUIDock_BottomBorder:Show()
@@ -182,21 +238,86 @@ local function ScreenBorderVisibility()
 	end
 end

-function MOD.SetThemeDockStyle(frame, isBottom)
+local function SetBasicBackdrop(frame)
+	local backdrop = CreateFrame("Frame", nil, frame)
+	backdrop:SetAllPoints(frame)
+	backdrop:SetFrameStrata("BACKGROUND")
+
+	local underlay = backdrop:CreateTexture(nil, "BORDER")
+	underlay:InsetPoints(backdrop)
+	underlay:SetTexture(0, 0, 0, 1)
+
+	local left = backdrop:CreateTexture(nil, "OVERLAY")
+	left:SetTexture(0, 0, 0, 1)
+	left:SetPoint("TOPLEFT", 1, -1)
+	left:SetPoint("BOTTOMLEFT", -1, -1)
+	left:SetWidth(2)
+
+	local right = backdrop:CreateTexture(nil, "OVERLAY")
+	right:SetTexture(0, 0, 0, 1)
+	right:SetPoint("TOPRIGHT", -1, -1)
+	right:SetPoint("BOTTOMRIGHT", -1, -1)
+	right:SetWidth(2)
+
+	local bottom = backdrop:CreateTexture(nil, "OVERLAY")
+	bottom:SetTexture(0, 0, 0, 1)
+	bottom:SetPoint("BOTTOMLEFT", 1, -1)
+	bottom:SetPoint("BOTTOMRIGHT", -1, -1)
+	bottom:SetHeight(2)
+
+	local top = backdrop:CreateTexture(nil, "OVERLAY")
+	top:SetTexture(0, 0, 0, 1)
+	top:SetPoint("TOPLEFT", 1, -1)
+	top:SetPoint("TOPRIGHT", -1, 1)
+	top:SetHeight(2)
+
+	return backdrop
+end
+
+local UpdateBackdrop = function(self)
+  local centerX, centerY = self:GetCenter()
+  local screenHeight = GetScreenHeight()
+  local heightTop = screenHeight  *  0.75;
+  if(centerY and (centerY > heightTop)) then
+    self.backdrop.underlay:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 0.8)
+		self.backdrop.left:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 1)
+		self.backdrop.right:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 1)
+		self.backdrop.bottom:SetTexture(0, 0, 0, 0)
+		self.backdrop.bottom:SetAlpha(0)
+		self.backdrop.bottom:SetHeight(1)
+		self.backdrop.top:SetTexture(0, 0, 0, 1)
+		self.backdrop.top:SetAlpha(1)
+		self.backdrop.top:SetHeight(2)
+  else
+		self.backdrop.underlay:SetGradientAlpha("VERTICAL", 0, 0, 0, 0.8, 0, 0, 0, 0)
+		self.backdrop.left:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0)
+		self.backdrop.right:SetGradientAlpha("VERTICAL", 0, 0, 0, 1, 0, 0, 0, 0)
+		self.backdrop.bottom:SetTexture(0, 0, 0, 1)
+		self.backdrop.bottom:SetAlpha(1)
+		self.backdrop.bottom:SetHeight(2)
+		self.backdrop.top:SetTexture(0, 0, 0, 0)
+		self.backdrop.top:SetAlpha(0)
+		self.backdrop.top:SetHeight(1)
+  end
+end
+
+function MOD.SetThemedBackdrop(frame, isBottom)
 	local backdrop = CreateFrame("Frame", nil, frame)
 	backdrop:SetAllPoints(frame)
 	backdrop:SetFrameStrata("BACKGROUND")

-	local bg = backdrop:CreateTexture(nil, "BORDER")
-	bg:InsetPoints(backdrop)
-	bg:SetTexture(1, 1, 1, 1)
+	local underlay = backdrop:CreateTexture(nil, "BORDER")
+	underlay:InsetPoints(backdrop)
+	underlay:SetTexture(1, 1, 1, 1)

 	if(isBottom) then
-		bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 0.8, 0, 0, 0, 0)
+		underlay:SetGradientAlpha("VERTICAL", 0, 0, 0, 0.8, 0, 0, 0, 0)
 	else
-		bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 0.8)
+		underlay:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 0.8)
 	end

+	backdrop.underlay = underlay;
+
 	local left = backdrop:CreateTexture(nil, "OVERLAY")
 	left:SetTexture(1, 1, 1, 1)
 	left:SetPoint("TOPLEFT", 1, -1)
@@ -208,6 +329,8 @@ function MOD.SetThemeDockStyle(frame, isBottom)
 		left:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 1)
 	end

+	backdrop.left = left;
+
 	local right = backdrop:CreateTexture(nil, "OVERLAY")
 	right:SetTexture(1, 1, 1, 1)
 	right:SetPoint("TOPRIGHT", -1, -1)
@@ -219,6 +342,8 @@ function MOD.SetThemeDockStyle(frame, isBottom)
 		right:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 1)
 	end

+	backdrop.right = right;
+
 	local bottom = backdrop:CreateTexture(nil, "OVERLAY")
 	bottom:SetPoint("BOTTOMLEFT", 1, -1)
 	bottom:SetPoint("BOTTOMRIGHT", -1, -1)
@@ -231,6 +356,8 @@ function MOD.SetThemeDockStyle(frame, isBottom)
 		bottom:SetHeight(1)
 	end

+	backdrop.bottom = bottom;
+
 	local top = backdrop:CreateTexture(nil, "OVERLAY")
 	top:SetPoint("TOPLEFT", 1, -1)
 	top:SetPoint("TOPRIGHT", -1, 1)
@@ -243,6 +370,10 @@ function MOD.SetThemeDockStyle(frame, isBottom)
 		top:SetHeight(2)
 	end

+	backdrop.top = top;
+
+	frame.UpdateBackdrop = UpdateBackdrop;
+
 	return backdrop
 end

@@ -463,21 +594,6 @@ local HighLight_OnUpdate = function(self)
 	end
 end

--- local function AnchorInsertHighlight(dockbar)
--- 	local location = dockbar.Data.Location;
--- 	local lastTab = dockbar.Data.Order[#dockbar.Data.Order];
--- 	local isLeft = (location:find('Left'));
--- 	local anchor1 = isLeft and 'LEFT' or 'RIGHT';
--- 	local anchor2 = isLeft and 'RIGHT' or 'LEFT';
--- 	local xOff = isLeft and 2 or -2;
--- 	dockbar.Highlight:ClearAllPoints();
--- 	if(not lastTab) then
--- 		dockbar.Highlight:SetPoint(anchor1, dockbar, anchor1, xOff, 0);
--- 	else
--- 		dockbar.Highlight:SetPoint(anchor1, _G[lastTab], anchor2, xOff, 0);
--- 	end
--- end
-
 local function GetDragToTarget()
 	for location, settings in pairs(DOCK_LOCATIONS) do
 		local dock = MOD[location];
@@ -575,7 +691,6 @@ local function ResetAllDockletWindows(dockbar, button)
 	local location = dockbar.Data.Location;
 	local buttonList = dockbar.Data.Buttons;
 	local currentButton = "";
-	dockbar.Parent.backdrop:Hide();
 	if(button and button.GetName) then
 		currentButton = button:GetName()
 	end
@@ -594,10 +709,11 @@ local function EnableDockletFloating(button)
 		button.isFloating = true;
 		local location = "Floating";
 		local name = button:GetName();
-		MOD.private.FloatingDocklets[name] = true;
 		MOD.private.Locations[name] = location;
 		button.FrameLink:ClearAllPoints();
 		button.FrameLink:SetPoint("BOTTOMLEFT", button, "TOPLEFT", -3, 6);
+		button.FrameLink:SetResizable(true);
+		button.FrameLink.resize:Show();
 	end
 end

@@ -605,7 +721,11 @@ local function DisableDockletFloating(button)
 	if(button and button.isFloating) then
 		button.isFloating = nil;
 		local name = button:GetName();
-		MOD.private.FloatingDocklets[name] = nil;
+		MOD.private.Locations[name] = nil;
+		if(button.FrameLink) then
+			button.FrameLink:SetResizable(false);
+			button.FrameLink.resize:Hide();
+		end
 	end
 end

@@ -615,8 +735,8 @@ local function UpdateDockletFloating(button)
 		button:SetDocked(false);
 		button:Show();
 		local name = button:GetName();
-		MOD.private.FloatingDocklets[name] = true;
 		MOD.private.Locations[name] = location;
+		SaveCurrentPosition(button)
 		if(ShowDockletWindow(button, location)) then
 			ActivateDockletButton(button);
 		end
@@ -633,19 +753,17 @@ local DockBar_SetDefault = function(self, button)

 	if(button) then
 		local name = button:GetName()
-		if(MOD.private.FloatingDocklets[name]) then
-			EnableDockletFloating(button);
-			return true;
-		elseif(button.isFloating) then
+		local lookup = MOD.private.Locations[name];
+		if(lookup and (lookup == "Floating")) then
 			UpdateDockletFloating(button);
 			return true;
 		elseif(button.FrameLink) then
-			MOD.private.DefaultDocklets[location] = name;
+			MOD.private.Active[location] = name;
 		end
 	end

 	if((not button) or (not button.FrameLink)) then
-		local defaultButton = MOD.private.DefaultDocklets[location];
+		local defaultButton = MOD.private.Active[location];
 		button = _G[defaultButton];
 	end

@@ -657,7 +775,6 @@ local DockBar_SetDefault = function(self, button)
 		end
 		self.Parent.Window:FadeIn();
 		if(ShowDockletWindow(button, location)) then
-			self.Parent.backdrop:Show();
 			ActivateDockletButton(button);
 			return true;
 		end
@@ -671,7 +788,7 @@ local DockBar_NextDefault = function(self)
 	local buttonList = self.Data.Buttons;
 	for name,button in pairs(buttonList) do
 		if(button.FrameLink) then
-			MOD.private.DefaultDocklets[location] = name;
+			MOD.private.Active[location] = name;
 			ResetAllDockletWindows(self, button);
 			self.Parent.Window.FrameLink = button.FrameLink;
 			if(not InCombatLockdown()) then
@@ -679,7 +796,6 @@ local DockBar_NextDefault = function(self)
 			end
 			self.Parent.Window:FadeIn();
 			if(ShowDockletWindow(button, location)) then
-				self.Parent.backdrop:Show();
 				ActivateDockletButton(button);
 				return;
 			end
@@ -758,9 +874,29 @@ local DockBar_CheckOrder = function(self, targetName)
 	end
 end

+local reverseAnchors = {
+		TOP = "BOTTOM",
+		BOTTOM = "TOP",
+		LEFT = "RIGHT",
+		RIGHT = "LEFT",
+		TOPRIGHT = "TOPLEFT",
+		TOPLEFT = "TOPRIGHT",
+		BOTTOMRIGHT = "BOTTOMLEFT",
+		BOTTOMLEFT = "BOTTOMRIGHT",
+}
+
+local function CreateDivider(parent, index)
+	local size = parent.ToolBar:GetHeight();
+	local frame = CreateFrame("Frame", nil, parent);
+	frame:SetSize(1,size);
+	parent.Dividers[index] = frame;
+	return frame;
+end
+
 local DockBar_UpdateLayout = function(self)
 	local location = self.Data.Location;
-	local anchor = upper(location)
+	local anchor = upper(location);
+	local reverse = reverseAnchors[anchor];
 	local mod = self.Data.Modifier
 	local size = self.ToolBar:GetHeight();
 	local count = #self.Data.Order;
@@ -778,6 +914,8 @@ local DockBar_UpdateLayout = function(self)
 					nextButton:ClearAllPoints();
 					nextButton:SetSize(calcWidth, size);
 					nextButton:SetPoint(anchor, self.ToolBar, anchor, (offset * mod), 0);
+					local divider = self.Dividers[i] or CreateDivider(self, i);
+					divider:SetPoint(anchor, nextButton, reverse, 2, 0);
 					offset = offset + (calcWidth + 6);
 				end
 				if(not nextButton:IsShown()) then
@@ -789,9 +927,9 @@ local DockBar_UpdateLayout = function(self)
 		end
 	end

-	local defaultButton = MOD.private.DefaultDocklets[location];
+	local defaultButton = MOD.private.Active[location];
 	if(not self.Data.Buttons[defaultButton]) then
-		MOD.private.DefaultDocklets[location] = nil
+		MOD.private.Active[location] = nil
 	end
 	self.ToolBar:SetWidth(offset + size);
 end
@@ -834,7 +972,7 @@ local DockBar_AddButton = function(self, button, forced)
 		frame:InsetPoints(self.Parent.Window)
 		frame.Parent = self.Parent
 		frame:FadeIn()
-		if(not MOD.private.DefaultDocklets[currentLocation]) then
+		if(not MOD.private.Active[currentLocation]) then
 			DockBar_SetDefault(self, button)
 		end
 	end
@@ -874,13 +1012,12 @@ local DockBar_RemoveButton = function(self, button, isMoving)
 		end

 		if(#self.Data.Order == 0) then
-			MOD.private.DefaultDocklets[currentLocation] = nil;
-			self.Parent.backdrop:Hide()
+			MOD.private.Active[currentLocation] = nil;
 		end

 		self.Data.Buttons[name] = nil;
 		DockBar_UpdateOrder(self);
-		if(MOD.private.DefaultDocklets[currentLocation] == name or (not MOD.private.DefaultDocklets[currentLocation]) or (MOD.private.DefaultDocklets[currentLocation] == "")) then
+		if(MOD.private.Active[currentLocation] == name or (not MOD.private.Active[currentLocation]) or (MOD.private.Active[currentLocation] == "")) then
 			self:NextDefault()
 		else
 			self:SetDefault()
@@ -917,6 +1054,9 @@ local DockButton_OnDragStop = function(self)
 		self:SetMovable(false);
 		self:MoveTo(MOD.private.Locations[self:GetName()]);
 	end
+	if(self.FrameLink and self.FrameLink.UpdateBackdrop) then
+		self.FrameLink:UpdateBackdrop()
+	end
 end

 local DockButton_DefaultTip = function(self, ...)
@@ -966,7 +1106,6 @@ local DockButton_OnClick = function(self, button)
 	MOD.ButtonSound()
 	if(button and (button == "RightButton")) then
 		if(IsAltKeyDown()) then
-			self.Parent.Parent.backdrop:Hide()
 			self.ActiveDocklet = false;
 			self:SetPanelColor("default")
 			if(self.Icon) then
@@ -1184,6 +1323,7 @@ for location, settings in pairs(DOCK_LOCATIONS) do
 	MOD[location].Bar.Add 				= DockBar_AddButton;
 	MOD[location].Bar.Remove 			= DockBar_RemoveButton;
 	MOD[location].Bar.Create 			= DockBar_CreateButton;
+	MOD[location].Bar.Dividers 		= {};
 	MOD[location].Bar.Data = {
 		Location = location,
 		Anchor = settings[2],
@@ -1236,6 +1376,15 @@ local Docklet_Relocate = function(self, location)
 	end
 end

+local DockletResize_OnMouseDown = function(self)
+	self.parent:StartSizing("BOTTOMRIGHT");
+end
+
+local DockletResize_OnMouseUp = function(self)
+	self.parent:StopMovingOrSizing();
+	SaveCurrentPosition(self.parent.Button);
+end
+
 function MOD:NewDocklet(location, globalName, readableName, texture, onclick, onenter)
 	if(DOCK_REGISTRY[globalName]) then return end;

@@ -1247,7 +1396,7 @@ function MOD:NewDocklet(location, globalName, readableName, texture, onclick, on

 	local newParent = self[location];
 	if(not newParent) then return end
-	newParent.backdrop:Show()
+
 	local frame = _G[globalName] or CreateFrame("Frame", globalName, UIParent);
 	frame:SetParent(newParent.Window);
 	frame:SetSize(newParent.Window:GetSize());
@@ -1261,13 +1410,23 @@ function MOD:NewDocklet(location, globalName, readableName, texture, onclick, on
 	frame.Relocate = Docklet_Relocate;
 	frame.GetButtonSize = Docklet_ButtonSize;

+	frame.backdrop = self:SetThemedBackdrop(frame)
+	frame.resize = CreateFrame("Frame", nil, frame.backdrop);
+	frame.resize:SetSize(16,16)
+	frame.resize:SetPoint("BOTTOMRIGHT", frame.backdrop, "BOTTOMRIGHT", 0, 0)
+
 	newParent.Bar.Data.Windows[globalName] = frame;

 	local buttonName = ("%sButton"):format(globalName)
 	frame.Button = newParent.Bar:Create(readableName, buttonName, texture, onclick, onenter, false, frame);
 	DOCK_REGISTRY[globalName] = frame;
-	frame:SetAlpha(0)
-	DOCK_CHECK = true
+	frame:SetAlpha(0);
+	DOCK_CHECK = true;
+
+	frame.resize.parent = frame;
+	frame.resize:SetScript("OnMouseDown", DockletResize_OnMouseDown);
+	frame.resize:SetScript("OnMouseUp", DockletResize_OnMouseUp);
+
 	return frame
 end
 --[[
@@ -1303,26 +1462,18 @@ local CornerButton_OnLeave = function(self, ...)
 	GameTooltip:Hide()
 end

-function MOD:UpdateDockBackdrops()
-	if(DOCK_CHECK and SV.db.Dock.rightDockBackdrop) then
-		MOD.BottomRight.backdrop:Show()
-		MOD.BottomRight.backdrop:ClearAllPoints()
-		MOD.BottomRight.backdrop:WrapPoints(MOD.BottomRight.Window, 4, 4)
+function MOD:UpdateLocals()
+	DOCK_WIDTH = SV.db.Dock.dockWidth;
+	DOCK_HEIGHT = SV.db.Dock.dockHeight;
+	DOCK_ALPHA = SV.db.Dock.dockOpacity;
+end

+function MOD:UpdateDockBackdrops()
+	if(DOCK_CHECK) then
 		MOD.BottomRight.Alert.backdrop:ClearAllPoints()
 		MOD.BottomRight.Alert.backdrop:WrapPoints(MOD.BottomRight.Alert, 4, 4)
-	else
-		MOD.BottomRight.backdrop:Hide()
-	end
-	if(DOCK_CHECK and SV.db.Dock.leftDockBackdrop) then
-		MOD.BottomLeft.backdrop:Show()
-		MOD.BottomLeft.backdrop:ClearAllPoints()
-		MOD.BottomLeft.backdrop:WrapPoints(MOD.BottomLeft.Window, 4, 4)
-
 		MOD.BottomLeft.Alert.backdrop:ClearAllPoints()
 		MOD.BottomLeft.Alert.backdrop:WrapPoints(MOD.BottomLeft.Alert, 4, 4)
-	else
-		MOD.BottomLeft.backdrop:Hide()
 	end
 end

@@ -1403,40 +1554,22 @@ function MOD:Load()

 	self.private = SV.private.Docks;

-	if(not self.private.AllFaded) then
-		self.private.AllFaded = false
-	end
-
-	if(not self.private.LeftFaded) then
-		self.private.LeftFaded = false
-	end
-
-	if(not self.private.RightFaded) then
-		self.private.RightFaded = false
-	end
-
-	if(not self.private.LeftExpanded) then
-		self.private.LeftExpanded = false
-	end
-
-	if(not self.private.RightExpanded) then
-		self.private.RightExpanded = false
-	end
-
-	if(not self.private.Order) then
-		self.private.Order = {}
-	end
-
-	if(not self.private.DefaultDocklets) then
-		self.private.DefaultDocklets = {}
-	end
+	if(not self.private.AllFaded) then self.private.AllFaded = false; end
+	if(not self.private.LeftFaded) then self.private.LeftFaded = false; end
+	if(not self.private.RightFaded) then self.private.RightFaded = false; end
+	if(not self.private.LeftExpanded) then self.private.LeftExpanded = false; end
+	if(not self.private.RightExpanded) then self.private.RightExpanded = false; end

-	if(not self.private.FloatingDocklets) then
-		self.private.FloatingDocklets = {}
-	end
+	if(not self.private.Order) then self.private.Order = {} end
+	if(not self.private.Locations) then self.private.Locations = {} end
+	if(not self.private.Floating) then self.private.Floating = {} end
+	if(not self.private.Opacity) then self.private.Opacity = {} end

-	if(not self.private.Locations) then
-		self.private.Locations = {}
+	if(self.private.DefaultDocklets) then
+		self.private.Active = copyTable(self.private.DefaultDocklets);
+		self.private.DefaultDocklets = nil;
+	elseif(not self.private.Active) then
+		self.private.Active = {}
 	end

 	local buttonsize = SV.db.Dock.buttonSize;
@@ -1496,42 +1629,42 @@ function MOD:Load()
 		dock.Bar.ToolBar:ClearAllPoints()

 		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.ToolBar:SetSize(1, buttonsize)
-	    	dock.Bar.ToolBar:SetPoint(barAnchor, dock.Bar.Button, barReverse, (spacing * mod), 0)
+    	dock.Bar.Button:SetSize(buttonsize, buttonsize)
+    	self:SetButtonTheme(dock.Bar.Button, buttonsize)
+    	dock.Bar.Button.Icon:SetTexture(SV.media.icon.default)
+    	dock.Bar.ToolBar:SetSize(1, buttonsize)
+    	dock.Bar.ToolBar:SetPoint(barAnchor, dock.Bar.Button, barReverse, (spacing * mod), 0)
 			dock.Bar.Button:SetPanelColor("default")
 			dock.Bar.Button.Icon:SetGradient(unpack(SV.media.gradient.icon))
 			dock.Bar.Button:SetScript("OnEnter", CornerButton_OnEnter)
 			dock.Bar.Button:SetScript("OnLeave", CornerButton_OnLeave)
+
 			if(location == "BottomLeft") then
 				dock.Bar.Button:SetScript("OnClick", ToggleSuperDockLeft)
 			else
 				dock.Bar.Button:SetScript("OnClick", ToggleSuperDockRight)
 			end
-	    else
-	    	dock.Bar.ToolBar:SetSize(1, buttonsize)
-	    	dock.Bar.ToolBar:SetPoint(barAnchor, dock.Bar, barAnchor, 0, 0)
-	    end
-
-	    dock:SetParent(SV.Screen)
-	    dock:ClearAllPoints()
-	    dock:SetPoint(anchor, dock.Bar, reverse, 0, (12 * vertMod))
-	    dock:SetSize(width, height)
-	    dock:SetAttribute("buttonSize", buttonsize)
-	    dock:SetAttribute("spacingSize", spacing)
-
-	    dock.Alert:ClearAllPoints()
-	    dock.Alert:SetSize(width, 1)
-	    dock.Alert:SetPoint(anchor, dock, anchor, 0, 0)
-
-	    dock.Window:ClearAllPoints()
-	    dock.Window:SetSize(width, height)
-	    dock.Window:SetPoint(anchor, dock.Alert, reverse, 0, 4)
-		dock.backdrop = self.SetThemeDockStyle(dock.Window, isBottom)
-		dock.backdrop:Hide()
-		dock.Alert.backdrop = self.SetThemeDockStyle(dock.Alert, isBottom)
+    else
+    	dock.Bar.ToolBar:SetSize(1, buttonsize)
+    	dock.Bar.ToolBar:SetPoint(barAnchor, dock.Bar, barAnchor, 0, 0)
+    end
+
+    dock:SetParent(SV.Screen)
+    dock:ClearAllPoints()
+    dock:SetPoint(anchor, dock.Bar, reverse, 0, (12 * vertMod))
+    dock:SetSize(width, height)
+    dock:SetAttribute("buttonSize", buttonsize)
+    dock:SetAttribute("spacingSize", spacing)
+
+    dock.Alert:ClearAllPoints()
+    dock.Alert:SetSize(width, 1)
+    dock.Alert:SetPoint(anchor, dock, anchor, 0, 0)
+
+    dock.Window:ClearAllPoints()
+    dock.Window:SetSize(width, height)
+    dock.Window:SetPoint(anchor, dock.Alert, reverse, 0, 4)
+
+		dock.Alert.backdrop = SetBasicBackdrop(dock.Alert)
 		dock.Alert.backdrop:Hide()

 		SV:NewAnchor(dock.Bar, location .. " Dock ToolBar");
@@ -1577,7 +1710,13 @@ end
 local function UpdateAllDocks()
 	for location, settings in pairs(DOCK_LOCATIONS) do
 		local dock = MOD[location];
-		DockBar_SetDefault(dock.Bar)
+		DockBar_SetDefault(dock.Bar);
+	end
+
+	for name, location in pairs(MOD.private.Locations) do
+		if(location == 'Floating') then
+			LoadSavedPosition(_G[name])
+		end
 	end

 	MOD:UpdateDockBackdrops()
diff --git a/SVUI_!Core/system/henchmen.lua b/SVUI_!Core/system/henchmen.lua
index 7edcb08..b7d5ca3 100644
--- a/SVUI_!Core/system/henchmen.lua
+++ b/SVUI_!Core/system/henchmen.lua
@@ -431,7 +431,6 @@ local function CreateHenchmenFrame()
 			end
 		end
 	end
-	Minion_OnMouseUp(m_option)

 	for i=1, 5 do
 		CreateHenchmenOptions(i)
diff --git a/SVUI_Chat/SVUI_Chat.lua b/SVUI_Chat/SVUI_Chat.lua
index e7236dd..44ed1cd 100644
--- a/SVUI_Chat/SVUI_Chat.lua
+++ b/SVUI_Chat/SVUI_Chat.lua
@@ -43,21 +43,10 @@ local tsort         = table.sort;
 local tconcat       = table.concat;
 local tinsert       = _G.tinsert;
 local tremove       = _G.tremove;
-local wipe         = _G.wipe;
+local wipe          = _G.wipe;
 --BLIZZARD API
 local time 					= _G.time;
-local difftime 				= _G.difftime;
-local BetterDate 			= _G.BetterDate;
-local ReloadUI              = _G.ReloadUI;
-local UnitName   			= _G.UnitName;
-local IsInGroup             = _G.IsInGroup;
-local CreateFrame           = _G.CreateFrame;
-local PlaySoundFile 		= _G.PlaySoundFile;
-local GameTooltip 			= _G.GameTooltip;
-local ChatTypeInfo 			= _G.ChatTypeInfo;
-local HideUIPanel 			= _G.HideUIPanel;
-local ShowUIPanel 			= _G.ShowUIPanel;
-local GetTime               = _G.GetTime;
+local difftime 			= _G.difftime;

 local ChatFrame_AddMessageEventFilter = _G.ChatFrame_AddMessageEventFilter;
 local ChatEdit_ChooseBoxForSend = _G.ChatEdit_ChooseBoxForSend;
@@ -735,11 +724,8 @@ do
 		chat:SetUserPlaced(true);

 		chat:RemoveTextures(true)
-
-		--chat:SetStyle("!_Frame", "Transparent")
 		chat:SetBackdropColor(0,0,0,0)
 		chat:SetBackdropBorderColor(0,0,0,0)
-		--chat.Panel:WrapPoints(chat, 4, 4)

 		_G[chatName.."ButtonFrame"]:Die()
 		-------------------------------------------
@@ -1388,7 +1374,7 @@ function MOD:Load()
 	frame:Hide()
 	frame:EnableMouse(true)
 	frame:SetFrameStrata("DIALOG")
-	SV.Dock.SetThemeDockStyle(frame)
+	SV.Dock.SetThemedBackdrop(frame)

 	frame.Title = frame:CreateFontString()
 	frame.Title:SetFontObject(SVUI_Font_Header)