Quantcast

Make it so when gestures or other scripts call StarTip:HideTooltip that the tooltip doesn't show till you call StarTip:ShowTooltip. The default gesture uses these. Note that this affects all instances where GameTooltip is to be shown.

Scott Sibley [10-09-10 - 07:06]
Make it so when gestures or other scripts call StarTip:HideTooltip that the tooltip doesn't show till you call StarTip:ShowTooltip. The default gesture uses these. Note that this affects all instances where GameTooltip is to be shown.
Filename
Modules/Gestures/Gestures.lua
StarTip.lua
diff --git a/Modules/Gestures/Gestures.lua b/Modules/Gestures/Gestures.lua
index 3ddd870..0502bcf 100644
--- a/Modules/Gestures/Gestures.lua
+++ b/Modules/Gestures/Gestures.lua
@@ -26,8 +26,11 @@ local defaults = {
 				enabled = true,
 				gestures = {{type="line", pattern="right"}, {type="line", pattern="left"}, {type="line", pattern="right"}, {type="line", pattern="left"}},
 				expression = [[
-_G.StarTip.unit = true
-_G.GameTooltip:Hide()
+if not _G.StarTip.tooltipHidden then
+    _G.StarTip:HideTooltip()
+else
+    _G.StarTip:ShowTooltip()
+end
 ]]
 			}
 		}
diff --git a/StarTip.lua b/StarTip.lua
index 7dc3ffb..047065c 100644
--- a/StarTip.lua
+++ b/StarTip.lua
@@ -599,12 +599,17 @@ function StarTip:OpenConfig()
 	AceConfigDialog:Open("StarTip-Addon")
 end

+function StarTip:HideTooltip()
+	GameTooltip:Hide()
+	self.tooltipHidden = true
+end
+
+function StarTip:ShowTooltip()
+	self.tooltipHidden = false
+	GameTooltip:Show()
+end
+
 function StarTip.GameTooltipAddLine(...)
-	do return end
-	if StarTip.addingLine then return ... end
-	local mod = StarTip:GetModule("UnitTooltip")
-	mod.NUM_LINES = mod.NUM_LINES + 1
-	return ...
 end

 local hideTimer
@@ -706,6 +711,7 @@ end


 function StarTip:GameTooltipShow(...)
+
 	local show = true
 	if StarTip.db.profile.modifier > 1 and type(modFuncs[StarTip.db.profile.modifier]) == "function" then
 		if not modFuncs[StarTip.db.profile.modifier]() then
@@ -743,6 +749,8 @@ function StarTip:GameTooltipShow(...)
 				show = false
 			end
 	end
+
+	show = not StarTip.tooltipHidden

 	if not show then GameTooltip:Hide(); return end