@@ -827,7 +827,11 @@ function ImportTabClass:ImportItemsAndSkills(charData)
827827 end )
828828 end
829829 if mainSkillEmpty then
830- self .build .mainSocketGroup = self :GuessMainSocketGroup ()
830+ local mainSocketGroup = self :GuessMainSocketGroup ()
831+ self .build .mainSocketGroup = mainSocketGroup
832+ if mainSocketGroup ~= nil then
833+ self .build .skillsTab .socketGroupList [mainSocketGroup ].includeInFullDPS = true
834+ end
831835 end
832836 self .build .itemsTab :PopulateSlots ()
833837 self .build .itemsTab :AddUndoState ()
@@ -1114,17 +1118,22 @@ function ImportTabClass:ImportSocketedItems(item, socketedItems, slotName)
11141118 end
11151119end
11161120
1117- -- Return the index of the group with the most gems
1121+ -- Return the index of the group with the most DPS
11181122function ImportTabClass :GuessMainSocketGroup ()
1119- local largestGroupSize = 0
1120- local largestGroupIndex = 1
1121- for i , socketGroup in ipairs (self .build .skillsTab .socketGroupList ) do
1122- if # socketGroup .gemList > largestGroupSize then
1123- largestGroupSize = # socketGroup .gemList
1124- largestGroupIndex = i
1123+ local bestDps = 0
1124+ local bestSocketGroup = nil
1125+ for i , socketGroup in pairs (self .build .skillsTab .socketGroupList ) do
1126+ self .build .mainSocketGroup = i
1127+ socketGroup .includeInFullDPS = true
1128+ local mainOutput = self .build .calcsTab .calcs .buildOutput (self .build , " MAIN" ).player .output
1129+ socketGroup .includeInFullDPS = false
1130+ local dps = mainOutput .FullDPS
1131+ if dps > bestDps then
1132+ bestDps = dps
1133+ bestSocketGroup = i
11251134 end
11261135 end
1127- return largestGroupIndex
1136+ return bestSocketGroup
11281137end
11291138
11301139function HexToChar (x )
0 commit comments