Color the hidden items gray when in highlight mode

Color hidden ground items gray when in item highlight mode to show
different between non-hidden and hidden items.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-03-20 18:09:30 +01:00
committed by Adam
parent 76d954db21
commit 5272e2d9b6
2 changed files with 10 additions and 3 deletions

View File

@@ -118,7 +118,8 @@ public class GroundItemsOverlay extends Overlay
}
final boolean hidden = plugin.isHidden(item.getName());
final Color color = getCostColor(item.getGePrice() > 0 ? item.getGePrice() : item.getHaPrice(), highlighted);
final Color color = getCostColor(item.getGePrice() > 0 ? item.getGePrice() : item.getHaPrice(),
highlighted, hidden);
itemStringBuilder.append(item.getName());
if (item.getQuantity() > 1)
@@ -208,8 +209,13 @@ public class GroundItemsOverlay extends Overlay
return null;
}
Color getCostColor(int cost, boolean highlighted)
Color getCostColor(int cost, boolean highlighted, boolean hidden)
{
if (hidden)
{
return Color.GRAY;
}
if (highlighted)
{
return config.highlightedColor();

View File

@@ -394,7 +394,8 @@ public class GroundItemsPlugin extends Plugin
ItemPrice itemPrice = getItemPrice(itemComposition);
int price = itemPrice == null ? itemComposition.getPrice() : itemPrice.getPrice();
int cost = quantity * price;
Color color = overlay.getCostColor(cost, isHighlighted(itemComposition.getName()));
Color color = overlay.getCostColor(cost, isHighlighted(itemComposition.getName()),
isHidden(itemComposition.getName()));
if (!color.equals(config.defaultColor()))
{