client: make appearance comparison opt in.
This commit is contained in:
@@ -36,6 +36,7 @@ import javax.annotation.Nullable;
|
||||
import net.runelite.api.annotations.VisibleForExternalPlugins;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.PlayerAppearanceChanged;
|
||||
import net.runelite.api.hooks.Callbacks;
|
||||
import net.runelite.api.hooks.DrawCallbacks;
|
||||
import net.runelite.api.vars.AccountType;
|
||||
@@ -2070,6 +2071,20 @@ public interface Client extends GameShell
|
||||
*/
|
||||
void setMirrored(boolean isMirrored);
|
||||
|
||||
/**
|
||||
* True if the client is comparing player appearance hashes.
|
||||
*/
|
||||
boolean isComparingAppearance();
|
||||
|
||||
/**
|
||||
* Setting this to true will allow the client to compare
|
||||
* player appearance hashes and dispatch when one changes
|
||||
* via the {@link PlayerAppearanceChanged} event.
|
||||
* <p>
|
||||
* WARNING - THIS METHOD IS CPU-INTENSE.
|
||||
*/
|
||||
void setComparingAppearance(boolean comparingAppearance);
|
||||
|
||||
/**
|
||||
* Sets the image to be used for the login screen, provided as SpritePixels
|
||||
* If the image is larger than half the width of fixed mode,
|
||||
|
||||
@@ -54,7 +54,14 @@ import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.MenuOpcode;
|
||||
import static net.runelite.api.MenuOpcode.*;
|
||||
import static net.runelite.api.MenuOpcode.PLAYER_EIGTH_OPTION;
|
||||
import static net.runelite.api.MenuOpcode.PLAYER_FIFTH_OPTION;
|
||||
import static net.runelite.api.MenuOpcode.PLAYER_FIRST_OPTION;
|
||||
import static net.runelite.api.MenuOpcode.PLAYER_FOURTH_OPTION;
|
||||
import static net.runelite.api.MenuOpcode.PLAYER_SECOND_OPTION;
|
||||
import static net.runelite.api.MenuOpcode.PLAYER_SEVENTH_OPTION;
|
||||
import static net.runelite.api.MenuOpcode.PLAYER_SIXTH_OPTION;
|
||||
import static net.runelite.api.MenuOpcode.PLAYER_THIRD_OPTION;
|
||||
import net.runelite.api.MessageNode;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
@@ -230,6 +237,9 @@ public abstract class RSClientMixin implements RSClient
|
||||
@Inject
|
||||
private boolean isMirrored = false;
|
||||
|
||||
@Inject
|
||||
private boolean comparingAppearance = false;
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void setPrintMenuActions(boolean yes)
|
||||
@@ -1912,6 +1922,20 @@ public abstract class RSClientMixin implements RSClient
|
||||
this.isMirrored = isMirrored;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public boolean isComparingAppearance()
|
||||
{
|
||||
return comparingAppearance;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void setComparingAppearance(boolean comparingAppearance)
|
||||
{
|
||||
this.comparingAppearance = comparingAppearance;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public ObjectDefinition getObjectDefinition(int objectId)
|
||||
|
||||
@@ -297,7 +297,7 @@ public abstract class RSPlayerMixin implements RSPlayer
|
||||
|
||||
this.copy$read(buffer);
|
||||
|
||||
if (getPlayerAppearance().getHash() != appearanceHash)
|
||||
if (client.isComparingAppearance() && getPlayerAppearance().getHash() != appearanceHash)
|
||||
{
|
||||
client.getCallbacks().post(PlayerAppearanceChanged.class, new PlayerAppearanceChanged(this));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user