poh plugin: fix icons displaying when changing planes
This commit is contained in:
@@ -65,17 +65,20 @@ public class BurnerOverlay extends Overlay
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (GameObject object : plugin.getPohObjects())
|
plugin.getPohObjects().forEach((object, tile) ->
|
||||||
{
|
{
|
||||||
if (BURNER_UNLIT.contains(object.getId()))
|
if (tile.getPlane() == client.getPlane())
|
||||||
{
|
{
|
||||||
drawBurner(graphics, "Unlit", object, Color.RED, parent);
|
if (BURNER_UNLIT.contains(object.getId()))
|
||||||
|
{
|
||||||
|
drawBurner(graphics, "Unlit", object, Color.RED, parent);
|
||||||
|
}
|
||||||
|
else if (BURNER_LIT.contains(object.getId()))
|
||||||
|
{
|
||||||
|
drawBurner(graphics, "Lit", object, Color.GREEN, parent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (BURNER_LIT.contains(object.getId()))
|
});
|
||||||
{
|
|
||||||
drawBurner(graphics, "Lit", object, Color.GREEN, parent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import java.util.List;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameObject;
|
|
||||||
import net.runelite.api.Perspective;
|
import net.runelite.api.Perspective;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import static net.runelite.client.plugins.poh.PohIcons.ALTAR;
|
import static net.runelite.client.plugins.poh.PohIcons.ALTAR;
|
||||||
@@ -87,11 +86,10 @@ public class PohOverlay extends Overlay
|
|||||||
}
|
}
|
||||||
|
|
||||||
Point localLocation = client.getLocalPlayer().getLocalLocation();
|
Point localLocation = client.getLocalPlayer().getLocalLocation();
|
||||||
|
plugin.getPohObjects().forEach((object, tile) ->
|
||||||
for (GameObject object : plugin.getPohObjects())
|
|
||||||
{
|
{
|
||||||
Point location = object.getLocalLocation();
|
Point location = object.getLocalLocation();
|
||||||
if (localLocation.distanceTo(location) <= MAX_DISTANCE)
|
if (tile.getPlane() == client.getPlane() && localLocation.distanceTo(location) <= MAX_DISTANCE)
|
||||||
{
|
{
|
||||||
PohIcons icon = PohIcons.getIcon(object.getId());
|
PohIcons icon = PohIcons.getIcon(object.getId());
|
||||||
|
|
||||||
@@ -105,7 +103,7 @@ public class PohOverlay extends Overlay
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ import com.google.inject.Binder;
|
|||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
@@ -43,6 +44,7 @@ import static net.runelite.api.ObjectID.INCENSE_BURNER_13210;
|
|||||||
import static net.runelite.api.ObjectID.INCENSE_BURNER_13211;
|
import static net.runelite.api.ObjectID.INCENSE_BURNER_13211;
|
||||||
import static net.runelite.api.ObjectID.INCENSE_BURNER_13212;
|
import static net.runelite.api.ObjectID.INCENSE_BURNER_13212;
|
||||||
import static net.runelite.api.ObjectID.INCENSE_BURNER_13213;
|
import static net.runelite.api.ObjectID.INCENSE_BURNER_13213;
|
||||||
|
import net.runelite.api.Tile;
|
||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.api.events.GameObjectDespawned;
|
import net.runelite.api.events.GameObjectDespawned;
|
||||||
import net.runelite.api.events.GameObjectSpawned;
|
import net.runelite.api.events.GameObjectSpawned;
|
||||||
@@ -61,7 +63,7 @@ public class PohPlugin extends Plugin
|
|||||||
static final Set<Integer> BURNER_LIT = Sets.newHashSet(INCENSE_BURNER_13209, INCENSE_BURNER_13211, INCENSE_BURNER_13213);
|
static final Set<Integer> BURNER_LIT = Sets.newHashSet(INCENSE_BURNER_13209, INCENSE_BURNER_13211, INCENSE_BURNER_13213);
|
||||||
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final Set<GameObject> pohObjects = new HashSet<>();
|
private final Map<GameObject, Tile> pohObjects = new HashMap<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private PohOverlay overlay;
|
private PohOverlay overlay;
|
||||||
@@ -105,7 +107,7 @@ public class PohPlugin extends Plugin
|
|||||||
GameObject gameObject = event.getGameObject();
|
GameObject gameObject = event.getGameObject();
|
||||||
if (BURNER_LIT.contains(gameObject.getId()) || BURNER_UNLIT.contains(gameObject.getId()) || PohIcons.getIcon(gameObject.getId()) != null)
|
if (BURNER_LIT.contains(gameObject.getId()) || BURNER_UNLIT.contains(gameObject.getId()) || PohIcons.getIcon(gameObject.getId()) != null)
|
||||||
{
|
{
|
||||||
pohObjects.add(gameObject);
|
pohObjects.put(gameObject, event.getTile());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user