megaglest-source icon indicating copy to clipboard operation
megaglest-source copied to clipboard

Add clickable unit portraits

Open Rampoina opened this issue 1 year ago • 5 comments

  • clicking on a unit portrait selects that unit
  • shift clicking on it, deselects it
  • control clicking on it selects all of the units of the same type from the selection

fixes #222

Rampoina avatar Aug 02 '22 19:08 Rampoina

@Rampoina New method select type is not working, i tested with code from https://github.com/MegaGlest/megaglest-source/blob/68fb4cdff636c075da32df983935f81cc5d10419/source/glest_game/gui/gui.cpp#L1225

it's works fine!

so better, will be create method select type in Gui.cpp and put there encapsulated code from line above

pavanvo avatar Aug 18 '22 03:08 pavanvo

@pavanvo please tell me what are you testing and the steps to reproduce the issue. With the last commit, control clicking does work and selects all the units of the same type in my tests. The code you linked is very similar to the one I added in selection.cpp (which I used as reference), keep in mind that it's selecting the same unit type from the selection

Rampoina avatar Aug 18 '22 10:08 Rampoina

@Rampoina what do you think about using right-click instead of shift-click when removing selected units?

andy5995 avatar Aug 23 '22 14:08 andy5995

@Rampoina what do you think about using right-click instead of shift-click when removing selected units?

so, may also "select type" with double click?

pavanvo avatar Aug 23 '22 22:08 pavanvo

@Rampoina what do you think about using right-click instead of shift-click when removing selected units?

Definitely not instead of, those are the standard bindings in most games. I see no harm in adding it as an alternative though. Double click feels intuitive but I'm not so sure about right click

Rampoina avatar Aug 23 '22 22:08 Rampoina