diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-12-30 00:48:09 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-12-30 00:48:09 +0100 |
commit | ace804d85c79caaaf7d6ed9f6bd90466c947b6b2 (patch) | |
tree | b0e170d824836072281526027bafdd46612dd710 /src/main/java/at/hannibal2/skyhanni | |
parent | e50d8d3b7d3f2682744b5b9ee98d248ea5f0ce5b (diff) | |
download | skyhanni-ace804d85c79caaaf7d6ed9f6bd90466c947b6b2.tar.gz skyhanni-ace804d85c79caaaf7d6ed9f6bd90466c947b6b2.tar.bz2 skyhanni-ace804d85c79caaaf7d6ed9f6bd90466c947b6b2.zip |
Adds a visual highlight to the Croesus inventory that shows what chests have not yet been opened.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
3 files changed, 50 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index 0af68df64..eccfc78c9 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -166,6 +166,7 @@ public class SkyHanniMod { registerEvent(new HighlightBonzoMasks()); registerEvent(new DungeonLevelColor()); registerEvent(new BazaarCancelledBuyOrderClipboard()); + registerEvent(new CroesusUnopenedChestTracker()); Commands.INSTANCE.init(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java b/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java index f706446a1..074d4e0f7 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java @@ -69,7 +69,7 @@ public class Dungeon { @Expose @ConfigOption(name = "Highlight Deathmites", desc = "Highlight deathmites in dungeon in red color.") @ConfigEditorBoolean - public boolean highlightDeathmites = false; + public boolean highlightDeathmites = true; @ConfigOption(name = "Object Hider", desc = "Hide various things in dungeon.") @ConfigEditorAccordion(id = 3) @@ -109,7 +109,7 @@ public class Dungeon { @ConfigOption(name = "Hide Skeleton Skull", desc = "Hide skeleton skulls laying around in dungeon.") @ConfigEditorBoolean @ConfigAccordionId(id = 3) - public boolean hideSkeletonSkull = false; + public boolean hideSkeletonSkull = true; @Expose @ConfigOption(name = "Hide Healer Orbs", desc = "Hides the damage, ability damage and defensive orbs that spawn when the healer kills mobs.") @@ -163,5 +163,11 @@ public class Dungeon { @ConfigOption(name = "Moving Skeleton Skulls", desc = "Highlight Skeleton Skulls when combining into a " + "Skeletor in orange color (not useful combined with feature Hide Skeleton Skull)") @ConfigEditorBoolean - public boolean highlightSkeletonSkull = false; + public boolean highlightSkeletonSkull = true; + + @Expose + @ConfigOption(name = "Croesus Unopened Chest Tracker", desc = "Adds a visual highlight to the Croesus inventory that " + + "shows what chests have not yet been opened.") + @ConfigEditorBoolean + public boolean croesusUnopenedChestTracker = true; }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusUnopenedChestTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusUnopenedChestTracker.kt new file mode 100644 index 000000000..ae5d5511d --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusUnopenedChestTracker.kt @@ -0,0 +1,40 @@ +package at.hannibal2.skyhanni.features.dungeon + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.utils.InventoryUtils +import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.LorenzColor +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.RenderUtils.highlight +import net.minecraft.client.gui.inventory.GuiChest +import net.minecraft.inventory.ContainerChest +import net.minecraftforge.fml.common.eventhandler.EventPriority +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class CroesusUnopenedChestTracker { + + @SubscribeEvent(priority = EventPriority.LOW) + fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { + if (!LorenzUtils.inSkyblock) return + if (!SkyHanniMod.feature.dungeon.croesusUnopenedChestTracker) return + + if (event.gui !is GuiChest) return + val guiChest = event.gui + val chest = guiChest.inventorySlots as ContainerChest + val chestName = chest.lowerChestInventory.displayName.unformattedText.trim() + + if (chestName == "Croesus") { + for (slot in InventoryUtils.getItemsInOpenChest()) { + val stack = slot.stack + val lore = stack.getLore() + if (lore.any { it.contains("Click to view") }) { + if (!lore.any { it.contains("Chests have been opened!") }) { + slot highlight LorenzColor.GREEN + } + } + } + } + + } +}
\ No newline at end of file |