aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-21 15:53:53 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-21 15:53:53 +0100
commita7372158d4e75d7f32f0cbf607940499e767dbe5 (patch)
treecba4d2f4e4ba6f6bf95b54e9e839bd40b2804824
parent9c52cce10df4851f517d2c64a486ff90e49c8a2b (diff)
downloadskyhanni-a7372158d4e75d7f32f0cbf607940499e767dbe5.tar.gz
skyhanni-a7372158d4e75d7f32f0cbf607940499e767dbe5.tar.bz2
skyhanni-a7372158d4e75d7f32f0cbf607940499e767dbe5.zip
Added Auction Highlighter.
-rw-r--r--CHANGELOG.md1
-rw-r--r--FEATURES.md1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/AuctionsHighlighter.kt36
6 files changed, 48 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0920dc8a5..f42e652d9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
### Features
+ Added **Time to Kill** - Show the time it takes to kill the Slayer boss.
+ Added skill and collection level as item stack.
++ Added **Auction Highlighter** - Highlight own items that are sold in green.
### Garden Features
+ Added **Copper Price** - Show copper to coin prices inside the Sky Mart inventory.
diff --git a/FEATURES.md b/FEATURES.md
index 913a32087..59fbfe4cf 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -57,6 +57,7 @@
+ Show the type of stats for the tuning point templates.
+ Highlight depleted Bonzo's Masks in your inventory.
+ Highlight stuff that is missing in the skyblock level guide inventory.
++ **Auction Highlighter** - Highlight own items that are sold in green.
## Item Abilities
- Show the cooldown of items in the inventory.
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
index c07feba3b..78644dad0 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
@@ -116,6 +116,7 @@ public class SkyHanniMod {
//features
loadModule(new BazaarOrderHelper());
+ loadModule(new AuctionsHighlighter());
loadModule(new ChatFilter());
loadModule(new PlayerChatModifier());
loadModule(new DungeonChatFilter());
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java b/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java
index f4df59580..912e09531 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java
@@ -137,4 +137,10 @@ public class Inventory {
desc = "Highlight stuff that is missing in the skyblock level guide inventory.")
@ConfigEditorBoolean
public boolean highlightMissingSkyBlockLevelGuide = true;
+
+ @Expose
+ @ConfigOption(name = "Highlight Auctions",
+ desc = "Highlight own items that are sold in green.")
+ @ConfigEditorBoolean
+ public boolean highlightAuctions = true;
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt
index 7f0e86598..bd9ef0a79 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt
@@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.ItemUtils.name
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
@@ -23,8 +24,10 @@ class BazaarOrderHelper {
@SubscribeEvent
fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) {
+ if (!LorenzUtils.inSkyBlock) return
if (!SkyHanniMod.feature.bazaar.orderHelper) return
if (event.gui !is GuiChest) return
+
val guiChest = event.gui
val chest = guiChest.inventorySlots as ContainerChest
val inventoryName = chest.getInventoryName()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/AuctionsHighlighter.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/AuctionsHighlighter.kt
new file mode 100644
index 000000000..ba1d3a680
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/AuctionsHighlighter.kt
@@ -0,0 +1,36 @@
+package at.hannibal2.skyhanni.features.inventory
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.GuiContainerEvent
+import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName
+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.SubscribeEvent
+
+class AuctionsHighlighter {
+
+ @SubscribeEvent
+ fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) {
+ if (!LorenzUtils.inSkyBlock) return
+ if (!SkyHanniMod.feature.inventory.highlightAuctions) return
+ if (event.gui !is GuiChest) return
+
+ val guiChest = event.gui
+ val chest = guiChest.inventorySlots as ContainerChest
+ if (chest.getInventoryName() != "Manage Auctions") return
+
+ for (slot in chest.inventorySlots) {
+ if (slot == null) continue
+ if (slot.slotNumber != slot.slotIndex) continue
+ val stack = slot.stack ?: continue
+
+ if (stack.getLore().any { it == "§7Status: §aSold!" }) {
+ slot highlight LorenzColor.GREEN
+ }
+ }
+ }
+} \ No newline at end of file