Skip to content

Commit a754b7a

Browse files
committed
Prettied up library and actually committed tooltip this time
1 parent dd3be9e commit a754b7a

File tree

3 files changed

+135
-14
lines changed

3 files changed

+135
-14
lines changed

src/Classes/MinionListControl.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ function MinionListClass:AddValueTooltip(tooltip, index, minionId)
5050
if tooltip:CheckForUpdate(minionId) then
5151
local minion = self.data.minions[minionId]
5252
tooltip:AddLine(18, "^7"..minion.name)
53+
if #minion.spawnLocation > 0 then
54+
local coloredLocations = {}
55+
for _, location in ipairs(minion.spawnLocation) do
56+
table.insert(coloredLocations, colorCodes.RELIC .. location)
57+
end
58+
tooltip:AddLine(14, s_format("^7Spawn: %s", table.concat(coloredLocations, ", ")))
59+
end
5360
tooltip:AddLine(14, s_format("^7Spectre Reservation: %s%d", colorCodes.SPIRIT, tostring(minion.spectreReservation)))
5461
tooltip:AddLine(14, s_format("^7Companion Reservation: %s%s%%", colorCodes.SPIRIT, tostring(minion.companionReservation)))
5562
tooltip:AddLine(14, "^7Category: "..minion.monsterCategory)

src/Data/Minions.lua

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ minions["RaisedZombie"] = {
2525
spectreReservation = 50,
2626
companionReservation = 30,
2727
monsterCategory = "Undead",
28+
spawnLocation = {
29+
},
2830
skillList = {
2931
"MinionMeleeStep",
3032
},
@@ -51,6 +53,8 @@ minions["SummonedRagingSpirit"] = {
5153
spectreReservation = 50,
5254
companionReservation = 30,
5355
monsterCategory = "Construct",
56+
spawnLocation = {
57+
},
5458
skillList = {
5559
"MinionMeleeStep",
5660
},
@@ -78,6 +82,8 @@ minions["RaisedSkeletonSniper"] = {
7882
spectreReservation = 50,
7983
companionReservation = 30,
8084
monsterCategory = "Undead",
85+
spawnLocation = {
86+
},
8187
skillList = {
8288
"MinionMeleeBow",
8389
"GasShotSkeletonSniperMinion",
@@ -107,6 +113,8 @@ minions["RaisedSkeletonBrute"] = {
107113
spectreReservation = 50,
108114
companionReservation = 30,
109115
monsterCategory = "Undead",
116+
spawnLocation = {
117+
},
110118
skillList = {
111119
"MinionMeleeStep",
112120
"BoneshatterBruteMinion",
@@ -136,6 +144,8 @@ minions["RaisedSkeletonStormMage"] = {
136144
spectreReservation = 50,
137145
companionReservation = 30,
138146
monsterCategory = "Undead",
147+
spawnLocation = {
148+
},
139149
skillList = {
140150
"ArcSkeletonMageMinion",
141151
"DeathStormSkeletonStormMageMinion",
@@ -165,6 +175,8 @@ minions["RaisedSkeletonFrostMage"] = {
165175
spectreReservation = 50,
166176
companionReservation = 30,
167177
monsterCategory = "Undead",
178+
spawnLocation = {
179+
},
168180
skillList = {
169181
"FrostBoltSkeletonMageMinion",
170182
"IceBombSkeletonMageMinion",
@@ -194,6 +206,8 @@ minions["RaisedSkeletonCleric"] = {
194206
spectreReservation = 50,
195207
companionReservation = 30,
196208
monsterCategory = "Undead",
209+
spawnLocation = {
210+
},
197211
skillList = {
198212
"HealSkeletonClericMinion",
199213
"ResurrectSkeletonClericMinion",
@@ -224,6 +238,8 @@ minions["RaisedSkeletonArsonist"] = {
224238
spectreReservation = 50,
225239
companionReservation = 30,
226240
monsterCategory = "Undead",
241+
spawnLocation = {
242+
},
227243
skillList = {
228244
"FireBombSkeletonMinion",
229245
"DestructiveLinkSkeletonBombadierMinion",
@@ -254,6 +270,8 @@ minions["RaisedSkeletonReaver"] = {
254270
spectreReservation = 50,
255271
companionReservation = 30,
256272
monsterCategory = "Undead",
273+
spawnLocation = {
274+
},
257275
skillList = {
258276
"MinionMeleeStep",
259277
"EnrageSkeletonReaverMinion",
@@ -284,6 +302,8 @@ minions["RaisedSkeletonWarriors"] = {
284302
spectreReservation = 50,
285303
companionReservation = 30,
286304
monsterCategory = "Undead",
305+
spawnLocation = {
306+
},
287307
skillList = {
288308
"MinionMeleeStep",
289309
},
@@ -313,6 +333,8 @@ minions["SummonedHellhound"] = {
313333
spectreReservation = 50,
314334
companionReservation = 30,
315335
monsterCategory = "Demon",
336+
spawnLocation = {
337+
},
316338
skillList = {
317339
"MinionMelee",
318340
},
@@ -339,6 +361,8 @@ minions["AncestralSpiritTurtle"] = {
339361
spectreReservation = 50,
340362
companionReservation = 30,
341363
monsterCategory = "Beast",
364+
spawnLocation = {
365+
},
342366
skillList = {
343367
"MeleeAtAnimationSpeed",
344368
"ABTTTortoiseTotemBubble",
@@ -369,6 +393,8 @@ minions["AncestralSpiritHulk"] = {
369393
spectreReservation = 50,
370394
companionReservation = 30,
371395
monsterCategory = "Beast",
396+
spawnLocation = {
397+
},
372398
skillList = {
373399
"MeleeAtAnimationSpeed",
374400
"DTTAncestralJadeHulkLeapSlam",
@@ -399,6 +425,8 @@ minions["AncestralSpiritCaster"] = {
399425
spectreReservation = 50,
400426
companionReservation = 30,
401427
monsterCategory = "Humanoid",
428+
spawnLocation = {
429+
},
402430
skillList = {
403431
"MeleeAtAnimationSpeed",
404432
"MPSAncestralTotemSpiritSoulCasterProjectile",
@@ -429,6 +457,8 @@ minions["AncestralSpiritWarhorn"] = {
429457
spectreReservation = 50,
430458
companionReservation = 30,
431459
monsterCategory = "Humanoid",
460+
spawnLocation = {
461+
},
432462
skillList = {
433463
"MeleeAtAnimationSpeed",
434464
"EGTotemSpiritJadeHornBlow",
@@ -455,6 +485,8 @@ minions["UnearthBoneConstruct"] = {
455485
spectreReservation = 50,
456486
companionReservation = 30,
457487
monsterCategory = "Undead",
488+
spawnLocation = {
489+
},
458490
skillList = {
459491
"MinionMelee",
460492
},
@@ -482,6 +514,8 @@ minions["SummonedRhoa"] = {
482514
spectreReservation = 50,
483515
companionReservation = 30,
484516
monsterCategory = "Beast",
517+
spawnLocation = {
518+
},
485519
skillList = {
486520
"MinionMelee",
487521
},
@@ -508,6 +542,8 @@ minions["ManifestWeapon"] = {
508542
spectreReservation = 50,
509543
companionReservation = 30,
510544
monsterCategory = "Construct",
545+
spawnLocation = {
546+
},
511547
skillList = {
512548
"MinionMelee",
513549
"GAAnimateWeaponMaceSlam",

src/Modules/Build.lua

Lines changed: 92 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,18 +1531,91 @@ function buildMode:OpenSpectreLibrary(library)
15311531
controls.minionGemLevel = new("EditControl", {"LEFT", controls.minionGemLevelLabel, "RIGHT"}, {4, 0, 60, 20}, "20", nil, "%D", 3, function()
15321532
controls.source.OnSelect()
15331533
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
15401612

15411613
-- Run this code whenever a new minion is selected in the list
15421614
controls.source.OnSelect = function()
1615+
if not controls.source.selValue then return end
15431616
local selected = controls.source.selValue
15441617
local minion = self.data.minions[selected]
1545-
local gemLevel = controls.minionGemLevel.buf
1618+
local gemLevel = m_max(controls.minionGemLevel.buf,1)
15461619
local baseLife = self.data.monsterAllyLifeTable[m_min(gemLevel * 2, 100)]
15471620
local totalLife = baseLife * minion.life
15481621
local totalES
@@ -1571,16 +1644,21 @@ function buildMode:OpenSpectreLibrary(library)
15711644
end
15721645
end
15731646
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},
15801653
colorCodes.FIRE..minion.fireResist.."^7/"..
15811654
colorCodes.COLD..minion.coldResist.."^7/"..
15821655
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
15841662
end
15851663
end
15861664

0 commit comments

Comments
 (0)