From abf5e1541e936f821216f11e285a33f2a50794b4 Mon Sep 17 00:00:00 2001 From: Lulonaut Date: Thu, 8 Jun 2023 09:34:50 +0200 Subject: Add museum donation status to tooltip (#710) --- .../moulberry/notenoughupdates/ItemPriceInformation.java | 14 +++++++++++++- .../options/seperateSections/TooltipTweaks.java | 11 ++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java index 6e7f83e4..64e83b3b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 NotEnoughUpdates contributors + * Copyright (C) 2022-2023 NotEnoughUpdates contributors * * This file is part of NotEnoughUpdates. * @@ -24,6 +24,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.auction.APIManager; import io.github.moulberry.notenoughupdates.core.config.KeybindHelper; +import io.github.moulberry.notenoughupdates.miscfeatures.inventory.MuseumTooltipManager; import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.Utils; import io.github.moulberry.notenoughupdates.util.hypixelapi.HypixelItemAPI; @@ -463,6 +464,17 @@ public class ItemPriceInformation { tooltip.add(""); tooltip.add(formatPrice("NPC Sell Price: ", npcSellPrice * stackMultiplier)); } + + if (NotEnoughUpdates.INSTANCE.config.tooltipTweaks.museumDonationStatus) { + if (!MuseumTooltipManager.INSTANCE.hasPlayerVisitedMuseum()) { + tooltip.add(EnumChatFormatting.RED + EnumChatFormatting.BOLD.toString() + + "[NEU] Visit your Museum to display donation status"); + } + if (MuseumTooltipManager.INSTANCE.isItemDonated(internalname)) { + tooltip.add( + EnumChatFormatting.YELLOW + "Item already donated to museum"); + } + } } private static String formatPrice(String label, double price) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java index 2957015b..e24800be 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 NotEnoughUpdates contributors + * Copyright (C) 2022-2023 NotEnoughUpdates contributors * * This file is part of NotEnoughUpdates. * @@ -102,6 +102,15 @@ public class TooltipTweaks { @ConfigAccordionId(id = 0) public boolean npcSellPrice = false; + @Expose + @ConfigOption( + name = "Display donation status", + desc = "Add an extra line on items you have already donated to the museum. Visit all pages of the museum to populate this list." + ) + @ConfigEditorBoolean + @ConfigAccordionId(id = 0) + public boolean museumDonationStatus = true; + @Expose @ConfigOption( name = "Use Short Number Format", -- cgit