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

Use key down and support key repeat in game menu #651

Merged

Conversation

Pinemarten
Copy link
Contributor

This PR includes two changes:

  • Use keyDown instead of keyUp in game menu. In vanilla Gothic 2 NOTR it's actually key down that triggers the menu action (e.g., going through menu items with up/down arrows), so this change makes OpenGothic in line with vanilla.
  • Add support for key repeat. In vanilla, it's possible to hold your key to decrease/increase value on the slider in the menu. For example, it's possible to hold left arrow key to decrease the music volume. It was previously not possible in OpenGothic.

@Try
Copy link
Owner

Try commented Jul 10, 2024

Hi, @Pinemarten !

Thanks for PR, looks good - will test once I'm back at home, roughtly by the end of this week

@Try
Copy link
Owner

Try commented Jul 13, 2024

Tested PR today:

  • In the main-menu vanilla has keyRepeat for UP/DOWN keys, but it's not achieved by this path\
  • For no/yes options LEFT/RIGHT keys do not have loop behavior in vanilla, but still can toggle no/yes only by holding only left key
  • For % options case is similar. For example view-range: in vanilla you can hold left and go as low as 20% and then it stops, in this path it loops to 300%
  • For sliders - works well

game/ui/menuroot.cpp Outdated Show resolved Hide resolved
@Pinemarten
Copy link
Contributor Author

Hi @Try, thanks for testing it!
I pushed some changes. UP/DOWN works now for keyRepeat. There's no loop behavior anymore for % options and yes/no.

@Try Try merged commit 35d4e74 into Try:master Jul 14, 2024
1 check passed
@Try
Copy link
Owner

Try commented Jul 14, 2024

Merged, thanks!

@Try
Copy link
Owner

Try commented Jul 15, 2024

Just to note: keyRepeatEvent in Tempest has repeat period same as OS. And usually it adjusted for text typing, not for video-games. So it's significantly faster than in vanilla-game.

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.

2 participants