@@ -169,12 +169,20 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
169
169
self .build .buildFlag = true
170
170
end )
171
171
172
+ self .controls .set1Enabled .enabled = function ()
173
+ return self .displayGroup .source == nil
174
+ end
175
+
172
176
self .controls .set2Enabled = new (" CheckBoxControl" , { " LEFT" , self .controls .set1Enabled , " RIGHT" }, { 50 , 0 , 20 }, " Set 2:" , function (state )
173
177
self .displayGroup .set2 = state
174
178
self :AddUndoState ()
175
179
self .build .buildFlag = true
176
180
end )
177
181
182
+ self .controls .set2Enabled .enabled = function ()
183
+ return self .displayGroup .source == nil
184
+ end
185
+
178
186
self .controls .groupEnabled = new (" CheckBoxControl" , { " LEFT" , self .controls .set2Enabled , " RIGHT" }, { 70 , 0 , 20 }, " Enabled:" , function (state )
179
187
self .displayGroup .enabled = state
180
188
self :AddUndoState ()
@@ -197,41 +205,6 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
197
205
self .controls .groupCount .shown = function ()
198
206
return self .displayGroup .source ~= nil
199
207
end
200
- self .controls .sourceNote = new (" LabelControl" , { " TOPLEFT" , self .controls .set1Enabled , " TOPLEFT" }, { - 42 , 30 , 0 , 16 })
201
- self .controls .sourceNote .shown = function ()
202
- return self .displayGroup .source ~= nil
203
- end
204
- self .controls .sourceNote .label = function ()
205
- local label
206
- if self .displayGroup .explodeSources then
207
- label = [[ ^7This is a special group created for the enemy explosion effect,
208
- which comes from the following sources:]]
209
- for _ , source in ipairs (self .displayGroup .explodeSources ) do
210
- label = label .. " \n\t " .. colorCodes [source .rarity or " NORMAL" ] .. (source .name or source .dn or " ???" )
211
- end
212
- label = label .. " ^7\n You cannot delete this group, but it will disappear if you lose the above sources."
213
- else
214
- local activeGem = self .displayGroup .gemList [1 ]
215
- local sourceName
216
- if self .displayGroup .sourceItem then
217
- sourceName = " '" .. colorCodes [self .displayGroup .sourceItem .rarity ] .. self .displayGroup .sourceItem .name
218
- elseif self .displayGroup .sourceNode then
219
- sourceName = " '" .. colorCodes [" NORMAL" ] .. self .displayGroup .sourceNode .name
220
- else
221
- sourceName = " '" .. colorCodes [" NORMAL" ] .. " ?"
222
- end
223
- sourceName = sourceName .. " ^7'"
224
- label = [[ ^7This is a special group created for the ']] .. activeGem .color .. (activeGem .grantedEffect and activeGem .grantedEffect .name or activeGem .nameSpec ) .. [[ ^7' skill,
225
- which is being provided by ]] .. sourceName .. [[ .
226
- You cannot delete this group, but it will disappear if you ]] .. (self .displayGroup .sourceNode and [[ un-allocate the node.]] or [[ un-equip the item.]] )
227
- if not self .displayGroup .noSupports then
228
- label = label .. " \n\n " .. [[ You cannot add support gems to this group, but support gems in
229
- any other group socketed into ]] .. sourceName .. [[
230
- will automatically apply to the skill.]]
231
- end
232
- end
233
- return label
234
- end
235
208
236
209
-- Scroll bar
237
210
self .controls .scrollBarH = new (" ScrollBarControl" , nil , {0 , 0 , 0 , 18 }, 100 , " HORIZONTAL" , true )
@@ -629,9 +602,12 @@ function SkillsTabClass:CreateGemSlot(index)
629
602
end )
630
603
end
631
604
slot .delete .shown = function ()
632
- return index <= # self .displayGroup .gemList + 1 and self . displayGroup . source == nil
605
+ return index <= # self .displayGroup .gemList + 1
633
606
end
634
607
slot .delete .enabled = function ()
608
+ if index == 1 and self .displayGroup and (self .displayGroup .sourceItem or self .displayGroup .sourceNode ) then
609
+ return false
610
+ end
635
611
return index <= # self .displayGroup .gemList
636
612
end
637
613
slot .delete .tooltipText = " Remove this gem."
@@ -684,6 +660,12 @@ function SkillsTabClass:CreateGemSlot(index)
684
660
end
685
661
self .build .buildFlag = true
686
662
end , true )
663
+ slot .nameSpec .enabled = function ()
664
+ if index == 1 and self .displayGroup and (self .displayGroup .sourceItem or self .displayGroup .sourceNode ) then
665
+ return false
666
+ end
667
+ return true
668
+ end
687
669
slot .nameSpec :AddToTabGroup (self .controls .groupLabel )
688
670
self .controls [" gemSlot" .. index .. " Name" ] = slot .nameSpec
689
671
@@ -705,6 +687,9 @@ function SkillsTabClass:CreateGemSlot(index)
705
687
end )
706
688
slot .level :AddToTabGroup (self .controls .groupLabel )
707
689
slot .level .enabled = function ()
690
+ if index == 1 and self .displayGroup and (self .displayGroup .sourceItem or self .displayGroup .sourceNode ) then
691
+ return false
692
+ end
708
693
return index <= # self .displayGroup .gemList
709
694
end
710
695
self .controls [" gemSlot" .. index .. " Level" ] = slot .level
@@ -786,6 +771,9 @@ function SkillsTabClass:CreateGemSlot(index)
786
771
end
787
772
slot .quality :AddToTabGroup (self .controls .groupLabel )
788
773
slot .quality .enabled = function ()
774
+ if index == 1 and self .displayGroup and (self .displayGroup .sourceItem or self .displayGroup .sourceNode ) then
775
+ return false
776
+ end
789
777
return index <= # self .displayGroup .gemList
790
778
end
791
779
self .controls [" gemSlot" .. index .. " Quality" ] = slot .quality
@@ -825,6 +813,9 @@ function SkillsTabClass:CreateGemSlot(index)
825
813
end
826
814
end
827
815
slot .enabled .enabled = function ()
816
+ if index == 1 and self .displayGroup and (self .displayGroup .sourceItem or self .displayGroup .sourceNode ) then
817
+ return false
818
+ end
828
819
return index <= # self .displayGroup .gemList
829
820
end
830
821
self .controls [" gemSlot" .. index .. " Enable" ] = slot .enabled
@@ -866,6 +857,9 @@ function SkillsTabClass:CreateGemSlot(index)
866
857
end
867
858
end
868
859
slot .count .enabled = function ()
860
+ if index == 1 and self .displayGroup and (self .displayGroup .sourceItem or self .displayGroup .sourceNode ) then
861
+ return false
862
+ end
869
863
return index <= # self .displayGroup .gemList
870
864
end
871
865
self .controls [" gemSlot" .. index .. " Count" ] = slot .count
@@ -1017,13 +1011,14 @@ function SkillsTabClass:ProcessSocketGroup(socketGroup)
1017
1011
end
1018
1012
elseif gemInstance .skillId then
1019
1013
-- Specified by skill ID
1020
- -- Used for skills granted by items
1014
+ -- Used for skills granted by items / nodes
1021
1015
gemInstance .errMsg = nil
1022
- local gemId = data .gemForSkill [gemInstance .skillId ]
1016
+ local grantedEffect = data .skills [gemInstance .skillId ]
1017
+ local gemId = data .gemForSkill [grantedEffect ]
1023
1018
if gemId then
1024
1019
gemInstance .gemData = data .gems [gemId ]
1025
1020
else
1026
- gemInstance .grantedEffect = data . skills [ gemInstance . skillId ]
1021
+ gemInstance .grantedEffect = grantedEffect
1027
1022
end
1028
1023
if gemInstance .triggered and gemInstance .grantedEffect then
1029
1024
if gemInstance .grantedEffect .levels [gemInstance .level ] then
@@ -1083,6 +1078,14 @@ function SkillsTabClass:SetDisplayGroup(socketGroup)
1083
1078
self .controls .groupLabel :SetText (socketGroup .label )
1084
1079
self .controls .groupEnabled .state = socketGroup .enabled
1085
1080
self .controls .includeInFullDPS .state = socketGroup .includeInFullDPS and socketGroup .enabled
1081
+ if socketGroup .sourceItem then
1082
+ socketGroup .set1 = true
1083
+ socketGroup .set2 = false
1084
+ elseif socketGroup .sourceNode then
1085
+ socketGroup .set1 = true
1086
+ socketGroup .set2 = true
1087
+ end
1088
+
1086
1089
self .controls .set1Enabled .state = socketGroup .set1 == nil and true or socketGroup .set1
1087
1090
self .controls .set2Enabled .state = socketGroup .set2 == nil and true or socketGroup .set2
1088
1091
self .controls .groupCount :SetText (socketGroup .groupCount or 1 )
0 commit comments