Skip to content

"Commander actions" API for mods #499

@Xymanek

Description

@Xymanek

The tactical HUD has a bar top-right that provides icons for non-soldier-specific actions. Unfortunately, the current implementation relies heavily on hardcoded flash stuff but I think it can be overcome.

The API would be an event with an array of actions, each of which would contain:

  • Icon
  • Text
  • Callback on usage
  • Maybe more things, depends

For controller, if

  • 1 action - show as "evac" text is shown in vanilla
  • 2 or more - show "commander actions" and on RS press, bring up a pause-like menu, but filled with the options (including the default evac option)

For kb+m, the icons would be positioned starting after the "end turn" one and before the chosen icon. Note that this will require some manual positioning recalculations but I think that it's quite possible to do with a few unsolicited flash calls. For buttons themsleves, we can take inspiration from unused UITacticalHUD_CommanderHUD

Using this, we could also fix the lack of ability to open sitrep and chosen information mid-battle with controllers

This would require non-trvial changes in UITacticalHUD, UITacticalHUD_MouseControls and UITacticalHUD_AbilityContainer

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions