Add high alchemy prices to grounditems plugin
Add configuration option to show high alch prices and ge prices
This commit is contained in:
@@ -40,9 +40,28 @@ public interface GroundItemsConfig
|
|||||||
name = "Enabled",
|
name = "Enabled",
|
||||||
description = "Configures whether or not item names/quantities are displayed"
|
description = "Configures whether or not item names/quantities are displayed"
|
||||||
)
|
)
|
||||||
|
|
||||||
default boolean enabled()
|
default boolean enabled()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "showGEPrice",
|
||||||
|
name = "Show Grand Exchange Prices",
|
||||||
|
description = "Configures whether or not to draw GE prices alongside ground items"
|
||||||
|
)
|
||||||
|
default boolean showGEPrice()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "showHAValue",
|
||||||
|
name = "Show High Alchemy Values",
|
||||||
|
description = "Configure whether or not to draw High Alchemy values alongside ground items"
|
||||||
|
)
|
||||||
|
default boolean showHAValue()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ public class GroundItemsOverlay extends Overlay
|
|||||||
// Threshold for highlighting items as pink.
|
// Threshold for highlighting items as pink.
|
||||||
private static final int INSANE_VALUE = 10_000_000;
|
private static final int INSANE_VALUE = 10_000_000;
|
||||||
private static final Color FADED_PINK = new Color(255, 102, 178);
|
private static final Color FADED_PINK = new Color(255, 102, 178);
|
||||||
|
// Used when getting High Alchemy value - multiplied by general store price.
|
||||||
|
private static final float HIGH_ALCHEMY_CONSTANT = 0.6f;
|
||||||
|
|
||||||
private final Client client = RuneLite.getClient();
|
private final Client client = RuneLite.getClient();
|
||||||
private final GroundItemsConfig config;
|
private final GroundItemsConfig config;
|
||||||
@@ -191,7 +193,7 @@ public class GroundItemsOverlay extends Overlay
|
|||||||
|
|
||||||
Color textColor = Color.WHITE; // Color to use when drawing the ground item
|
Color textColor = Color.WHITE; // Color to use when drawing the ground item
|
||||||
ItemPrice itemPrice = itemManager.get(itemId);
|
ItemPrice itemPrice = itemManager.get(itemId);
|
||||||
if (itemPrice != null)
|
if (itemPrice != null && config.showGEPrice())
|
||||||
{
|
{
|
||||||
int cost = itemPrice.getPrice() * quantity;
|
int cost = itemPrice.getPrice() * quantity;
|
||||||
// set the color according to rarity, if possible
|
// set the color according to rarity, if possible
|
||||||
@@ -217,6 +219,13 @@ public class GroundItemsOverlay extends Overlay
|
|||||||
.append(" gp)");
|
.append(" gp)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.showHAValue())
|
||||||
|
{
|
||||||
|
itemStringBuilder.append(" (HA: ")
|
||||||
|
.append(Math.round(item.getPrice() * HIGH_ALCHEMY_CONSTANT))
|
||||||
|
.append(" gp)");
|
||||||
|
}
|
||||||
|
|
||||||
String itemString = itemStringBuilder.toString();
|
String itemString = itemStringBuilder.toString();
|
||||||
itemStringBuilder.setLength(0);
|
itemStringBuilder.setLength(0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user