cluescroll: Combine nested if statements
This commit is contained in:
@@ -78,13 +78,10 @@ public class ClueScrollOverlay extends Overlay
|
|||||||
|
|
||||||
clue.makeOverlayHint(panelComponent, plugin);
|
clue.makeOverlayHint(panelComponent, plugin);
|
||||||
|
|
||||||
if (clue.isRequiresSpade() && plugin.getInventoryItems() != null)
|
if (clue.isRequiresSpade() && plugin.getInventoryItems() != null && !HAS_SPADE.fulfilledBy(plugin.getInventoryItems()))
|
||||||
{
|
{
|
||||||
if (!HAS_SPADE.fulfilledBy(plugin.getInventoryItems()))
|
panelComponent.getChildren().add(LineComponent.builder().left("").build());
|
||||||
{
|
panelComponent.getChildren().add(LineComponent.builder().left("Requires Spade!").leftColor(Color.RED).build());
|
||||||
panelComponent.getChildren().add(LineComponent.builder().left("").build());
|
|
||||||
panelComponent.getChildren().add(LineComponent.builder().left("Requires Spade!").leftColor(Color.RED).build());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return panelComponent.render(graphics);
|
return panelComponent.render(graphics);
|
||||||
|
|||||||
@@ -211,12 +211,9 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clue instanceof HotColdClue)
|
if (clue instanceof HotColdClue && ((HotColdClue) clue).update(event.getMessage(), this))
|
||||||
{
|
{
|
||||||
if (((HotColdClue) clue).update(event.getMessage(), this))
|
worldMapPointsSet = false;
|
||||||
{
|
|
||||||
worldMapPointsSet = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!event.getMessage().equals("The strange device cools as you find your treasure.")
|
if (!event.getMessage().equals("The strange device cools as you find your treasure.")
|
||||||
@@ -272,20 +269,17 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if three step clue check for clue scroll pieces
|
// if three step clue check for clue scroll pieces
|
||||||
if (clue instanceof ThreeStepCrypticClue)
|
if (clue instanceof ThreeStepCrypticClue && ((ThreeStepCrypticClue) clue).update(client, event, itemManager))
|
||||||
{
|
{
|
||||||
if (((ThreeStepCrypticClue) clue).update(client, event, itemManager))
|
worldMapPointsSet = false;
|
||||||
|
npcsToMark.clear();
|
||||||
|
|
||||||
|
if (this.displayHintArrows)
|
||||||
{
|
{
|
||||||
worldMapPointsSet = false;
|
client.clearHintArrow();
|
||||||
npcsToMark.clear();
|
|
||||||
|
|
||||||
if (this.displayHintArrows)
|
|
||||||
{
|
|
||||||
client.clearHintArrow();
|
|
||||||
}
|
|
||||||
|
|
||||||
checkClueNPCs(clue, client.getCachedNPCs());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkClueNPCs(clue, client.getCachedNPCs());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -483,12 +477,9 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
final String text = Text.sanitizeMultilineText(clueScrollText.getText()).toLowerCase();
|
final String text = Text.sanitizeMultilineText(clueScrollText.getText()).toLowerCase();
|
||||||
|
|
||||||
// Early return if this is same clue as already existing one
|
// Early return if this is same clue as already existing one
|
||||||
if (clue instanceof TextClueScroll)
|
if (clue instanceof TextClueScroll && ((TextClueScroll) clue).getText().equalsIgnoreCase(text))
|
||||||
{
|
{
|
||||||
if (((TextClueScroll) clue).getText().equalsIgnoreCase(text))
|
return clue;
|
||||||
{
|
|
||||||
return clue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// (This|The) anagram reveals who to speak to next:
|
// (This|The) anagram reveals who to speak to next:
|
||||||
|
|||||||
Reference in New Issue
Block a user