Remove bounding boxes
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user