Skip to content

Commit 5ab2118

Browse files
author
LocalIdentity
committed
Fix tooltip display
1 parent afafaa2 commit 5ab2118

1 file changed

Lines changed: 41 additions & 45 deletions

File tree

src/Classes/GemSelectControl.lua

Lines changed: 41 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ function GemSelectClass:AddGrantedEffectInfo(gemInstance, grantedEffect, addReq)
583583
(gemInstance.level >= gemInstance.gemData.naturalMaxLevel) and " (Max)" or ""
584584
))
585585
end
586-
if grantedEffect.support and not grantedEffect.hidden then
586+
if grantedEffect.support then
587587
if grantedEffectLevel.manaMultiplier and grantedEffectLevel.reservationMultiplier and grantedEffectLevel.manaMultiplier == grantedEffectLevel.reservationMultiplier then
588588
self.tooltip:AddLine(16, string.format("^x7F7F7FCost & Reservation Multiplier: ^7%d%%", grantedEffectLevel.manaMultiplier + 100))
589589
elseif grantedEffectLevel.reservationMultiplier then
@@ -628,44 +628,42 @@ function GemSelectClass:AddGrantedEffectInfo(gemInstance, grantedEffect, addReq)
628628
if cost then
629629
self.tooltip:AddLine(16, "^x7F7F7FCost: ^7"..cost)
630630
end
631-
if not grantedEffect.hidden then
632-
if grantedEffectLevel.cooldown then
633-
local string = string.format("^x7F7F7FCooldown Time: ^7%.2f sec", grantedEffectLevel.cooldown)
634-
if grantedEffectLevel.storedUses and grantedEffectLevel.storedUses > 1 then
635-
string = string .. string.format(" (%d uses)", grantedEffectLevel.storedUses)
636-
end
637-
self.tooltip:AddLine(16, string)
631+
if grantedEffectLevel.cooldown then
632+
local string = string.format("^x7F7F7FCooldown Time: ^7%.2f sec", grantedEffectLevel.cooldown)
633+
if grantedEffectLevel.storedUses and grantedEffectLevel.storedUses > 1 then
634+
string = string .. string.format(" (%d uses)", grantedEffectLevel.storedUses)
638635
end
639-
if grantedEffectLevel.vaalStoredUses then
640-
self.tooltip:AddLine(16, string.format("^x7F7F7FCan Store ^7%d ^x7F7F7FUse (%d Souls)", grantedEffectLevel.vaalStoredUses, grantedEffectLevel.vaalStoredUses * grantedEffectLevel.cost.Soul))
636+
self.tooltip:AddLine(16, string)
637+
end
638+
if grantedEffectLevel.vaalStoredUses then
639+
self.tooltip:AddLine(16, string.format("^x7F7F7FCan Store ^7%d ^x7F7F7FUse (%d Souls)", grantedEffectLevel.vaalStoredUses, grantedEffectLevel.vaalStoredUses * grantedEffectLevel.cost.Soul))
640+
end
641+
if grantedEffectLevel.soulPreventionDuration then
642+
self.tooltip:AddLine(16, string.format("^x7F7F7FSoul Gain Prevention: ^7%d sec", grantedEffectLevel.soulPreventionDuration))
643+
end
644+
if gemInstance.gemData.tags.attack then
645+
if grantedEffectLevel.attackSpeedMultiplier then
646+
self.tooltip:AddLine(16, string.format("^x7F7F7FAttack Speed: ^7%d%% of base", grantedEffectLevel.attackSpeedMultiplier + 100))
641647
end
642-
if grantedEffectLevel.soulPreventionDuration then
643-
self.tooltip:AddLine(16, string.format("^x7F7F7FSoul Gain Prevention: ^7%d sec", grantedEffectLevel.soulPreventionDuration))
648+
if grantedEffectLevel.attackTime then
649+
self.tooltip:AddLine(16, string.format("^x7F7F7FAttack Time: ^7%.2f sec", grantedEffectLevel.attackTime / 1000))
644650
end
645-
if gemInstance.gemData.tags.attack then
646-
if grantedEffectLevel.attackSpeedMultiplier then
647-
self.tooltip:AddLine(16, string.format("^x7F7F7FAttack Speed: ^7%d%% of base", grantedEffectLevel.attackSpeedMultiplier + 100))
648-
end
649-
if grantedEffectLevel.attackTime then
650-
self.tooltip:AddLine(16, string.format("^x7F7F7FAttack Time: ^7%.2f sec", grantedEffectLevel.attackTime / 1000))
651-
end
652-
if grantedEffectLevel.baseMultiplier then
653-
self.tooltip:AddLine(16, string.format("^x7F7F7FAttack Damage: ^7%g%% of base", grantedEffectLevel.baseMultiplier * 100))
654-
end
655-
else
656-
if grantedEffect.castTime > 0 then
657-
self.tooltip:AddLine(16, string.format("^x7F7F7FCast Time: ^7%.2f sec", grantedEffect.castTime))
658-
else
659-
self.tooltip:AddLine(16, "^x7F7F7FCast Time: ^7Instant")
660-
end
661-
end
662-
if grantedEffectLevel.critChance then
663-
self.tooltip:AddLine(16, string.format("^x7F7F7FCritical Hit Chance: ^7%.2f%%", grantedEffectLevel.critChance))
651+
if grantedEffectLevel.baseMultiplier then
652+
self.tooltip:AddLine(16, string.format("^x7F7F7FAttack Damage: ^7%g%% of base", grantedEffectLevel.baseMultiplier * 100))
664653
end
665-
if gemInstance.gemData.weaponRequirements then
666-
self.tooltip:AddLine(16, "^x7F7F7F Requires: ^7" .. gemInstance.gemData.weaponRequirements)
654+
else
655+
if grantedEffect.castTime > 0 then
656+
self.tooltip:AddLine(16, string.format("^x7F7F7FCast Time: ^7%.2f sec", grantedEffect.castTime))
657+
else
658+
self.tooltip:AddLine(16, "^x7F7F7FCast Time: ^7Instant")
667659
end
668660
end
661+
if grantedEffectLevel.critChance then
662+
self.tooltip:AddLine(16, string.format("^x7F7F7FCritical Hit Chance: ^7%.2f%%", grantedEffectLevel.critChance))
663+
end
664+
if gemInstance.gemData.weaponRequirements and not grantedEffect.hidden then
665+
self.tooltip:AddLine(16, "^x7F7F7F Requires: ^7" .. gemInstance.gemData.weaponRequirements)
666+
end
669667
end
670668
if addReq and displayInstance.quality > 0 then
671669
self.tooltip:AddLine(16, string.format("^x7F7F7FQuality: "..colorCodes.MAGIC.."+%d%%^7%s",
@@ -691,18 +689,16 @@ end
691689
function GemSelectClass:AddStatSetInfo(gemInstance, grantedEffect, statSet, noLabel)
692690
local displayInstance = gemInstance.displayEffect or gemInstance
693691
local statSetLevel = statSet.levels[displayInstance.level] or { }
694-
if not grantedEffect.hidden then
695-
if statSet.label ~= grantedEffect.name and statSet.label ~= "" and not noLabel then
696-
self.tooltip:AddSeparator(10)
697-
self.tooltip:AddLine(20, colorCodes.GEM .. statSet.label)
698-
self.tooltip:AddSeparator(10)
699-
end
700-
if statSetLevel.critChance then
701-
self.tooltip:AddLine(16, string.format("^x7F7F7FCritical Hit Chance: ^7%.2f%%", statSetLevel.critChance))
702-
end
703-
if statSetLevel.baseMultiplier then
704-
self.tooltip:AddLine(16, string.format("^x7F7F7FAttack Damage: ^7%d%%", statSetLevel.baseMultiplier * 100))
705-
end
692+
if statSet.label ~= grantedEffect.name and statSet.label ~= "" and not noLabel then
693+
self.tooltip:AddSeparator(10)
694+
self.tooltip:AddLine(20, colorCodes.GEM .. statSet.label)
695+
self.tooltip:AddSeparator(10)
696+
end
697+
if statSetLevel.critChance then
698+
self.tooltip:AddLine(16, string.format("^x7F7F7FCritical Hit Chance: ^7%.2f%%", statSetLevel.critChance))
699+
end
700+
if statSetLevel.baseMultiplier then
701+
self.tooltip:AddLine(16, string.format("^x7F7F7FAttack Damage: ^7%d%%", statSetLevel.baseMultiplier * 100))
706702
end
707703
if self.skillsTab and self.skillsTab.build.data.describeStats then
708704
if not noLabel then self.tooltip:AddSeparator(10) end

0 commit comments

Comments
 (0)