ChatboxPanelManager: Kill panels when logging out.
Otherwise key listeners stay running and that is not a good idea on the login screen
This commit is contained in:
@@ -32,8 +32,10 @@ import com.google.inject.Singleton;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.ScriptID;
|
||||
import net.runelite.api.VarClientInt;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.api.vars.InputType;
|
||||
import net.runelite.api.widgets.JavaScriptCallback;
|
||||
@@ -143,6 +145,21 @@ public class ChatboxPanelManager
|
||||
public void onScriptCallbackEvent(ScriptCallbackEvent ev)
|
||||
{
|
||||
if (currentInput != null && "resetChatboxInput".equals(ev.getEventName()))
|
||||
{
|
||||
killCurrentPanel();
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
private void onGameStateChanged(GameStateChanged ev)
|
||||
{
|
||||
if (currentInput != null && ev.getGameState() == GameState.LOGIN_SCREEN)
|
||||
{
|
||||
killCurrentPanel();
|
||||
}
|
||||
}
|
||||
|
||||
private void killCurrentPanel()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -168,7 +185,6 @@ public class ChatboxPanelManager
|
||||
}
|
||||
currentInput = null;
|
||||
}
|
||||
}
|
||||
|
||||
public Widget getContainerWidget()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user