Skip to content

Commit 6c036db

Browse files
committed
remove compared build from save
1 parent e26c8bd commit 6c036db

6 files changed

Lines changed: 1 addition & 139 deletions

File tree

src/Classes/BuildListControl.lua

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,6 @@ function BuildListClass:GetRowValue(column, index, build)
175175
label = ">> " .. build.folderName
176176
else
177177
label = build.buildName or "?"
178-
if build.compareLabels and #build.compareLabels > 0 then
179-
if #build.compareLabels == 1 then
180-
label = label .. " (+" .. build.compareLabels[1] .. ")"
181-
else
182-
label = label .. " (+" .. #build.compareLabels .. " compared builds)"
183-
end
184-
end
185178
end
186179
if self.cutBuild and self.cutBuild.buildName == build.buildName and self.cutBuild.folderName == build.folderName then
187180
return "^xC0B0B0"..label

src/Classes/CompareEntry.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ local CompareEntryClass = newClass("CompareEntry", "ControlHost", function(self,
4141
self.data = data
4242

4343
-- Flags
44-
self.modFlag = false
4544
self.buildFlag = false
4645
self.outputRevision = 1
4746

@@ -273,7 +272,6 @@ end
273272

274273
function CompareEntryClass:SetMainSocketGroup(index)
275274
self.mainSocketGroup = index
276-
self.modFlag = true
277275
self.buildFlag = true
278276
end
279277

src/Classes/CompareTab.lua

Lines changed: 0 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ function CompareTabClass:InitControls()
262262
local entry = self:GetActiveCompare()
263263
if entry and entry.treeTab and entry.treeTab.specList[index] then
264264
entry:SetActiveSpec(index)
265-
self.modFlag = true
266265
-- Restore primary build's window title (SetActiveSpec changes it)
267266
if self.primaryBuild.spec then
268267
self.primaryBuild.spec:SetWindowTitleWithBuildClass()
@@ -280,7 +279,6 @@ function CompareTabClass:InitControls()
280279
local entry = self:GetActiveCompare()
281280
if entry and entry.skillsTab and entry.skillsTab.skillSetOrderList[index] then
282281
entry:SetActiveSkillSet(entry.skillsTab.skillSetOrderList[index])
283-
self.modFlag = true
284282
end
285283
end)
286284
self.controls.compareSkillSetSelect.enabled = setsEnabled
@@ -291,7 +289,6 @@ function CompareTabClass:InitControls()
291289
local entry = self:GetActiveCompare()
292290
if entry and entry.itemsTab and entry.itemsTab.itemSetOrderList[index] then
293291
entry:SetActiveItemSet(entry.itemsTab.itemSetOrderList[index])
294-
self.modFlag = true
295292
end
296293
end)
297294
self.controls.compareItemSetSelect.enabled = setsEnabled
@@ -305,7 +302,6 @@ function CompareTabClass:InitControls()
305302
if setId then
306303
entry.configTab:SetActiveConfigSet(setId)
307304
entry.buildFlag = true
308-
self.modFlag = true
309305
self.configNeedsRebuild = true
310306
end
311307
end
@@ -337,8 +333,6 @@ function CompareTabClass:InitControls()
337333
local mainSocketGroup = entry.skillsTab.socketGroupList[entry.mainSocketGroup]
338334
if mainSocketGroup then
339335
mainSocketGroup.mainActiveSkill = index
340-
entry.modFlag = true
341-
self.modFlag = true
342336
entry.buildFlag = true
343337
end
344338
end
@@ -355,8 +349,6 @@ function CompareTabClass:InitControls()
355349
local activeSkill = displaySkillList and displaySkillList[mainSocketGroup.mainActiveSkill or 1]
356350
if activeSkill and activeSkill.activeEffect then
357351
activeSkill.activeEffect.srcInstance.skillPart = index
358-
entry.modFlag = true
359-
self.modFlag = true
360352
entry.buildFlag = true
361353
end
362354
end
@@ -376,8 +368,6 @@ function CompareTabClass:InitControls()
376368
local activeSkill = displaySkillList and displaySkillList[mainSocketGroup.mainActiveSkill or 1]
377369
if activeSkill and activeSkill.activeEffect then
378370
activeSkill.activeEffect.srcInstance.skillStageCount = tonumber(buf)
379-
entry.modFlag = true
380-
self.modFlag = true
381371
entry.buildFlag = true
382372
end
383373
end
@@ -397,8 +387,6 @@ function CompareTabClass:InitControls()
397387
local activeSkill = displaySkillList and displaySkillList[mainSocketGroup.mainActiveSkill or 1]
398388
if activeSkill and activeSkill.activeEffect then
399389
activeSkill.activeEffect.srcInstance.skillMineCount = tonumber(buf)
400-
entry.modFlag = true
401-
self.modFlag = true
402390
entry.buildFlag = true
403391
end
404392
end
@@ -422,8 +410,6 @@ function CompareTabClass:InitControls()
422410
elseif selected.minionId then
423411
activeSkill.activeEffect.srcInstance.skillMinion = selected.minionId
424412
end
425-
entry.modFlag = true
426-
self.modFlag = true
427413
entry.buildFlag = true
428414
end
429415
end
@@ -442,8 +428,6 @@ function CompareTabClass:InitControls()
442428
local activeSkill = displaySkillList and displaySkillList[mainSocketGroup.mainActiveSkill or 1]
443429
if activeSkill and activeSkill.activeEffect then
444430
activeSkill.activeEffect.srcInstance.skillMinionSkill = index
445-
entry.modFlag = true
446-
self.modFlag = true
447431
entry.buildFlag = true
448432
end
449433
end
@@ -568,7 +552,6 @@ function CompareTabClass:InitControls()
568552
if entry then
569553
entry.calcsTab.input.skill_number = index
570554
entry.buildFlag = true
571-
self.modFlag = true
572555
end
573556
end)
574557
self.controls.cmpCalcsSocketGroup.shown = false
@@ -582,7 +565,6 @@ function CompareTabClass:InitControls()
582565
if mainSocketGroup then
583566
mainSocketGroup.mainActiveSkillCalcs = index
584567
entry.buildFlag = true
585-
self.modFlag = true
586568
end
587569
end
588570
end)
@@ -598,7 +580,6 @@ function CompareTabClass:InitControls()
598580
if activeSkill and activeSkill.activeEffect then
599581
activeSkill.activeEffect.srcInstance.skillPartCalcs = index
600582
entry.buildFlag = true
601-
self.modFlag = true
602583
end
603584
end
604585
end
@@ -615,7 +596,6 @@ function CompareTabClass:InitControls()
615596
if activeSkill and activeSkill.activeEffect then
616597
activeSkill.activeEffect.srcInstance.skillStageCountCalcs = tonumber(buf)
617598
entry.buildFlag = true
618-
self.modFlag = true
619599
end
620600
end
621601
end
@@ -632,7 +612,6 @@ function CompareTabClass:InitControls()
632612
if activeSkill and activeSkill.activeEffect then
633613
activeSkill.activeEffect.srcInstance.skillMineCountCalcs = tonumber(buf)
634614
entry.buildFlag = true
635-
self.modFlag = true
636615
end
637616
end
638617
end
@@ -644,7 +623,6 @@ function CompareTabClass:InitControls()
644623
if entry then
645624
entry.calcsTab.input.showMinion = state
646625
entry.buildFlag = true
647-
self.modFlag = true
648626
end
649627
end, "Show stats for the minion instead of the player.")
650628
self.controls.cmpCalcsShowMinion.shown = false
@@ -665,7 +643,6 @@ function CompareTabClass:InitControls()
665643
activeSkill.activeEffect.srcInstance.skillMinionCalcs = selected.minionId
666644
end
667645
entry.buildFlag = true
668-
self.modFlag = true
669646
end
670647
end
671648
end
@@ -683,7 +660,6 @@ function CompareTabClass:InitControls()
683660
if activeSkill and activeSkill.activeEffect then
684661
activeSkill.activeEffect.srcInstance.skillMinionSkillCalcs = index
685662
entry.buildFlag = true
686-
self.modFlag = true
687663
end
688664
end
689665
end
@@ -695,7 +671,6 @@ function CompareTabClass:InitControls()
695671
if entry then
696672
entry.calcsTab.input.misc_buffMode = value.buffMode
697673
entry.buildFlag = true
698-
self.modFlag = true
699674
end
700675
end)
701676
self.controls.cmpCalcsMode.shown = false
@@ -770,7 +745,6 @@ function CompareTabClass:InitControls()
770745
local entry = self:GetActiveCompare()
771746
if entry and entry.itemsTab and entry.itemsTab.itemSetOrderList[index] then
772747
entry:SetActiveItemSet(entry.itemsTab.itemSetOrderList[index])
773-
self.modFlag = true
774748
end
775749
end)
776750
self.controls.compareItemSetSelect2.enabled = itemsShown
@@ -797,7 +771,6 @@ function CompareTabClass:InitControls()
797771
local entry = self:GetActiveCompare()
798772
if entry and entry.treeTab and entry.treeTab.specList[index] then
799773
entry:SetActiveSpec(index)
800-
self.modFlag = true
801774
if self.primaryBuild.spec then
802775
self.primaryBuild.spec:SetWindowTitleWithBuildClass()
803776
end
@@ -845,7 +818,6 @@ function CompareTabClass:InitControls()
845818
local entry = self:GetActiveCompare()
846819
if entry and entry.treeTab and entry.treeTab.specList[index] then
847820
entry:SetActiveSpec(index)
848-
self.modFlag = true
849821
-- Restore primary build's window title (compare entry's SetActiveSpec changes it)
850822
if self.primaryBuild.spec then
851823
self.primaryBuild.spec:SetWindowTitleWithBuildClass()
@@ -1222,106 +1194,15 @@ function CompareTabClass:ImportFromCode(code)
12221194
return false
12231195
end
12241196
if self:ImportBuild(xmlText, "Imported build") then
1225-
self.modFlag = true
12261197
return true
12271198
end
12281199
return false
12291200
end
12301201

1231-
-- Save comparison builds to the build file
1232-
function CompareTabClass:Save(xml)
1233-
xml.attrib = {
1234-
activeCompareIndex = tostring(self.activeCompareIndex),
1235-
}
1236-
-- Sync current notes edit buffer to the active entry before saving
1237-
if self.notesActiveEntry then
1238-
self.notesActiveEntry.notesText = self.controls.notesEdit.buf
1239-
end
1240-
for _, entry in ipairs(self.compareEntries) do
1241-
local attrib = {
1242-
label = entry.label,
1243-
buildCode = common.base64.encode(Deflate(entry.xmlText)):gsub("+","-"):gsub("/","_"),
1244-
}
1245-
if entry.treeTab then
1246-
attrib.activeSpec = tostring(entry.treeTab.activeSpec)
1247-
end
1248-
if entry.skillsTab then
1249-
attrib.activeSkillSetId = tostring(entry.skillsTab.activeSkillSetId)
1250-
end
1251-
if entry.itemsTab then
1252-
attrib.activeItemSetId = tostring(entry.itemsTab.activeItemSetId)
1253-
end
1254-
if entry.configTab then
1255-
attrib.activeConfigSetId = tostring(entry.configTab.activeConfigSetId)
1256-
end
1257-
local entryNode = {
1258-
elem = "CompareEntry",
1259-
attrib = attrib,
1260-
}
1261-
if entry.notesText and entry.notesText ~= "" then
1262-
t_insert(entryNode, { elem = "Notes", attrib = {}, entry.notesText })
1263-
end
1264-
t_insert(xml, entryNode)
1265-
end
1266-
end
1267-
1268-
-- Load comparison builds from the build file
1269-
function CompareTabClass:Load(xml, dbFileName)
1270-
local savedIndex = tonumber(xml.attrib and xml.attrib.activeCompareIndex) or 0
1271-
for _, child in ipairs(xml) do
1272-
if type(child) == "table" and child.elem == "CompareEntry" then
1273-
local code = child.attrib and child.attrib.buildCode
1274-
if code then
1275-
local xmlText = Inflate(common.base64.decode(code:gsub("-","+"):gsub("_","/")))
1276-
if xmlText then
1277-
if self:ImportBuild(xmlText, child.attrib.label or "Comparison Build") then
1278-
local entry = self.compareEntries[#self.compareEntries]
1279-
local savedSpec = tonumber(child.attrib.activeSpec)
1280-
if savedSpec and entry.treeTab and entry.treeTab.specList[savedSpec] then
1281-
entry:SetActiveSpec(savedSpec)
1282-
end
1283-
local savedSkillSet = tonumber(child.attrib.activeSkillSetId)
1284-
if savedSkillSet and entry.skillsTab then
1285-
entry:SetActiveSkillSet(savedSkillSet)
1286-
end
1287-
local savedItemSet = tonumber(child.attrib.activeItemSetId)
1288-
if savedItemSet and entry.itemsTab then
1289-
entry:SetActiveItemSet(savedItemSet)
1290-
end
1291-
local savedConfigSet = tonumber(child.attrib.activeConfigSetId)
1292-
if savedConfigSet and entry.configTab and entry.configTab.configSets[savedConfigSet] then
1293-
entry.configTab:SetActiveConfigSet(savedConfigSet)
1294-
end
1295-
-- Restore edited notes (overrides notes from original build XML)
1296-
for _, grandchild in ipairs(child) do
1297-
if type(grandchild) == "table" and grandchild.elem == "Notes" then
1298-
for _, text in ipairs(grandchild) do
1299-
if type(text) == "string" then
1300-
entry.notesText = text
1301-
break
1302-
end
1303-
end
1304-
break
1305-
end
1306-
end
1307-
end
1308-
end
1309-
end
1310-
end
1311-
end
1312-
if #self.compareEntries > 0 then
1313-
self.activeCompareIndex = m_max(1, m_min(savedIndex, #self.compareEntries))
1314-
else
1315-
self.activeCompareIndex = 0
1316-
end
1317-
self:UpdateBuildSelector()
1318-
end
1319-
13201202
-- Remove a comparison build
13211203
function CompareTabClass:RemoveBuild(index)
13221204
if index >= 1 and index <= #self.compareEntries then
13231205
t_remove(self.compareEntries, index)
1324-
self.modFlag = true
13251206
self.notesActiveEntry = nil
13261207
if self.activeCompareIndex > #self.compareEntries then
13271208
self.activeCompareIndex = #self.compareEntries
@@ -1531,7 +1412,6 @@ function CompareTabClass:OpenImportPopup()
15311412
local xmlText = Inflate(common.base64.decode(codeData:gsub("-","+"):gsub("_","/")))
15321413
if xmlText then
15331414
self:ImportBuild(xmlText, customName or ("Imported from " .. site.label))
1534-
self.modFlag = true
15351415
main:ClosePopup()
15361416
else
15371417
stateText = colorCodes.NEGATIVE .. "Failed to decode build data"
@@ -1548,7 +1428,6 @@ function CompareTabClass:OpenImportPopup()
15481428
local xmlText = Inflate(common.base64.decode(buf:gsub("-","+"):gsub("_","/")))
15491429
if xmlText then
15501430
self:ImportBuild(xmlText, customName or "Imported build")
1551-
self.modFlag = true
15521431
main:ClosePopup()
15531432
else
15541433
stateText = colorCodes.NEGATIVE .. "Invalid build code"
@@ -4502,7 +4381,6 @@ function CompareTabClass:DrawNotes(vp, compareEntry, inputEvents)
45024381
-- Sync edits back to the compare entry
45034382
if compareEntry.notesText ~= self.controls.notesEdit.buf then
45044383
compareEntry.notesText = self.controls.notesEdit.buf
4505-
self.modFlag = true
45064384
end
45074385

45084386
main:DrawBackground(vp)

src/Classes/ImportTab.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ You can get this from your web browser's cookies while logged into the Path of E
318318
-- Import as comparison build
319319
if self.build.compareTab then
320320
if self.build.compareTab:ImportBuild(self.importCodeXML, "Imported comparison") then
321-
self.build.compareTab.modFlag = true
322321
self.build.viewMode = "COMPARE"
323322
else
324323
main:OpenMessagePopup("Import Error", "Failed to import build for comparison.")

src/Modules/Build.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,6 @@ function buildMode:Init(dbFileName, buildName, buildXML, convertBuild, importLin
606606
["Skills"] = self.skillsTab,
607607
["Calcs"] = self.calcsTab,
608608
["Import"] = self.importTab,
609-
["Compare"] = self.compareTab,
610609
}
611610
self.legacyLoaders = { -- Special loaders for legacy sections
612611
["Spec"] = self.treeTab,
@@ -1064,7 +1063,6 @@ function buildMode:ResetModFlags()
10641063
self.skillsTab.modFlag = false
10651064
self.itemsTab.modFlag = false
10661065
self.calcsTab.modFlag = false
1067-
self.compareTab.modFlag = false
10681066
end
10691067

10701068
function buildMode:OnFrame(inputEvents)
@@ -1213,7 +1211,7 @@ function buildMode:OnFrame(inputEvents)
12131211
self.compareTab:Draw(tabViewPort, inputEvents)
12141212
end
12151213

1216-
self.unsaved = self.modFlag or self.notesTab.modFlag or self.partyTab.modFlag or self.configTab.modFlag or self.treeTab.modFlag or self.treeTab.searchFlag or self.spec.modFlag or self.skillsTab.modFlag or self.itemsTab.modFlag or self.calcsTab.modFlag or self.compareTab.modFlag
1214+
self.unsaved = self.modFlag or self.notesTab.modFlag or self.partyTab.modFlag or self.configTab.modFlag or self.treeTab.modFlag or self.treeTab.searchFlag or self.spec.modFlag or self.skillsTab.modFlag or self.itemsTab.modFlag or self.calcsTab.modFlag
12171215

12181216
SetDrawLayer(5)
12191217

src/Modules/BuildList.lua

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,6 @@ function listMode:BuildList()
220220
main:OpenCloudErrorPopup(build.fullFileName)
221221
return
222222
end
223-
build.compareLabels = { }
224-
for label in fileText:gmatch('<CompareEntry[^>]-label="([^"]*)"') do
225-
t_insert(build.compareLabels, label)
226-
end
227223
fileText = fileText:match("(<Build.->)")
228224
if fileText then
229225
local xml = common.xml.ParseXML(fileText.."</Build>")

0 commit comments

Comments
 (0)