Skip to content

Commit

Permalink
Block character login keyboard shortcut when any dialogs are open (#380)
Browse files Browse the repository at this point in the history
Fixes issue #360 where login shortcut would be activated if typing 1/2/3 shortcut keys as part of a password.
  • Loading branch information
ethanmoffat authored Aug 28, 2024
1 parent a1ade1d commit 5866310
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion EndlessClient/UIControls/CharacterInfoPanel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using EndlessClient.Controllers;
using EndlessClient.Dialogs.Services;
Expand Down Expand Up @@ -163,7 +164,8 @@ protected virtual void DoUpdateLogic(GameTime gameTime)

var previousKeyState = _userInputProvider.PreviousKeyState;
var currentKeyState = _userInputProvider.CurrentKeyState;
if (currentKeyState.IsKeyPressedOnce(previousKeyState, Keys.D1 + _characterIndex))
if (currentKeyState.IsKeyPressedOnce(previousKeyState, Keys.D1 + _characterIndex) &&
!Game.Components.OfType<IXNADialog>().Any())
{
AsyncButtonClick(() => _loginController.LoginToCharacter(_character));
}
Expand Down

0 comments on commit 5866310

Please sign in to comment.