From 479dbd14c585deb7010fc07f063a73430e3d5106 Mon Sep 17 00:00:00 2001 From: sdburns1998 Date: Sun, 7 Jul 2019 18:05:52 +0200 Subject: [PATCH] questlist: Merge nested if statements --- .../plugins/questlist/QuestListPlugin.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java index a7e0dbf03f..2f0fb9b415 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java @@ -182,12 +182,9 @@ public class QuestListPlugin extends Plugin @Subscribe public void onVarClientIntChanged(VarClientIntChanged varClientIntChanged) { - if (varClientIntChanged.getIndex() == VarClientInt.INVENTORY_TAB.getIndex()) + if (varClientIntChanged.getIndex() == VarClientInt.INVENTORY_TAB.getIndex() && isChatboxOpen() && isNotOnQuestTab()) { - if (isChatboxOpen() && isNotOnQuestTab()) - { - chatboxPanelManager.close(); - } + chatboxPanelManager.close(); } } @@ -314,11 +311,10 @@ public class QuestListPlugin extends Plugin Collection quests = questSet.get(questContainer); - if (quests != null) - { + if (quests != null && // Check to make sure the list hasn't been rebuild since we were last her // Do this by making sure the list's dynamic children are the same as when we last saw them - if (quests.stream().noneMatch(w -> + quests.stream().noneMatch(w -> { Widget codeWidget = w.getQuest(); if (codeWidget == null) @@ -327,9 +323,8 @@ public class QuestListPlugin extends Plugin } return list.getChild(codeWidget.getIndex()) == codeWidget; })) - { - quests = null; - } + { + quests = null; } if (quests == null)