Skip to content

Commit a78ad69

Browse files
author
justjuangui
committed
Rollback Source Notes and fix duplicate nodes
1 parent e99ddec commit a78ad69

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

src/Classes/SkillsTab.lua

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,24 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
207207
return self.displayGroup.source ~= nil
208208
end
209209

210+
self.controls.sourceNote = new("LabelControl", { "TOPLEFT", self.controls.groupLabel, "TOPLEFT" }, { 0, 30 + 28, 0, 16 })
211+
self.controls.sourceNote.shown = function()
212+
return self.displayGroup.explodeSources ~= nil
213+
end
214+
215+
self.controls.sourceNote.label = function()
216+
local label
217+
if self.displayGroup.explodeSources then
218+
label = [[^7This is a special group created for the enemy explosion effect,
219+
which comes from the following sources:]]
220+
for _, source in ipairs(self.displayGroup.explodeSources) do
221+
label = label .. "\n\t" .. colorCodes[source.rarity or "NORMAL"] .. (source.name or source.dn or "???")
222+
end
223+
label = label .. "^7\nYou cannot delete this group, but it will disappear if you lose the above sources."
224+
end
225+
return label
226+
end
227+
210228
-- Scroll bar
211229
self.controls.scrollBarH = new("ScrollBarControl", nil, {0, 0, 0, 18}, 100, "HORIZONTAL", true)
212230

@@ -603,7 +621,7 @@ function SkillsTabClass:CreateGemSlot(index)
603621
end)
604622
end
605623
slot.delete.shown = function()
606-
return index <= #self.displayGroup.gemList + 1
624+
return index <= #self.displayGroup.gemList + 1 and self.displayGroup.explodeSources == nil
607625
end
608626
slot.delete.enabled = function()
609627
if index == 1 and self.displayGroup and (self.displayGroup.sourceItem or self.displayGroup.sourceNode) then

src/Modules/CalcSetup.lua

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,24 @@ function calcs.buildModListForNode(env, node, incSmallPassiveSkill)
175175
t_insert(node.grantedSkills, {
176176
skillId = skill.skillId,
177177
level = skill.level,
178-
noSupports = skill.noSupports ~= nil and skill.noSupports,
178+
noSupports = skill.noSupports,
179179
source = "Tree:"..node.id
180180
})
181181
end
182182
end
183183

184184
if modList:Flag(nil, "CanExplode") then
185-
t_insert(env.explodeSources, node)
185+
-- we need to filter because buildModListForNodeList call twice this method
186+
local found = false
187+
for _, n in ipairs(env.explodeSources) do
188+
if n.id == node.id then
189+
found = true
190+
break
191+
end
192+
end
193+
if not found then
194+
t_insert(env.explodeSources, node)
195+
end
186196
end
187197

188198
for i, mod in ipairs(modList) do

0 commit comments

Comments
 (0)