Jump to content
Sign in to follow this  
Paulquappe

[1.0.1][Minor][Fix included] Command summary does not display all commands

Recommended Posts

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

Share this post


Link to post
Share on other sites
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...