Quantcast

Added version checks and warnings for Dongle

James Whitehead II [01-11-07 - 02:23]
Added version checks and warnings for Dongle
Removed clique "special" mode
Filename
Clique.lua
CliqueOptions.lua
diff --git a/Clique.lua b/Clique.lua
index 1d53060..45954dd 100644
--- a/Clique.lua
+++ b/Clique.lua
@@ -4,6 +4,11 @@

 Clique = {Locals = {}}

+assert(DongleStub, string.format("Clique requires DongleStub."))
+assert(DongleStub:GetVersion() == "DongleStub-Beta0",
+	string.format("Clique requires DongelStub-Beta0.  You are using an older version."))
+assert(DongleStub("Dongle-Beta0"),
+	string.format("Clique requires Dongle-Beta0.  You are using an older version."))

 DongleStub("Dongle-Beta0"):New("Clique", Clique)

@@ -422,3 +427,65 @@ end
 for k,v in pairs(buttonsraw) do
 	table.insert(buttons, v)
 end
+
+--collectgarbage("setpause", 100)
+--collectgarbage("setstepmul", 2000)
+
+--[[
+local tbl = {}
+
+local min
+local max
+local elapsed = 0
+local frame = CreateFrame("Frame", "gctest")
+frame:SetScript("OnUpdate", function(f, t)
+	elapsed = elapsed + t
+	if elapsed >= 0.3 then
+		local count = collectgarbage("count")
+		if not min then
+			min = count
+			max = count
+		end
+
+		if count > max then max = count end
+		if count < min then min = count end
+		Clique:Print(string.format("%2.f (min %2.f, max %2.f)", count, min, max), count < max and "Cycle" or "")
+		elapsed = 0
+		for i=1,500 do
+			table.insert(tbl, {1,2,3,4,5})
+		end
+		tbl = {}
+	end
+end)
+--]]
+
+-- pause, mul
+-- 100,200
+-- min: 16096
+-- max: 20993
+-- cycle: 19794
+
+-- 100,500
+-- min: 16096
+-- max: 18292
+-- cycle: 16500
+
+-- 100,1000
+-- min: 16095
+-- max: 17225
+-- cycle: 16500
+
+-- 100,2000
+-- min: 16095
+-- max: 16722
+-- cycle: 16300
+
+-- Default Settings
+-- min: 16095
+-- max: 36114
+-- cycle: 18600
+
+-- 100 pause, default mult
+-- min: 16095
+-- max: 20052
+-- cycle: 17857
\ No newline at end of file
diff --git a/CliqueOptions.lua b/CliqueOptions.lua
index f720e7c..2f30714 100644
--- a/CliqueOptions.lua
+++ b/CliqueOptions.lua
@@ -12,37 +12,6 @@ function Clique:OptionsOnLoad()
         this.updateTooltip = nil
         GameTooltip:Hide()
     end
-
-	self.special = CreateFrame("Frame", UIParent)
-	self.special:SetFrameStrata("DIALOG")
-	self.special:SetHeight(32)
-	self.special:SetWidth(32)
-	self.special.texture = self.special:CreateTexture("ARTWORK")
-	self.special.texture:SetTexture("Interface\\AddOns\\Clique\\Images\\myborder")
-	self.special.texture:SetAllPoints()
-	self.special:SetAlpha(1.0)
-
-	CreateFrame("Button", "CliqueSpecialButton")
-
-	CliqueSpecialButton:SetScript("OnClick", function()
-		if not self.sequence then self.sequence = 1 end
-		ClearOverrideBindings(CliqueSpecialButton)
-		if self.sequence == 1 then
-			SetOverrideBindingClick(CliqueSpecialButton, true, "O", "CliqueSpecialButton")
-		elseif self.sequence == 2 then
-			SetOverrideBindingClick(CliqueSpecialButton, true, "L", "CliqueSpecialButton")
-		elseif self.sequence == 3 then
-			SetOverrideBindingClick(CliqueSpecialButton, true, "E", "CliqueSpecialButton")
-		elseif self.sequence == 4 then
-			self:Print("Special mode activated")
-			for k,v in pairs(self.ccframes) do
-				k:SetScript("PostClick", function()
-					self.special:SetPoint("CENTER", k, "CENTER", 0, 0)
-				end)
-			end
-		end
-		self.sequence = self.sequence + 1
-	end)

     for i=1,12 do
         local parent = getglobal("SpellButton"..i)
@@ -162,10 +131,6 @@ function Clique:Toggle()
         Clique:CreateOptionsFrame()
 		CliqueFrame:Hide()
 		CliqueFrame:Show()
-		SetOverrideBindingClick(CliqueSpecialButton, true, "M", "CliqueSpecialButton")
-		CliqueFrame:SetScript("OnHide", function()
-			ClearOverrideBindings(CliqueSpecialButton)
-		end)
 	else
         if CliqueFrame:IsVisible() then
             CliqueFrame:Hide()
@@ -173,7 +138,6 @@ function Clique:Toggle()
         else
             CliqueFrame:Show()
 			CliquePulloutTab:SetChecked(true)
-			SetOverrideBindingClick(CliqueSpecialButton, true, "M", "CliqueSpecialButton")
         end
     end

@@ -559,8 +523,8 @@ function Clique:CreateOptionsFrame()
 	frame:SetWidth(450)
 	frame:SetPoint("CENTER", 70, -50)
 	self:SkinFrame(frame)
+	frame:SetFrameStrata("DIALOG")
 	frame.title:SetText("Clique Custom Editor");
-	frame:SetFrameStrata("HIGH")
     frame:Hide()

 	-- Help text for Custom screen