Fixes chat re-opening on Sending Message when bound to Enter #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this do?
Currently binding chat to Enter causes a problem: When you send a message with Enter it instantly re-opens chat which forces you to close it by double tapping Escape
This PR adds few extra checks to prevent this from happening
How does it do so?
Using
return
inif
blocks to not trigger chat opening and closing on the same update, checking for_focused
as extra stepWhy should this be merged?
I am fairly sure it is a bug, and as I remember wise person once said:
Testing
Run the game, entered training mode, sent a bunch of messages using Enter.
Changelog:
Fix: Binding Chat to Enter will now allow you to close chat