Skip to content

Commit fbf84dc

Browse files
LocalIdentityLocalIdentity
andauthored
Load Crossbow Damage skills by default instead of Ammo Skill (#1405)
The Crossbow skills have their Ammo skill as the GrantedEffect entry so we were previously loading them first in the stat set list. This also caused the Ammo Skill to be used in all the places the skill name showed up like the sidebar, skill list, calcs tab etc Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent d6e8f0d commit fbf84dc

6 files changed

Lines changed: 46 additions & 3 deletions

File tree

src/Classes/GemSelectControl.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ function GemSelectClass:AddGemTooltip(gemInstance)
535535
if grantedEffect.name:match("^Spectre:") or grantedEffect.name:match("^Companion:") then
536536
self.tooltip:AddLine(20, colorCodes.GEM .. (gemInstance.displayEffect and gemInstance.displayEffect.nameSpec or gemInstance.gemData.name))
537537
else
538-
self.tooltip:AddLine(20, colorCodes.GEM .. grantedEffect.name)
538+
self.tooltip:AddLine(20, colorCodes.GEM .. gemInstance.gemData.name)
539539
end
540540
self.tooltip:AddSeparator(10)
541541
self.tooltip:AddLine(18, colorCodes.NORMAL .. gemInstance.gemData.gemType)

src/Data/Gems.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7366,6 +7366,7 @@ return {
73667366
variantId = "BlackPowderBlitzReservation",
73677367
grantedEffectId = "BlackPowderBlitzReservationPlayer",
73687368
additionalGrantedEffectId1 = "BlackPowderBlitzPlayer",
7369+
grantedEffectDisplayOrder = { 1 },
73697370
tags = {
73707371
buff = true,
73717372
strength = true,
@@ -7616,6 +7617,7 @@ return {
76167617
variantId = "HighVelocityRounds",
76177618
grantedEffectId = "HighVelocityRoundsAmmoPlayer",
76187619
additionalGrantedEffectId1 = "HighVelocityRoundsPlayer",
7620+
grantedEffectDisplayOrder = { 1, 0 },
76197621
tags = {
76207622
strength = true,
76217623
dexterity = true,
@@ -7643,6 +7645,7 @@ return {
76437645
variantId = "FragmentationRounds",
76447646
grantedEffectId = "FragmentationRoundsAmmoPlayer",
76457647
additionalGrantedEffectId1 = "FragmentationRoundsPlayer",
7648+
grantedEffectDisplayOrder = { 1, 0 },
76467649
tags = {
76477650
strength = true,
76487651
dexterity = true,
@@ -7670,6 +7673,7 @@ return {
76707673
variantId = "SiegeCascade",
76717674
grantedEffectId = "SiegeCascadeAmmoPlayer",
76727675
additionalGrantedEffectId1 = "SiegeCascadePlayer",
7676+
grantedEffectDisplayOrder = { 1, 0 },
76737677
tags = {
76747678
strength = true,
76757679
dexterity = true,
@@ -7696,6 +7700,7 @@ return {
76967700
variantId = "ArmourPiercingRounds",
76977701
grantedEffectId = "ArmourPiercingBoltsAmmoPlayer",
76987702
additionalGrantedEffectId1 = "ArmourPiercingBoltsPlayer",
7703+
grantedEffectDisplayOrder = { 1, 0 },
76997704
tags = {
77007705
strength = true,
77017706
dexterity = true,
@@ -7721,6 +7726,7 @@ return {
77217726
variantId = "ExplosiveShot",
77227727
grantedEffectId = "ExplosiveShotAmmoPlayer",
77237728
additionalGrantedEffectId1 = "ExplosiveShotPlayer",
7729+
grantedEffectDisplayOrder = { 1, 0 },
77247730
tags = {
77257731
strength = true,
77267732
dexterity = true,
@@ -7748,6 +7754,7 @@ return {
77487754
variantId = "IncendiaryShot",
77497755
grantedEffectId = "IncendiaryShotAmmoPlayer",
77507756
additionalGrantedEffectId1 = "IncendiaryShotPlayer",
7757+
grantedEffectDisplayOrder = { 1, 0 },
77517758
tags = {
77527759
strength = true,
77537760
dexterity = true,
@@ -7775,6 +7782,7 @@ return {
77757782
variantId = "RapidShot",
77767783
grantedEffectId = "RapidShotAmmoPlayer",
77777784
additionalGrantedEffectId1 = "RapidShotPlayer",
7785+
grantedEffectDisplayOrder = { 1, 0 },
77787786
tags = {
77797787
strength = true,
77807788
dexterity = true,
@@ -7800,6 +7808,7 @@ return {
78007808
variantId = "GlacialBolt",
78017809
grantedEffectId = "GlacialBoltAmmoPlayer",
78027810
additionalGrantedEffectId1 = "GlacialBoltPlayer",
7811+
grantedEffectDisplayOrder = { 1, 0 },
78037812
tags = {
78047813
strength = true,
78057814
dexterity = true,
@@ -7827,6 +7836,7 @@ return {
78277836
variantId = "PermafrostBolts",
78287837
grantedEffectId = "PermafrostBoltsAmmoPlayer",
78297838
additionalGrantedEffectId1 = "PermafrostBoltsPlayer",
7839+
grantedEffectDisplayOrder = { 1, 0 },
78307840
tags = {
78317841
strength = true,
78327842
dexterity = true,
@@ -7854,6 +7864,7 @@ return {
78547864
variantId = "HailstormRounds",
78557865
grantedEffectId = "HailstormRoundsAmmoPlayer",
78567866
additionalGrantedEffectId1 = "HailstormRoundsPlayer",
7867+
grantedEffectDisplayOrder = { 1, 0 },
78577868
tags = {
78587869
strength = true,
78597870
dexterity = true,
@@ -7881,6 +7892,7 @@ return {
78817892
variantId = "IceShards",
78827893
grantedEffectId = "IceShardsAmmoPlayer",
78837894
additionalGrantedEffectId1 = "IceShardsPlayer",
7895+
grantedEffectDisplayOrder = { 1, 0 },
78847896
tags = {
78857897
strength = true,
78867898
dexterity = true,
@@ -7909,6 +7921,7 @@ return {
79097921
variantId = "PlasmaBlast",
79107922
grantedEffectId = "PlasmaBlastAmmoPlayer",
79117923
additionalGrantedEffectId1 = "PlasmaBlastPlayer",
7924+
grantedEffectDisplayOrder = { 1, 0 },
79127925
tags = {
79137926
strength = true,
79147927
dexterity = true,
@@ -7936,6 +7949,7 @@ return {
79367949
variantId = "GalvanicShards",
79377950
grantedEffectId = "GalvanicShardsAmmoPlayer",
79387951
additionalGrantedEffectId1 = "GalvanicShardsPlayer",
7952+
grantedEffectDisplayOrder = { 1, 0 },
79397953
tags = {
79407954
strength = true,
79417955
dexterity = true,
@@ -7963,6 +7977,7 @@ return {
79637977
variantId = "StormblastBolts",
79647978
grantedEffectId = "StormblastBoltsAmmoPlayer",
79657979
additionalGrantedEffectId1 = "StormblastBoltsPlayer",
7980+
grantedEffectDisplayOrder = { 1, 0 },
79667981
tags = {
79677982
strength = true,
79687983
dexterity = true,
@@ -7990,6 +8005,7 @@ return {
79908005
variantId = "ShockburstRounds",
79918006
grantedEffectId = "ShockburstRoundsAmmoPlayer",
79928007
additionalGrantedEffectId1 = "ShockburstRoundsPlayer",
8008+
grantedEffectDisplayOrder = { 1, 0 },
79938009
tags = {
79948010
strength = true,
79958011
dexterity = true,
@@ -10246,6 +10262,7 @@ return {
1024610262
variantId = "WarBanner",
1024710263
grantedEffectId = "WarBannerReservationPlayer",
1024810264
additionalGrantedEffectId1 = "WarBannerPlayer",
10265+
grantedEffectDisplayOrder = { 1, 0 },
1024910266
tags = {
1025010267
strength = true,
1025110268
dexterity = true,
@@ -10273,6 +10290,7 @@ return {
1027310290
variantId = "DefianceBanner",
1027410291
grantedEffectId = "DefianceBannerReservationPlayer",
1027510292
additionalGrantedEffectId1 = "DefianceBannerPlayer",
10293+
grantedEffectDisplayOrder = { 1, 0 },
1027610294
tags = {
1027710295
strength = true,
1027810296
dexterity = true,
@@ -10300,6 +10318,7 @@ return {
1030010318
variantId = "DreadBanner",
1030110319
grantedEffectId = "DreadBannerReservationPlayer",
1030210320
additionalGrantedEffectId1 = "DreadBannerPlayer",
10321+
grantedEffectDisplayOrder = { 1, 0 },
1030310322
tags = {
1030410323
strength = true,
1030510324
dexterity = true,
@@ -11313,6 +11332,7 @@ return {
1131311332
grantedEffectId = "MetaMirageArcherPlayer",
1131411333
additionalGrantedEffectId1 = "SupportMirageArcherPlayer",
1131511334
additionalGrantedEffectId2 = "MirageArcherSpawnPlayer",
11335+
grantedEffectDisplayOrder = { 1, 2 },
1131611336
tags = {
1131711337
buff = true,
1131811338
dexterity = true,
@@ -15814,6 +15834,7 @@ return {
1581415834
variantId = "CrossbowRequiem",
1581515835
grantedEffectId = "CrossbowRequiemAmmoPlayer",
1581615836
additionalGrantedEffectId1 = "CrossbowRequiemPlayer",
15837+
grantedEffectDisplayOrder = { 1, 0 },
1581715838
tags = {
1581815839
strength = true,
1581915840
dexterity = true,

src/Export/Scripts/skills.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,15 @@ for skillGem in dat("SkillGems"):Rows() do
898898
out:write('\t\tadditionalGrantedEffectId' .. tostring(count) .. ' = "', additionalGrantedEffect.Id, '",\n')
899899
end
900900
end
901+
if gemEffect.GrantedEffectDisplayOrder then
902+
local grantedEffectDisplayOrder = { }
903+
for _, order in ipairs(gemEffect.GrantedEffectDisplayOrder) do
904+
table.insert(grantedEffectDisplayOrder, order)
905+
end
906+
if next(grantedEffectDisplayOrder) then
907+
out:write('\t\tgrantedEffectDisplayOrder = { ', table.concat(grantedEffectDisplayOrder, ", "), ' },\n')
908+
end
909+
end
901910
if #gemEffect.SecondarySupportName > 0 then
902911
out:write('\t\tsecondaryEffectName = "', gemEffect.SecondarySupportName, '",\n')
903912
end

src/Export/spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7123,7 +7123,7 @@ return {
71237123
},
71247124
[13]={
71257125
list=true,
7126-
name="",
7126+
name="GrantedEffectDisplayOrder",
71277127
refTo="",
71287128
type="Int",
71297129
width=150

src/Modules/CalcSetup.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1738,11 +1738,12 @@ function calcs.initEnv(build, mode, override, specEnv)
17381738
group.displayLabel = nil
17391739
for _, gemInstance in ipairs(group.gemList) do
17401740
local grantedEffect = gemInstance.gemData and gemInstance.gemData.grantedEffect or gemInstance.grantedEffect
1741+
local gemName = gemInstance.gemData and gemInstance.gemData.name
17411742
if grantedEffect and not grantedEffect.support and gemInstance.enabled then
17421743
if grantedEffect.name:match("^Companion:") or grantedEffect.name:match("^Spectre:") then
17431744
group.displayLabel = (group.displayLabel and group.displayLabel..", " or "") .. gemInstance.nameSpec
17441745
else
1745-
group.displayLabel = (group.displayLabel and group.displayLabel..", " or "") .. grantedEffect.name
1746+
group.displayLabel = (group.displayLabel and group.displayLabel..", " or "") .. gemName or grantedEffect.name
17461747
end
17471748
end
17481749
end

src/Modules/Data.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,18 @@ local function setupGem(gem, gemId)
892892
table.insert(gem.additionalGrantedEffects, data.skills[gem["additionalGrantedEffectId"..i]])
893893
i = i + 1
894894
end
895+
if gem.grantedEffectDisplayOrder then
896+
local tempTable = {}
897+
local moved = false
898+
for i, temp in ipairs(gem.grantedEffectList) do
899+
if gem.grantedEffectDisplayOrder[i] then
900+
tempTable[i] = gem.grantedEffectList[gem.grantedEffectDisplayOrder[i] + 1]
901+
else
902+
tempTable[i] = temp
903+
end
904+
end
905+
gem.grantedEffectList = tempTable
906+
end
895907
gem.naturalMaxLevel = gem.naturalMaxLevel or (#gem.grantedEffect.levels > 20 and #gem.grantedEffect.levels - 20) or (gem.grantedEffect.levels[3][1] and 3) or 1
896908
end
897909

0 commit comments

Comments
 (0)