NPC hider based on name

This commit is contained in:
James Munson
2019-06-15 16:00:36 -07:00
parent 4d3b7b2510
commit 844089ae2e
5 changed files with 44 additions and 1 deletions

View File

@@ -64,6 +64,10 @@ public abstract class EntityHiderBridgeMixin implements RSClient
@Inject
public static boolean hideProjectiles;
@Inject
public static String hideNPCsNames;
@Inject
@Override
public void setIsHidingEntities(boolean state)
@@ -127,6 +131,13 @@ public abstract class EntityHiderBridgeMixin implements RSClient
hideNPCs2D = state;
}
@Inject
@Override
public void setNPCsNames(String NPCs)
{
hideNPCsNames = NPCs;
}
@Inject
@Override
public void setAttackersHidden(boolean state)

View File

@@ -67,6 +67,9 @@ public abstract class EntityHiderMixin implements RSScene
@Shadow("hideNPCs")
private static boolean hideNPCs;
@Shadow("hideNPCsNames")
private static String hideNPCsNames;
@Shadow("hideNPCs2D")
private static boolean hideNPCs2D;
@@ -151,6 +154,7 @@ public abstract class EntityHiderMixin implements RSScene
else if (renderable instanceof RSNPC)
{
RSNPC npc = (RSNPC) renderable;
String[] names = hideNPCsNames.split(",");
if (!hideAttackers)
{
@@ -160,6 +164,14 @@ public abstract class EntityHiderMixin implements RSScene
}
}
for(String name: names)
{
if(names.equals(npc.getName()))
{
return false;
}
}
return drawingUI ? !hideNPCs2D : !hideNPCs;
}
else if (renderable instanceof RSProjectile)