v3.2.13 Tooltips

His Dad [08-31-15 - 09:33]
v3.2.13  Tooltips
Filename
AIResearchGrid.lua
AIResearchGrid.txt
doc/changelog.txt
diff --git a/AIResearchGrid.lua b/AIResearchGrid.lua
index 51c2f7b..f5f873d 100644
--- a/AIResearchGrid.lua
+++ b/AIResearchGrid.lua
@@ -247,7 +247,7 @@ function AIRG.initUI()
         AIRG.UI.columnButtons[i]:SetHidden(true)
         AIRG.UI.columnButtons[i]:SetEnabled(true)
         AIRG.UI.columnButtons[i]:SetMouseOverTexture("ESOUI/art/buttons/generic_highlight.dds")
-        AIRG.UI.columnButtons[i].text = i
+        AIRG.UI.columnButtons[i].text = i	-- placeholder
         AIRG.UI.columnButtons[i]:SetHandler("OnMouseEnter", function (self)
                                                 ZO_Tooltips_ShowTextTooltip(self, TOP, self.text)
                                             end)
@@ -267,16 +267,19 @@ function AIRG.initUI()
             AIRG.UI.gridButtons[i][j]:SetMouseEnabled(false)
             -- Following tooltip code uses ideas contributed by Krysstof
             AIRG.UI.gridButtons[i][j]:SetHandler("OnMouseEnter", function (self)
-                        if (self.tooltipText > 0) then      -- Check the item is being researched and has a timestamp
-					        local tRemaining = tonumber(self.tooltipText) - GetTimeStamp()
+			            --   if (self.tooltipText > 0) then      -- Check the item is being researched and has a timestamp
+                        if (self.Known > 0) then      -- Check the item is being researched and has a timestamp
+					        local tRemaining = tonumber(self.Known) - GetTimeStamp()
                             local tFormatted = FormatTimeSeconds(tRemaining, TIME_FORMAT_STYLE_DESCRIPTIVE_SHORT, TIME_FORMAT_PRECISION_SECONDS, TIME_FORMAT_DIRECTION_DESCENDING)
-					        ZO_Tooltips_ShowTextTooltip(self, RIGHT, tFormatted)
+							ZO_Tooltips_ShowTextTooltip(self, RIGHT, tFormatted)
     						-- loop with "registerforupdate" once per second
     						EVENT_MANAGER:RegisterForUpdate(self.name, 1000, function()
     						        local tRemaining = tonumber(self.tooltipText) - GetTimeStamp()
                                     local tFormatted = FormatTimeSeconds(tRemaining, TIME_FORMAT_STYLE_DESCRIPTIVE_SHORT, TIME_FORMAT_PRECISION_SECONDS, TIME_FORMAT_DIRECTION_DESCENDING)
-    						        ZO_Tooltips_ShowTextTooltip(self, RIGHT, tFormatted)
+									ZO_Tooltips_ShowTextTooltip(self, RIGHT, tFormatted)
     						    end)
+						else
+							ZO_Tooltips_ShowTextTooltip(self, RIGHT, self.tooltipText)
     				    end
 					end)
             AIRG.UI.gridButtons[i][j]:SetHandler("OnMouseExit", function (self)
@@ -358,7 +361,7 @@ function AIRG.OnCraftSelected(_,thisCraft)
     AIRG.UI.WindowSubTitle:SetText(AIRG.craftNames[thisCraft])
     local i,j,busy

-    local tType,tDesc,tKnown,tRemain,rowNum,traitCount,alltraits
+    local tType,tDesc,tKnown,tRemain,rowNum,traitCount,alltraits, tooltiptext
     local maxLines = GetNumSmithingResearchLines(thisCraft) -- the number of columns for this profession
     AIRG.curCraft = thisCraft
 	alltraits = 0
@@ -401,13 +404,16 @@ function AIRG.OnCraftSelected(_,thisCraft)
               end

               for rowNum,tKnown in pairs(AIRG.relative[AIRG.curCharacter][thisCraft][i]) do
-                  AIRG.UI.gridButtons[i][rowNum].tooltipText = tKnown
+				  AIRG.UI.gridButtons[i][rowNum].Known = tKnown
                   if (tKnown == -1) then       -- Trait is known
                     if (busy) then
                         AIRG.UI.gridButtons[i][rowNum]:SetColor(0.7, 0.6, 0.6, .8)   -- Dull Reddish
                     else
                         AIRG.UI.gridButtons[i][rowNum]:SetColor(0.2, 1, 0.2, 1)   -- Green
+						AIRG.UI.gridButtons[i][rowNum]:SetMouseEnabled(true)
                     end
+					tooltiptext = zo_strjoin(" ",AIRG.UI.rowLabels[rowNum]:GetText() , AIRG.UI.columnButtons[i].text)
+					AIRG.UI.gridButtons[i][rowNum].tooltipText = tooltiptext
                     AIRG.UI.gridButtons[i][rowNum]:SetTexture("/esoui/art/loot/loot_finesseitem.dds")
                     traitCount = traitCount + 1
                   end
@@ -416,11 +422,15 @@ function AIRG.OnCraftSelected(_,thisCraft)

             else -- not relative
               for rowNum,tKnown in pairs(AIRG.vars.data[AIRG.curCharacter][thisCraft][i]) do
-                AIRG.UI.gridButtons[i][rowNum].tooltipText = tKnown
+				AIRG.UI.gridButtons[i][rowNum].Known = tKnown
+
                 if (tKnown == -1) then       -- Trait is known
                     AIRG.UI.gridButtons[i][rowNum]:SetColor(0.2, 1, 0.2, 1)   -- Green
                     AIRG.UI.gridButtons[i][rowNum]:SetTexture("/esoui/art/loot/loot_finesseitem.dds")
                     traitCount = traitCount + 1
+					tooltiptext = zo_strjoin(" ",AIRG.UI.rowLabels[rowNum]:GetText() , AIRG.UI.columnButtons[i].text)
+					AIRG.UI.gridButtons[i][rowNum].tooltipText = tooltiptext
+					AIRG.UI.gridButtons[i][rowNum]:SetMouseEnabled(true)
                 elseif (tKnown > 0) then   -- Trait is being researched
                         AIRG.UI.gridButtons[i][rowNum]:SetTexture("ESOUI/art/mounts/timer_icon.dds")
                         AIRG.UI.gridButtons[i][rowNum]:SetColor(0.5, 0.5, 1, 1)   -- Blue
diff --git a/AIResearchGrid.txt b/AIResearchGrid.txt
index a5ee5fc..dfe5145 100644
--- a/AIResearchGrid.txt
+++ b/AIResearchGrid.txt
@@ -1,6 +1,6 @@
 ## Title: |cFFFFB0Research Grid|r v3.2.12
 ## APIVersion: 100011
-## Version: 3.2.12
+## Version: 3.2.13
 ## Author: Stormknight and Team
 ## OptionalDependsOn: LibAddonMenu-2.0
 ## SavedVariables: AIRG_SavedVariables
diff --git a/doc/changelog.txt b/doc/changelog.txt
index 2fd4eb5..6e6ed29 100644
--- a/doc/changelog.txt
+++ b/doc/changelog.txt
@@ -1,3 +1,10 @@
+2015-08-31  v3.2.13
+	New Feature
+	Tooltips for known item (Green tick) showing "Trait Item"
+	Updated Version String.
+	Bug Fix
+	None
+
 2015-08-23  v3.2.12
 	New Feature
 	Dialog will close on Esc