Quantcast

Hover over someone and press ctrl after the talents line shows to clear that player's cache so the talents can be reloaded. I'm not even sre if this works yet.

Scott Sibley [08-08-10 - 21:24]
Hover over someone and press ctrl after the talents line shows to clear that player's cache so the talents can be reloaded. I'm not even sre if this works yet.
Filename
Modules/DeadlyAnnounce.lua
Modules/Talents.lua
StarTip.lua
diff --git a/Modules/DeadlyAnnounce.lua b/Modules/DeadlyAnnounce.lua
index ad03c4f..ddbda67 100644
--- a/Modules/DeadlyAnnounce.lua
+++ b/Modules/DeadlyAnnounce.lua
@@ -162,8 +162,10 @@ function mod:OnEnable()
 end

 function mod:OnDisable()
-	local mod = BigWigs:GetBossModule(module)
-	StarTip:RemoveHook(mod, "DelayMessage")
+	if BigWigs then
+		local mod = BigWigs:GetBossModule(module)
+		StarTip:RemoveHook(mod, "DelayMessage")
+	end
 end

 function mod:GetOptions()
@@ -235,7 +237,8 @@ end

 local lastGuid
 function mod:SetUnit()
-	StarTip:Print("set unit")
+
+	if self.modifier then return end

 	line = 1

@@ -287,4 +290,4 @@ function mod:SetUnit()

 	self.shown = true

-end
\ No newline at end of file
+end
diff --git a/Modules/Talents.lua b/Modules/Talents.lua
index 242ba98..9e545bb 100644
--- a/Modules/Talents.lua
+++ b/Modules/Talents.lua
@@ -29,6 +29,7 @@ local linesToAddRightG = {}
 local linesToAddRightB = {}
 local TalentQuery = LibStub:GetLibrary("LibTalentQuery-1.0", true)
 local spec = setmetatable({}, {__mode='v'})
+mod.spec = spec
 local timer, talentTimer
 local dw = StarTip:GetModule("DeadlyAnnounce", true)

@@ -142,7 +143,9 @@ local updateTalents = function()
 		else
 			lineNum = GameTooltip:NumLines() + 1
 		end
+
 		GameTooltip:AddDoubleLine(' ', ' ')
+
 		local left = mod.leftLines[lineNum]
 		local right = mod.rightLines[lineNum]
 		left:SetText("Talents:")
@@ -208,6 +211,12 @@ function mod:SetUnit()
 		return
 	end

+	for i = 1, GameTooltip:NumLines() do
+		if StarTip.leftLines[i]:GetText() == "Talents:" then
+			self.oldLine = i
+		end
+	end
+
 	if UnitIsUnit("mouseover", "player") then
 		self:TalentQuery_Ready(_, UnitName("player"))
 	else
@@ -237,3 +246,22 @@ function mod:OnHide()
 	end
 end

+function mod:MODIFIER_STATE_CHANGED(ev, modifier, up, ...)
+	self.modifier = true
+	local mod = (modifier == "LCTRL" or modifier == "RCTRL") and "LCTRL"
+
+	StarTip:Print("1")
+	if mod ~= "LCTRL" or not UnitExists("mouseover") then
+		return
+	end
+
+	StarTip:Print("2")
+
+	local nameRealm = select(1, UnitName("mouseover")) .. (select(2, UnitName("mouseover")) or '')
+
+	StarTip:Print(nameRealm)
+
+	spec[nameRealm] = nil
+
+	self.modifier = false
+end
diff --git a/StarTip.lua b/StarTip.lua
index a020f24..cf633b4 100644
--- a/StarTip.lua
+++ b/StarTip.lua
@@ -521,7 +521,12 @@ function StarTip:GetMouseoverUnit()
 end

 -- Taken from CowTip and modified a bit
-function StarTip:MODIFIER_STATE_CHANGED(ev, modifier, up)
+function StarTip:MODIFIER_STATE_CHANGED(ev, modifier, up, ...)
+	for i, v in self:IterateModules() do
+		if v.MODIFIER_STATE_CHANGED then
+			v:MODIFIER_STATE_CHANGED(ev, modifier, up, ...)
+		end
+	end
 	local mod
 	if self.db.profile.modifier == 2 then
 		mod = (modifier == "LCTRL" or modifier == "RCTRL") and "LCTRL"