entityhider: Pets entity hider & isFollower (#2094)
This commit is contained in:
@@ -1561,6 +1561,13 @@ public interface Client extends GameShell
|
|||||||
*/
|
*/
|
||||||
void setNPCsHidden2D(boolean state);
|
void setNPCsHidden2D(boolean state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether Pets from other players are hidden.
|
||||||
|
*
|
||||||
|
* @param state new pet hidden state
|
||||||
|
*/
|
||||||
|
void setPetsHidden(boolean state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether attacking players or NPCs are hidden.
|
* Sets whether attacking players or NPCs are hidden.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ public interface NPCDefinition
|
|||||||
|
|
||||||
boolean isClickable();
|
boolean isClickable();
|
||||||
|
|
||||||
|
boolean isFollower();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets whether the NPC is visible on the mini-map.
|
* Gets whether the NPC is visible on the mini-map.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -234,11 +234,22 @@ public interface EntityHiderConfig extends Config
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
position = 18,
|
||||||
|
keyName = "hidePets",
|
||||||
|
name = "Hide Pets",
|
||||||
|
description = "Configures whether or not other player pets are hidden"
|
||||||
|
)
|
||||||
|
default boolean hidePets()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigTitleSection(
|
@ConfigTitleSection(
|
||||||
keyName = "miscTitle",
|
keyName = "miscTitle",
|
||||||
name = "Miscellaneous",
|
name = "Miscellaneous",
|
||||||
description = "",
|
description = "",
|
||||||
position = 18
|
position = 19
|
||||||
)
|
)
|
||||||
default Title miscTitle()
|
default Title miscTitle()
|
||||||
{
|
{
|
||||||
@@ -246,7 +257,7 @@ public interface EntityHiderConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 19,
|
position = 20,
|
||||||
keyName = "hideProjectiles",
|
keyName = "hideProjectiles",
|
||||||
name = "Hide Projectiles",
|
name = "Hide Projectiles",
|
||||||
description = "Configures whether or not projectiles are hidden",
|
description = "Configures whether or not projectiles are hidden",
|
||||||
|
|||||||
@@ -140,6 +140,8 @@ public class EntityHiderPlugin extends Plugin
|
|||||||
//client.setNPCsNames(Text.fromCSV(config.hideNPCsNames()));
|
//client.setNPCsNames(Text.fromCSV(config.hideNPCsNames()));
|
||||||
//client.setNPCsHiddenOnDeath(Text.fromCSV(config.hideNPCsOnDeath()));
|
//client.setNPCsHiddenOnDeath(Text.fromCSV(config.hideNPCsOnDeath()));
|
||||||
|
|
||||||
|
client.setPetsHidden(config.hidePets());
|
||||||
|
|
||||||
client.setAttackersHidden(config.hideAttackers());
|
client.setAttackersHidden(config.hideAttackers());
|
||||||
|
|
||||||
client.setProjectilesHidden(config.hideProjectiles());
|
client.setProjectilesHidden(config.hideProjectiles());
|
||||||
@@ -164,6 +166,8 @@ public class EntityHiderPlugin extends Plugin
|
|||||||
client.setNPCsHidden(false);
|
client.setNPCsHidden(false);
|
||||||
client.setNPCsHidden2D(false);
|
client.setNPCsHidden2D(false);
|
||||||
|
|
||||||
|
client.setPetsHidden(false);
|
||||||
|
|
||||||
client.setAttackersHidden(false);
|
client.setAttackersHidden(false);
|
||||||
|
|
||||||
client.setProjectilesHidden(false);
|
client.setProjectilesHidden(false);
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ public abstract class EntityHiderBridgeMixin implements RSClient
|
|||||||
@Inject
|
@Inject
|
||||||
public static boolean hideNPCs2D;
|
public static boolean hideNPCs2D;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public static boolean hidePets;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public static boolean hideAttackers;
|
public static boolean hideAttackers;
|
||||||
|
|
||||||
@@ -222,6 +225,13 @@ public abstract class EntityHiderBridgeMixin implements RSClient
|
|||||||
hideSpecificPlayers = players;
|
hideSpecificPlayers = players;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Override
|
||||||
|
public void setPetsHidden(boolean state)
|
||||||
|
{
|
||||||
|
hidePets = state;
|
||||||
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Override
|
@Override
|
||||||
public void setAttackersHidden(boolean state)
|
public void setAttackersHidden(boolean state)
|
||||||
|
|||||||
@@ -83,6 +83,9 @@ public abstract class EntityHiderMixin implements RSScene
|
|||||||
@Shadow("hideNPCs2D")
|
@Shadow("hideNPCs2D")
|
||||||
private static boolean hideNPCs2D;
|
private static boolean hideNPCs2D;
|
||||||
|
|
||||||
|
@Shadow("hidePets")
|
||||||
|
private static boolean hidePets;
|
||||||
|
|
||||||
@Shadow("hideAttackers")
|
@Shadow("hideAttackers")
|
||||||
private static boolean hideAttackers;
|
private static boolean hideAttackers;
|
||||||
|
|
||||||
@@ -188,6 +191,14 @@ public abstract class EntityHiderMixin implements RSScene
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hidePets)
|
||||||
|
{
|
||||||
|
if (npc.getDefinition().isFollower())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (hideDeadNPCs && npc.getHealthRatio() == 0)
|
if (hideDeadNPCs && npc.getHealthRatio() == 0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ public interface RSNPCDefinition extends NPCDefinition
|
|||||||
@Override
|
@Override
|
||||||
boolean isClickable();
|
boolean isClickable();
|
||||||
|
|
||||||
|
@Import("isFollower")
|
||||||
|
@Override
|
||||||
|
boolean isFollower();
|
||||||
|
|
||||||
@Import("drawMapDot")
|
@Import("drawMapDot")
|
||||||
@Override
|
@Override
|
||||||
boolean isMinimapVisible();
|
boolean isMinimapVisible();
|
||||||
|
|||||||
Reference in New Issue
Block a user