wasd plugin: allow input to chat dialogs

The chat dialogs use the same key listener as the chatbox
This commit is contained in:
Adam
2018-08-16 13:42:11 -04:00
parent 5cac102798
commit 34b513f433
3 changed files with 22 additions and 1 deletions

View File

@@ -105,7 +105,21 @@ public class WASDCameraPlugin extends Plugin
boolean chatboxFocused()
{
Widget chatboxParent = client.getWidget(WidgetInfo.CHATBOX_PARENT);
return chatboxParent != null && chatboxParent.getOnKeyListener() != null;
if (chatboxParent == null || chatboxParent.getOnKeyListener() == null)
{
return false;
}
// chat dialogs use the same key listener as chat
if (client.getWidget(WidgetInfo.DIALOG_NPC) != null
|| client.getWidget(WidgetInfo.DIALOG_SPRITE) != null
|| client.getWidget(WidgetInfo.DIALOG_OPTION) != null
|| client.getWidget(WidgetInfo.DIALOG_PLAYER) != null)
{
return false;
}
return true;
}
@Subscribe