Quantcast

5.2.4

Steven Jackson [11-24-14 - 02:21]
5.2.4
Filename
Interface/AddOns/SVUI/data/defaults.lua
Interface/AddOns/SVUI/framework/api/api_templates.lua
Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua
Interface/AddOns/SVUI/system/screen.lua
Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
diff --git a/Interface/AddOns/SVUI/data/defaults.lua b/Interface/AddOns/SVUI/data/defaults.lua
index 768ddbe..2600f03 100644
--- a/Interface/AddOns/SVUI/data/defaults.lua
+++ b/Interface/AddOns/SVUI/data/defaults.lua
@@ -74,7 +74,8 @@ SV.defaults["general"] = {
     ["sharingiscaring"] = false,
     ["arenadrink"] = true,
     ["stupidhat"] = true,
-    ["graphSize"] = 64,
+    ["graphSize"] = 64,
+    ["scaleAdjust"] = 0.64,
 }

 SV.defaults["totems"] = {
diff --git a/Interface/AddOns/SVUI/framework/api/api_templates.lua b/Interface/AddOns/SVUI/framework/api/api_templates.lua
index c685c89..49ae711 100644
--- a/Interface/AddOns/SVUI/framework/api/api_templates.lua
+++ b/Interface/AddOns/SVUI/framework/api/api_templates.lua
@@ -800,9 +800,8 @@ local ShowAlertFlash = function(self)
 end

 local HideAlertFlash = function(self)
-    local r,g,b = unpack(SV.Media.color.default);
-    self:ColorBorder(1,0.9,0,nil,true)
     SV.Animate:StopFlash(self.__border)
+    self:ColorBorder(1,0.9,0, nil, true)
 end

 local function SetFramedButtonTemplate(self, template, borderSize)
diff --git a/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua b/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua
index b4f8069..53fec21 100644
--- a/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua
+++ b/Interface/AddOns/SVUI/framework/movers/mover_mentalo.lua
@@ -706,13 +706,15 @@ function Mentalo:Reset(request)
 				SV.cache.Anchors[frameName] = nil
 			end
 		end
-	elseif(request == "Blizzard") then
+	elseif(request == "Blizzard") then
 		for frameName, point in pairs(self.Blizzard) do
 			local frame = _G[frameName];
-			if(point and (type(point) == "string")) then
-				local u, v, w, x, y = split("\031", point)
-				frame:ClearAllPoints()
-				frame:SetPoint(u, v, w, x, y)
+			if(frame) then
+				if(point and (type(point) == "string")) then
+					local u, v, w, x, y = split("\031", point)
+					frame:ClearAllPoints()
+					frame:SetPoint(u, v, w, x, y)
+				end
 			end
 			if(SV.cache.Anchors and SV.cache.Anchors[frameName]) then
 				SV.cache.Anchors[frameName] = nil
@@ -889,10 +891,13 @@ local BlizzardFrame_OnUpdate = function(self)
 		local anchor1, parent, anchor2, x, y = split("\031", SV.cache.Anchors[frameName])
 		self:ClearAllPoints()
 		self:SetPoint(anchor1, parent, anchor2, x, y)
-	elseif(Mentalo.Blizzard[frameName] and (type(Mentalo.Blizzard[frameName]) == "string")) then
-		local anchor1, parent, anchor2, x, y = split("\031", Mentalo.Blizzard[frameName])
-		self:ClearAllPoints()
-		self:SetPoint(anchor1, parent, anchor2, x, y)
+	else
+		local defaultPoint = Mentalo.Blizzard[frameName]
+		if(defaultPoint and (type(defaultPoint) == "string")) then
+			local anchor1, parent, anchor2, x, y = split("\031", defaultPoint)
+			self:ClearAllPoints()
+			self:SetPoint(anchor1, parent, anchor2, x, y)
+		end
 	end
 end

@@ -918,11 +923,14 @@ local BlizzardFrame_OnDragStop = function(self)
 	Mentalo:SaveMovable(frameName)
 end

-local MentaloMaster_OnEvent = function(self)
+local UIPanelsAdjusted = {};
+
+local MentaloDraggablesUpdate = function(self, event, ...)
+	if(InCombatLockdown()) then return end
 	for _, frameName in pairs(DraggableFrames) do
-		local frame = _G[frameName]
-		if(frame) then
-			if(frameName ~= "LossOfControlFrame" and (not self.Blizzard[frameName])) then
+		if((not self.Blizzard[frameName]) or (self.Blizzard[frameName] and (self.Blizzard[frameName] == "TBD"))) then
+			local frame = _G[frameName]
+			if(frame) then
 				frame:EnableMouse(true)

 				if(frameName == "LFGDungeonReadyPopup") then
@@ -936,10 +944,18 @@ local MentaloMaster_OnEvent = function(self)
 				frame:SetScript("OnDragStart", BlizzardFrame_OnDragStart)
 				frame:SetScript("OnDragStop", BlizzardFrame_OnDragStop)

+				if(self.CenterEverything and (not UIPanelsAdjusted[panelName])) then
+					frame:ClearAllPoints()
+					frame:SetPoint('TOP', SV.Screen, 'TOP', 0, -180)
+					UIPanelsAdjusted[frameName] = true
+				end
+
 				self.Blizzard[frameName] = CurrentPosition(frame)
-			end
-		end
-	end
+			else
+				self.Blizzard[frameName] = "TBD"
+			end
+		end
+	end
 end

 Mentalo:RegisterEvent("PLAYER_LOGIN")
@@ -951,7 +967,7 @@ Mentalo:RegisterEvent("UPDATE_WORLD_STATES")
 Mentalo:RegisterEvent("WORLD_STATE_TIMER_START")
 Mentalo:RegisterEvent("WORLD_STATE_UI_TIMER_UPDATE")

-Mentalo:SetScript("OnEvent", MentaloMaster_OnEvent)
+Mentalo:SetScript("OnEvent", MentaloDraggablesUpdate)
 --[[
 ##########################################################
 Initialize
@@ -984,25 +1000,11 @@ function Mentalo:Initialize()
 	SVUI_MentaloPrecisionRightButton:SetButtonTemplate()

 	SV.cache.Anchors = SV.cache.Anchors or {}
+	self.CenterEverything = SV.db.general.multiMonitor

-	self:SetPositions()
+	MentaloDraggablesUpdate(self)

-	if(SV.db.general.multiMonitor) then
-		for panelName, panelData in pairs(_G["UIPanelWindows"]) do
-			if(self.Blizzard[panelName] and (not SV.cache.Anchors[frameName])) then
-				if(panelData.area and (panelData.area == 'left')) then
-					local frame = _G[panelName];
-					local parent = frame:GetParent():GetName()
-					if(parent and ((parent == UIParent) or (parent == SV.Screen))) then
-						frame:ClearAllPoints()
-						frame:SetPoint('CENTER', parent, 'CENTER', 0, 0)
-						SetUIPanelAttribute(frame, 'area', 'center')
-						self.Blizzard[frameName] = CurrentPosition(frame)
-					end
-				end
-			end
-		end
-	end
+	self:SetPositions()
 end

 SV.Mentalo = Mentalo
\ No newline at end of file
diff --git a/Interface/AddOns/SVUI/system/screen.lua b/Interface/AddOns/SVUI/system/screen.lua
index 04b5a45..8627747 100644
--- a/Interface/AddOns/SVUI/system/screen.lua
+++ b/Interface/AddOns/SVUI/system/screen.lua
@@ -41,6 +41,7 @@ GET ADDON DATA
 local SV = select(2, ...)

 SV.Screen = _G["SVUIParent"];
+local BASE_MOD = 0.64;
 local SCREEN_MOD = 1;
 --[[
 ##########################################################
@@ -118,12 +119,14 @@ function SV:UI_SCALE_CHANGED(event)
             self.Screen:SetSize(UIParent:GetSize());
         end

-        local change = abs((testScale1 * 100) - (testScale2 * 100))
-        if(change > 1) then
-            if(self.db.general.autoScale) then
-                self:StaticPopup_Show('FAILED_UISCALE')
-            else
-                self:StaticPopup_Show('RL_CLIENT')
+        if(event == 'UI_SCALE_CHANGED') then
+            local change = abs((testScale1 * 100) - (testScale2 * 100))
+            if(change > 1) then
+                if(self.db.general.autoScale) then
+                    self:StaticPopup_Show('FAILED_UISCALE')
+                else
+                    self:StaticPopup_Show('RL_CLIENT')
+                end
             end
         end
     end
@@ -160,10 +163,13 @@ function SV.Screen:Update()
     end

     local gxScale;
+    if(SV.db.general.scaleAdjust and type(SV.db.general.scaleAdjust) == "number") then
+        BASE_MOD = SV.db.general.scaleAdjust;
+    end
     if(SV.db.general.autoScale) then
-        gxScale = max(0.7, min(1.15, gxMod));
+        gxScale = max(BASE_MOD, min(1.15, gxMod));
     else
-        gxScale = max(0.7, min(1.15, GetCVar("uiScale") or UIParent:GetScale() or gxMod));
+        gxScale = max(BASE_MOD, min(1.15, GetCVar("uiScale") or UIParent:GetScale() or gxMod));
     end

     SCREEN_MOD = (gxMod / gxScale);
diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
index b11a3bc..4546934 100644
--- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
+++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
@@ -163,14 +163,22 @@ SV.Options.args.primary = {
 					order = 3,
 					width = "full",
 					type = "execute",
-					name = L["Reset Anchors"],
-					desc = L["Reset all frames to their original positions."],
+					name = L["Reset SVUI Anchors"],
+					desc = L["Reset all SVUI frames to their original positions."],
 					func = function() SV.Mentalo:Reset() end
 				},
-				toggleKeybind = {
+				ResetDraggables = {
 					order = 4,
 					width = "full",
 					type = "execute",
+					name = L["Reset Blizzard Anchors"],
+					desc = L["Reset all draggable Blizzard frames to their original positions."],
+					func = function() SV.Mentalo:Reset("Blizzard") end
+				},
+				toggleKeybind = {
+					order = 5,
+					width = "full",
+					type = "execute",
 					name = L["Keybind Mode"],
 					func = function()
 						SV.SVBar:ToggleKeyBindingMode()
@@ -240,6 +248,18 @@ SV.Options.args.common = {
 									get = function(j)return SV.db.general.loginmessage end,
 									set = function(j,value)SV.db.general.loginmessage = value end
 								},
+								scaleAdjust = {
+									order = 5,
+									name = L["Base Scale"],
+									desc = L["You can use this to adjust the base value applied to auto-scaling."],
+									type = "range",
+									width = "full",
+									min = 0.64,
+									max = 1,
+									step = 0.01,
+									get = function(j)return SV.db.general.scaleAdjust end,
+									set = function(j,value) SV.db.general.scaleAdjust = value; SV:StaticPopup_Show("RL_CLIENT") end
+								},
 							}
 						},
 						lootGroup = {