@@ -1417,7 +1417,8 @@ function buildMode:OpenSpectreLibrary(library)
1417
1417
[7 ] = { field = " fireResist" , asc = false },
1418
1418
[8 ] = { field = " coldResist" , asc = false },
1419
1419
[9 ] = { field = " lightningResist" , asc = false },
1420
- [10 ] = { field = " totalResist" , asc = false },
1420
+ [10 ] = { field = " chaosResist" , asc = false },
1421
+ [11 ] = { field = " totalResist" , asc = false },
1421
1422
}
1422
1423
local sortModeIndex = controls .sortModeDropDown and controls .sortModeDropDown .selIndex or 1
1423
1424
local sortOption = sortFields [sortModeIndex ]
@@ -1470,20 +1471,34 @@ function buildMode:OpenSpectreLibrary(library)
1470
1471
sortSourceList ()
1471
1472
end
1472
1473
end
1473
- controls .sortMonsterCheckboxBeast = new (" CheckBoxControl" , {" TOPLEFT" , controls .source , " BOTTOMLEFT" }, {0 , 24 , 26 , 26 }, " " , monsterTypeCheckboxChange (" Beast" ), " Beast" , true )
1474
- controls .sortMonsterCheckboxBeast .shown = library ~= " beast"
1475
- controls .sortMonsterCheckboxHumanoid = new (" CheckBoxControl" , {" TOPLEFT" , controls .source , " BOTTOMLEFT" }, {37 , 24 , 26 , 26 }, " " , monsterTypeCheckboxChange (" Humanoid" ), " Humanoid" , true )
1476
- controls .sortMonsterCheckboxHumanoid .shown = library ~= " beast"
1477
- controls .sortMonsterCheckboxEldritch = new (" CheckBoxControl" , {" TOPLEFT" , controls .source , " BOTTOMLEFT" }, {74 , 24 , 26 , 26 }, " " , monsterTypeCheckboxChange (" Eldritch" ), " Eldritch" , true )
1478
- controls .sortMonsterCheckboxEldritch .shown = library ~= " beast"
1479
- controls .sortMonsterCheckboxConstruct = new (" CheckBoxControl" , {" TOPLEFT" , controls .source , " BOTTOMLEFT" }, {111 , 24 , 26 , 26 }, " " , monsterTypeCheckboxChange (" Construct" ), " Construct" , true )
1480
- controls .sortMonsterCheckboxConstruct .shown = library ~= " beast"
1481
- controls .sortMonsterCheckboxDemon = new (" CheckBoxControl" , {" TOPLEFT" , controls .source , " BOTTOMLEFT" }, {148 , 24 , 26 , 26 }, " " , monsterTypeCheckboxChange (" Demon" ), " Demon" , true )
1482
- controls .sortMonsterCheckboxDemon .shown = library ~= " beast"
1483
- controls .sortMonsterCheckboxUndead = new (" CheckBoxControl" , {" TOPLEFT" , controls .source , " BOTTOMLEFT" }, {185 , 24 , 26 , 26 }, " " , monsterTypeCheckboxChange (" Undead" ), " Undead" , true )
1484
- controls .sortMonsterCheckboxUndead .shown = library ~= " beast"
1474
+ local function getMonsterTypeImages ()
1475
+ local tree = main :LoadTree (latestTreeVersion )
1476
+ local images = {}
1477
+ for name , value in pairs (monsterTypeSort ) do
1478
+ images [name ] = tree :GetAssetByName (name )
1479
+ end
1480
+ return images
1481
+ end
1482
+ self .monsterImages = getMonsterTypeImages ()
1483
+
1484
+ local monsterTypeCheckbox = {
1485
+ { name = " Beast" , x = 0 },
1486
+ { name = " Humanoid" , x = 37 },
1487
+ { name = " Eldritch" , x = 74 },
1488
+ { name = " Construct" , x = 111 },
1489
+ { name = " Demon" , x = 148 },
1490
+ { name = " Undead" , x = 185 },
1491
+ }
1492
+ for _ , monster in ipairs (monsterTypeCheckbox ) do
1493
+ local controlName = " sortMonsterCheckbox" .. monster .name
1494
+ local checkbox = new (" CheckBoxControl" , {" TOPLEFT" , controls .source , " BOTTOMLEFT" }, {monster .x , 24 , 26 , 26 }, " " , monsterTypeCheckboxChange (monster .name ), monster .name , true )
1495
+ checkbox :SetCheckImage (self .monsterImages [monster .name ])
1496
+ checkbox .shown = library ~= " beast"
1497
+ controls [controlName ] = checkbox
1498
+ end
1499
+
1485
1500
controls .sortLabel = new (" LabelControl" , {" TOPLEFT" ,controls .source ," BOTTOMLEFT" }, {2 , 2 , 0 , 16 }, " Sort by:" )
1486
- controls .sortModeDropDown = new (" DropDownControl" , {" TOPRIGHT" ,controls .source ," BOTTOMRIGHT" }, {0 , 2 , 155 , 18 }, { " Names" , " Life" , " Energy Shield" , " Attack Speed" , " Companion Reservation" , " Spectre Reservation" , " Fire Resistance" , " Cold Resistance" , " Lightning Resistance" , " Total Resistance" }, function (index , value )
1501
+ controls .sortModeDropDown = new (" DropDownControl" , {" TOPRIGHT" ,controls .source ," BOTTOMRIGHT" }, {0 , 2 , 155 , 18 }, { " Names" , " Life" , " Energy Shield" , " Attack Speed" , " Companion Reservation" , " Spectre Reservation" , " Fire Resistance" , " Cold Resistance" , " Lightning Resistance" , " Chaos Resistance " , " Total Resistance" }, function (index , value )
1487
1502
sortSourceList ()
1488
1503
end )
1489
1504
controls .save = new (" ButtonControl" , nil , {- 45 , 390 , 80 , 20 }, " Save" , function ()
@@ -1527,7 +1542,6 @@ function buildMode:OpenSpectreLibrary(library)
1527
1542
controls .source .OnSelect = function ()
1528
1543
local selected = controls .source .selValue
1529
1544
local minion = self .data .minions [selected ]
1530
- -- Get the gem level from the control, default to 20 if not set
1531
1545
local gemLevel = controls .minionGemLevel .buf
1532
1546
local baseLife = self .data .monsterAllyLifeTable [m_min (gemLevel * 2 , 100 )]
1533
1547
local totalLife = baseLife * minion .life
0 commit comments