@@ -1531,18 +1531,91 @@ function buildMode:OpenSpectreLibrary(library)
1531
1531
controls .minionGemLevel = new (" EditControl" , {" LEFT" , controls .minionGemLevelLabel , " RIGHT" }, {4 , 0 , 60 , 20 }, " 20" , nil , " %D" , 3 , function ()
1532
1532
controls .source .OnSelect ()
1533
1533
end )
1534
- controls .lifeLabel = new (" LabelControl" , {" TOP" , controls .source , " TOPRIGHT" }, {60 , 4 , 0 , 16 }, colorCodes .LIFE .. " LIFE" )
1535
- controls .energyshieldLabel = new (" LabelControl" , {" TOP" ,controls .source ," TOPRIGHT" }, {190 , 4 , 0 , 16 }, colorCodes .ES .. " ENERGY SHIELD" )
1536
- controls .armourLabel = new (" LabelControl" , {" TOP" ,controls .source ," TOPRIGHT" }, {60 , 42 , 0 , 16 }, colorCodes .ARMOUR .. " ARMOUR" )
1537
- controls .evasionLabel = new (" LabelControl" , {" TOP" ,controls .source ," TOPRIGHT" }, {190 , 42 , 0 , 16 }, colorCodes .EVASION .. " EVASION" )
1538
- controls .blockLabel = new (" LabelControl" , {" TOP" ,controls .source ," TOPRIGHT" }, {60 , 80 , 0 , 16 }, colorCodes .NORMAL .. " BLOCK" )
1539
- controls .resistsLabel = new (" LabelControl" , {" TOP" ,controls .source ," TOPRIGHT" }, {190 , 80 , 0 , 16 }, " RESISTS" )
1534
+ controls .lifeLabel = new (" LabelControl" , {" TOP" , controls .source , " TOP" }, {170 , 4 , 0 , 16 }, colorCodes .LIFE .. " LIFE" )
1535
+ controls .lifeLabel .Draw = function (self , view )
1536
+ local xPos , yPos = self :GetPos ()
1537
+ local width , height = 120 , 50
1538
+ SetDrawColor (colorCodes .LIFE )
1539
+ DrawImage (nil , xPos - 45 , yPos - 3 , width , height )
1540
+ SetDrawColor (0 , 0 , 0 , 1 )
1541
+ DrawImage (nil , (xPos + 2 ) - 45 , (yPos + 2 ) - 3 , width - 4 , height - 4 )
1542
+ SetDrawColor (colorCodes .LIFE )
1543
+ DrawImage (nil , xPos - 45 , yPos + 15 , width , 2 )
1544
+ SetDrawColor (1 ,1 ,1 )
1545
+ DrawString (xPos , yPos , " LEFT" , 16 , " VAR BOLD" , " LIFE" )
1546
+ end
1547
+ controls .energyshieldLabel = new (" LabelControl" , {" TOP" ,controls .source ," TOP" }, {295 , 4 , 0 , 16 }, colorCodes .ES .. " ENERGY SHIELD" )
1548
+ controls .energyshieldLabel .Draw = function (self , view )
1549
+ local xPos , yPos = self :GetPos ()
1550
+ local width , height = 120 , 50
1551
+ SetDrawColor (colorCodes .ES )
1552
+ DrawImage (nil , xPos - 7 , yPos - 3 , width , height )
1553
+ SetDrawColor (0 , 0 , 0 , 1 )
1554
+ DrawImage (nil , (xPos + 2 ) - 7 , (yPos + 2 ) - 3 , width - 4 , height - 4 )
1555
+ SetDrawColor (colorCodes .ES )
1556
+ DrawImage (nil , xPos - 7 , yPos + 15 , width , 2 )
1557
+ SetDrawColor (1 ,1 ,1 )
1558
+ DrawString (xPos - 2 , yPos , " LEFT" , 16 , " VAR BOLD" , " ENERGY SHIELD" )
1559
+ end
1560
+ controls .armourLabel = new (" LabelControl" , {" TOP" ,controls .lifeLabel ," TOP" }, {0 , 54 , 0 , 16 }, colorCodes .ARMOUR .. " ARMOUR" )
1561
+ controls .armourLabel .Draw = function (self , view )
1562
+ local xPos , yPos = self :GetPos ()
1563
+ local width , height = 120 , 50
1564
+ SetDrawColor (colorCodes .NORMAL )
1565
+ DrawImage (nil , xPos - 29 , yPos - 3 , width , height )
1566
+ SetDrawColor (0 , 0 , 0 , 1 )
1567
+ DrawImage (nil , (xPos + 2 ) - 29 , (yPos + 2 ) - 3 , width - 4 , height - 4 )
1568
+ SetDrawColor (colorCodes .NORMAL )
1569
+ DrawImage (nil , xPos - 29 , yPos + 15 , width , 2 )
1570
+ SetDrawColor (1 ,1 ,1 )
1571
+ DrawString (xPos , yPos , " LEFT" , 16 , " VAR BOLD" , " ARMOUR" )
1572
+ end
1573
+ controls .evasionLabel = new (" LabelControl" , {" TOP" ,controls .energyshieldLabel ," TOP" }, {0 , 54 , 0 , 16 }, colorCodes .EVASION .. " EVASION" )
1574
+ controls .evasionLabel .Draw = function (self , view )
1575
+ local xPos , yPos = self :GetPos ()
1576
+ local width , height = 120 , 50
1577
+ SetDrawColor (colorCodes .EVASION )
1578
+ DrawImage (nil , xPos - 32 , yPos - 3 , width , height )
1579
+ SetDrawColor (0 , 0 , 0 , 1 )
1580
+ DrawImage (nil , (xPos + 2 ) - 32 , (yPos + 2 ) - 3 , width - 4 , height - 4 )
1581
+ SetDrawColor (colorCodes .EVASION )
1582
+ DrawImage (nil , xPos - 32 , yPos + 15 , width , 2 )
1583
+ SetDrawColor (1 ,1 ,1 )
1584
+ DrawString (xPos , yPos , " LEFT" , 16 , " VAR BOLD" , " EVASION" )
1585
+ end
1586
+ controls .blockLabel = new (" LabelControl" , {" TOP" ,controls .armourLabel ," TOP" }, {0 , 54 , 0 , 16 }, colorCodes .NORMAL .. " BLOCK" )
1587
+ controls .blockLabel .Draw = function (self , view )
1588
+ local xPos , yPos = self :GetPos ()
1589
+ local width , height = 120 , 50
1590
+ SetDrawColor (colorCodes .NORMAL )
1591
+ DrawImage (nil , xPos - 35 , yPos - 3 , width , height )
1592
+ SetDrawColor (0 , 0 , 0 , 1 )
1593
+ DrawImage (nil , (xPos + 2 ) - 35 , (yPos + 2 ) - 3 , width - 4 , height - 4 )
1594
+ SetDrawColor (colorCodes .NORMAL )
1595
+ DrawImage (nil , xPos - 35 , yPos + 15 , width , 2 )
1596
+ SetDrawColor (1 ,1 ,1 )
1597
+ DrawString (xPos , yPos , " LEFT" , 16 , " VAR BOLD" , " BLOCK" )
1598
+ end
1599
+ controls .resistsLabel = new (" LabelControl" , {" TOP" ,controls .evasionLabel ," TOP" }, {0 , 54 , 0 , 16 }, " RESISTS" )
1600
+ controls .resistsLabel .Draw = function (self , view )
1601
+ local xPos , yPos = self :GetPos ()
1602
+ local width , height = 120 , 50
1603
+ SetDrawColor (colorCodes .DEFENCE )
1604
+ DrawImage (nil , xPos - 32 , yPos - 3 , width , height )
1605
+ SetDrawColor (0 , 0 , 0 , 1 )
1606
+ DrawImage (nil , (xPos + 2 ) - 32 , (yPos + 2 ) - 3 , width - 4 , height - 4 )
1607
+ SetDrawColor (colorCodes .DEFENCE )
1608
+ DrawImage (nil , xPos - 32 , yPos + 15 , width , 2 )
1609
+ SetDrawColor (1 ,1 ,1 )
1610
+ DrawString (xPos , yPos , " LEFT" , 16 , " VAR BOLD" , " RESISTS" )
1611
+ end
1540
1612
1541
1613
-- Run this code whenever a new minion is selected in the list
1542
1614
controls .source .OnSelect = function ()
1615
+ if not controls .source .selValue then return end
1543
1616
local selected = controls .source .selValue
1544
1617
local minion = self .data .minions [selected ]
1545
- local gemLevel = controls .minionGemLevel .buf
1618
+ local gemLevel = m_max ( controls .minionGemLevel .buf , 1 )
1546
1619
local baseLife = self .data .monsterAllyLifeTable [m_min (gemLevel * 2 , 100 )]
1547
1620
local totalLife = baseLife * minion .life
1548
1621
local totalES
@@ -1571,16 +1644,21 @@ function buildMode:OpenSpectreLibrary(library)
1571
1644
end
1572
1645
end
1573
1646
controls .minionNameLabel = new (" LabelControl" , {" TOP" ,controls .source ," TOPRIGHT" }, {130 , - 25 , 0 , 18 }, minion .name )
1574
- controls .lifeLabelNum = new (" LabelControl" , {" TOP" ,controls .lifeLabel ," BOTTOM" }, {0 , 2 , 0 , 16 }, colorCodes . LIFE .. round (totalLife ))
1575
- controls .energyshieldLabelNum = new (" LabelControl" , {" TOP" ,controls .energyshieldLabel ," BOTTOM" }, {0 , 2 , 0 , 16 }, colorCodes . ES .. round (totalES ))
1576
- controls .blockLabelNum = new (" LabelControl" , {" TOP" ,controls .blockLabel ," BOTTOM" }, {4 , 2 , 0 , 16 }, blockChance .. " %" )
1577
- controls .armourLabelNum = new (" LabelControl" , {" TOP" ,controls .armourLabel ," BOTTOM" }, {0 , 2 , 0 , 16 }, colorCodes . ARMOUR .. round (totalArmour ))
1578
- controls .evasionLabelNum = new (" LabelControl" , {" TOP" ,controls .evasionLabel ," BOTTOM" }, {0 , 2 , 0 , 16 }, colorCodes . EVASION .. round (totalEvasion ))
1579
- controls .resistsLabelNum = new (" LabelControl" , {" TOP" ,controls .resistsLabel ," BOTTOM" }, {0 , 2 , 0 , 16 },
1647
+ controls .lifeLabelNum = new (" LabelControl" , {" TOP" ,controls .lifeLabel ," BOTTOM" }, {0 , 6 , 0 , 16 }, round (totalLife ))
1648
+ controls .energyshieldLabelNum = new (" LabelControl" , {" TOP" ,controls .energyshieldLabel ," BOTTOM" }, {0 , 6 , 0 , 16 }, (totalES ))
1649
+ controls .blockLabelNum = new (" LabelControl" , {" TOP" ,controls .blockLabel ," BOTTOM" }, {6 , 6 , 0 , 16 }, blockChance .. " %" )
1650
+ controls .armourLabelNum = new (" LabelControl" , {" TOP" ,controls .armourLabel ," BOTTOM" }, {0 , 6 , 0 , 16 }, (totalArmour ))
1651
+ controls .evasionLabelNum = new (" LabelControl" , {" TOP" ,controls .evasionLabel ," BOTTOM" }, {0 , 6 , 0 , 16 }, round (totalEvasion ))
1652
+ controls .resistsLabelNum = new (" LabelControl" , {" TOP" ,controls .resistsLabel ," BOTTOM" }, {0 , 6 , 0 , 16 },
1580
1653
colorCodes .FIRE .. minion .fireResist .. " ^7/" ..
1581
1654
colorCodes .COLD .. minion .coldResist .. " ^7/" ..
1582
1655
colorCodes .LIGHTNING .. minion .lightningResist .. " ^7/" ..
1583
- colorCodes .CHAOS .. minion .chaosResist .. colorCodes .NORMAL )
1656
+ colorCodes .CHAOS .. minion .chaosResist )
1657
+ controls .resistsLabelNum ._oldDraw = controls .resistsLabelNum .Draw
1658
+ controls .resistsLabelNum .Draw = function (self , view )
1659
+ self :_oldDraw (view )
1660
+ SetDrawColor (1 , 1 , 1 , 1 ) -- Reset to white otherwise spectre notes and other lines get colored
1661
+ end
1584
1662
end
1585
1663
end
1586
1664
0 commit comments