kourendlibrary: Method is always inverted

This commit is contained in:
sdburns1998
2019-07-07 15:20:53 +02:00
parent b61c98e2a3
commit 60bb8b7001

View File

@@ -138,7 +138,7 @@ class KourendLibraryOverlay extends Overlay
Color color = bookIsKnown ? Color.ORANGE : Color.WHITE;
// Render the poly on the floor
if (!(bookIsKnown && book == null) && (library.getState() == SolvedState.NO_DATA || book != null || !possible.isEmpty()) && !shouldHideOverlayIfDuplicateBook(book))
if (!(bookIsKnown && book == null) && (library.getState() == SolvedState.NO_DATA || book != null || !possible.isEmpty()) && shouldShowOverlayIfDuplicateBook(book))
{
Polygon poly = getCanvasTilePoly(client, localBookcase);
if (poly != null)
@@ -151,7 +151,7 @@ class KourendLibraryOverlay extends Overlay
// If the book is singled out, render the text and the book's icon
if (bookIsKnown)
{
if (book != null && !shouldHideOverlayIfDuplicateBook(book))
if (book != null && shouldShowOverlayIfDuplicateBook(book))
{
FontMetrics fm = g.getFontMetrics();
Rectangle2D bounds = fm.getStringBounds(book.getShortName(), g);
@@ -239,11 +239,11 @@ class KourendLibraryOverlay extends Overlay
return null;
}
private boolean shouldHideOverlayIfDuplicateBook(@Nullable Book book)
private boolean shouldShowOverlayIfDuplicateBook(@Nullable Book book)
{
return plugin.isHideDuplicateBook()
&& book != null
&& !book.isDarkManuscript()
&& plugin.doesPlayerContainBook(book);
return !plugin.isHideDuplicateBook()
|| book == null
|| book.isDarkManuscript()
|| !plugin.doesPlayerContainBook(book);
}
}