Paulquappe Posted April 11, 2020 Share Posted April 11, 2020 The command summary on the galaxy map (lower left corner) does not display all commands correctly. It only displays the respective icon, but no text. Revision: r22541 Steps to reproduce: - Open galaxy map - Select sector with controllable ships - Select controllable ship - Order Repair (/ Repair Target/ Escort) Cause of failure: MapRoutes.getOrderDescription in scripts/player/map/maproutes.lua does not handle every OrderType. Fix: Append following code to the if/else-block: elseif order.action == OrderType.Escort then line.ltext = "[${i}] Escort"%_t % {i = i} line.rtext = "${craftName}"%_t % {craftName = order.craftName} elseif order.action == OrderType.AttackCraft then line.ltext = "[${i}] Attack"%_t % {i = i} line.rtext = "${craftName}"%_t % {craftName = order.craftName} elseif order.action == OrderType.GuardPosition then line.ltext = "[${i}] Guard Position"%_t % {i = i} line.rtext = math.floor(order.px) .. " : " .. math.floor(order.py) .. " : " .. math.floor(order.pz) elseif order.action == OrderType.FlyToPosition then line.ltext = "[${i}] Fly To"%_t % {i = i} line.rtext = math.floor(order.px) .. " : " .. math.floor(order.py) .. " : " .. math.floor(order.pz) elseif order.action == OrderType.Board then line.ltext = "[${i}] Board"%_t % {i = i} line.rtext = "${craftName}"%_t % {craftName = order.craftName} elseif order.action == OrderType.RepairTarget then line.ltext = "[${i}] Repair "%_t % {i = i} line.rtext = "${craftName}"%_t % {craftName = order.craftName} elseif order.action == OrderType.Repair then line.ltext = "[${i}] Repair"%_t % {i = i} end This requires the craft name in the order chain (querying it here would result in performance loss, since getOrderDescription is called every frame). I included the name in scripts/entity/orderchain.lua. For example: local order = {action = OrderType.Escort, craftId = craftId.string, craftName = craftName} in OrderChain.addEscortOrder. See the attachment for the full source. maproutes.lua.txt orderchain.lua.txt Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now