diff --git a/runelite-api/src/main/java/net/runelite/api/Client.java b/runelite-api/src/main/java/net/runelite/api/Client.java index 82b6ce89eb..dea3bc7133 100644 --- a/runelite-api/src/main/java/net/runelite/api/Client.java +++ b/runelite-api/src/main/java/net/runelite/api/Client.java @@ -47,7 +47,6 @@ public interface Client extends GameEngine { /** * The client invokes these callbacks to communicate to - * @return */ Callbacks getCallbacks(); @@ -58,7 +57,6 @@ public interface Client extends GameEngine /** * Retrieve a global logger for the client. * This is most useful for mixins which can't have their own. - * @return */ Logger getLogger(); @@ -351,7 +349,7 @@ public interface Client extends GameEngine /** * Loads and creates the sprite images of the passed archive and file IDs. * - * @param source the sprite database + * @param source the sprite index * @param archiveId the sprites archive ID * @param fileId the sprites file ID * @return the sprite image of the file @@ -359,16 +357,12 @@ public interface Client extends GameEngine SpritePixels[] getSprites(IndexDataBase source, int archiveId, int fileId); /** - * Gets the sprite index database. - * - * @return the sprite database + * Gets the sprite index. */ IndexDataBase getIndexSprites(); /** - * Gets the script index database. - * - * @return the script database + * Gets the script index. */ IndexDataBase getIndexScripts(); @@ -554,8 +548,7 @@ public interface Client extends GameEngine * Sets the array of open menu entries. *
* This method should typically be used in the context of the {@link net.runelite.api.events.MenuOpened} - * event, since setting the menu entries will be overwritten the next - * time the menu entries are calculated. + * event, since setting the menu entries will be overwritten the next frame * * @param entries new array of open menu entries */ @@ -603,22 +596,15 @@ public interface Client extends GameEngine * plane, x and y the x-axis and y-axis coordinates of a tile * divided by the size of a chunk. *
- * The bits of the int value held by the coordinates are structured - * with the following format: - *
{@code
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | |rot| y chunk coord | x chunk coord |pln| |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * }
* @return the array of instance template chunks
* @see Constants#CHUNK_SIZE
* @see InstanceTemplates
@@ -1010,48 +996,32 @@ public interface Client extends GameEngine
ItemContainer getItemContainer(InventoryID inventory);
/**
- * Gets the index of the last integer added to the
- * {@link #getIntStack()} array.
- *
- * @return the array index
+ * Gets the length of the cs2 vm's int stack
*/
int getIntStackSize();
/**
- * Sets the index of the last integer added to the
- * {@link #getIntStack()} array.
- *
- * @param stackSize the array index
+ * Sets the length of the cs2 vm's int stack
*/
void setIntStackSize(int stackSize);
/**
- * Gets the integer stack
- *
- * @return the array
+ * Gets the cs2 vm's int stack
*/
int[] getIntStack();
/**
- * Gets the index of the last string added to the
- * {@link #getStringStack()} array.
- *
- * @return the array index
+ * Gets the length of the cs2 vm's string stack
*/
int getStringStackSize();
/**
- * Sets the index of the last string added to the
- * {@link #getStringStack()} array.
- *
- * @param stackSize the array index
+ * Sets the length of the cs2 vm's string stack
*/
void setStringStackSize(int stackSize);
/**
- * Gets the string stack
- *
- * @return the string stack
+ * Gets the cs2 vm's string stack
*/
String[] getStringStack();
@@ -1224,8 +1194,6 @@ public interface Client extends GameEngine
/**
* Creates a new instance of a world.
- *
- * @return the created world
*/
World createWorld();
@@ -1238,7 +1206,9 @@ public interface Client extends GameEngine
SpritePixels drawInstanceMap(int z);
/**
- * Runs a RuneLite script.
+ * Executes a client script from the cache
+ *
+ * This method must be ran on the client thread and is not reentrant
*
* @param id the script ID
* @param args additional arguments to execute the script with
@@ -1521,8 +1491,6 @@ public interface Client extends GameEngine
/**
* Gets the enabled state for the Oculus orb mode
- *
- * @return
*/
int getOculusOrbState();
@@ -1535,8 +1503,6 @@ public interface Client extends GameEngine
/**
* Sets the normal moving speed when using oculus orb (default value is 12)
- *
- * @param speed speed
*/
void setOculusOrbNormalSpeed(int speed);
diff --git a/runelite-api/src/main/java/net/runelite/api/IndexDataBase.java b/runelite-api/src/main/java/net/runelite/api/IndexDataBase.java
index 5503cb6885..67de31469e 100644
--- a/runelite-api/src/main/java/net/runelite/api/IndexDataBase.java
+++ b/runelite-api/src/main/java/net/runelite/api/IndexDataBase.java
@@ -25,7 +25,7 @@
package net.runelite.api;
/**
- * Represents an indexed database, typically used for sprites.
+ * Represents an index in the cache
*/
public interface IndexDataBase
{
diff --git a/runelite-api/src/main/java/net/runelite/api/ItemComposition.java b/runelite-api/src/main/java/net/runelite/api/ItemComposition.java
index 98ac7332be..eaaed4e2aa 100644
--- a/runelite-api/src/main/java/net/runelite/api/ItemComposition.java
+++ b/runelite-api/src/main/java/net/runelite/api/ItemComposition.java
@@ -105,9 +105,7 @@ public interface ItemComposition
boolean isStackable();
/**
- * Returns whether or not the item can be traded to other players.
- *
- * @return true if tradeable, false otherwise
+ * Returns whether or not the item can be sold on the grand exchange.
*/
boolean isTradeable();
diff --git a/runelite-api/src/main/java/net/runelite/api/events/ScriptCallbackEvent.java b/runelite-api/src/main/java/net/runelite/api/events/ScriptCallbackEvent.java
index c640d22ea2..d78269be44 100644
--- a/runelite-api/src/main/java/net/runelite/api/events/ScriptCallbackEvent.java
+++ b/runelite-api/src/main/java/net/runelite/api/events/ScriptCallbackEvent.java
@@ -28,7 +28,7 @@ import lombok.Data;
import net.runelite.api.Script;
/**
- * An event where a Runelite ASM script is called.
+ * A callback from a runelite_callback opcode in a cs2
*/
@Data
public class ScriptCallbackEvent
diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java b/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java
index 958aeca008..3aa6e23f13 100644
--- a/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java
+++ b/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java
@@ -32,8 +32,8 @@ import net.runelite.api.Point;
/**
* Represents an on-screen UI element that is drawn on the canvas.
* - * It should be noted that unique RuneLite elements are note widgets - * themselves, and that Widgets are primarily RuneScape elements. + * It should be noted that most RuneLite-added elements are not Widgets, but are + * an Overlay. Notable exceptions include bank tag tabs and chatbox inputs *
* Examples of Widgets include: *
* The name of the widget is used in the tooltip when an action is * available. For example, the widget that activates quick prayers @@ -263,6 +266,8 @@ public interface Widget /** * Checks whether this widget or any of its parents are hidden. * + * This must be ran on the client thread + * * @return true if this widget or any parent is hidden, false otherwise */ boolean isHidden(); @@ -276,7 +281,7 @@ public interface Widget boolean isSelfHidden(); /** - * Sets the hidden state of this widget. + * Sets the self-hidden state of this widget. * * @param hidden new hidden state */ @@ -310,8 +315,11 @@ public interface Widget /** * Sets the width of the widget. * - * @param width the new width + * You do not want to use this. Use {@link #setOriginalWidth(int)}, {@link #setWidthMode(int)} + * and {@link #revalidate()}. Almost any interaction with this widget from a clientscript will + * recalculate this value. */ + @Deprecated void setWidth(int width); /** @@ -324,8 +332,11 @@ public interface Widget /** * Sets the height of the widget. * - * @param height the new height + * You do not want to use this. Use {@link #setOriginalHeight(int)}, {@link #setHeightMode(int)} + * and {@link #revalidate()}. Almost any interaction with this widget from a clientscript will + * recalculate this value. */ + @Deprecated void setHeight(int height); /** @@ -348,6 +359,7 @@ public interface Widget * @param index index of the item * @return the widget item at index, or null if an item at index * does not exist + * @throws IndexOutOfBoundsException if the index is out of bounds */ WidgetItem getWidgetItem(int index); @@ -380,8 +392,8 @@ public interface Widget void setItemQuantity(int quantity); /** - * Checks whether or not the drawn area of this widget contains - * a point on the canvas. + * Checks if the passed canvas points is inside of this widget's + * {@link #getBounds() bounds} * * @param point the canvas point * @return true if this widget contains the point, false otherwise @@ -429,65 +441,63 @@ public interface Widget void setScrollHeight(int height); /** - * Gets the original x-axis coordinate. - * - * @return the original coordinate + * Gets the X coordinate of this widget before being adjusted by + * {@link #getXPositionMode()}}. */ int getOriginalX(); /** - * Sets the original x-axis coordinate. + * Sets the X input to the {@link WidgetPositionMode}. {@link #revalidate()} must be + * called for the new values to take effect. * - * @param originalX the new coordinate + * @see #setXPositionMode(int) */ void setOriginalX(int originalX); /** - * Gets the original y-axis coordinate. - * - * @return the original coordinate + * Gets the Y coordinate of this widget before being adjusted by + * {@link #getYPositionMode()}} */ int getOriginalY(); /** - * Sets the original y-axis coordinate. + * Sets the Y input to the {@link WidgetPositionMode}. {@link #revalidate()} must be + * called for the new values to take effect. * - * @param originalY the new coordinate + * @see #setYPositionMode(int) */ void setOriginalY(int originalY); /** - * Gets the original height of the widget. - * - * @return the original height + * Gets the height coordinate of this widget before being adjusted by + * {@link #getHeightMode()} */ int getOriginalHeight(); /** - * Sets the original height of the widget. + * Sets the height input to the {@link WidgetSizeMode}. {@link #revalidate()} must be + * called for the new values to take effect. * - * @param originalHeight the original height + * @see #setHeightMode(int) */ void setOriginalHeight(int originalHeight); /** - * Gets the original width of the widget. - * - * @return the original width + * Gets the width coordinate of this widget before being adjusted by + * {@link #getWidthMode()} */ int getOriginalWidth(); /** - * Sets the original width of the widget. + * Sets the width input to the {@link WidgetSizeMode}. {@link #revalidate()} must be + * called for the new values to take effect. * - * @param originalWidth the original width + * @see #setWidthMode(int) */ void setOriginalWidth(int originalWidth); /** - * Gets the actions available on the widget. - * - * @return the actions + * Gets the menu options available on the widget as a sparse array. */ String[] getActions(); @@ -505,10 +515,10 @@ public interface Widget void deleteAllChildren(); /** - * Creates a menu action on the widget + * Creates a menu option on the widget * * @param index The index of the menu - * @param action The string to be displayed next to the widget's name in the context menu + * @param action The verb to be displayed next to the widget's name in the context menu */ void setAction(int index, String action); @@ -592,11 +602,15 @@ public interface Widget /** * Returns the archive id of the font used + * + * @see net.runelite.api.FontID */ int getFontId(); /** * Sets the archive id of the font + * + * @see net.runelite.api.FontID */ void setFontId(int id); @@ -661,7 +675,8 @@ public interface Widget int getXPositionMode(); /** - * Sets the mode that the X position is calculated from the original X position + * Sets the mode that the X position is calculated from the original X position. + * {@link #revalidate()} must be called for new values to take effect. * * @see WidgetPositionMode */ @@ -675,7 +690,8 @@ public interface Widget int getYPositionMode(); /** - * Sets the mode that the Y position is calculated from the original Y position + * Sets the mode that the Y position is calculated from the original Y position. + * {@link #revalidate()} must be called for new values to take effect. * * @see WidgetPositionMode */ @@ -717,7 +733,8 @@ public interface Widget int getWidthMode(); /** - * Sets the mode controlling widget width + * Sets the mode controlling widget width. + * {@link #revalidate()} must be called for new values to take effect. * * @see WidgetSizeMode */ @@ -731,7 +748,8 @@ public interface Widget int getHeightMode(); /** - * Sets the mode controlling widget width + * Sets the mode controlling widget width. + * {@link #revalidate()} must be called for new values to take effect. * * @see WidgetSizeMode */