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

Defocus chat input field on enter and refocus on 'Y' press #2159

Open
Measurity opened this issue Aug 9, 2024 · 0 comments · May be fixed by #2182
Open

Defocus chat input field on enter and refocus on 'Y' press #2159

Measurity opened this issue Aug 9, 2024 · 0 comments · May be fixed by #2182
Labels
Area: user interface (game) Related to UI/UX in the game Complexity: easy Suitable for contributors new to Nitrox
Milestone

Comments

@Measurity
Copy link
Collaborator

Measurity commented Aug 9, 2024

Describe the issue

Chat doesn't defocus when you press enter (if you hold enter and type you'll immediately submit the letter).
Make it so that:

  1. Enter defocuses the input
  2. Y (default chat key) refocuses the input, always (even when in-game cursor is active).

This makes it more inline with other games like Counter Strike 2 or Deep Rock Galactic.

Related code

// Detect if there's a ghost message on top of the list (one that wasn't sent but still saved)
if (sentMessagesIndex != sentMessages.Count && sentMessages.Count > 0)
{
sentMessages.RemoveAt(sentMessages.Count - 1);
}
// If the list is too long, we'll just remove the first message of the list
if (sentMessages.Count > historyLength)
{
sentMessages.RemoveAt(0);
}
sentMessages.Add(InputField.text);
_sentMessagesIndex = sentMessages.Count;
playerChatManager.SendMessage();

@Measurity Measurity added Complexity: easy Suitable for contributors new to Nitrox Area: user interface (game) Related to UI/UX in the game labels Aug 9, 2024
@Measurity Measurity added this to the 1.8 milestone Aug 9, 2024
@Measurity Measurity changed the title Defocus chat input field on enter Defocus chat input field on enter and refocus on 'Y' press Aug 15, 2024
MistaOmega added a commit to MistaOmega/Nitrox that referenced this issue Sep 25, 2024
@MistaOmega MistaOmega linked a pull request Sep 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: user interface (game) Related to UI/UX in the game Complexity: easy Suitable for contributors new to Nitrox
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant