Quantcast

updated

Steven Jackson [07-29-14 - 23:27]
updated
Filename
Interface/AddOns/SVUI/system/system.lua
Interface/AddOns/SVUI/system/templates.lua
Interface/AddOns/SVUI/system/timers.lua
Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua
diff --git a/Interface/AddOns/SVUI/system/system.lua b/Interface/AddOns/SVUI/system/system.lua
index ccbda5e..4bf9394 100644
--- a/Interface/AddOns/SVUI/system/system.lua
+++ b/Interface/AddOns/SVUI/system/system.lua
@@ -767,6 +767,7 @@ SVUI LOAD PROCESS
 ##########################################################
 ]]--
 function SuperVillain:Load()
+	self:ClearAllTimers()
 	if not SVUI_Global then SVUI_Global = {} end
     if not SVUI_Global["profiles"] then SVUI_Global["profiles"] = {} end

@@ -915,19 +916,12 @@ SVUISystemEventHandler:SetScript("OnEvent", SVUISystem_OnEvent)
 local LoadEventHandler = CreateFrame("Frame", nil)
 local LoadEventHandler_OnEvent = function(self, event, arg1)
 	if (event == "ADDON_LOADED"  and arg1 ~= "Blizzard_DebugTools") or event == "PLAYER_LOGIN" then
-		local actionsTaken = false
 		if(not SuperVillain.AddonLoaded) then
 			SuperVillain:Load()
-			actionsTaken = true
 		end
 		if(not SuperVillain.AddonLaunched and IsLoggedIn()) then
 			SuperVillain:Launch()
-			actionsTaken = true
 		end
-		-- if(not actionsTaken) then
-		-- 	self:UnregisterEvent("ADDON_LOADED")
-		-- 	self:UnregisterEvent("PLAYER_LOGIN")
-		-- end
 	end
 end

diff --git a/Interface/AddOns/SVUI/system/templates.lua b/Interface/AddOns/SVUI/system/templates.lua
index d0aa137..3403dac 100644
--- a/Interface/AddOns/SVUI/system/templates.lua
+++ b/Interface/AddOns/SVUI/system/templates.lua
@@ -821,7 +821,11 @@ local function CreateButtonPanel(frame, noChecked, brightChecked)

     if(frame.SetDisabledTexture) then
         frame:SetDisabledTexture("")
-    end
+    end
+
+    if(frame.SetCheckedTexture) then
+        frame:SetCheckedTexture("")
+    end

     if(frame.SetHighlightTexture and not frame.hover) then
         local hover = frame:CreateTexture(nil, "OVERLAY")
@@ -1009,13 +1013,13 @@ end
 local function SetCheckboxTemplate(self, underlay, x, y)
     if self.styled then return end
     if(underlay) then
-        x = -7
-        y = -7
+        x = x or -7
+        y = y or -7
     end
     CreatePanelTemplate(self, "Slot", underlay, true, 1, x, y)
     CreateButtonPanel(self, false, true)

-    NewHook(self, "SetChecked",function(self,checked)
+    NewHook(self, "SetChecked", function(self,checked)
         local r,g,b = 0,0,0
         if(checked == 1) then
             r,g,b = self:GetCheckedTexture():GetVertexColor()
diff --git a/Interface/AddOns/SVUI/system/timers.lua b/Interface/AddOns/SVUI/system/timers.lua
index 119ce78..4636bd1 100644
--- a/Interface/AddOns/SVUI/system/timers.lua
+++ b/Interface/AddOns/SVUI/system/timers.lua
@@ -113,7 +113,13 @@ function SuperVillain:RemoveLoop(id)
 		ExeTimerQueue[id] = nil
 		self.TimerCount = self.TimerCount - 1;
 	end
-end
+end
+
+function SuperVillain:ClearAllTimers()
+	ExeTimerManager:SetScript("OnUpdate", nil)
+	ExeTimerQueue = {}
+	ExeTimerManager:SetScript("OnUpdate", ExeTimerManager_OnUpdate)
+end
 --[[
 ##########################################################
 TIMER FUNCTIONS
diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua
index a44f755..f304941 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua
@@ -168,10 +168,11 @@ local function LFDFrameStyle()
   for _,name in pairs(LFDFrameList) do
     local frame = _G[name];
     if frame then
-      frame.checkButton:SetCheckboxTemplate(true)
+      frame.checkButton:Formula409()
+      frame.checkButton:SetCheckboxTemplate(true, -4, -4)
+      frame.checkButton:SetFrameLevel(frame.checkButton:GetFrameLevel() + 50)
       frame:DisableDrawLayer("BACKGROUND")
       frame:DisableDrawLayer("OVERLAY")
-      frame.checkButton:SetFrameLevel(frame.checkButton:GetFrameLevel() + 50)
     end
   end;
   LFDQueueFrameRoleButtonLeader.leadIcon = LFDQueueFrameRoleButtonLeader:CreateTexture(nil, 'BACKGROUND')
@@ -184,22 +185,23 @@ local function LFDFrameStyle()
   RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetPoint(RaidFinderQueueFrameRoleButtonLeader:GetNormalTexture():GetPoint())
   RaidFinderQueueFrameRoleButtonLeader.leadIcon:Size(50)
   RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetAlpha(0.4)
-  hooksecurefunc('LFG_DisableRoleButton', function(t)
-    if t.checkButton:GetChecked() then
-       t.checkButton:SetAlpha(1)
+  hooksecurefunc('LFG_DisableRoleButton', function(self)
+    if self.checkButton:GetChecked() then
+       self.checkButton:SetAlpha(1)
     else
-       t.checkButton:SetAlpha(0)
+       self.checkButton:SetAlpha(0)
     end;
-    if t.background then
-       t.background:Show()
+    if self.background then
+       self.background:Show()
     end
   end)
-  hooksecurefunc('LFG_EnableRoleButton', function(t)
-    t.checkButton:SetAlpha(1)
+  hooksecurefunc('LFG_EnableRoleButton', function(self)
+    self.checkButton:SetAlpha(1)
   end)
-  hooksecurefunc("LFG_PermanentlyDisableRoleButton", function(o)
-    if o.background then
-       o.background:Show()o.background:SetDesaturated(true)
+  hooksecurefunc("LFG_PermanentlyDisableRoleButton", function(self)
+    if self.background then
+       self.background:Show()
+       self.background:SetDesaturated(true)
     end
   end)
   for u = 1, 4 do
@@ -228,24 +230,19 @@ local function LFDFrameStyle()
   LFDParentFrame:Formula409()
   LFDQueueFrameFindGroupButton:Formula409()
   LFDParentFrameInset:Formula409()
+  LFDQueueFrameSpecificListScrollFrame:Formula409()
   LFDQueueFrameFindGroupButton:SetButtonTemplate()
   hooksecurefunc("LFDQueueFrameRandom_UpdateFrame", LFDQueueRandom_OnUpdate)
-  for u = 1, NUM_LFD_CHOICE_BUTTONS do
-     _G["LFDQueueFrameSpecificListButton"..u].enableButton:SetCheckboxTemplate(true)
-  end;
   hooksecurefunc("ScenarioQueueFrameSpecific_Update", function()
     for u = 1, NUM_SCENARIO_CHOICE_BUTTONS do
-      local t = _G["ScenarioQueueFrameSpecificButton"..u]
-      if t and not t.styled then
-        t.enableButton:SetCheckboxTemplate(true)
-        t.styled = true
-      end
+      local box = _G["ScenarioQueueFrameSpecificButton"..u.."EnableButton"]
+      if(box and (not box.Panel)) then
+        box:Formula409()
+        box:SetCheckboxTemplate(true, -2, -3)
+      end
     end
   end)
-  for u = 1, NUM_LFR_CHOICE_BUTTONS do
-    local v = _G["LFRQueueFrameSpecificListButton"..u].enableButton;
-    v:SetCheckboxTemplate(true)
-  end;
+
   STYLE:ApplyDropdownStyle(LFDQueueFrameTypeDropDown)
   FlexRaidFrameScrollFrame:Formula409()
   FlexRaidFrameBottomInset:Formula409()
@@ -257,6 +254,8 @@ local function LFDFrameStyle()
   RaidFinderFrame:Formula409()
   RaidFinderFrameBottomInset:Formula409()
   RaidFinderFrameRoleInset:Formula409()
+  LFDQueueFrameRandomScrollFrameScrollBar:Formula409()
+  ScenarioQueueFrameSpecificScrollFrame:Formula409()
   RaidFinderFrameBottomInsetBg:Hide()
   RaidFinderFrameBtnCornerRight:Hide()
   RaidFinderFrameButtonBottomBorder:Hide()
@@ -314,16 +313,10 @@ local function LFDFrameStyle()
   LFRQueueFrameAcceptCommentButton:SetButtonTemplate()
   STYLE:ApplyScrollStyle(LFRQueueFrameCommentScrollFrameScrollBar)
   STYLE:ApplyScrollStyle(LFDQueueFrameSpecificListScrollFrameScrollBar)
-  LFDQueueFrameSpecificListScrollFrame:Formula409()
   RaidBrowserFrame:HookScript('OnShow', function()
     if not LFRQueueFrameSpecificListScrollFrameScrollBar.styled then
       STYLE:ApplyScrollStyle(LFRQueueFrameSpecificListScrollFrameScrollBar)
-      local list = {LFRQueueFrameRoleButtonHealer, LFRQueueFrameRoleButtonDPS, LFRQueueFrameRoleButtonTank}
       LFRBrowseFrame:Formula409()
-      for _,s in pairs(list) do
-        s.checkButton:SetCheckboxTemplate(true)
-        s:GetChildren():SetFrameLevel(s:GetChildren():GetFrameLevel() + 1)
-      end;
       for u = 1, 2 do
         local C = _G['LFRParentFrameSideTab'..u]
         C:DisableDrawLayer('BACKGROUND')
@@ -365,15 +358,30 @@ local function LFDFrameStyle()
   _G[RaidFinderQueueFrame.PartyBackfill:GetName().."NoBackfillButton"]:SetButtonTemplate()
   _G[ScenarioQueueFrame.PartyBackfill:GetName().."BackfillButton"]:SetButtonTemplate()
   _G[ScenarioQueueFrame.PartyBackfill:GetName().."NoBackfillButton"]:SetButtonTemplate()
-  LFDQueueFrameRandomScrollFrameScrollBar:Formula409()
-  ScenarioQueueFrameSpecificScrollFrame:Formula409()
+
   STYLE:ApplyScrollStyle(LFDQueueFrameRandomScrollFrameScrollBar)
   STYLE:ApplyScrollStyle(ScenarioQueueFrameSpecificScrollFrameScrollBar)
   LFDQueueFrameRandomScrollFrame:SetFixedPanelTemplate("Inset")
   ScenarioQueueFrameRandomScrollFrame:SetFixedPanelTemplate("Inset")
   RaidFinderQueueFrameScrollFrame:SetFixedPanelTemplate("Inset")
   FlexRaidFrameScrollFrame:SetFixedPanelTemplate("Inset")
-end;
+  for u = 1, NUM_LFD_CHOICE_BUTTONS do
+    local box = _G["LFDQueueFrameSpecificListButton"..u.."EnableButton"]
+    if(box and (not box.Panel)) then
+      box:Formula409()
+      box:SetCheckboxTemplate(true, -2, -3)
+      box:SetFrameLevel(box:GetFrameLevel() + 50)
+    end
+  end
+  for u = 1, NUM_LFR_CHOICE_BUTTONS do
+    local box = _G["LFRQueueFrameSpecificListButton"..u.."EnableButton"]
+    if(box and (not box.Panel)) then
+      box:Formula409()
+      box:SetCheckboxTemplate(true, -2, -3)
+      box:SetFrameLevel(box:GetFrameLevel() + 50)
+    end
+  end
+end
 --[[
 ##########################################################
 STYLE LOADING