npc indicators: allow combination of higlight styles
This commit is contained in:
@@ -28,23 +28,56 @@ import java.awt.Color;
|
|||||||
import net.runelite.client.config.Config;
|
import net.runelite.client.config.Config;
|
||||||
import net.runelite.client.config.ConfigGroup;
|
import net.runelite.client.config.ConfigGroup;
|
||||||
import net.runelite.client.config.ConfigItem;
|
import net.runelite.client.config.ConfigItem;
|
||||||
|
import net.runelite.client.config.ConfigSection;
|
||||||
|
|
||||||
@ConfigGroup("npcindicators")
|
@ConfigGroup("npcindicators")
|
||||||
public interface NpcIndicatorsConfig extends Config
|
public interface NpcIndicatorsConfig extends Config
|
||||||
{
|
{
|
||||||
|
@ConfigSection(
|
||||||
|
name = "Render style",
|
||||||
|
description = "The render style of NPC highlighting",
|
||||||
|
position = 0
|
||||||
|
)
|
||||||
|
String renderStyleSection = "renderStyleSection";
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 0,
|
position = 0,
|
||||||
keyName = "highlightStyle",
|
keyName = "highlightHull",
|
||||||
name = "Highlight Style",
|
name = "Highlight hull",
|
||||||
description = "Highlight setting"
|
description = "Configures whether or not NPC should be highlighted by hull",
|
||||||
|
section = renderStyleSection
|
||||||
)
|
)
|
||||||
default RenderStyle renderStyle()
|
default boolean highlightHull()
|
||||||
{
|
{
|
||||||
return RenderStyle.HULL;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 1,
|
position = 1,
|
||||||
|
keyName = "highlightTile",
|
||||||
|
name = "Highlight tile",
|
||||||
|
description = "Configures whether or not NPC should be highlighted by tile",
|
||||||
|
section = renderStyleSection
|
||||||
|
)
|
||||||
|
default boolean highlightTile()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
position = 2,
|
||||||
|
keyName = "highlightSouthWestTile",
|
||||||
|
name = "Highlight south west tile",
|
||||||
|
description = "Configures whether or not NPC should be highlighted by south western tile",
|
||||||
|
section = renderStyleSection
|
||||||
|
)
|
||||||
|
default boolean highlightSouthWestTile()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
position = 3,
|
||||||
keyName = "npcToHighlight",
|
keyName = "npcToHighlight",
|
||||||
name = "NPCs to Highlight",
|
name = "NPCs to Highlight",
|
||||||
description = "List of NPC names to highlight"
|
description = "List of NPC names to highlight"
|
||||||
@@ -55,7 +88,7 @@ public interface NpcIndicatorsConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 2,
|
position = 4,
|
||||||
keyName = "npcColor",
|
keyName = "npcColor",
|
||||||
name = "Highlight Color",
|
name = "Highlight Color",
|
||||||
description = "Color of the NPC highlight"
|
description = "Color of the NPC highlight"
|
||||||
@@ -66,7 +99,7 @@ public interface NpcIndicatorsConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 3,
|
position = 5,
|
||||||
keyName = "drawNames",
|
keyName = "drawNames",
|
||||||
name = "Draw names above NPC",
|
name = "Draw names above NPC",
|
||||||
description = "Configures whether or not NPC names should be drawn above the NPC"
|
description = "Configures whether or not NPC names should be drawn above the NPC"
|
||||||
@@ -77,7 +110,7 @@ public interface NpcIndicatorsConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 4,
|
position = 6,
|
||||||
keyName = "drawMinimapNames",
|
keyName = "drawMinimapNames",
|
||||||
name = "Draw names on minimap",
|
name = "Draw names on minimap",
|
||||||
description = "Configures whether or not NPC names should be drawn on the minimap"
|
description = "Configures whether or not NPC names should be drawn on the minimap"
|
||||||
@@ -88,7 +121,7 @@ public interface NpcIndicatorsConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 5,
|
position = 7,
|
||||||
keyName = "highlightMenuNames",
|
keyName = "highlightMenuNames",
|
||||||
name = "Highlight menu names",
|
name = "Highlight menu names",
|
||||||
description = "Highlight NPC names in right click menu"
|
description = "Highlight NPC names in right click menu"
|
||||||
@@ -99,7 +132,7 @@ public interface NpcIndicatorsConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 6,
|
position = 8,
|
||||||
keyName = "ignoreDeadNpcs",
|
keyName = "ignoreDeadNpcs",
|
||||||
name = "Ignore dead NPCs",
|
name = "Ignore dead NPCs",
|
||||||
description = "Prevents highlighting NPCs after they are dead"
|
description = "Prevents highlighting NPCs after they are dead"
|
||||||
@@ -110,7 +143,15 @@ public interface NpcIndicatorsConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 7,
|
position = 9,
|
||||||
|
keyName = "deadNpcMenuColor",
|
||||||
|
name = "Dead NPC menu color",
|
||||||
|
description = "Color of the NPC menus for dead NPCs"
|
||||||
|
)
|
||||||
|
Color deadNpcMenuColor();
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
position = 10,
|
||||||
keyName = "showRespawnTimer",
|
keyName = "showRespawnTimer",
|
||||||
name = "Show respawn timer",
|
name = "Show respawn timer",
|
||||||
description = "Show respawn timer of tagged NPCs")
|
description = "Show respawn timer of tagged NPCs")
|
||||||
@@ -118,12 +159,4 @@ public interface NpcIndicatorsConfig extends Config
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
position = 7,
|
|
||||||
keyName = "deadNpcMenuColor",
|
|
||||||
name = "Dead NPC menu color",
|
|
||||||
description = "Color of the NPC menus for dead NPCs"
|
|
||||||
)
|
|
||||||
Color deadNpcMenuColor();
|
|
||||||
}
|
}
|
||||||
@@ -152,34 +152,32 @@ public class NpcSceneOverlay extends Overlay
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (config.renderStyle())
|
if (config.highlightHull())
|
||||||
{
|
{
|
||||||
case SOUTH_WEST_TILE:
|
Shape objectClickbox = actor.getConvexHull();
|
||||||
{
|
renderPoly(graphics, color, objectClickbox);
|
||||||
int size = npcComposition.getSize();
|
}
|
||||||
LocalPoint localPoint = actor.getLocalLocation();
|
|
||||||
|
|
||||||
int x = localPoint.getX() - ((size - 1) * Perspective.LOCAL_TILE_SIZE / 2);
|
if (config.highlightTile())
|
||||||
int y = localPoint.getY() - ((size - 1) * Perspective.LOCAL_TILE_SIZE / 2);
|
{
|
||||||
|
int size = npcComposition.getSize();
|
||||||
|
LocalPoint lp = actor.getLocalLocation();
|
||||||
|
Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size);
|
||||||
|
|
||||||
Polygon tilePoly = Perspective.getCanvasTilePoly(client, new LocalPoint(x, y));
|
renderPoly(graphics, color, tilePoly);
|
||||||
|
}
|
||||||
|
|
||||||
renderPoly(graphics, color, tilePoly);
|
if (config.highlightSouthWestTile())
|
||||||
break;
|
{
|
||||||
}
|
int size = npcComposition.getSize();
|
||||||
case TILE:
|
LocalPoint lp = actor.getLocalLocation();
|
||||||
int size = npcComposition.getSize();
|
|
||||||
LocalPoint lp = actor.getLocalLocation();
|
|
||||||
Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size);
|
|
||||||
|
|
||||||
renderPoly(graphics, color, tilePoly);
|
int x = lp.getX() - ((size - 1) * Perspective.LOCAL_TILE_SIZE / 2);
|
||||||
break;
|
int y = lp.getY() - ((size - 1) * Perspective.LOCAL_TILE_SIZE / 2);
|
||||||
|
|
||||||
case HULL:
|
Polygon southWestTilePoly = Perspective.getCanvasTilePoly(client, new LocalPoint(x, y));
|
||||||
Shape objectClickbox = actor.getConvexHull();
|
|
||||||
|
|
||||||
renderPoly(graphics, color, objectClickbox);
|
renderPoly(graphics, color, southWestTilePoly);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.drawNames() && actor.getName() != null)
|
if (config.drawNames() && actor.getName() != null)
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2018, Raqes <j.raqes@gmail.com>
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
||||||
* list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
|
||||||
* and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
||||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
package net.runelite.client.plugins.npchighlight;
|
|
||||||
|
|
||||||
public enum RenderStyle
|
|
||||||
{
|
|
||||||
OFF,
|
|
||||||
TILE,
|
|
||||||
HULL,
|
|
||||||
SOUTH_WEST_TILE
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user