mes, metronome, npchighlight, npcunaggroarea, objectindicators

This commit is contained in:
therealunull
2020-12-16 15:28:24 -05:00
parent fc1c0799bd
commit 5d7bf6aa54
52 changed files with 4885 additions and 59 deletions

View File

@@ -1807,7 +1807,7 @@ public interface Client extends GameShell
/**
* Returns client item composition cache
*/
NodeCache getItemDefinitionCache();
NodeCache getItemCompositionCache();
/**
* Returns the array of cross sprites that appear and animate when left-clicking

View File

@@ -43,13 +43,13 @@ public interface Preferences
*/
void setRememberedUsername(String username);
int getSoundEffectsVolume();
int getSoundEffectVolume();
void setSoundEffectsVolume(int i);
void setSoundEffectVolume(int i);
int getAreaSoundEffectsVolume();
int getAreaSoundEffectVolume();
void setAreaSoundEffectsVolume(int i);
void setAreaSoundEffectVolume(int i);
int getMusicVolume();

View File

@@ -159,12 +159,25 @@ public class WorldPoint
* Gets the coordinate of the tile that contains the passed local point,
* accounting for instances.
*
* @param client the client
* @param client the client
* @param localPoint the local coordinate
* @return the tile coordinate containing the local point
*/
@Nullable
public static WorldPoint fromLocalInstance(Client client, LocalPoint localPoint)
{
return fromLocalInstance(client, localPoint, client.getPlane());
}
/**
* Gets the coordinate of the tile that contains the passed local point,
* accounting for instances.
*
* @param client the client
* @param localPoint the local coordinate
* @param plane the plane for the returned point, if it is not an instance
* @return the tile coordinate containing the local point
*/
public static WorldPoint fromLocalInstance(Client client, LocalPoint localPoint, int plane)
{
if (client.isInInstancedRegion())
{
@@ -176,11 +189,6 @@ public class WorldPoint
int chunkX = sceneX / CHUNK_SIZE;
int chunkY = sceneY / CHUNK_SIZE;
if (chunkX >= 13 || chunkY >= 13)
{
return null;
}
// get the template chunk for the chunk
int[][][] instanceTemplateChunks = client.getInstanceTemplateChunks();
int templateChunk = instanceTemplateChunks[client.getPlane()][chunkX][chunkY];
@@ -188,18 +196,18 @@ public class WorldPoint
int rotation = templateChunk >> 1 & 0x3;
int templateChunkY = (templateChunk >> 3 & 0x7FF) * CHUNK_SIZE;
int templateChunkX = (templateChunk >> 14 & 0x3FF) * CHUNK_SIZE;
int plane = templateChunk >> 24 & 0x3;
int templateChunkPlane = templateChunk >> 24 & 0x3;
// calculate world point of the template
int x = templateChunkX + (sceneX & (CHUNK_SIZE - 1));
int y = templateChunkY + (sceneY & (CHUNK_SIZE - 1));
// create and rotate point back to 0, to match with template
return rotate(new WorldPoint(x, y, plane), 4 - rotation);
return rotate(new WorldPoint(x, y, templateChunkPlane), 4 - rotation);
}
else
{
return fromLocal(client, localPoint);
return fromLocal(client, localPoint.getX(), localPoint.getY(), plane);
}
}

View File

@@ -981,7 +981,7 @@ public enum WidgetInfo
* @param id passed group-child ID
* @return the group ID
*/
public static int getGroupFromID(int id)
public static int TO_GROUP(int id)
{
return id >>> 16;
}