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

Enable mouse input - rework #41605

Merged
merged 58 commits into from
Aug 3, 2020

Conversation

martinrhan
Copy link
Contributor

@martinrhan martinrhan commented Jun 26, 2020

Summary

SUMMARY: Features "Enable mouse input for uilist and pickup, optimized some codes."

Purpose of change

#41272 (review)
As the using of struct entry_drawn_info is not a good practice, I redone the codes and forgone them.
And beyond that I also further made mouse input thing for pickup. Now user can use mouse to choose items to pickup.

Describe the solution

Used struct inclusive_rectangle in point.h instead. Therefore we get rid of some extra and useless struct defined.
Codes added to pickup.h and pickup.cpp. It is similar to what was done previously, but for pickup it need to have an int cur_it to store the index of which item that this pickup_rect refers to and it doesn't has any entry thing defined as a class, it was just directly do everything within one single method, so I add a struct inheriting inclusive_rectangle, and a static vector<pickup_rect> within it to store all rectangles of pickup entry.

Describe alternatives you've considered

N/A

Testing

WIN10, VS, Release build tested, mouse input worked nicely for inventory, uilist, pickup.

Additional context

Also added one comment for method get_coordinates_text in input.h

src/input.h Outdated Show resolved Hide resolved
src/inventory_ui.cpp Outdated Show resolved Hide resolved
src/pickup.h Outdated Show resolved Hide resolved
@anothersimulacrum anothersimulacrum added [C++] Changes (can be) made in C++. Previously named `Code` Controls / Input Keyboard, mouse, keybindings, input UI, etc. Info / User Interface Game - player communication, menus, etc. SDL: Tiles / Sound Tiles visual interface and sounds. labels Jun 26, 2020
@lgtm-com
Copy link

lgtm-com bot commented Jun 26, 2020

This pull request introduces 2 alerts when merging 9315ac9 into ff1ff7e - view on LGTM.com

new alerts:

  • 1 for Declaration hides parameter
  • 1 for Returning stack-allocated memory

src/pickup.cpp Outdated Show resolved Hide resolved
martinrhan and others added 4 commits June 27, 2020 08:46
Co-authored-by: BevapDin <tho_ki@gmx.de>
Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>
Co-authored-by: BevapDin <tho_ki@gmx.de>
Co-authored-by: BevapDin <tho_ki@gmx.de>
src/inventory_ui.cpp Outdated Show resolved Hide resolved
src/sdltiles.cpp Outdated Show resolved Hide resolved
src/sdltiles.cpp Outdated Show resolved Hide resolved
src/inventory_ui.cpp Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Jul 28, 2020

This pull request introduces 1 alert when merging 14bbe4d into 7e17b10 - view on LGTM.com

new alerts:

  • 1 for Declaration hides parameter

src/pickup.cpp Outdated Show resolved Hide resolved
src/pickup.cpp Outdated Show resolved Hide resolved
src/pickup.cpp Outdated Show resolved Hide resolved
src/pickup.cpp Outdated Show resolved Hide resolved
src/ui.h Outdated Show resolved Hide resolved
src/ui.cpp Outdated Show resolved Hide resolved
src/pickup.h Outdated Show resolved Hide resolved
src/pickup.cpp Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Controls / Input Keyboard, mouse, keybindings, input UI, etc. Info / User Interface Game - player communication, menus, etc. SDL: Tiles / Sound Tiles visual interface and sounds.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants