Expand the hiscore panel when looking up players

This commit is contained in:
UniquePassive
2018-01-01 21:12:44 +01:00
committed by Adam
parent a407af8672
commit e4487362a5

View File

@@ -25,9 +25,11 @@
package net.runelite.client.plugins.hiscore;
import com.google.common.eventbus.Subscribe;
import java.lang.reflect.InvocationTargetException;
import java.util.concurrent.ScheduledExecutorService;
import javax.imageio.ImageIO;
import javax.inject.Inject;
import javax.swing.SwingUtilities;
import net.runelite.client.events.PlayerMenuOptionClicked;
import net.runelite.client.menus.MenuManager;
import net.runelite.client.plugins.Plugin;
@@ -74,7 +76,25 @@ public class HiscorePlugin extends Plugin
{
if (event.getMenuOption().equals(LOOKUP))
{
executor.execute(() -> hiscorePanel.lookup(event.getMenuTarget()));
executor.execute(() ->
{
try
{
SwingUtilities.invokeAndWait(() ->
{
if (!navButton.isSelected())
{
navButton.doClick();
}
});
}
catch (InterruptedException | InvocationTargetException e)
{
throw new RuntimeException(e);
}
hiscorePanel.lookup(event.getMenuTarget());
});
}
}