Merge pull request #1975 from deathbeam/agi-remove-text

Do not draw text on top of Mark Of Grace
This commit is contained in:
Adam
2018-04-26 20:19:44 -04:00
committed by GitHub
2 changed files with 16 additions and 6 deletions

View File

@@ -29,6 +29,7 @@ import java.awt.Color;
import static java.awt.Color.RED;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Polygon;
import java.awt.geom.Area;
import javax.inject.Inject;
import lombok.extern.slf4j.Slf4j;
@@ -75,6 +76,7 @@ public class AgilityOverlay extends Overlay
if (objectClickbox != null)
{
Color configColor = markOfGrace != null ? RED : config.getOverlayColor();
if (objectClickbox.contains(mousePosition.getX(), mousePosition.getY()))
{
graphics.setColor(configColor.darker());
@@ -83,6 +85,7 @@ public class AgilityOverlay extends Overlay
{
graphics.setColor(configColor);
}
graphics.draw(objectClickbox);
graphics.setColor(new Color(configColor.getRed(), configColor.getGreen(), configColor.getBlue(), 50));
graphics.fill(objectClickbox);
@@ -96,7 +99,14 @@ public class AgilityOverlay extends Overlay
if (markOfGrace.getPlane() == client.getPlane() && markOfGrace.getItemLayer() != null
&& markOfGrace.getLocalLocation().distanceTo(playerLocation) < MAX_DISTANCE)
{
OverlayUtil.renderTileOverlay(graphics, markOfGrace.getItemLayer(), "Mark of Grace", config.getMarkColor());
final Polygon poly = markOfGrace.getItemLayer().getCanvasTilePoly();
if (poly == null)
{
return null;
}
OverlayUtil.renderPolygon(graphics, poly, config.getMarkColor());
}
}

View File

@@ -165,11 +165,13 @@ public class AgilityPlugin extends Plugin
public void onItemLayerChanged(ItemLayerChanged event)
{
if (obstacles.isEmpty())
{
return;
}
Tile tile = event.getTile();
ItemLayer itemLayer = tile.getItemLayer();
boolean hasMark = tileHasMark(itemLayer);
final Tile tile = event.getTile();
final ItemLayer itemLayer = tile.getItemLayer();
final boolean hasMark = tileHasMark(itemLayer);
if (markOfGrace != null && tile.getWorldLocation().equals(markOfGrace.getWorldLocation()) && !hasMark)
{
@@ -203,8 +205,6 @@ public class AgilityPlugin extends Plugin
return false;
}
// This code, brought to you, in part, by the letters C and V
// ... and the words "search" and "replace"
@Subscribe
public void onGameObjectSpawned(GameObjectSpawned event)
{