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

Add clickable unit portraits #231

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Rampoina
Copy link
Contributor

@Rampoina Rampoina commented Aug 2, 2022

  • 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 added 2 commits August 2, 2022 21:06
clicking on a unit portrait selects that unit
shift clicking on it, deselects it
@pavanvo
Copy link

pavanvo commented Aug 18, 2022

@Rampoina New method select type is not working,
i tested with code from

//select all units of the same type if double click

it's works fine!

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

@Rampoina
Copy link
Contributor Author

Rampoina commented Aug 18, 2022

@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

Copy link
Contributor

@andy5995 andy5995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me!

Nice! Thanks @Rampoina

@andy5995
Copy link
Contributor

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

@pavanvo
Copy link

pavanvo commented Aug 23, 2022

@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?

@Rampoina
Copy link
Contributor Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the option to select/remove individual units from a selection
3 participants