@@ -64,7 +64,7 @@ local function addGrantedEffectInfo(tooltip, build, gemInstance, grantedEffect,
6464 end
6565
6666 if not levelRange and gemInstance .gemData .Tier and gemInstance .gemData .Tier > 0 and not grantedEffect .isLineage and not grantedEffect .hidden then
67- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FTier : ^7%d" , gemInstance .gemData .Tier ), " FONTIN SC" )
67+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Tier : ^7%d" , gemInstance .gemData .Tier ), " FONTIN SC" )
6868 end
6969 if not levelRange and addReq and not grantedEffect .support then
7070 local totalGlobalLevels = 0
@@ -82,36 +82,41 @@ local function addGrantedEffectInfo(tooltip, build, gemInstance, grantedEffect,
8282 totalGlobalLevels > 0 or
8383 (displayInstance .level - gemInstance .level - corruptLevel > 0 )
8484 then
85- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FLevel : ^7" .. colorCodes .MAGIC .. totalLevel ), " FONTIN SC" )
86- tooltip :AddLine (fontSizeBig , " ^7" .. gemInstance .level .. " Levels from Gem" .. ((gemInstance .level >= gemInstance .gemData .naturalMaxLevel ) and " (Max)" or " " ), " FONTIN SC" )
85+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Level : ^7" .. colorCodes .MAGIC .. totalLevel ), " FONTIN SC" )
86+ tooltip :AddLine (fontSizeBig , " ^7" .. gemInstance .level .. " Levels from Gem" .. ((gemInstance .level >= gemInstance .gemData .naturalMaxLevel ) and " (Max)" or " " ), " FONTIN SC" )
8787 else
88- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FLevel : ^7" .. totalLevel .. ((gemInstance .level >= gemInstance .gemData .naturalMaxLevel ) and " (Max)" or " " )), " FONTIN SC" )
88+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Level : ^7" .. totalLevel .. ((gemInstance .level >= gemInstance .gemData .naturalMaxLevel ) and " (Max)" or " " )), " FONTIN SC" )
8989 end
9090 if corruptLevel > 0 then
91- tooltip :AddLine (fontSizeBig , colorCodes .MAGIC .. " +" .. corruptLevel .. " Level from Corruption" , " FONTIN SC" )
91+ tooltip :AddLine (fontSizeBig , colorCodes .MAGIC .. " +" .. corruptLevel .. " Level from Corruption" , " FONTIN SC" )
9292 elseif corruptLevel < 0 then
9393 tooltip :AddLine (fontSizeBig , colorCodes .MAGIC .. corruptLevel .. " Level from Corruption" , " FONTIN SC" )
9494 end
9595 if totalGlobalLevels > 0 then
96- tooltip :AddLine (fontSizeBig , colorCodes .MAGIC .. " +" .. totalGlobalLevels .. " Levels from Global Modifiers" , " FONTIN SC" )
96+ tooltip :AddLine (fontSizeBig , colorCodes .MAGIC .. " +" .. totalGlobalLevels .. " Levels from Global Modifiers" , " FONTIN SC" )
9797 if totalLevel - gemInstance .level - corruptLevel - totalGlobalLevels > 0 then
98- tooltip :AddLine (fontSizeBig , colorCodes .MAGIC .. " +" .. totalLevel - gemInstance .level - corruptLevel - totalGlobalLevels .. " Levels from Supports" , " FONTIN SC" )
98+ tooltip :AddLine (fontSizeBig , colorCodes .MAGIC .. " +" .. totalLevel - gemInstance .level - corruptLevel - totalGlobalLevels .. " Levels from Supports" , " FONTIN SC" )
9999 end
100100 elseif totalLevel - gemInstance .level - corruptLevel > 0 then
101- tooltip :AddLine (fontSizeBig , colorCodes .MAGIC .. " +" .. totalLevel - gemInstance .level - corruptLevel .. " Levels from Supports" , " FONTIN SC" )
101+ tooltip :AddLine (fontSizeBig , colorCodes .MAGIC .. " +" .. totalLevel - gemInstance .level - corruptLevel .. " Levels from Supports" , " FONTIN SC" )
102102 end
103103 end
104-
104+ if not levelRange and addReq and displayInstance .quality > 0 then
105+ tooltip :AddLine (fontSizeBig , colorCodes .GEMINFO .. string.format (" Quality: " .. colorCodes .MAGIC .. " +%d%%^7%s" ,
106+ gemInstance .quality ,
107+ (displayInstance .quality > gemInstance .quality ) and " (" .. colorCodes .MAGIC .. " +" .. (displayInstance .quality - gemInstance .quality ) .. " ^7)" or " "
108+ ), " FONTIN SC" )
109+ end
105110 if not levelRange and grantedEffect .support then
106111 if levelStats .manaMultiplier and levelStats .reservationMultiplier and levelStats .manaMultiplier == levelStats .reservationMultiplier then
107- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FCost & Reservation Multiplier: ^7%d%%" , levelStats .manaMultiplier + 100 ), " FONTIN SC" )
112+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Cost & Reservation Multiplier: ^7%d%%" , levelStats .manaMultiplier + 100 ), " FONTIN SC" )
108113 elseif levelStats .reservationMultiplier then
109- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FReservation Multiplier: ^7%d%%" , levelStats .reservationMultiplier + 100 ), " FONTIN SC" )
114+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Reservation Multiplier: ^7%d%%" , levelStats .reservationMultiplier + 100 ), " FONTIN SC" )
110115 elseif levelStats .manaMultiplier then
111- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FCost Multiplier: ^7%d%%" , levelStats .manaMultiplier + 100 ), " FONTIN SC" )
116+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Cost Multiplier: ^7%d%%" , levelStats .manaMultiplier + 100 ), " FONTIN SC" )
112117 end
113118 if levelStats .spiritReservationFlat then
114- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FAdditional Reservation: ^7%d Spirit" , levelStats .spiritReservationFlat ), " FONTIN SC" )
119+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Additional Reservation: ^7%d Spirit" , levelStats .spiritReservationFlat ), " FONTIN SC" )
115120 end
116121 else
117122 if gemInstance .skillMinion and not levelRange then
@@ -122,10 +127,10 @@ local function addGrantedEffectInfo(tooltip, build, gemInstance, grantedEffect,
122127 end
123128 end
124129 if levelStats .spiritReservationFlat then
125- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FReservation : ^7%s Spirit" , valueOrRange (" spiritReservationFlat" )), " FONTIN SC" )
130+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Reservation : ^7%s Spirit" , valueOrRange (" spiritReservationFlat" )), " FONTIN SC" )
126131 end
127132 if levelStats .spiritReservationPercent then
128- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FReservation : ^7%s%% Spirit" , valueOrRange (" spiritReservationPercent" , " %.1f" )), " FONTIN SC" )
133+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Reservation : ^7%s%% Spirit" , valueOrRange (" spiritReservationPercent" , " %.1f" )), " FONTIN SC" )
129134 end
130135 local cost
131136 for _ , res in ipairs (data .costs ) do
@@ -140,12 +145,12 @@ local function addGrantedEffectInfo(tooltip, build, gemInstance, grantedEffect,
140145 end
141146 end
142147 if cost then
143- tooltip :AddLine (fontSizeBig , " ^x7F7F7FCost : ^7" .. cost , " FONTIN SC" )
148+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. " Cost : ^7" .. cost , " FONTIN SC" )
144149 end
145150 end
146151
147152 if levelStats .cooldown then
148- local line = string.format (" ^x7F7F7FCooldown Time: ^7%s sec" , valueOrRange (" cooldown" , " %.2f" ))
153+ local line = colorCodes . GEMINFO .. string.format (" Cooldown Time: ^7%s sec" , valueOrRange (" cooldown" , " %.2f" ))
149154 if levelStats .storedUses and levelStats .storedUses > 1 then
150155 line = line .. string.format (" (%s uses)" , valueOrRange (" storedUses" ))
151156 end
@@ -159,42 +164,37 @@ local function addGrantedEffectInfo(tooltip, build, gemInstance, grantedEffect,
159164 end
160165 if gemInstance .gemData .tags .attack then
161166 if levelStats .attackSpeedMultiplier then
162- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FAttack Speed: ^7%s%% of base" , valueOrRange (" attackSpeedMultiplier" , nil , 100 )), " FONTIN SC" )
167+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Attack Speed: ^7%s%% of base" , valueOrRange (" attackSpeedMultiplier" , nil , 100 )), " FONTIN SC" )
163168 end
164169 if levelStats .attackTime then
165- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FAttack Time: ^7%s sec" , valueOrRange (" attackTime" , " %.2f" , nil , 1000 )), " FONTIN SC" )
170+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Attack Time: ^7%s sec" , valueOrRange (" attackTime" , " %.2f" , nil , 1000 )), " FONTIN SC" )
166171 end
167172 if levelStats .baseMultiplier then
168- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FAttack Damage: ^7%s%% of base" , valueOrRange (" baseMultiplier" , " %g" , nil , nil , 100 )), " FONTIN SC" )
173+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Attack Damage: ^7%s%% of base" , valueOrRange (" baseMultiplier" , " %g" , nil , nil , 100 )), " FONTIN SC" )
169174 end
170175 elseif not grantedEffect .hidden then
171176 if (grantedEffect .castTime or 0 ) > 0 then
172- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FCast Time: ^7%.2f sec" , grantedEffect .castTime ), " FONTIN SC" )
177+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Cast Time: ^7%.2f sec" , grantedEffect .castTime ), " FONTIN SC" )
173178 else
174- tooltip :AddLine (fontSizeBig , " ^x7F7F7FCast Time: ^7Instant" , " FONTIN SC" )
179+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. " Cast Time: ^7Instant" , " FONTIN SC" )
175180 end
176181 end
177182 if levelStats .critChance then
178- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FCritical Hit Chance: ^7%s%%" , valueOrRange (" critChance" , " %.2f" )), " FONTIN SC" )
179- end
180- if gemInstance .gemData .weaponRequirements and not grantedEffect .hidden then
181- tooltip :AddLine (fontSizeBig , " ^x7F7F7F Requires: ^7" .. gemInstance .gemData .weaponRequirements , " FONTIN SC" )
183+ tooltip :AddLine (fontSizeBig , colorCodes .GEMINFO .. string.format (" Critical Hit Chance: ^7%s%%" , valueOrRange (" critChance" , " %.2f" )), " FONTIN SC" )
182184 end
183- if not levelRange and addReq and displayInstance .quality > 0 then
184- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FQuality: " .. colorCodes .MAGIC .. " +%d%%^7%s" ,
185- gemInstance .quality ,
186- (displayInstance .quality > gemInstance .quality ) and " (" .. colorCodes .MAGIC .. " +" .. (displayInstance .quality - gemInstance .quality ) .. " ^7)" or " "
187- ), " FONTIN SC" )
188- end
189- tooltip :AddSeparator (10 )
190185 if not levelRange and addReq then
191186 local reqLevel = grantedEffect .levels [gemInstance .level ] and grantedEffect .levels [gemInstance .level ].levelRequirement or 1
192187 build :AddRequirementsToTooltip (tooltip , reqLevel ,
193188 calcLib .getGemStatRequirement (reqLevel , gemInstance .gemData .reqStr , grantedEffect .support ),
194189 calcLib .getGemStatRequirement (reqLevel , gemInstance .gemData .reqDex , grantedEffect .support ),
195190 calcLib .getGemStatRequirement (reqLevel , gemInstance .gemData .reqInt , grantedEffect .support ))
196191 end
192+ if gemInstance .gemData .weaponRequirements and not grantedEffect .hidden then
193+ tooltip :AddLine (fontSizeBig , " ^x7F7F7FRequires: ^7" .. gemInstance .gemData .weaponRequirements , " FONTIN SC" )
194+ end
195+ tooltip .center = true
197196 if grantedEffect .description then
197+ tooltip :AddSeparator (10 )
198198 local wrap = main :WrapString (grantedEffect .description , 16 , m_max (DrawStringWidth (fontSizeBig , " VAR" , gemInstance .gemData .tagString ), 400 ))
199199 for _ , line in ipairs (wrap ) do
200200 tooltip :AddLine (fontSizeBig , colorCodes .GEMDESCRIPTION .. line , " FONTIN ITALIC" )
@@ -216,10 +216,10 @@ local function addStatSetInfo(tooltip, build, gemInstance, grantedEffect, statSe
216216 tooltip :AddSeparator (10 )
217217 end
218218 if statSetLevel .critChance then
219- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FCritical Hit Chance: ^7%.2f%%" , statSetLevel .critChance ), " FONTIN SC" )
219+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Critical Hit Chance: ^7%.2f%%" , statSetLevel .critChance ), " FONTIN SC" )
220220 end
221221 if statSetLevel .baseMultiplier then
222- tooltip :AddLine (fontSizeBig , string.format (" ^x7F7F7FAttack Damage: ^7%d%%" , statSetLevel .baseMultiplier * 100 ), " FONTIN SC" )
222+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. string.format (" Attack Damage: ^7%d%%" , statSetLevel .baseMultiplier * 100 ), " FONTIN SC" )
223223 end
224224 if build .data .describeStats then
225225 if not noLabel then tooltip :AddSeparator (10 ) end
@@ -288,33 +288,44 @@ function GemTooltip.AddGemTooltip(tooltip, build, gemInstance, options)
288288 options = options or { }
289289 local fontSizeBig , fontSizeTitle = getFontSizes ()
290290 local levelRange = options .levelRange
291- tooltip .center = true
291+ tooltip .center = false
292292 tooltip .color = colorCodes .GEM
293+ tooltip .minWidth = 600
293294 tooltip .tooltipHeader = " GEM"
295+ tooltip .gemIcon = gemInstance .gemData .grantedEffect .icon
296+ tooltip .gemBackground = gemInstance .gemData .grantedEffect .id
294297
295298 local grantedEffect = gemInstance .gemData .grantedEffect
296299 local additionalEffects = gemInstance .gemData .additionalGrantedEffects
297300
301+ if grantedEffect .isLineage then
302+ tooltip .isUniqueGem = true
303+ end
304+
305+ local iconNameIndent = " "
306+ local iconTagIndent = " "
307+ if grantedEffect .support then
308+ iconNameIndent = " "
309+ iconTagIndent = " "
310+ end
311+
298312 if grantedEffect .name :match (" ^Spectre:" ) or grantedEffect .name :match (" ^Companion:" ) then
299- tooltip :AddLine (fontSizeTitle , colorCodes .GEM .. (gemInstance .displayEffect and gemInstance .displayEffect .nameSpec or gemInstance .gemData .name ), " FONTIN SC" )
313+ tooltip :AddLine (fontSizeTitle , colorCodes .GEM .. iconNameIndent .. (gemInstance .displayEffect and gemInstance .displayEffect .nameSpec or gemInstance .gemData .name ), " FONTIN SC" )
300314 else
301- tooltip :AddLine (fontSizeTitle , colorCodes .GEM .. gemInstance .gemData .name , " FONTIN SC" )
302- tooltip : AddSeparator ( 10 )
303- if grantedEffect . legacy then
304- tooltip :AddLine ( fontSizeTitle , colorCodes . WARNING .. " Legacy Gem " , " FONTIN SC " )
305- tooltip : AddLine ( fontSizeBig , colorCodes . WARNING .. " Gem only exists in Standard League " , " FONTIN SC " )
306- tooltip :AddSeparator ( 10 )
307- end
315+ tooltip :AddLine (fontSizeTitle , colorCodes .GEM .. iconNameIndent .. gemInstance .gemData .name , " FONTIN SC" )
316+ end
317+ tooltip : AddLine ( fontSizeBig , colorCodes . GEMINFO .. iconTagIndent .. gemInstance . gemData . gemType , " FONTIN SC " )
318+ tooltip :AddSeparator ( 8 )
319+ if grantedEffect . legacy then
320+ tooltip :AddLine ( fontSizeBig , colorCodes . WARNING .. " Legacy Gem " , " FONTIN SC " )
321+ tooltip : AddLine ( fontSizeBig , colorCodes . WARNING .. " Gem only exists in Standard League " , " FONTIN SC " )
308322 end
309- tooltip :AddSeparator (10 )
310- tooltip :AddLine (fontSizeBig , colorCodes .NORMAL .. gemInstance .gemData .gemType , " FONTIN SC" )
311323 if gemInstance .gemData .tagString ~= " " then
312- tooltip :AddLine (fontSizeBig , " ^x7F7F7F" .. gemInstance .gemData .tagString , " FONTIN SC " )
324+ tooltip :AddLine (fontSizeBig , " ^x7F7F7F" .. gemInstance .gemData .tagString , " FONTIN" )
313325 end
314326 if gemInstance .gemData .gemFamily then
315- tooltip :AddLine (fontSizeBig , " ^x7F7F7FCategory : ^7" .. gemInstance .gemData .gemFamily , " FONTIN SC" )
327+ tooltip :AddLine (fontSizeBig , colorCodes . GEMINFO .. " Category : ^7" .. gemInstance .gemData .gemFamily , " FONTIN SC" )
316328 end
317-
318329 -- Default mode preserves the old GemSelectControl tooltip. levelRange is only for passive-tree granted skills.
319330 addGrantedEffectInfo (tooltip , build , gemInstance , grantedEffect , true , levelRange )
320331 addEffectStats (tooltip , build , gemInstance , grantedEffect , nil , levelRange )
0 commit comments