Class MenuItem
- java.lang.Object
-
- com.runemate.game.api.hybrid.local.hud.MenuItem
-
- All Implemented Interfaces:
Interactable
,Renderable
public final class MenuItem extends java.lang.Object implements Interactable, Renderable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MenuItem.Type
-
Constructor Summary
Constructors Constructor Description MenuItem(int index, java.lang.String action, java.lang.String target, int opcode, int identifier, int arg0, int arg1)
MenuItem(int index, java.lang.String action, java.lang.String target, int opcode, int identifier, int arg0, int arg1, boolean rs3)
Deprecated.MenuItem(com.runemate.client.game.open.OpenMenuItem item)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
click()
Clicks this entity in an interactable pointboolean
click(Interactable interactable)
boolean
contains(java.awt.Point point)
Checks if the projected bounds of this entity contains the Point provided.boolean
equals(java.lang.Object o)
@NonNull java.lang.String
getAction()
int
getArg0()
int
getArg1()
int
getArg2()
Deprecated.InteractableRectangle
getBounds()
int
getIdentifier()
int
getIndex()
InteractablePoint
getInteractionPoint(java.awt.Point origin)
Gets a point within the entity that can be interacted with.int
getOpcode()
@Nullable java.lang.String
getTarget()
@Nullable Interactable
getTargetEntity()
@Nullable MenuItem.Type
getTargetType()
double
getVisibility()
Returns a rough estimate of how visible this entity is as a percent (0 to 100)boolean
hasDynamicBounds()
int
hashCode()
boolean
interact(java.util.regex.Pattern action, java.util.regex.Pattern target)
Attempts to match action and target using Matcher.find() and then interacts with the appropriate menu itemboolean
isVisible()
Whether the entity is visiblevoid
render(java.awt.Graphics2D g2d)
Renders this entity onto the givenGraphics2D
, use is discouragedvoid
render(javafx.scene.canvas.GraphicsContext gc)
Renders this entity onto the givenGraphicsContext
boolean
targets(Interactable desiredTarget)
boolean
targets(Interactable entity, java.util.regex.Pattern action, java.util.regex.Pattern target)
java.lang.String
toString()
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Interactable
getInteractionPoint, hover, interact, interact, interact, interact, interact, isHovered
-
-
-
-
Constructor Detail
-
MenuItem
public MenuItem(int index, java.lang.String action, java.lang.String target, int opcode, int identifier, int arg0, int arg1)
-
MenuItem
@Deprecated public MenuItem(int index, java.lang.String action, java.lang.String target, int opcode, int identifier, int arg0, int arg1, boolean rs3)
Deprecated.
-
MenuItem
public MenuItem(com.runemate.client.game.open.OpenMenuItem item)
-
-
Method Detail
-
getBounds
public InteractableRectangle getBounds()
-
render
public void render(java.awt.Graphics2D g2d)
Description copied from interface:Renderable
Renders this entity onto the givenGraphics2D
, use is discouraged- Specified by:
render
in interfaceRenderable
-
render
public void render(javafx.scene.canvas.GraphicsContext gc)
Description copied from interface:Renderable
Renders this entity onto the givenGraphicsContext
- Specified by:
render
in interfaceRenderable
-
targets
public boolean targets(Interactable desiredTarget)
-
targets
public boolean targets(Interactable entity, java.util.regex.Pattern action, java.util.regex.Pattern target)
-
getVisibility
public double getVisibility()
Description copied from interface:Interactable
Returns a rough estimate of how visible this entity is as a percent (0 to 100)- Specified by:
getVisibility
in interfaceInteractable
-
hasDynamicBounds
public boolean hasDynamicBounds()
- Specified by:
hasDynamicBounds
in interfaceInteractable
-
click
public boolean click()
Description copied from interface:Interactable
Clicks this entity in an interactable point- Specified by:
click
in interfaceInteractable
- Returns:
- true if successfully clicked
-
isVisible
public boolean isVisible()
Description copied from interface:Interactable
Whether the entity is visible- Specified by:
isVisible
in interfaceInteractable
- Returns:
- true if visible, and false if not visible
-
getInteractionPoint
public InteractablePoint getInteractionPoint(java.awt.Point origin)
Description copied from interface:Interactable
Gets a point within the entity that can be interacted with. Takes into account the direction of movement from the origin point.- Specified by:
getInteractionPoint
in interfaceInteractable
-
contains
public boolean contains(java.awt.Point point)
Description copied from interface:Interactable
Checks if the projected bounds of this entity contains the Point provided.- Specified by:
contains
in interfaceInteractable
- Returns:
-
click
public boolean click(Interactable interactable)
-
interact
public boolean interact(java.util.regex.Pattern action, java.util.regex.Pattern target)
Description copied from interface:Interactable
Attempts to match action and target using Matcher.find() and then interacts with the appropriate menu item- Specified by:
interact
in interfaceInteractable
- Parameters:
action
- The pattern to match the action with, if null it's ignoredtarget
- The pattern to match the target with, if null it's ignored
-
getAction
@NonNull public @NonNull java.lang.String getAction()
-
getTarget
@Nullable public @Nullable java.lang.String getTarget()
-
getIndex
public int getIndex()
-
getOpcode
public int getOpcode()
-
getArg0
public int getArg0()
-
getArg1
public int getArg1()
-
getIdentifier
public int getIdentifier()
-
getArg2
@Deprecated public int getArg2()
Deprecated.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getTargetEntity
@Nullable public @Nullable Interactable getTargetEntity()
-
getTargetType
@Nullable public @Nullable MenuItem.Type getTargetType()
-
-