From d4c2c62b5666b95facfd3bad8a6844183aaaf645 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Sun, 10 Nov 2013 00:30:33 +0000 Subject: [PATCH] When displaying values in the icons, show the full value in the tooltip. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1143 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleIcone.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/OvaleIcone.lua b/OvaleIcone.lua index 411054b..3723b55 100644 --- a/OvaleIcone.lua +++ b/OvaleIcone.lua @@ -18,8 +18,11 @@ local OvaleOptions = Ovale.OvaleOptions local OvaleSpellBook = Ovale.OvaleSpellBook local OvaleState = Ovale.OvaleState +local next = next +local pairs = pairs local strfind = string.find local strsub = string.sub +local tostring = tostring -- -- @@ -32,11 +35,12 @@ local function SetValue(self, value, actionTexture) self.aPortee:Hide() self.shortcut:Hide() if value then + self.value = value + self.spellId = nil if value < 10 then self.remains:SetFormattedText("%.1f", value) elseif value == math.huge then - -- Clamp infinite time values to 3600 (one hour) - self.remains:SetFormattedText("3600") + self.remains:SetFormattedText("inf") else self.remains:SetFormattedText("%d", value) end @@ -51,6 +55,8 @@ local function Update(self, element, minAttente, actionTexture, actionInRange, a actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellId, actionTarget) self.spellId = spellId + self.value = nil + local profile = OvaleOptions:GetProfile() if (minAttente~=nil and actionTexture) then @@ -232,13 +238,16 @@ function OvaleIcone_OnMouseUp(self) end function OvaleIcone_OnEnter(self) - if self.help or next(Ovale.casesACocher) or next(Ovale.listes) or self.spellId then + if self.help or next(Ovale.casesACocher) or next(Ovale.listes) or self.spellId or self.value then GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT") if self.help then GameTooltip:SetText(L[self.help]) end if self.spellId then GameTooltip:AddLine(OvaleSpellBook:GetSpellName(self.spellId), 0.5, 1, 0.75) + elseif self.value then + local value = (value < math.huge) and tostring(value) or "infinity" + GameTooltip:AddLine(value, 0.5, 1, 0.75) end if next(Ovale.casesACocher) or next(Ovale.listes) then GameTooltip:AddLine(L["Cliquer pour afficher/cacher les options"],1,1,1) @@ -274,6 +283,7 @@ function OvaleIcone_OnLoad(self) self.shouldClick = false self.help = nil self.spellId = nil + self.value = nil self.fontScale = nil self.lastSound = nil self.ancienneAttente = nil -- 1.7.9.5