grounditems: refactor isDropped into LootType

the isDropped boolean was essentially just a lootype all its own
this allows the onlyShowLoot option to show your own dropped items overlay
This commit is contained in:
Alexsuperfly
2020-01-01 20:31:17 -05:00
parent 61a72d5a54
commit bd21c43118
4 changed files with 4 additions and 8 deletions

View File

@@ -48,10 +48,6 @@ class GroundItem
private boolean tradeable;
@Nonnull
private LootType lootType;
/**
* Is dropped by me
*/
private boolean isDropped;
@Nullable
private Instant spawnTime;

View File

@@ -364,7 +364,7 @@ public class GroundItemsOverlay extends Overlay
private void drawTimerOverlay(Graphics2D graphics, int textX, int textY, GroundItem groundItem)
{
// We can only accurately guess despawn times for our own pvm loot and dropped items
if (groundItem.getLootType() != LootType.PVM && !groundItem.isDropped())
if (groundItem.getLootType() != LootType.PVM && groundItem.getLootType() != LootType.DROPPED)
{
return;
}
@@ -395,7 +395,7 @@ public class GroundItemsOverlay extends Overlay
}
else
{
if (groundItem.isDropped())
if (groundItem.getLootType() == LootType.DROPPED)
{
despawnTime = spawnTime.plus(DESPAWN_TIME_DROP);
}

View File

@@ -393,8 +393,7 @@ public class GroundItemsPlugin extends Plugin
.haPrice(alchPrice)
.height(tile.getItemLayer().getHeight())
.tradeable(itemComposition.isTradeable())
.lootType(LootType.UNKNOWN)
.isDropped(dropped)
.lootType(dropped ? LootType.DROPPED : LootType.UNKNOWN)
.spawnTime(Instant.now())
.build();

View File

@@ -27,6 +27,7 @@ package net.runelite.client.plugins.grounditems;
enum LootType
{
UNKNOWN,
DROPPED,
PVP,
PVM;
}