Include unit prices in examine messages

Fixes #495
This commit is contained in:
SomeoneWithAnInternetConnection
2018-01-29 15:06:59 -05:00
parent 8e7e37812e
commit 21348414b6

View File

@@ -310,10 +310,8 @@ public class ExaminePlugin extends Plugin
} }
int itemCompositionPrice = itemComposition.getPrice(); int itemCompositionPrice = itemComposition.getPrice();
final int gePrice = itemPrice == null ? 0 : itemPrice.getPrice() * quantity; final int gePrice = itemPrice == null ? 0 : itemPrice.getPrice();
final int alchPrice = itemCompositionPrice <= 0 final int alchPrice = itemCompositionPrice <= 0 ? 0 : Math.round(itemCompositionPrice * HIGH_ALCHEMY_CONSTANT);
? 0
: Math.round(itemCompositionPrice * HIGH_ALCHEMY_CONSTANT) * quantity;
if (gePrice > 0 || alchPrice > 0) if (gePrice > 0 || alchPrice > 0)
{ {
@@ -340,7 +338,18 @@ public class ExaminePlugin extends Plugin
.append(ChatColorType.NORMAL) .append(ChatColorType.NORMAL)
.append(" GE average ") .append(" GE average ")
.append(ChatColorType.HIGHLIGHT) .append(ChatColorType.HIGHLIGHT)
.append(String.format("%,d", gePrice)); .append(String.format("%,d", gePrice * quantity));
}
if (quantity > 1)
{
message
.append(ChatColorType.NORMAL)
.append(" (")
.append(ChatColorType.HIGHLIGHT)
.append(Integer.toString(gePrice))
.append(ChatColorType.NORMAL)
.append("ea)");
} }
if (alchPrice > 0) if (alchPrice > 0)
@@ -349,7 +358,18 @@ public class ExaminePlugin extends Plugin
.append(ChatColorType.NORMAL) .append(ChatColorType.NORMAL)
.append(" HA value ") .append(" HA value ")
.append(ChatColorType.HIGHLIGHT) .append(ChatColorType.HIGHLIGHT)
.append(String.format("%,d", alchPrice)); .append(String.format("%,d", alchPrice * quantity));
}
if (quantity > 1)
{
message
.append(ChatColorType.NORMAL)
.append(" (")
.append(ChatColorType.HIGHLIGHT)
.append(Integer.toString(alchPrice))
.append(ChatColorType.NORMAL)
.append("ea)");
} }
chatMessageManager.queue(ChatMessageType.EXAMINE_ITEM, message.build()); chatMessageManager.queue(ChatMessageType.EXAMINE_ITEM, message.build());