Skip to content

Commit afafaa2

Browse files
author
LocalIdentity
committed
Fix gem display
1 parent 43335cc commit afafaa2

2 files changed

Lines changed: 47 additions & 43 deletions

File tree

src/Classes/GemSelectControl.lua

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ end
573573
function GemSelectClass:AddGrantedEffectInfo(gemInstance, grantedEffect, addReq)
574574
local displayInstance = gemInstance.displayEffect or gemInstance
575575
local grantedEffectLevel = grantedEffect.levels[displayInstance.level] or { }
576-
if gemInstance.gemData.Tier and not grantedEffect.isLineage then
576+
if gemInstance.gemData.Tier and not grantedEffect.isLineage and not grantedEffect.hidden then
577577
self.tooltip:AddLine(16, string.format("^x7F7F7FTier: ^7%d", gemInstance.gemData.Tier))
578578
end
579579
if addReq and not grantedEffect.support then
@@ -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 then
586+
if grantedEffect.support and not grantedEffect.hidden 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,41 +628,43 @@ function GemSelectClass:AddGrantedEffectInfo(gemInstance, grantedEffect, addReq)
628628
if cost then
629629
self.tooltip:AddLine(16, "^x7F7F7FCost: ^7"..cost)
630630
end
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)
635-
end
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))
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)
647638
end
648-
if grantedEffectLevel.attackTime then
649-
self.tooltip:AddLine(16, string.format("^x7F7F7FAttack Time: ^7%.2f sec", grantedEffectLevel.attackTime / 1000))
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))
650641
end
651-
if grantedEffectLevel.baseMultiplier then
652-
self.tooltip:AddLine(16, string.format("^x7F7F7FAttack Damage: ^7%g%% of base", grantedEffectLevel.baseMultiplier * 100))
642+
if grantedEffectLevel.soulPreventionDuration then
643+
self.tooltip:AddLine(16, string.format("^x7F7F7FSoul Gain Prevention: ^7%d sec", grantedEffectLevel.soulPreventionDuration))
653644
end
654-
else
655-
if grantedEffect.castTime > 0 then
656-
self.tooltip:AddLine(16, string.format("^x7F7F7FCast Time: ^7%.2f sec", grantedEffect.castTime))
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
657655
else
658-
self.tooltip:AddLine(16, "^x7F7F7FCast Time: ^7Instant")
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))
664+
end
665+
if gemInstance.gemData.weaponRequirements then
666+
self.tooltip:AddLine(16, "^x7F7F7F Requires: ^7" .. gemInstance.gemData.weaponRequirements)
659667
end
660-
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 then
665-
self.tooltip:AddLine(16, "^x7F7F7F Requires: ^7" .. gemInstance.gemData.weaponRequirements)
666668
end
667669
end
668670
if addReq and displayInstance.quality > 0 then
@@ -689,16 +691,18 @@ end
689691
function GemSelectClass:AddStatSetInfo(gemInstance, grantedEffect, statSet, noLabel)
690692
local displayInstance = gemInstance.displayEffect or gemInstance
691693
local statSetLevel = statSet.levels[displayInstance.level] or { }
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))
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
702706
end
703707
if self.skillsTab and self.skillsTab.build.data.describeStats then
704708
if not noLabel then self.tooltip:AddSeparator(10) end

src/Classes/SkillsTab.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ function SkillsTabClass:CreateGemSlot(index)
768768
-- Do the stats one at a time because we're not guaranteed to get the descriptions in the same order we look at them here
769769
local stats = { }
770770
stats[qual[1]] = qual[2] * 20
771-
local descriptions = self.build.data.describeStats(stats, grantedEffect.statSets[1].statDescriptionScope)
771+
local descriptions = self.build.data.describeStats(stats, grantedEffect.statSets[1].statDescriptionScope, true)
772772
-- line may be nil if the value results in no line due to not being enough quality
773773
for _, line in ipairs(descriptions) do
774774
if line then

0 commit comments

Comments
 (0)