Add mouse control style to match other, non-C&C, RTS games
As title. Addresses #16669, but without breaking expectations from 3rd-gen C&C players.
I'm not sure why the ftl files have every line changed, I'm guessing a line ending difference between how my editor is set up and what was there before, but I have no idea why they would be overridden
I'm not sure why the ftl files have every line changed, I'm guessing a line ending difference between how my editor is set up and what was there before, but I have no idea why they would be overridden
Your editor is not respecting newline format. You are doing CRLF, changing it from LF. Literally adding a CR character to every line break
Fixed the line endings, wish I knew how to reliably squash commits without having to force push
Fixed the line endings, wish I knew how to reliably squash commits without having to force push
Force push is the thing you do with the rebase workflow
This seems to just create more inconsistencies. All unit orders remain on RMB, but just attack move is special to be moved to LMB?
This seems to just create more inconsistencies. All unit orders remain on RMB, but just attack move is special to be moved to LMB?
A more general solution would be to have a TargetedUnitOrderGenerator that can be on left-click regardless of which button sends orders to units, and have the AttackMoveOrderGenerator inherit from that. Currently Attack Move is the only order that is targeted, as mods don't really have targeted unit abilities, but the convention in RTS games as a genre is to treat attack move as a targeted unit ability.
What about Guard and other "abilities"?
Good point, Guard is also a targeted order, and I rarely use it exactly because it being on right click is awkward for me. I'll set up the generalized TargetedUnitOrderGenerator when I get the chance, likely tomorrow (busy with work and Hallowe'en stuff today)
Both left and right mouse buttons now activate attack move with no method of cancelling. Also please run out tests suite before pushing out a PR
https://github.com/OpenRA/OpenRA/wiki/Contributing
make check for code style, and make test for unit tests
Right, sorry, I'm doing the tests now.
Can reproduce the cancel bug, fixed in next commit
Does it seem correct that basically all the commands in the command bar still get cancelled by left click orders?
Ah, yeah, fixed that, and the chronotank teleport. Did a sweep for everything that inherits from OrderGenerator and UnitOrderGenerator to make sure I didn't miss any others
Not sure if the setting should be a check box or part of the dropdown. I feel like the dropdown would make more sense, but I'm not sure if I'm the only one
After some thought I've realized that the way I'm doing it, where order generators being "targeted orders" is opt-in rather than opt-out (or just no options besides the user-side ones), is over-engineered and already causing massive headaches, let alone when other mods with their own orders/traits with orders update and have to track down every order type that involves a 2-step order selection and targeting process. I'm re-designing it from bleed to go the other way, where there'll be a mode where Action is on left button, but the default UnitOrderGenerator.Order(function) and it's attendant support functions uses the right button, since that just works as expected without having to fiddle with every UnitOrderGenerator derived class
For guard both mous buttons activate it
Maybe minimap should also use left click?
Fixed the Guard bug too,
I thought minimap was handling things properly (maybe it was before the redesign), will take a look at that tomorrow
Minimap behaviour fixed, including some spurious selection cursors in Modern mode that was pre-existing (it was consistent with how RA3 works with right-click orders, but a bug in both cases)
I can cancel attack and guard by double clicking left mouse button. Hold down shift
Minimap still seems broken. You move on it with left mouse button, but left also activates support powers and orders units
I also notice a sound bug with shift+left-click, I'll look into that too.
The minimap behaviour is working as intended, or at least, working as intended given that I meant for the term "Generals" to be a shorthand for "not like C&C games" without actually saying it. Technically C&C Generals always has the left mouse button move the minimap, but you can only issue right-click orders through the minimap, and have to switch to right-click to target support powers. This is inconsistent between the map and minimap, and a downgrade for targeted orders, unlike the other two input modes. However, that's just Generals, every other RTS game I can find with a minimap will prioritize targeted orders over minimap movement if there is an order ready to be targeted, though some (like StarCraft 2) will switch right-click to moving the minimap in that case (which is easier to code than what is currently in the PR and an approach I took initially because of that)
I personally find ctrl+RMB makes perfect sense as the way to have that work in this context, since it's still a one-click command, just with a key held (as opposed to using the command bar). If you're talking about having a separate key for the two-step approach (like how "Attack Ground" keys work in other RTS games) then that would be left click as that would be a key press (not hold) to change mode. Since Shift is meant to queue whatever orders are given it shouldn't change the click behaviour from an unqueued order at all.
I'll look into the cursor issue, getting that to work properly has been a bit tricky
Maybe for description to take up less space, we could remove the light with support powers?
Makes sense, it's always left click. I assume you're proposing that for every mouse control type, not just Generals?
What about merging "Select Units...", "Place Buildings..." and "Support Powers..." into a two-line thing, since they are always left click?
Could merge "Place Buildings..." and "Support Powers...". However selection is very different from both
Is it? Every mode uses "Select units using the <Left> mouse button" line as a separate line, even Classic. Merging just "Place Buildings..." and "Support Powers..." doesn't save any lines
The UI now looks great.
I see there's no way to cancel waypoint mode, except for adding another order like enabling attack move. Also, the waypoint mode get's confirmed by right click?
Waypoint mode is really weird, especially since everything it does is done better by just holding shift (that is, it doesn't produce waypoints for actions independent of units selected as it does in classic C&C games). Ideally it would be able to handle any order but that doesn't even work in the other modes, so right now it just handles contextual actions (matching the functionality of the other modes), cancelled by clicking on it again (which AFAICT is the old C&C UI flow), though also by choosing another order
On modern you can't activate support powers on minimap
That's always been true. Did you want me to change that in this PR? If so, did you want it on right click (consistent with other minimap orders) or left click (consistent with support powers targeted on the main map, and AFAICT way easier to code, in a way that will remove the HACK in ForceModifiersOrderGenerator along with a bunch of other bodges and hacks, but does require either reflection shenanigans or making a property that should be get-only settable to otherwise work the way PR currently does. https://github.com/dvr333/OpenRA/tree/left-click-attack-move-expectedbutton if you want to check that out)?
it is weird. But as of this PR, it doesn't work like contextual and still uses right click orders. Cancelling should be done with right click no?
Fair, it is a two-step order when you click on it, so I see the logic of it using left click
Merged the experimental branch. It fixes all the problems listed, both the hacks and the support powers issue on Modern, and also reduces the amount of hardcoding, which seems to be a recent goal overall. I'll leave the commits unsquashed for now to allow review of the different approaches
Would it be possible to structure the PR with an initial commit that generalises the plumbing, and then a second commit to add the new mode and UI?
Would it be possible to structure the PR with an initial commit that generalises the plumbing, and then a second commit to add the new mode and UI?
Done