@@ -824,7 +824,11 @@ function ImportTabClass:ImportItemsAndSkills(charData)
824824 end )
825825 end
826826 if mainSkillEmpty then
827- self .build .mainSocketGroup = self :GuessMainSocketGroup ()
827+ local mainSocketGroup = self :GuessMainSocketGroup ()
828+ self .build .mainSocketGroup = mainSocketGroup
829+ if mainSocketGroup ~= nil then
830+ self .build .skillsTab .socketGroupList [mainSocketGroup ].includeInFullDPS = true
831+ end
828832 end
829833 self .build .itemsTab :PopulateSlots ()
830834 self .build .itemsTab :AddUndoState ()
@@ -1111,17 +1115,22 @@ function ImportTabClass:ImportSocketedItems(item, socketedItems, slotName)
11111115 end
11121116end
11131117
1114- -- Return the index of the group with the most gems
1118+ -- Return the index of the group with the most DPS
11151119function ImportTabClass :GuessMainSocketGroup ()
1116- local largestGroupSize = 0
1117- local largestGroupIndex = 1
1118- for i , socketGroup in ipairs (self .build .skillsTab .socketGroupList ) do
1119- if # socketGroup .gemList > largestGroupSize then
1120- largestGroupSize = # socketGroup .gemList
1121- largestGroupIndex = i
1122- end
1123- end
1124- return largestGroupIndex
1120+ local bestDps = 0
1121+ local bestSocketGroup = nil
1122+ for i , socketGroup in pairs (self .build .skillsTab .socketGroupList ) do
1123+ self .build .mainSocketGroup = i
1124+ socketGroup .includeInFullDPS = true
1125+ local mainOutput = self .build .calcsTab .calcs .buildOutput (self .build , " MAIN" ).player .output
1126+ socketGroup .includeInFullDPS = false
1127+ local dps = mainOutput .FullDPS
1128+ if dps > bestDps then
1129+ bestDps = dps
1130+ bestSocketGroup = i
1131+ end
1132+ end
1133+ return bestSocketGroup
11251134end
11261135
11271136function HexToChar (x )
0 commit comments