Feature #1950
open[Qt] Multi-select for stacked units.
0%
Description

- Ctrl+A to select all
- Ctrl+LeftMouseClick to toggle individual unit's selection state
- Shift+LeftMouseClick to select all units from the previously selected unit
- (as before) LeftMouseClick selects and completes the selection window
- The Enter/Return key also completes the selection window
Files
Updated by John Robertson 8 months ago
- File 1950.v2.patch 1950.v2.patch added
whoops, need to remove the `log_normal()` lines.
Updated by John Robertson 8 months ago
- File clipboard-202602221910-5yuf7.png clipboard-202602221910-5yuf7.png added
- File 1950.v3.patch 1950.v3.patch added

necessarily, changed the selected text color
Updated by Marko Lindqvist 19 days ago
In file included from ../../src/utility/shared.h:181,
from ../../src/common/fc_types.h:23,
from ../../src/common/actres.h:21,
from ../../src/common/actions.h:18,
from ../../src/client/gui-qt/dialogs.cpp:41:
../../src/client/gui-qt/dialogs.cpp: In member function ‘void units_select::create_pixmap()’:
../../src/client/gui-qt/dialogs.cpp:5305:37: error: declaration of ‘punit’ shadows a previous local [-Werror=shadow]
5305 | unit_list_iterate(utile->units, punit) {
| ^~~~~
../../src/utility/speclist.h:578:14: note: in definition of macro ‘TYPED_LIST_ITERATE’
578 | TYPE_data *NAME_data; \
| ^~~~~~~~~
../../src/client/gui-qt/dialogs.cpp:5305:5: note: in expansion of macro ‘unit_list_iterate’
5305 | unit_list_iterate(utile->units, punit) {
| ^~~~~~~~~~~~~~~~~
../../src/client/gui-qt/dialogs.cpp:5259:16: note: shadowed declaration is here
5259 | struct unit *punit;
| ^~~~~Updated by Marko Lindqvist 19 days ago
The patch is quite hard to read due to big formatting changes hiding the small logic changes.
Updated by Marko Lindqvist 19 days ago
- Blocked by Feature #2312: Qt: Improve units_select::create_pixmap() formatting added
Updated by Marko Lindqvist 19 days ago
Marko Lindqvist wrote in #note-5:
The patch is quite hard to read due to big formatting changes hiding the small logic changes.
#2312 does bulk of the formatting changes first. Attached patch applies on top of it. The patch results in the same final files that the old patch did without #2312. This also reveals that formatting also with this patch is badly off at places.
Updated by Marko Lindqvist 19 days ago
Marko Lindqvist wrote in #note-7:
Marko Lindqvist wrote in #note-5:
The patch is quite hard to read due to big formatting changes hiding the small logic changes.
#2312 does bulk of the formatting changes first. Attached patch applies on top of it. The patch results in the same final files that the old patch did without #2312. This also reveals that formatting also with this patch is badly off at places.
New version attached, with indentation adjusted. No other changes, e.g., the compiler warning is still there.
Updated by Marko Lindqvist 19 days ago
- You remove update_units(), and all calls to it. Are you sure things work correctly when enemy kills some units from the tile while the selection is open?
- style: Make sure there's an empty line between variable declarations and first line of code on each code block
Updated by Marko Lindqvist 19 days ago
Marko Lindqvist wrote in #note-9:
- You remove update_units(), and all calls to it. Are you sure things work correctly when enemy kills some units from the tile while the selection is open?
Indexes in tile->units can change also because of allied player moving units in/out. It can even be an allied ship carrying our units in/out.