kourendlibrary: fix panel reloading not being done on the swing thread
This commit is contained in:
@@ -171,29 +171,31 @@ public class KourendLibraryPlugin extends Plugin
|
|||||||
|
|
||||||
if (ev.getKey().equals("hideVarlamoreEnvoy"))
|
if (ev.getKey().equals("hideVarlamoreEnvoy"))
|
||||||
{
|
{
|
||||||
panel.reload();
|
SwingUtilities.invokeLater(panel::reload);
|
||||||
}
|
}
|
||||||
|
else if (ev.getKey().equals("hideButton"))
|
||||||
SwingUtilities.invokeLater(() ->
|
|
||||||
{
|
{
|
||||||
if (!config.hideButton())
|
SwingUtilities.invokeLater(() ->
|
||||||
{
|
{
|
||||||
clientToolbar.addNavigation(navButton);
|
if (!config.hideButton())
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Player lp = client.getLocalPlayer();
|
|
||||||
boolean inRegion = lp != null && lp.getWorldLocation().getRegionID() == REGION;
|
|
||||||
if (inRegion)
|
|
||||||
{
|
{
|
||||||
clientToolbar.addNavigation(navButton);
|
clientToolbar.addNavigation(navButton);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
clientToolbar.removeNavigation(navButton);
|
Player lp = client.getLocalPlayer();
|
||||||
|
boolean inRegion = lp != null && lp.getWorldLocation().getRegionID() == REGION;
|
||||||
|
if (inRegion)
|
||||||
|
{
|
||||||
|
clientToolbar.addNavigation(navButton);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
clientToolbar.removeNavigation(navButton);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
|
|||||||
Reference in New Issue
Block a user