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 Tomas Slusny
parent 285926924b
commit 36fdb620fc

View File

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