OpenXcom Forum

OpenXcom Forks => OpenXcom Extended (OXCE) => OXCE Suggestions DONE => Topic started by: Tamren on October 25, 2024, 05:17:46 am

Title: [DONE][Suggestion] Undo last "dontReselect" soldier
Post by: Tamren on October 25, 2024, 05:17:46 am
The idea is that right clicking on the Don't Reselect Unit button undoes the last selection. So it would cycle through all units selected that way in reverse order and also undo the "don't reselect part". This would put the button more in line with other parts of the UI where right clicking can be used to cycle a button in reverse order such as the unit selection button and the deployment inventory tabs.

Sometimes I hit the Don't Reselect button by mistake when trying to switch to the next unit, this would provide a way to undo that. Another common scenario is that I'm using the Don't Reselect button to "clean up" a bunch of units that have no TUs left but I click the button one too many times and have to go back and search for the one I just "deleted".
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Delian on October 25, 2024, 03:43:42 pm
I also rarely accidentally click the Don't Reselect button and there's no way to undo that.
I wish that button acted the same as the Kneel button, being pressed down when the property is set, and to be able to click on it again to undo it.
For people who use it often, I suppose the right-click solution to find the previous don't-reselect-me soldier could also be useful.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Meridian on November 03, 2024, 04:04:41 pm
The idea is that right clicking on the Don't Reselect Unit button undoes the last selection.

The "last action" is not remembered anywhere (and thus cannot be undone).

So it would cycle through all units selected that way in reverse order and also undo the "don't reselect part".

The "sequence in which the units were actioned" is not remembered anywhere (and thus cannot be iterated through).


Remembering them is possible to implement, but not really worth the effort IMHO.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Tamren on November 04, 2024, 07:18:15 am
Hmm okay, I think I was overcomplicating this.

What if instead of trying to remember the entire sequence you just have the Don't Reselect button remember the (single) previous unit whenever you click the button and allow you to jump back to it with right click? Basically adding a 1-step undo button with no further features required. This would solve the two most common issues with that button which are:

1. You click Don't Reselect by mistake instead of Next Unit
2. You click Don't Reselect one too many times
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: psavola on November 04, 2024, 07:50:32 am
I haven't used Don't Reselect for a long time (since OG days), but..

If you clicked it by accident, couldn't you just manually cycle through ALL your soldiers to find the one you misclicked? It's not like there are usually dozens of troops to go through. After you have done so, you could finish the work you want that soldier to do. Or maybe there you could undo (with tighter meaning) "Don't Reselect" e.g. by RMB action so that if you shuffle through the soldiers again with TAB, this soldier would also come up again. This way the engine would not been to remember the history of last action.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Tamren on November 04, 2024, 08:32:39 am
If you clicked it by accident, couldn't you just manually cycle through ALL your soldiers to find the one you misclicked?
No you can't because Don't Reselect flags the soldier as hidden and the Next Soldier button will no longer select it. The only way to control that soldier again is to click on them directly, which may be difficult if you don't know exactly what soldier that was and where they are on the map.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: psavola on November 04, 2024, 09:27:29 am
No you can't because Don't Reselect flags the soldier as hidden and the Next Soldier button will no longer select it. The only way to control that soldier again is to click on them directly, which may be difficult if you don't know exactly what soldier that was and where they are on the map.

This only affects TAB and "Select next unit" buttons.

You can still find the soldier you misclicked on the battlescape. Or when opening a soldier's inventory, cycle through all the soldiers with "<" and ">" buttons next to "OK" (don't reselect does not affect this). Most likely going back with "<" once is the thing you want (unless there are soldies in between where you already had correctly clicked don't reselect). These are the options to mitigate the issue I was referring to. It's not like there are hundreds of soldiers out there. If you misclicked, it should be relatively painless to check at most about a dozen soldiers.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Tamren on November 04, 2024, 01:22:21 pm
It's not that easy, in my current XPiratez game a base defense against my main headquarters would require me to control 85 soldiers, not including the cats. For offensive missions I might deploy soldiers in groups of 24. Furthermore visual conditions are not always ideal. I give you an example in the attached picture, this mission takes place at night and to protect my soldiers I have deployed several smoke grenades. Even if there are "only" 14 soldiers within one screen worth of space it's still possible to "lose" a soldier with TUs and finding them again if I can't use the next soldier button is very difficult. Your trick with opening the inventory and pressing the back button doesn't work because I don't select and control my units in descending order.

I rely heavily on the Next Soldier and Don't Reselect button for these reasons. Next soldier will rapidly cycle through anyone I haven't moved yet while skipping over the soldiers I have hidden. The issue is that it's easy to accidentally hide a soldier by accident though misclicking, this is why I'm requesting an undo feature. Being able to undo just one single click would solve almost all of my problems.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Juku121 on November 04, 2024, 02:45:17 pm
Your trick with opening the inventory and pressing the back button doesn't work because I don't select and control my units in descending order.
Why does this matter? You can still find the 'lost' fellow, even if it takes more clicks and maybe some examination of TUs to find the right person.

Or, in other words, it's a question of some inconvenience vs implementing and maintaining a wholly new functionality.


I also use the 'skip' function a lot (mapped it to spacebar due to 4X habits :) ), and it's relatively rare that I have to find a skipped guy who hasn't moved yet. And if I do have to look for such a soldier, it's because he wasn't particularly important to the battle, otherwise I'd have manually selected and moved/acted in the first place.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Tamren on November 04, 2024, 04:38:06 pm
Why does this matter? You can still find the 'lost' fellow, even if it takes more clicks and maybe some examination of TUs to find the right person.

Again: Eighty. Five. Soldiers.

Your inventory based method of locating soldiers with remaining TUs is not practical for me in large scale battles (which occur several times a month in XPiratez) because unlike the Next Soldier button it does not skip the soldiers who have already moved. If I misclick and delete a soldier I have no idea where in the list of soldiers that one is located and have to trawl through everything in the way to reach them. If I scroll through the list in the right direction it could take me as little as one click to find them, if I scroll in the wrong direction it could take me as many as eighty four clicks, potentially even more than that if I confuse them for a different soldier and have to start the search again.

Or, in other words, it's a question of some inconvenience vs implementing and maintaining a wholly new functionality.

I understand that programmer man hours are finite and valuable. I would not have suggested this in the first place if I didn't think it was worth implementing based on the player QoL vs dev time ratio. I even amended it to make it simpler in scope based on Meridian's feedback, there is no need to remember a list of previous soldiers as just one would suffice to enable an Undo function.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Juku121 on November 04, 2024, 05:12:18 pm
In that case, it's not a matter of what order you select your soldiers in. It's a matter of there being way too many units on the battlefield, which is more of a mod design issue. I've seen plenty of people only move a quarter of their 16 or 24 troopers on the map when there's nothing much happening. 


Hmm, maybe the easier solution that wouldn't need any new info to be saved would be for the right-click to cycle through 'skipped' soldiers, like the default is to do it for 'unskipped'? There'd be no need to remember any new data, just a modification of the existing routine to negate the 'skipped' flag.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Solarius Scorch on November 04, 2024, 05:35:42 pm
If this happens to me, I just press "I" to open inventory of the next soldier and then I go back one time to find the soldier I skipped by mistake.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Tamren on November 04, 2024, 06:21:16 pm
In that case, it's not a matter of what order you select your soldiers in. It's a matter of there being way too many units on the battlefield

No the issue is that there is no way to undo pressing the Don't Reselect button, a problem that has existed since the DOS release in 1994. Adding an undo feature will fix the problem for everyone regardless of any other factors such as number of soldiers deployed or mods used.

If this happens to me, I just press "I" to open inventory of the next soldier and then I go back one time to find the soldier I skipped by mistake.

The only way this works consistently is if you only ever select new soldiers using the Next Soldier button. For instance if I had soldiers 123456789, and I hide soldiers 4567, if I were controlling soldier 3 and hit Don't Reselect by mistake, the game will jump me to soldier 8. If I back up one step in the inventory screen I would get soldier 7 instead of 3. The problem gets worse as the number of soldiers increases. This is why remembering the previous selected unit is necessary for an Undo feature to work properly.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Solarius Scorch on November 04, 2024, 06:59:04 pm
The only way this works consistently is if you only ever select new soldiers using the Next Soldier button. For instance if I had soldiers 123456789, and I hide soldiers 4567, if I were controlling soldier 3 and hit Don't Reselect by mistake, the game will jump me to soldier 8. If I back up one step in the inventory screen I would get soldier 7 instead of 3. The problem gets worse as the number of soldiers increases. This is why remembering the previous selected unit is necessary for an Undo feature to work properly.

I fail to see the problem. Yes, I'd have to move back 5 times instead of 1, but how often does this happen? Once per 10 hours of playing? And even if that's the case, what's so hard about this?
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: shinr on November 04, 2024, 09:07:47 pm
Had a thought about it:

Don't Reselect gets cleared for all units on next turn;

Is it possible to trigger that without going into next turn?
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Yankes on November 04, 2024, 11:40:53 pm
Had a thought about it:

Don't Reselect gets cleared for all units on next turn;

Is it possible to trigger that without going into next turn?
Yes, change like this should be easy as only would need boilerplate for new keybinding as rest of logic should be available or easy to implement.

For "prev" unit, if behavior would be "go to last ignored unit (if was any)" then this could be implemented too relativity easy, as we should only store
one value for last unit (question is if should be remember after save/load?).
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Tamren on November 05, 2024, 12:52:33 pm
I fail to see the problem. Yes, I'd have to move back 5 times instead of 1, but how often does this happen? Once per 10 hours of playing? And even if that's the case, what's so hard about this?

Again. EIGHTY. FIVE. SOLDIERS. It's not "1-5 clicks" for me, it's 1-84 clicks looking for a specific soldier with no identifying marks who is indistinguishable from other soldiers with full TUs who have not moved yet, and soldiers with full TUs who were previously hidden for reaction fire purposes. Not a problem on small scales, but a big problem for me because I deal with this on a regular basis.

Enemies attempt to invade my bases multiple times every month, sometimes twice in the same week, and every time that happens I have to control as many as 85 different soldiers, not including any assorted HWPs and war beasts. When sending soldiers to a particularly dangerous mission I often deploy as many as 24. In order to keep up with the daily threats I face I require dozens and dozens of soldiers because missions come fast and often, while wounds and combat fatigue force me to cycle them out after every deployment. This wasn't by choice, this is just how XPiratez is in the midgame.

For "prev" unit, if behavior would be "go to last ignored unit (if was any)" then this could be implemented too relativity easy, as we should only store
one value for last unit (question is if should be remember after save/load?).

Only if it were very easy to add that value to battlescape save files. Otherwise simply keeping it in memory should suffice. The undo button is an "oops" feature that players will use immediately to correct their mistake, or not at all.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Meridian on November 05, 2024, 01:38:11 pm
Only if it were very easy to add that value to battlescape save files. Otherwise simply keeping it in memory should suffice. The undo button is an "oops" feature that players will use immediately to correct their mistake, or not at all.

The implementation efforts are not big.
When I say "not worth the effort", I don't necessarily mean implementation effort.

With requests like this, just finding the correct solution is 98% of the total effort.
If possible, I want a user-friendly, intuitive, discoverable, unobtrusive, non-distracting and non-annoying solution... which is hard to find.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Tamren on November 06, 2024, 10:23:58 am
If possible, I want a user-friendly, intuitive, discoverable, unobtrusive, non-distracting and non-annoying solution... which is hard to find.

Okay how about this:

When mousing over any button on the battlescape the game displays a tooltip for that button explaining what it does, as shown in the picture. This is where we get the button names "Select Next Unit" and "Don't Reselect Unit". The tooltips for those two buttons could be changed to explain the additional RMB functions, which would look something like:

"Select Next Unit - RMB To Select Previous"
"Don't Reselect Unit - RMB To Undo"


I think this would fulfill your criteria. It's unobtrusive because it doesn't appear unless you mouse over the button. It's easily discoverable because mousing over stuff to read tooltips is normal behaviour for players. It's also intuitive in the sense that adding a right click function to Don't Reselect would match the mechanics for other UI buttons such as Select Next, and the Next button on the pre-battle inventory screen.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Meridian on November 06, 2024, 10:38:02 am
Those tooltips are from OXC and are updated/synchronized from Transifex automatically.

I would have to change them by a mod
or manually overwrite with each release
or create completely new translation keys (and thus lose all already translated versions).

Possible, but all 3 are a PITA.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Tamren on November 08, 2024, 09:07:32 am
Ah ok. What if you just implemented this as a hidden feature?

The game is already full of commands like that, XPirates has two whole codex entries which are nothing but lists of shortcut commands, usually those with shift- and ctrl- modifiers because they do not appear in the options menu. It also has a third codex entry that appears automatically and teaches players to try using RMB and MMB on everything because a lot of the hidden features are activated that way such as re-ordering the list of aircraft and bases using right click.

It wouldn't be very discoverable, but I have ideas on how to address that which belong in a separate thread. It would still be intuitive because right clicking to activate alternate functions is a pattern players will learn across various other parts of the UI.
Title: Re: [QoL] Right clicking Don't Reselect Unit button undoes last selection
Post by: Meridian on November 08, 2024, 10:05:01 am
Ah ok. What if you just implemented this as a hidden feature?

That's the most likely outcome at the end.
But I'll think about it for a while longer.
Title: Re: [DONE][Suggestion] Undo last "dontReselect" soldier
Post by: Meridian on January 12, 2025, 03:06:41 pm
Done.

https://github.com/MeridianOXC/OpenXcom/commit/6122a159df9a5deaab75307103f0639bc7601b95

Allows one level of undo.
Title: Re: [DONE][Suggestion] Undo last "dontReselect" soldier
Post by: Cooper on January 14, 2025, 05:02:22 pm
Thats soooooo nice, always wanted this!