Quantcast

More work on gestures.

Scott Sibley [08-03-11 - 08:09]
More work on gestures.
Filename
Modules/Gestures/Gestures.lua
StarTip.toc
StarTip_Environment/Environment.lua
StarTip_Environment/StarTip_Environment.toc
diff --git a/Modules/Gestures/Gestures.lua b/Modules/Gestures/Gestures.lua
index 8bd0027..fe9b95a 100644
--- a/Modules/Gestures/Gestures.lua
+++ b/Modules/Gestures/Gestures.lua
@@ -13,9 +13,6 @@ local UIParent = _G.UIParent
 local gestures = {}
 local environment = {}

-local dw,dh = 1000,1000; -- default width/height. Used for the uniform coordinate system.
-local odw,odh = 480, 320; -- default width/height for rev. 45 and older.
-
 -- LeftButtonDown
 local buttonsList = {L["Left Button"], L["Right Button"], L["Center Button"]}
 local buttons = {"LeftButton", "RightButton", "CenterButton"}
@@ -72,16 +69,38 @@ StopNoise()
 		cancelBUtton = "RightButtonUp",
 		startFunc = [[
 return function(rec, a, b, c, d)
+    local self = rec.widgetdata
+    self.cdoodle = self.cdoodle or {}
+    wipe(self.cdoodle)
+    self.cdoodle.creator = self.name
+    self.dw, self.dh = 1000, 1000
 end
 ]],
 		updateFunc = [[
 return function(rec, a, b, c, d)
+    local self = rec.widgetdata
+    if #rec.cdoodle > 0 then
+        local l = rec.cdoodle[#self.cdoodle]
+        if (floor(l[1]) ~= floor(c) or floor(l[2]) ~= floor(d)) then
+            local dist = sqrt( pow(l[1] - c, 2) + pow(l[2] - d, 2))
+            if ( dist >= 3 and (rec.x ~= c or rec.y ~= d)) then
+                tinsert(rec.cdoodle, {c*(self.dw/rec.width), d*(self.dh/rec.height), nil})
+                rec.x, rec.y = c, d
+            end
+        end
+    else
+        table.insert(rec.cdoodle, {c*(self.dw/rec.width),d*(self.dh/rec.height), nil})
+    end
+    self:Draw()
 end
 ]],
 		stopFunc = false,
 		stopFuncoff = [[
 return function(rec, a, b, c, d)
-   rec.widgetdata:Start()
+    local sefl = rec.widgetdata
+    self:Draw()
+    self:Start()
+    rec.cdoodle = {creator=self.name}
 end
 ]],

@@ -91,12 +110,14 @@ end
 ]],
 		cancelFunc = [[
 return function(rec, a, b, c, d)
+    self:Start()
 end
 ]],
 		tooltip = false,

 		maxGestures = 1,
-		showTrail = false
+		showTrail = true,
+		tooltip = "Test"


 	}
@@ -132,8 +153,9 @@ local optionsDefaults = {
 		type = "execute",
 		func = function()
 			mod.db.profile.gestures = {}
+			mod:WipeGestures()
+			mod:ReInit()
 			StarTip:RebuildOpts()
-			StarTip:Print(L["You'll need to reload your UI. Type /reload"])
 		end,
 		order = 6
 	},
diff --git a/StarTip.toc b/StarTip.toc
index b7b110f..e62d297 100644
--- a/StarTip.toc
+++ b/StarTip.toc
@@ -1,6 +1,6 @@
 ## Interface: 40200
 ## Title: StarTip
-## Notes: Tooltips from Outerspace
+## Notes: Tooltips from |c1d1a6bffOuter|r|c751f82ffspace|r
 ## Author: Starlon
 ## Version: @project-version@
 ## X-Category: Tooltip
diff --git a/StarTip_Environment/Environment.lua b/StarTip_Environment/Environment.lua
deleted file mode 100644
index 049925e..0000000
--- a/StarTip_Environment/Environment.lua
+++ /dev/null
@@ -1,2 +0,0 @@
-
-StarTip_Environent = {}
diff --git a/StarTip_Environment/StarTip_Environment.toc b/StarTip_Environment/StarTip_Environment.toc
deleted file mode 100644
index a1f8440..0000000
--- a/StarTip_Environment/StarTip_Environment.toc
+++ /dev/null
@@ -1,9 +0,0 @@
-## Interface: 40200
-## Title: StarTip [Environment]
-## Notes: Tooltips from Outerspace
-## Author: Starlon
-## Version: 1.0
-## X-Category: Tooltip
-## X-Part-Of: StarTip
-
-Environment.lua