ChatboxPanelManager: Be more resilient when scripts mismatch

If RESET_CHATBOX_INPUT doesn't invoke runelite_callback resetChatboxInput because the script hash mismatches panels never get killed, so they a) break jagex inputs, and b) can be lost and not get unregistered, so they will record passwords on the login screen
This commit is contained in:
Max Weber
2019-03-21 07:09:55 -06:00
parent 7af89342b4
commit f7a9374639

View File

@@ -93,6 +93,10 @@ public class ChatboxPanelManager
0,
1
);
if (currentInput != null)
{
killCurrentPanel();
}
}
private void unsafeOpenInput(ChatboxInput input)
@@ -113,6 +117,11 @@ public class ChatboxPanelManager
mouseManager.registerMouseWheelListener((MouseWheelListener) input);
}
if (currentInput != null)
{
killCurrentPanel();
}
currentInput = input;
client.setVar(VarClientInt.INPUT_TYPE, InputType.RUNELITE_CHATBOX_PANEL.getType());
client.getWidget(WidgetInfo.CHATBOX_TITLE).setHidden(true);