Disable inspector buttons on close in dev tools

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-11-27 09:19:57 +00:00
parent 9b1e55de93
commit 1c0fffd865
2 changed files with 12 additions and 4 deletions

View File

@@ -84,6 +84,7 @@ class VarInspector extends JFrame
private final static int MAX_LOG_ENTRIES = 10_000; private final static int MAX_LOG_ENTRIES = 10_000;
private final Client client; private final Client client;
private final DevToolsPlugin plugin;
private final EventBus eventBus; private final EventBus eventBus;
private final JPanel tracker = new JPanel(); private final JPanel tracker = new JPanel();
@@ -98,10 +99,11 @@ class VarInspector extends JFrame
private String[] oldStrVarcs = null; private String[] oldStrVarcs = null;
@Inject @Inject
VarInspector(Client client, EventBus eventBus) VarInspector(Client client, EventBus eventBus, DevToolsPlugin plugin)
{ {
this.eventBus = eventBus; this.eventBus = eventBus;
this.client = client; this.client = client;
this.plugin = plugin;
setTitle("RuneLite Var Inspector"); setTitle("RuneLite Var Inspector");
setIconImage(ClientUI.ICON); setIconImage(ClientUI.ICON);
@@ -115,6 +117,7 @@ class VarInspector extends JFrame
public void windowClosing(WindowEvent e) public void windowClosing(WindowEvent e)
{ {
close(); close();
plugin.getVarInspector().setActive(false);
} }
}); });

View File

@@ -63,6 +63,7 @@ class WidgetInspector extends JFrame
private final ClientThread clientThread; private final ClientThread clientThread;
private final DevToolsConfig config; private final DevToolsConfig config;
private final DevToolsOverlay overlay; private final DevToolsOverlay overlay;
private final DevToolsPlugin plugin;
private final JTree widgetTree; private final JTree widgetTree;
private final WidgetInfoTableModel infoTableModel; private final WidgetInfoTableModel infoTableModel;
@@ -77,13 +78,15 @@ class WidgetInspector extends JFrame
WidgetInfoTableModel infoTableModel, WidgetInfoTableModel infoTableModel,
DevToolsConfig config, DevToolsConfig config,
EventBus eventBus, EventBus eventBus,
DevToolsOverlay overlay) DevToolsOverlay overlay,
DevToolsPlugin plugin)
{ {
this.client = client; this.client = client;
this.clientThread = clientThread; this.clientThread = clientThread;
this.infoTableModel = infoTableModel; this.infoTableModel = infoTableModel;
this.config = config; this.config = config;
this.overlay = overlay; this.overlay = overlay;
this.plugin = plugin;
eventBus.register(this); eventBus.register(this);
@@ -96,8 +99,8 @@ class WidgetInspector extends JFrame
@Override @Override
public void windowClosing(WindowEvent e) public void windowClosing(WindowEvent e)
{ {
overlay.setWidget(null); close();
overlay.setItemIndex(-1); plugin.getWidgetInspector().setActive(false);
} }
}); });
@@ -298,6 +301,8 @@ class WidgetInspector extends JFrame
public void close() public void close()
{ {
overlay.setWidget(null);
overlay.setItemIndex(-1);
setVisible(false); setVisible(false);
} }
} }