@@ -152,12 +152,20 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
152
152
self .build .buildFlag = true
153
153
end )
154
154
155
+ self .controls .set1Enabled .enabled = function ()
156
+ return self .displayGroup .source == nil
157
+ end
158
+
155
159
self .controls .set2Enabled = new (" CheckBoxControl" , { " LEFT" , self .controls .set1Enabled , " RIGHT" }, { 50 , 0 , 20 }, " Set 2:" , function (state )
156
160
self .displayGroup .set2 = state
157
161
self :AddUndoState ()
158
162
self .build .buildFlag = true
159
163
end )
160
164
165
+ self .controls .set2Enabled .enabled = function ()
166
+ return self .displayGroup .source == nil
167
+ end
168
+
161
169
self .controls .groupEnabled = new (" CheckBoxControl" , { " LEFT" , self .controls .set2Enabled , " RIGHT" }, { 70 , 0 , 20 }, " Enabled:" , function (state )
162
170
self .displayGroup .enabled = state
163
171
self :AddUndoState ()
@@ -180,41 +188,6 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
180
188
self .controls .groupCount .shown = function ()
181
189
return self .displayGroup .source ~= nil
182
190
end
183
- self .controls .sourceNote = new (" LabelControl" , { " TOPLEFT" , self .controls .set1Enabled , " TOPLEFT" }, { - 42 , 30 , 0 , 16 })
184
- self .controls .sourceNote .shown = function ()
185
- return self .displayGroup .source ~= nil
186
- end
187
- self .controls .sourceNote .label = function ()
188
- local label
189
- if self .displayGroup .explodeSources then
190
- label = [[ ^7This is a special group created for the enemy explosion effect,
191
- which comes from the following sources:]]
192
- for _ , source in ipairs (self .displayGroup .explodeSources ) do
193
- label = label .. " \n\t " .. colorCodes [source .rarity or " NORMAL" ] .. (source .name or source .dn or " ???" )
194
- end
195
- label = label .. " ^7\n You cannot delete this group, but it will disappear if you lose the above sources."
196
- else
197
- local activeGem = self .displayGroup .gemList [1 ]
198
- local sourceName
199
- if self .displayGroup .sourceItem then
200
- sourceName = " '" .. colorCodes [self .displayGroup .sourceItem .rarity ] .. self .displayGroup .sourceItem .name
201
- elseif self .displayGroup .sourceNode then
202
- sourceName = " '" .. colorCodes [" NORMAL" ] .. self .displayGroup .sourceNode .name
203
- else
204
- sourceName = " '" .. colorCodes [" NORMAL" ] .. " ?"
205
- end
206
- sourceName = sourceName .. " ^7'"
207
- label = [[ ^7This is a special group created for the ']] .. activeGem .color .. (activeGem .grantedEffect and activeGem .grantedEffect .name or activeGem .nameSpec ) .. [[ ^7' skill,
208
- which is being provided by ]] .. sourceName .. [[ .
209
- You cannot delete this group, but it will disappear if you ]] .. (self .displayGroup .sourceNode and [[ un-allocate the node.]] or [[ un-equip the item.]] )
210
- if not self .displayGroup .noSupports then
211
- label = label .. " \n\n " .. [[ You cannot add support gems to this group, but support gems in
212
- any other group socketed into ]] .. sourceName .. [[
213
- will automatically apply to the skill.]]
214
- end
215
- end
216
- return label
217
- end
218
191
219
192
-- Scroll bar
220
193
self .controls .scrollBarH = new (" ScrollBarControl" , nil , {0 , 0 , 0 , 18 }, 100 , " HORIZONTAL" , true )
@@ -612,9 +585,12 @@ function SkillsTabClass:CreateGemSlot(index)
612
585
end )
613
586
end
614
587
slot .delete .shown = function ()
615
- return index <= # self .displayGroup .gemList + 1 and self . displayGroup . source == nil
588
+ return index <= # self .displayGroup .gemList + 1
616
589
end
617
590
slot .delete .enabled = function ()
591
+ if index == 1 and self .displayGroup and (self .displayGroup .sourceItem or self .displayGroup .sourceNode ) then
592
+ return false
593
+ end
618
594
return index <= # self .displayGroup .gemList
619
595
end
620
596
slot .delete .tooltipText = " Remove this gem."
@@ -667,6 +643,12 @@ function SkillsTabClass:CreateGemSlot(index)
667
643
end
668
644
self .build .buildFlag = true
669
645
end , true )
646
+ slot .nameSpec .enabled = function ()
647
+ if index == 1 and self .displayGroup and (self .displayGroup .sourceItem or self .displayGroup .sourceNode ) then
648
+ return false
649
+ end
650
+ return true
651
+ end
670
652
slot .nameSpec :AddToTabGroup (self .controls .groupLabel )
671
653
self .controls [" gemSlot" .. index .. " Name" ] = slot .nameSpec
672
654
@@ -688,6 +670,9 @@ function SkillsTabClass:CreateGemSlot(index)
688
670
end )
689
671
slot .level :AddToTabGroup (self .controls .groupLabel )
690
672
slot .level .enabled = function ()
673
+ if index == 1 and self .displayGroup and (self .displayGroup .sourceItem or self .displayGroup .sourceNode ) then
674
+ return false
675
+ end
691
676
return index <= # self .displayGroup .gemList
692
677
end
693
678
self .controls [" gemSlot" .. index .. " Level" ] = slot .level
@@ -769,6 +754,9 @@ function SkillsTabClass:CreateGemSlot(index)
769
754
end
770
755
slot .quality :AddToTabGroup (self .controls .groupLabel )
771
756
slot .quality .enabled = function ()
757
+ if index == 1 and self .displayGroup and (self .displayGroup .sourceItem or self .displayGroup .sourceNode ) then
758
+ return false
759
+ end
772
760
return index <= # self .displayGroup .gemList
773
761
end
774
762
self .controls [" gemSlot" .. index .. " Quality" ] = slot .quality
@@ -808,6 +796,9 @@ function SkillsTabClass:CreateGemSlot(index)
808
796
end
809
797
end
810
798
slot .enabled .enabled = function ()
799
+ if index == 1 and self .displayGroup and (self .displayGroup .sourceItem or self .displayGroup .sourceNode ) then
800
+ return false
801
+ end
811
802
return index <= # self .displayGroup .gemList
812
803
end
813
804
self .controls [" gemSlot" .. index .. " Enable" ] = slot .enabled
@@ -849,6 +840,9 @@ function SkillsTabClass:CreateGemSlot(index)
849
840
end
850
841
end
851
842
slot .count .enabled = function ()
843
+ if index == 1 and self .displayGroup and (self .displayGroup .sourceItem or self .displayGroup .sourceNode ) then
844
+ return false
845
+ end
852
846
return index <= # self .displayGroup .gemList
853
847
end
854
848
self .controls [" gemSlot" .. index .. " Count" ] = slot .count
@@ -1000,13 +994,14 @@ function SkillsTabClass:ProcessSocketGroup(socketGroup)
1000
994
end
1001
995
elseif gemInstance .skillId then
1002
996
-- Specified by skill ID
1003
- -- Used for skills granted by items
997
+ -- Used for skills granted by items / nodes
1004
998
gemInstance .errMsg = nil
1005
- local gemId = data .gemForSkill [gemInstance .skillId ]
999
+ local grantedEffect = data .skills [gemInstance .skillId ]
1000
+ local gemId = data .gemForSkill [grantedEffect ]
1006
1001
if gemId then
1007
1002
gemInstance .gemData = data .gems [gemId ]
1008
1003
else
1009
- gemInstance .grantedEffect = data . skills [ gemInstance . skillId ]
1004
+ gemInstance .grantedEffect = grantedEffect
1010
1005
end
1011
1006
if gemInstance .triggered and gemInstance .grantedEffect then
1012
1007
if gemInstance .grantedEffect .levels [gemInstance .level ] then
@@ -1066,6 +1061,14 @@ function SkillsTabClass:SetDisplayGroup(socketGroup)
1066
1061
self .controls .groupLabel :SetText (socketGroup .label )
1067
1062
self .controls .groupEnabled .state = socketGroup .enabled
1068
1063
self .controls .includeInFullDPS .state = socketGroup .includeInFullDPS and socketGroup .enabled
1064
+ if socketGroup .sourceItem then
1065
+ socketGroup .set1 = true
1066
+ socketGroup .set2 = false
1067
+ elseif socketGroup .sourceNode then
1068
+ socketGroup .set1 = true
1069
+ socketGroup .set2 = true
1070
+ end
1071
+
1069
1072
self .controls .set1Enabled .state = socketGroup .set1 == nil and true or socketGroup .set1
1070
1073
self .controls .set2Enabled .state = socketGroup .set2 == nil and true or socketGroup .set2
1071
1074
self .controls .groupCount :SetText (socketGroup .groupCount or 1 )
0 commit comments