@@ -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
12291200end
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
13211203function 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 )
0 commit comments