Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Commander actions" API for mods #499

Open
Xymanek opened this issue May 1, 2019 · 13 comments · May be fixed by #589
Open

"Commander actions" API for mods #499

Xymanek opened this issue May 1, 2019 · 13 comments · May be fixed by #589

Comments

@Xymanek
Copy link
Member

Xymanek commented May 1, 2019

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

@MrNiceUK
Copy link
Contributor

MrNiceUK commented May 1, 2019

hmmmm, how about RS press for more than one option acts similar to right trigger, ie then dpad to move alow the row of icons? RS or B to cancel out again, A to select? Would also add "tooltip", I think the evac button has a tooltip, longer than just the "Evac" text controllers get beside the RS icon...

@Xymanek
Copy link
Member Author

Xymanek commented May 1, 2019

2 downsides I see to such approach:

  1. Much more complex code changes
  2. Focusing small things in top-right corner of screen may not be the best idea UX-wise. This can be solved by forcing shot preview central panel for every action (like the evac does), but in my original plan that was not required

@MrNiceUK
Copy link
Contributor

MrNiceUK commented May 1, 2019

on 2) that's already being done for the mouse input?

@Xymanek
Copy link
Member Author

Xymanek commented May 1, 2019

Only if the action itself wants to do it (eg. evac). Something like LW2's show/hide command radius doesn't need/use it. Besides, the shot preview would require all actions to be actual abilities on the unit

@MrNiceUK
Copy link
Contributor

MrNiceUK commented May 1, 2019

Not sure we mean quite the same thing then? was just referring to the element of showing a row of icons, whether mouse or controller input....

@Xymanek
Copy link
Member Author

Xymanek commented May 1, 2019

I understand what you mean, but that way you need to somehow present to the player that the command row is currently focused. Simply highlighting the small buttons in far corner of screen doesn't seem enough for me

@MrNiceUK
Copy link
Contributor

MrNiceUK commented May 1, 2019

Well they don't seem that small to me, but anyways, get it working at all before worrying about controller UI issues really... Although, one more thing, if you want to be fancy, have have RS tap always be evac, then RS hold for the selection, the arg Param to OnUnrealCommand() distinguishes taps, holds etc if you need to tell the difference.

@Xymanek
Copy link
Member Author

Xymanek commented May 1, 2019

RS hold for the selection

That's an interesting idea, didn't consider that. How would you suggest to present it to the player though? I want it to feel as natural part of UI

get it working at all

Wanted to see what other people think first

before worrying about controller UI

As X2 experience shows, bolting controller onto kb+m UI isn't a great approach, so I'm considering both from get go

@MrNiceUK
Copy link
Contributor

MrNiceUK commented May 1, 2019

Hmmm, discoverability eh? not 100 sure on that one...
I don't see the massive difference in terms of UI feed back etc between mouse clicking one of a row of icons, and selecting one with the dpad, Once the "selection" is up there?

@Xymanek
Copy link
Member Author

Xymanek commented Jul 31, 2019

Question: in vanilla, the mouse "call evac" button is shown if the current unit has it; the controller UI oth shows it only if the ability can be used... Do we want to unify this experience?

@Xymanek
Copy link
Member Author

Xymanek commented Jul 31, 2019

Another fun fact:

  • With controller you can jump to evac targeting while already targeting another ability
  • With mouse you cannot (you need to exit first)

@Iridar
Copy link
Contributor

Iridar commented Jan 10, 2021

Would really love to have this functionality for things like calling reinforcements and support strikes.

@Xymanek
Copy link
Member Author

Xymanek commented Feb 11, 2021

Would really love to have this functionality

Me too, me too...

@Xymanek Xymanek removed their assignment May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants