ground markers: Fix startup and shutdown bug

When logging in to the game with the plugin disabled, enabling it will
not cause points to be filled, as the game state trigger will not be
reached. This commit properly loads points on plugin startup and clears
them on shutdown.
This commit is contained in:
Jordan Atwood
2019-02-17 19:43:49 -08:00
committed by Adam
parent 5420f874db
commit 15fbbdd786

View File

@@ -133,6 +133,12 @@ public class GroundMarkerPlugin extends Plugin
points.clear();
int[] regions = client.getMapRegions();
if (regions == null)
{
return;
}
for (int regionId : regions)
{
// load points for region
@@ -235,6 +241,7 @@ public class GroundMarkerPlugin extends Plugin
{
overlayManager.add(overlay);
keyManager.registerKeyListener(inputListener);
loadPoints();
}
@Override
@@ -242,6 +249,7 @@ public class GroundMarkerPlugin extends Plugin
{
overlayManager.remove(overlay);
keyManager.unregisterKeyListener(inputListener);
points.clear();
}
private void markTile(LocalPoint localPoint)