Quantcast

Change it so the Nameplates module hides the GameTooltip instead of the nameplate instead of the other way around.

Scott Sibley [10-20-10 - 06:28]
Change it so the Nameplates module hides the GameTooltip instead of the nameplate instead of the other way around.
Filename
Modules/Nameplates/Nameplates.lua
Modules/Texts/Texts.lua
diff --git a/Modules/Nameplates/Nameplates.lua b/Modules/Nameplates/Nameplates.lua
index 9d25f81..9a1fe76 100644
--- a/Modules/Nameplates/Nameplates.lua
+++ b/Modules/Nameplates/Nameplates.lua
@@ -1,7 +1,7 @@
 local mod = StarTip:NewModule("Nameplates", "AceTimer-3.0")
 mod.name = "Hide Nameplates"
 mod.toggled = true
-mod.desc = "Toggle this module on to cause the mouse cursor to hide nameplates when mousing over them."
+mod.desc = "Toggle this module on to cause the tooltip to hide when mousing over nameplates."
 mod.defaultOff = true
 local _G = _G
 local StarTip = _G.StarTip
@@ -89,14 +89,6 @@ local function isNameplate(frame)
 	return region and region:GetObjectType() == "Texture" and region:GetTexture() == "Interface\\TargetingFrame\\UI-TargetingFrame-Flash"
 end

-local function showframe(frame)
-	frame:Show()
-end
-
-local function stoptimer(frame)
-	frame.startiptimer:Stop()
-end
-
 local anchor = CreateFrame("Frame")
 anchor:SetWidth(200)
 anchor:SetHeight(200)
@@ -111,9 +103,7 @@ function update()
 				anchor:ClearAllPoints()
 				anchor:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", x - 100, y - 100)
 				if PluginUtils.Intersect(anchor, frame) then
-					frame:Hide()
-					frame.startiptimer = frame.startiptimer or LibTimer:New("timer", 3000, false, showframe, frame)
-					frame.startiptimer:Start()
+					GameTooltip:Hide()
 				end
 			end
 		end
diff --git a/Modules/Texts/Texts.lua b/Modules/Texts/Texts.lua
index 010629b..264f856 100644
--- a/Modules/Texts/Texts.lua
+++ b/Modules/Texts/Texts.lua
@@ -57,6 +57,7 @@ local defaultWidgets = {
 	[1] = {
 		name = "Name",
 		enabled = true,
+		frameName = "StarTipTextName",
 		value = [[
 if not UnitExists(unit) then return end
 return '--' .. select(1, UnitName(unit)) .. '--'
@@ -326,13 +327,13 @@ local new, del
 do
 	local pool = {}
 	local i = 0
-	function new(background)
+	function new(name, parent, background)
 		local text = next(pool)

 		if text then
 			pool[text] = nil
 		else
-			local frame = CreateFrame("Frame")
+			local frame = CreateFrame("Frame", name, parent)
 			frame:SetParent(UIParent)
 			if background then
 				frame:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
@@ -405,7 +406,7 @@ function createTexts()
 			end
 			local widget = mod.texts[v]
 			if not widget then
-				local text = new(v.background)
+				local text = new(v.frameName, v.parent, v.background)
 				widget = WidgetText:New(mod.core, v.name, v, v.row or 0, v.col or 0, v.layer or 0, StarTip.db.profile.errorLevel, updateText)
 				text:ClearAllPoints()
 				text:SetParent("UIParent")