questlist: Merge nested if statements

This commit is contained in:
sdburns1998
2019-07-07 18:05:52 +02:00
parent af2b0e019b
commit 479dbd14c5

View File

@@ -182,12 +182,9 @@ public class QuestListPlugin extends Plugin
@Subscribe @Subscribe
public void onVarClientIntChanged(VarClientIntChanged varClientIntChanged) 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<QuestWidget> quests = questSet.get(questContainer); Collection<QuestWidget> 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 // 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 // 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(); Widget codeWidget = w.getQuest();
if (codeWidget == null) if (codeWidget == null)
@@ -327,9 +323,8 @@ public class QuestListPlugin extends Plugin
} }
return list.getChild(codeWidget.getIndex()) == codeWidget; return list.getChild(codeWidget.getIndex()) == codeWidget;
})) }))
{ {
quests = null; quests = null;
}
} }
if (quests == null) if (quests == null)