Skip to content

Commit

Permalink
Merge pull request #134 from Thource/feature/126
Browse files Browse the repository at this point in the history
  • Loading branch information
Thource authored Apr 13, 2023
2 parents 9002c25 + 4deec6c commit 7584b21
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public class DeathStorageManager extends StorageManager<DeathStorageType, DeathS
private DeathStorageManager(DudeWheresMyStuffPlugin plugin) {
super(plugin);

playTimeInfoBox.setTooltip("Navigate to the quest tab and swap to the Character Summary tab "
+ "(brown star) to track cross-client deathpiles.");
playTimeInfoBox.setTooltip("Navigate to the quest tab and swap to</br>the Character Summary tab"
+ " (brown star) to</br>track cross-client deathpiles.");

storages.add(new DeathItems(plugin, this));
}
Expand Down Expand Up @@ -315,6 +315,8 @@ private void refreshDeathpileInfoBoxes() {

for (DeathpileInfoBox infoBox : deathpileInfoBoxes) {
if (plugin.getConfig().deathpileInfoBox()) {
infoBox.refreshTooltip();

if (!currentInfoBoxes.contains(infoBox)) {
infoBoxManager.addInfoBox(infoBox);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@
import lombok.Getter;
import net.runelite.api.ItemID;
import net.runelite.client.ui.overlay.infobox.InfoBox;
import net.runelite.client.util.QuantityFormatter;

class DeathpileInfoBox extends InfoBox {

@Getter private final Deathpile deathpile;
private final String regionName;

public DeathpileInfoBox(@Nonnull DudeWheresMyStuffPlugin plugin, Deathpile deathpile) {
super(plugin.getItemManager().getImage(ItemID.BONES), plugin);
this.deathpile = deathpile;

Region region = Region.get(deathpile.getWorldPoint().getRegionID());
setTooltip((region == null ? "Unknown" : region.getName()) + " deathpile");
regionName = (region == null ? "Unknown" : region.getName());
refreshTooltip();
}

void refreshTooltip() {
String deathpileValue = QuantityFormatter.quantityToStackSize(deathpile.getTotalValue());

setTooltip(regionName + " deathpile (" + deathpileValue + " gp)");
}

@Override
Expand Down

0 comments on commit 7584b21

Please sign in to comment.