Remove bounding boxes

This commit is contained in:
Adam
2018-05-10 08:45:45 -04:00
parent b805f786a8
commit 4d9c58750a
9 changed files with 0 additions and 205 deletions

View File

@@ -262,51 +262,6 @@ 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();
int getMouseIdleTicks();

View File

@@ -27,10 +27,7 @@ package net.runelite.client.plugins.devtools;
import java.awt.Color;
import java.awt.GridLayout;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.inject.Inject;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JPanel;
import lombok.extern.slf4j.Slf4j;
@@ -136,9 +133,6 @@ public class DevToolsPanel extends PluginPanel
});
container.add(renderProjectilesBtn);
final JPanel boundsDebugPanel = createBoundsDebugMultiButton();
container.add(boundsDebugPanel);
final JButton varSnapshotBtn = new JButton("Snapshot Vars");
varSnapshotBtn.addActionListener(varTracker::snapshot);
container.add(varSnapshotBtn);
@@ -207,73 +201,6 @@ public class DevToolsPanel extends PluginPanel
return container;
}
private JPanel createBoundsDebugMultiButton()
{
ImageIcon bBox2DIcon;
ImageIcon bBox3DIcon;
ImageIcon clickBoxIcon;
ImageIcon bBox3DMousoverIcon;
try
{
synchronized (ImageIO.class)
{
bBox2DIcon = new ImageIcon(ImageIO.read(DevToolsPlugin.class.getResourceAsStream("2D_bounding_box.png")));
bBox3DIcon = new ImageIcon(ImageIO.read(DevToolsPlugin.class.getResourceAsStream("3D_bounding_box.png")));
clickBoxIcon = new ImageIcon(ImageIO.read(DevToolsPlugin.class.getResourceAsStream("2D_clickbox_geometry.png")));
bBox3DMousoverIcon = new ImageIcon(ImageIO.read(DevToolsPlugin.class.getResourceAsStream("mouseover_3D_bounding_box.png")));
}
}
catch (IOException ex)
{
log.warn("unable to load bounding box images", ex);
return new JPanel();
}
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new GridLayout(1, 4));
JButton bBox2DButton = new JButton(bBox2DIcon);
bBox2DButton.addActionListener(e ->
{
client.setDrawBoundingBoxes2D(!client.getDrawBoundingBoxes2D());
highlightButton(bBox2DButton);
});
buttonPanel.add(bBox2DButton);
JButton bBox3DButton = new JButton(bBox3DIcon);
bBox3DButton.addActionListener(e ->
{
client.setDrawBoundingBoxes3D(!client.getDrawBoundingBoxes3D());
highlightButton(bBox3DButton);
});
buttonPanel.add(bBox3DButton);
JButton clickBoxButton = new JButton(clickBoxIcon);
clickBoxButton.addActionListener(e ->
{
client.setdrawObjectGeometry2D(!client.getdrawObjectGeometry2D());
highlightButton(clickBoxButton);
});
buttonPanel.add(clickBoxButton);
JButton mouseoverModeButton = new JButton(client.getBoundingBoxAlwaysOnMode() ? bBox3DIcon : bBox3DMousoverIcon);
mouseoverModeButton.addActionListener(e ->
{
client.setBoundingBoxAlwaysOnMode(!client.getBoundingBoxAlwaysOnMode());
if (client.getBoundingBoxAlwaysOnMode())
{
mouseoverModeButton.setIcon(bBox3DIcon);
}
else
{
mouseoverModeButton.setIcon(bBox3DMousoverIcon);
}
});
buttonPanel.add(mouseoverModeButton);
return buttonPanel;
}
private void highlightButton(JButton button)
{
if (button.getBackground().equals(Color.GREEN))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 430 B

View File

@@ -521,27 +521,6 @@ public abstract class RSClientMixin implements RSClient
return null;
}
@Inject
@Override
public boolean getBoundingBoxAlwaysOnMode()
{
return getboundingBox3DDrawMode() == getALWAYSDrawMode();
}
@Inject
@Override
public void setBoundingBoxAlwaysOnMode(boolean alwaysDrawBoxes)
{
if (alwaysDrawBoxes)
{
setboundingBox3DDrawMode(getALWAYSDrawMode());
}
else
{
setboundingBox3DDrawMode(getON_MOUSEOVERDrawMode());
}
}
@Inject
@Override
public void changeMemoryMode(boolean lowMemory)

View File

@@ -1,30 +0,0 @@
/*
* 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

@@ -436,42 +436,6 @@ 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
RSBufferProvider getBufferProvider();