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 keybindings for readying and spectating in multi rooms #31114

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

Conversation

orwenn22
Copy link

Hey, it's my first time trying to contribute here. This PR adds customisable bindings for readying and spectating in multiplayer rooms.
I mostly play mania, and I find it kinda frustrating that I have to use the touchpad of my laptop between each games when I play multi.
To my knowledge there is currently no way to ready up using only the keyboard (if there is then I'm not aware).
I have no idea if this implementation is clean or if there are other things that need to be modified. Let me know if there are any issues.

2024-12-13.16-13-09.mp4

Comment on lines +195 to +196
new KeyBinding(new[] { InputKey.Control, InputKey.R }, GlobalAction.MultiplayerReady),
new KeyBinding(new[] { InputKey.Control, InputKey.S }, GlobalAction.MultiplayerSpectate),
Copy link
Collaborator

Choose a reason for hiding this comment

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

These seem kinda weird / arbitrary. I'd propose something like ctrl/shift-enter for these or something. Something that has more weight behind it, these are supposed to be primary actions for this screen.

Copy link
Author

@orwenn22 orwenn22 Dec 16, 2024

Choose a reason for hiding this comment

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

I'm not sure what to do about this, I just picked whatever made sense for me when I made the PR, but I wasn't actually sure if these keybindings were good or not. Ctrl-enter seems good for the ready button, but I still don't really know what to choose for the spectate button (maybe Ctrl-backspace ? Or leave it unbinded by default ?).

switch (e.Action)
{
case GlobalAction.MultiplayerReady:
onReadyButtonClick();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
onReadyButtonClick();
readyButton.TriggerClick();

is preferred as that should play out all of the related button animations that play when the button is clicked using the mouse. It's a UX thing. Same for the other hotkey.

Copy link
Author

Choose a reason for hiding this comment

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

Ah, makes sense. By doing things that way it also looks like the checks I previously did with operationInProgress.Value and !readyButton.Enabled.Value are now useless, so I got rid of those.

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

Successfully merging this pull request may close these issues.

3 participants