|
1 | 1 | local buildCmdFactory, buildCmdEconomy, buildCmdDefence, buildCmdSpecial, buildCmdUnits, cmdPosDef, factoryUnitPosDef = include("Configs/integral_menu_commands_processed.lua", nil, VFS.RAW_FIRST) |
2 | 2 |
|
3 | 3 | local missileCmdIDs = { |
4 | | - 39610, -- EOS |
5 | | - 39611, -- Seismic |
6 | | - 39612, -- Shockley |
7 | | - 39613, -- Inferno |
8 | | - 39614, -- Reef Missile |
9 | | - 39615, -- Trinity |
10 | | - 39616, -- Zeno |
| 4 | + {id = 39610, name = "EOS", icon = "tacnuke"}, |
| 5 | + {id = 39611, name = "Seismic", icon = "seismic"}, |
| 6 | + {id = 39612, name = "Shockley", icon = "empmissile"}, |
| 7 | + {id = 39613, name = "Inferno", icon = "napalmmissile"}, |
| 8 | + {id = 39614, name = "Reef Missile", icon = "shipcarrier"}, |
| 9 | + {id = 39615, name = "Trinity", icon = "staticnuke"}, |
| 10 | + {id = 39616, name = "Zeno", icon = "missileslow"}, |
11 | 11 | } |
12 | 12 |
|
13 | 13 | local function isMissileCommand(cmdID) |
14 | | - for _, id in ipairs(missileCmdIDs) do |
15 | | - if cmdID == id then return true end |
| 14 | + for _, missile in ipairs(missileCmdIDs) do |
| 15 | + if cmdID == missile.id then return true end |
16 | 16 | end |
17 | 17 | return false |
18 | 18 | end |
@@ -494,13 +494,24 @@ local factoryButtonLayoutOverride = { |
494 | 494 | } |
495 | 495 |
|
496 | 496 | -- Missile command display configurations |
497 | | -commandDisplayConfig[39610] = { texture = imageDir .. 'Bold/attack.png', tooltip = "Launch EOS (Tactical Nuke)\nTactical nuclear missile with high damage."} |
498 | | -commandDisplayConfig[39611] = { texture = imageDir .. 'Bold/attack.png', tooltip = "Launch Seismic\nArea denial seismic missile, slows units."} |
499 | | -commandDisplayConfig[39612] = { texture = imageDir .. 'Bold/attack.png', tooltip = "Launch Shockley (EMP)\nElectromagnetic pulse missile disables units."} |
500 | | -commandDisplayConfig[39613] = { texture = imageDir .. 'Bold/attack.png', tooltip = "Launch Inferno (Napalm)\nNapalm missile with persistent damage."} |
501 | | -commandDisplayConfig[39614] = { texture = imageDir .. 'Bold/attack.png', tooltip = "Launch Disarm Missile\nDisables units temporarily."} |
502 | | -commandDisplayConfig[39615] = { texture = imageDir .. 'Bold/attack.png', tooltip = "Launch Trinity (Strategic Nuke)\nLong-range nuclear missile."} |
503 | | -commandDisplayConfig[39616] = { texture = imageDir .. 'Bold/attack.png', tooltip = "Launch Zeno (Slow Missile)\nSlow homing missile with lingering damage."} |
| 497 | +local missileTooltips = { |
| 498 | + [39610] = "Launch EOS (Tactical Nuke)\nTactical nuclear missile with high damage.", |
| 499 | + [39611] = "Launch Seismic\nArea denial seismic missile, slows units.", |
| 500 | + [39612] = "Launch Shockley (EMP)\nElectromagnetic pulse missile disables units.", |
| 501 | + [39613] = "Launch Inferno (Napalm)\nNapalm missile with persistent damage.", |
| 502 | + [39614] = "Launch Disarm Missile\nDisables units temporarily.", |
| 503 | + [39615] = "Launch Trinity (Strategic Nuke)\nLong-range nuclear missile.", |
| 504 | + [39616] = "Launch Zeno (Slow Missile)\nSlow homing missile with lingering damage.", |
| 505 | +} |
| 506 | + |
| 507 | +for _, missile in ipairs(missileCmdIDs) do |
| 508 | + local unitDef = UnitDefNames[missile.icon] |
| 509 | + local icon = unitDef and ("#" .. unitDef.id) or (imageDir .. 'Bold/attack.png') |
| 510 | + commandDisplayConfig[missile.id] = { |
| 511 | + texture = icon, |
| 512 | + tooltip = missileTooltips[missile.id] |
| 513 | + } |
| 514 | +end |
504 | 515 |
|
505 | 516 | local function hasMissileUnits() |
506 | 517 | local teamUnits = Spring.GetTeamUnits(Spring.GetMyTeamID()) or {} |
|
0 commit comments