Quantcast

* More work on gestures module. There's a basic example called Draw that you can use to draw on ChatFrame1 with. Bugs exist and it's not right. ;)

Scott Sibley [08-03-11 - 09:35]
* More work on gestures module. There's a basic example called Draw that you can use to draw on ChatFrame1 with. Bugs exist and it's not right. ;)
* Gave StarTip a better welcome message and Note in the toc file. Added some color.
Filename
Modules/Gestures/Gestures.lua
StarTip.lua
StarTip.toc
diff --git a/Modules/Gestures/Gestures.lua b/Modules/Gestures/Gestures.lua
index fe9b95a..ca47844 100644
--- a/Modules/Gestures/Gestures.lua
+++ b/Modules/Gestures/Gestures.lua
@@ -69,27 +69,29 @@ StopNoise()
 		cancelBUtton = "RightButtonUp",
 		startFunc = [[
 return function(rec, a, b, c, d)
-    local self = rec.widgetdata
+print("startFunc")
+    local self = rec.widgetData
     self.cdoodle = self.cdoodle or {}
-    wipe(self.cdoodle)
     self.cdoodle.creator = self.name
     self.dw, self.dh = 1000, 1000
+    rec.w, rec.h = self.drawLayer:GetWidth(), self.drawLayer:GetHeight()
 end
 ]],
 		updateFunc = [[
 return function(rec, a, b, c, d)
-    local self = rec.widgetdata
+print("updateFunc")
+    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 l = rec.cdoodle[#rec.cdoodle]
+        if l and (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})
+                tinsert(rec.cdoodle, {c*(self.dw/rec.w), d*(self.dh/rec.h), 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})
+        table.insert(rec.cdoodle, {c*(self.dw/rec.w),d*(self.dh/rec.h), nil})
     end
     self:Draw()
 end
@@ -97,7 +99,8 @@ end
 		stopFunc = false,
 		stopFuncoff = [[
 return function(rec, a, b, c, d)
-    local sefl = rec.widgetdata
+print("Stop func")
+    local sefl = rec.widgetData
     self:Draw()
     self:Start()
     rec.cdoodle = {creator=self.name}
@@ -106,10 +109,12 @@ end

 		nextFunc = [[
 return function(rec, a, b, c, d)
+print("nextFunc")
 end
 ]],
 		cancelFunc = [[
 return function(rec, a, b, c, d)
+print("cancelFunc")
     self:Start()
 end
 ]],
diff --git a/StarTip.lua b/StarTip.lua
index 4bc287d..e2961ef 100644
--- a/StarTip.lua
+++ b/StarTip.lua
@@ -3,6 +3,7 @@ local addonName, addon = ...

 _G["StarTip"] = LibStub("AceAddon-3.0"):NewAddon("StarTip", "AceConsole-3.0", "AceHook-3.0", "AceEvent-3.0", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0")
 StarTip.version = GetAddOnMetadata("StarTip", "Version") or addonName
+StarTip.notes = GetAddOnMetadata("StarTip", "Notes")

 local LibDBIcon = LibStub("LibDBIcon-1.0")
 local LSM = _G.LibStub("LibSharedMedia-3.0")
@@ -726,7 +727,7 @@ function StarTip:OnEnable()
 	local plugin = {}
 	LibStub("LibScriptablePluginColor-1.0"):New(plugin)
 	if self.db.profile.message then
-		ChatFrame1:AddMessage(plugin.Colorize(L["Welcome to "] .. StarTip.name, 0, 1, 1) .. plugin.Colorize(L[" Type /startip to open config. Alternatively you could press escape and choose the addons menu. Or you can choose to show a minimap icon. You can turn off this message under Settings."], 1, 1, 0))
+		ChatFrame1:AddMessage(plugin.Colorize(L["Welcome to "] .. StarTip.name .. " (" .. StarTip.notes .. ")", 0, 1, 1).. plugin.Colorize(L[" Type /startip to open config. Alternatively you could press escape and choose the addons menu. Or you can choose to show a minimap icon. You can turn off this message under Settings."], 1, 1, 0))
 	end
 end

diff --git a/StarTip.toc b/StarTip.toc
index e62d297..7b11aa3 100644
--- a/StarTip.toc
+++ b/StarTip.toc
@@ -1,6 +1,6 @@
 ## Interface: 40200
 ## Title: StarTip
-## Notes: Tooltips from |c1d1a6bffOuter|r|c751f82ffspace|r
+## Notes: |cff751f82Tooltips from |r|cff202585Outer|r|cff751f82space|r
 ## Author: Starlon
 ## Version: @project-version@
 ## X-Category: Tooltip