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 generic list selection menu and use it in an editor menu #1895

Merged
merged 5 commits into from
Dec 8, 2021
Merged

Add generic list selection menu and use it in an editor menu #1895

merged 5 commits into from
Dec 8, 2021

Conversation

Rami-Slicer
Copy link
Contributor

Add a generic list selection menu and use it.

  • Add menu_list.cpp and its header
  • Replace a somewhat annoying string selector used to configure the badguys emitted by a dispenser who's options were every single badguy.

Closes #1894

Copy link
Member

@Semphriss Semphriss left a comment

Choose a reason for hiding this comment

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

Heya, thanks for the PR!

I gave it a quick look and I have a few questions on choices regarding code design. I'm not sure what's intended and what's a mistake, so if there's a reason you made certain things this way, let me know!

src/gui/menu_list.cpp Outdated Show resolved Hide resolved
src/gui/menu_list.cpp Outdated Show resolved Hide resolved
src/gui/menu_list.cpp Outdated Show resolved Hide resolved
src/gui/menu_list.cpp Outdated Show resolved Hide resolved
@Busybody64
Copy link

I think you should also try to add a dropdown menu for the owl, too!
We don't want the game to crash because you made a typo.

Copy link
Member

@Semphriss Semphriss left a comment

Choose a reason for hiding this comment

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

I'm not sure if you finished all the edits you planned to do, but in case you did, I have two extra comments:

src/gui/menu_list.cpp Outdated Show resolved Hide resolved
src/gui/menu_list.cpp Outdated Show resolved Hide resolved
src/gui/menu_list.cpp Outdated Show resolved Hide resolved
More changes and fix signedness compiler warning

Fix inconsistent indentation
@mrkubax10
Copy link
Member

mrkubax10 commented Nov 18, 2021

Files menu_list.cpp and menu_list.hpp are missing license info, check how it looks like in other files.

@Rami-Slicer
Copy link
Contributor Author

Woops I forgot about that

src/gui/menu_list.hpp Outdated Show resolved Hide resolved
Fix trailing underscore
@Semphriss
Copy link
Member

Please address the build issues. (Most are due to code quality problems, like a missing override)

@Semphriss
Copy link
Member

Pro tip: before pushing, you can enable code quality checks by passing -DWARNINGS=ON and -DWERROR=ON and rebuild SuperTux with both GCC and Clang, and it'll show where the problems are without needing to wait for the CI.

Comment on lines 24 to 25
for(uint i = 0; i < items.size(); i++) {
add_entry(i, items[i]);
Copy link
Member

Choose a reason for hiding this comment

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

MSVC doesn't recognize uint, please use size_t instead

@Rami-Slicer
Copy link
Contributor Author

Ah I was wondering how to get the errors to appear, thanks

@Semphriss
Copy link
Member

That last build error is not part of the code, it's a known issue with the environment.

@mrkubax10 mrkubax10 self-requested a review December 8, 2021 07:25
@mrkubax10 mrkubax10 merged commit cf60131 into SuperTux:master Dec 8, 2021
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.

Replace arrow selectors with too many choices with a better selection menu
4 participants