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

View File

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