Expose runescape click/boundingbox display mode

This commit is contained in:
SomeoneWithAnInternetConnection
2018-01-21 11:01:13 -05:00
committed by Adam
parent 9dcde75bdf
commit 74ae39258e
4 changed files with 126 additions and 1 deletions

View File

@@ -176,7 +176,6 @@ public interface Client extends GameEngine
List<Projectile> getProjectiles();
/**
* Play a sound effect at the player's current location.
* This is how UI, and player-generated (e.g. mining, woodcutting) sound effects are normally played
@@ -195,6 +194,45 @@ public interface Client extends GameEngine
*/
void playSoundEffect(int id, int x, int y, int range);
boolean getDrawBoundingBoxes2D();
/**
* When {@code shouldDraw} is true, a 2D bounding box will be drawn for all on-screen objects
*
* @param shouldDraw whether or not to draw 2D bounding boxes
*/
void setDrawBoundingBoxes2D(boolean shouldDraw);
boolean getDrawBoundingBoxes3D();
/**
* When {@code shouldDraw} is true, 3D bounding boxes will be drawn
* either for the object under the cursor, or every object on screen
* according to {@link #setBoundingBoxAlwaysOnMode(boolean) BoundingBoxAlwaysOnMode}
*
* @param shouldDraw whether or not to draw 3D bounding boxes
*/
void setDrawBoundingBoxes3D(boolean shouldDraw);
boolean getdrawObjectGeometry2D();
/**
* When {@code shouldDraw} is true, the clickbox geometry for the object under the cursor will be displayed
*
* @param shouldDraw whether or not to draw the clickbox geometry
*/
void setdrawObjectGeometry2D(boolean shouldDraw);
boolean getBoundingBoxAlwaysOnMode();
/**
* Changes how {@link #getDrawBoundingBoxes3D()} behaves when active.
* When {@code alwaysDrawBoxes} is true, 3D bounding boxes will be drawn.
* When false, a 3D bounding box will only be drawn for the object under the cursor
*
* @param alwaysDrawBoxes whether or not to draw every 3D bounding box, when 3D bounding boxes are enabled
*/
void setBoundingBoxAlwaysOnMode(boolean alwaysDrawBoxes);
BufferProvider getBufferProvider();

View File

@@ -375,6 +375,27 @@ public abstract class RSClientMixin implements RSClient
return new Point(getDestinationX(), getDestinationY());
}
@Inject
@Override
public boolean getBoundingBoxAlwaysOnMode()
{
return getboundingBox3DDrawMode() == getALWAYSDrawMode();
}
@Inject
@Override
public void setBoundingBoxAlwaysOnMode(boolean alwaysDrawBoxes)
{
if (alwaysDrawBoxes)
{
setboundingBox3DDrawMode(getALWAYSDrawMode());
}
else
{
setboundingBox3DDrawMode(getON_MOUSEOVERDrawMode());
}
}
@FieldHook("skillExperiences")
@Inject
public static void experiencedChanged(int idx)

View File

@@ -0,0 +1,30 @@
/*
* Copyright (c) 2018, SomeoneWithAnInternetConnection
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.rs.api;
public interface RSBoundingBox3DDrawMode
{
}

View File

@@ -373,6 +373,42 @@ public interface RSClient extends RSGameEngine, Client
@Import("queuedSoundEffectCount")
void setQueuedSoundEffectCount(int queuedSoundEffectCount);
@Import("drawBoundingBoxes2D")
@Override
boolean getDrawBoundingBoxes2D();
@Import("drawBoundingBoxes2D")
@Override
void setDrawBoundingBoxes2D(boolean shouldDraw);
@Import("drawBoundingBoxes3D")
@Override
boolean getDrawBoundingBoxes3D();
@Import("drawBoundingBoxes3D")
@Override
void setDrawBoundingBoxes3D(boolean shouldDraw);
@Import("drawObjectGeometry2D")
@Override
boolean getdrawObjectGeometry2D();
@Import("drawObjectGeometry2D")
@Override
void setdrawObjectGeometry2D(boolean shouldDraw);
@Import("boundingBox3DDrawMode")
RSBoundingBox3DDrawMode getboundingBox3DDrawMode();
@Import("boundingBox3DDrawMode")
void setboundingBox3DDrawMode(RSBoundingBox3DDrawMode drawMode);
@Import("ON_MOUSEOVER")
RSBoundingBox3DDrawMode getON_MOUSEOVERDrawMode();
@Import("ALWAYS")
RSBoundingBox3DDrawMode getALWAYSDrawMode();
@Import("rasterProvider")
@Override
BufferProvider getBufferProvider();