item stats: use ClientThread where necessary for resetting

This commit is contained in:
trimbe
2019-03-12 17:55:05 -04:00
parent b9bf0e3639
commit 1a10215b1d

View File

@@ -52,6 +52,7 @@ import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo; import net.runelite.api.widgets.WidgetInfo;
import net.runelite.api.widgets.WidgetTextAlignment; import net.runelite.api.widgets.WidgetTextAlignment;
import net.runelite.api.widgets.WidgetType; import net.runelite.api.widgets.WidgetType;
import net.runelite.client.callback.ClientThread;
import net.runelite.client.config.ConfigManager; import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe; import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.game.ItemManager; import net.runelite.client.game.ItemManager;
@@ -90,6 +91,9 @@ public class ItemStatPlugin extends Plugin
@Inject @Inject
private ItemStatConfig config; private ItemStatConfig config;
@Inject
private ClientThread clientThread;
private Widget itemInformationTitle; private Widget itemInformationTitle;
@Provides @Provides
@@ -114,7 +118,7 @@ public class ItemStatPlugin extends Plugin
protected void shutDown() throws Exception protected void shutDown() throws Exception
{ {
overlayManager.remove(overlay); overlayManager.remove(overlay);
resetGEInventory(); clientThread.invokeLater(this::resetGEInventory);
} }
@Subscribe @Subscribe
@@ -122,7 +126,7 @@ public class ItemStatPlugin extends Plugin
{ {
if (event.getKey().equals("geStats")) if (event.getKey().equals("geStats"))
{ {
resetGEInventory(); clientThread.invokeLater(this::resetGEInventory);
} }
} }