Merge remote-tracking branch 'runelite/master'

This commit is contained in:
Owain van Brakel
2022-03-09 01:47:04 +01:00
23 changed files with 485 additions and 153 deletions

View File

@@ -445,6 +445,20 @@ public interface Client extends GameEngine
@Nullable
SpritePixels createItemSprite(int itemId, int quantity, int border, int shadowColor, @MagicConstant(valuesFromClass = ItemQuantityMode.class) int stackable, boolean noted, int scale);
/**
* Get the item model cache. These models are used for drawing widgets of type {@link net.runelite.api.widgets.WidgetType#MODEL}
* and inventory item icons
* @return
*/
NodeCache getItemModelCache();
/**
* Get the item sprite cache. These are 2d SpritePixels which are used to raster item images on the inventory and
* on widgets of type {@link net.runelite.api.widgets.WidgetType#GRAPHIC}
* @return
*/
NodeCache getItemSpriteCache();
/**
* Loads and creates the sprite images of the passed archive and file IDs.
*

View File

@@ -8,14 +8,15 @@ import javax.annotation.Nullable;
public interface ItemComposition extends ParamHolder
{
/**
* Gets the items name.
* Gets the item's name.
*
* @return the name of the item
*/
String getName();
/**
* Sets the items name.
* Sets the item's name.
* @param name the new name
*/
void setName(String name);
@@ -141,20 +142,109 @@ public interface ItemComposition extends ParamHolder
int getInventoryModel();
/**
* Since the client reuses item models, it stores colors that can be replaced.
* This returns what colors the item model will be replaced with.
*
* Set the model ID of the inventory item. You will also need to flush the item model cache and the item
* sprite cache to have the changes fully propagated after changing this value.
* @see Client#getItemModelCache()
* @see Client#getItemSpriteCache()
*/
void setInventoryModel(int model);
/**
* Get the colors to be replaced on this item's model for this item.
* @see JagexColor
* @see ItemComposition#getColorToReplaceWith()
* @return the colors to be replaced
*/
@Nullable
short[] getColorToReplace();
/**
* Set the colors to be replaced on this item's model for this item.
* @see JagexColor
* @see ItemComposition#setColorToReplaceWith(short[])
*/
void setColorToReplace(short[] colorsToReplace);
/**
* Get the colors applied to this item's model for this item.
* @see JagexColor
* @see ItemComposition#getColorToReplace()
* @return the colors to replace with
*/
@Nullable
short[] getColorToReplaceWith();
/**
* Since the client reuses item models, it stores textures that can be replaced.
* This returns what textures the item model will be replaced with.
*
* Set the colors applied to this item's model for this item.
* @see JagexColor
* @see ItemComposition#setColorToReplace(short[])
*/
void setColorToReplaceWith(short[] colorToReplaceWith);
/**
* Get the textures to be replaced on this item's model for this item.
* @see ItemComposition#getTextureToReplaceWith()
* @return the textures to be replaced
*/
@Nullable
short[] getTextureToReplace();
/**
* Set the textures to be replaced on this item's model for this item.
* @see ItemComposition#setTextureToReplaceWith(short[])
*/
void setTextureToReplace(short[] textureToFind);
/**
* Get the textures applied to this item's model for this item.
* @see ItemComposition#getTextureToReplace()
* @return the textures to replace with
*/
@Nullable
short[] getTextureToReplaceWith();
/**
* Set the textures applied to this item's model for this item.
* @see ItemComposition#setTextureToReplace(short[])
*/
void setTextureToReplaceWith(short[] textureToReplaceWith);
/**
* Get the x angle for 2d item sprites used in the inventory.
* @see net.runelite.api.coords.Angle
* @return
*/
int getXan2d();
/**
* Get the y angle for 2d item sprites used in the inventory.
* @see net.runelite.api.coords.Angle
* @return
*/
int getYan2d();
/**
* Get the z angle for 2d item sprites used in the inventory.
* @see net.runelite.api.coords.Angle
* @return
*/
int getZan2d();
/**
* Set the x angle for 2d item sprites used in the inventory.
* @see net.runelite.api.coords.Angle
*/
void setXan2d(int angle);
/**
* Set the y angle for 2d item sprites used in the inventory.
* @see net.runelite.api.coords.Angle
*/
void setYan2d(int angle);
/**
* Set the z angle for 2d item sprites used in the inventory.
* @see net.runelite.api.coords.Angle
*/
void setZan2d(int angle);
}