@@ -787,6 +787,23 @@ function ImportTabClass:ImportItem(itemData, slotName)
787
787
end
788
788
end
789
789
790
+
791
+ -- parse real gem name by ommiting the first word if alt qual is set
792
+ function ImportTabClass :GetBaseNameAndQuality (gemTypeLine )
793
+ if gemTypeLine then
794
+ local firstword , otherwords = gemTypeLine :match (" (%w+)%s(.+)" )
795
+ if firstword and otherwords then
796
+ for indx , entry in ipairs (self .build .skillsTab .getAlternateGemQualityList ()) do
797
+ if firstword == entry .label then
798
+ return otherwords , entry .type
799
+ end
800
+ end
801
+ end
802
+ end
803
+
804
+ return gemTypeLine , " Default"
805
+ end
806
+
790
807
function ImportTabClass :ImportSocketedItems (item , socketedItems , slotName )
791
808
-- Build socket group list
792
809
local itemSocketGroupList = { }
@@ -796,16 +813,19 @@ function ImportTabClass:ImportSocketedItems(item, socketedItems, slotName)
796
813
self :ImportItem (socketedItem , slotName .. " Abyssal Socket " .. abyssalSocketId )
797
814
abyssalSocketId = abyssalSocketId + 1
798
815
else
799
- local gemId = self .build .data .gemForBaseName [socketedItem .typeLine ]
816
+ local normalizedBasename , qualityType = self :GetBaseNameAndQuality (socketedItem .typeLine )
817
+ local gemId = self .build .data .gemForBaseName [normalizedBasename ]
800
818
if not gemId and socketedItem .hybrid then
801
819
-- Dual skill gems (currently just Stormbind) show the second skill as the typeLine, which won't match the actual gem
802
820
-- Luckily the primary skill name is also there, so we can find the gem using that
803
- gemId = self .build .data .gemForBaseName [socketedItem .hybrid .baseTypeName ]
821
+ normalizedBasename , qualityType = self :GetBaseNameAndQuality (socketedItem .hybrid .baseTypeName )
822
+ gemId = self .build .data .gemForBaseName [normalizedBasename ]
804
823
end
805
824
if gemId then
806
825
local gemInstance = { level = 20 , quality = 0 , enabled = true , enableGlobal1 = true , gemId = gemId }
807
826
gemInstance .nameSpec = self .build .data .gems [gemId ].name
808
827
gemInstance .support = socketedItem .support
828
+ gemInstance .qualityId = qualityType
809
829
for _ , property in pairs (socketedItem .properties ) do
810
830
if property .name == " Level" then
811
831
gemInstance .level = tonumber (property .values [1 ][1 ]:match (" %d+" ))
0 commit comments