Skip to content

Commit a1a4ff6

Browse files
committed
dev(8948): Link multiple notes feature to build loadouts.
1 parent a78b9db commit a1a4ff6

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/Modules/Build.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,10 @@ function buildMode:Init(dbFileName, buildName, buildXML, convertBuild, importLin
338338
t_insert(self.configTab.configSetOrderList, configSet.id)
339339
configSet.title = loadout
340340

341+
local note = self.notesTab:NewNote(#self.notesTab.notes + 1)
342+
t_insert(self.notesTab.notesOrderList, note.id)
343+
note.title = loadout
344+
341345
self:SyncLoadouts()
342346
self.modFlag = true
343347
main:ClosePopup()
@@ -387,14 +391,16 @@ function buildMode:Init(dbFileName, buildName, buildXML, convertBuild, importLin
387391
local oneSkill = self.skillsTab and #self.skillsTab.skillSetOrderList == 1
388392
local oneItem = self.itemsTab and #self.itemsTab.itemSetOrderList == 1
389393
local oneConfig = self.configTab and #self.configTab.configSetOrderList == 1
394+
local oneNote = self.notesTab and #self.notesTab.notesOrderList == 1
390395

391396
local newSpecId = findNamedSetId(self.treeTab:GetSpecList(), value, self.treeListSpecialLinks)
392397
local newItemId = oneItem and 1 or findSetId(self.itemsTab.itemSetOrderList, value, self.itemsTab.itemSets, self.itemListSpecialLinks)
393398
local newSkillId = oneSkill and 1 or findSetId(self.skillsTab.skillSetOrderList, value, self.skillsTab.skillSets, self.skillListSpecialLinks)
394399
local newConfigId = oneConfig and 1 or findSetId(self.configTab.configSetOrderList, value, self.configTab.configSets, self.configListSpecialLinks)
400+
local newNoteId = oneNote and 1 or findSetId(self.notesTab.notesOrderList, value, self.notesTab.notes, self.noteListSpecialLinks)
395401

396402
-- if exact match nor special grouping cannot find setIds, bail
397-
if newSpecId == nil or newItemId == nil or newSkillId == nil or newConfigId == nil then
403+
if newSpecId == nil or newItemId == nil or newSkillId == nil or newConfigId == nil or newNoteId == nil then
398404
return
399405
end
400406

@@ -410,6 +416,9 @@ function buildMode:Init(dbFileName, buildName, buildXML, convertBuild, importLin
410416
if newConfigId ~= self.configTab.activeConfigSetId then
411417
self.configTab:SetActiveConfigSet(newConfigId)
412418
end
419+
if newNoteId ~= self.notesTab.activeNoteId then
420+
self.notesTab:SetActiveNote(newNoteId)
421+
end
413422

414423
self.controls.buildLoadouts:SelByValue(value)
415424
end)

0 commit comments

Comments
 (0)