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:
committed by
Tomas Slusny
parent
285926924b
commit
36fdb620fc
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user