Skip to content

Commit 7c67801

Browse files
authored
Improvement: Added color options for types of Auction items (#4646)
1 parent 612c2e8 commit 7c67801

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

src/main/java/at/hannibal2/skyhanni/config/features/inventory/AuctionHouseConfig.kt

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package at.hannibal2.skyhanni.config.features.inventory
22

33
import at.hannibal2.skyhanni.config.FeatureToggle
4+
import at.hannibal2.skyhanni.utils.LorenzColor
45
import com.google.gson.annotations.Expose
6+
import io.github.notenoughupdates.moulconfig.ChromaColour
57
import io.github.notenoughupdates.moulconfig.annotations.Accordion
68
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean
9+
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour
710
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorKeybind
811
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption
912
import org.lwjgl.input.Keyboard
@@ -17,12 +20,22 @@ class AuctionHouseConfig {
1720
@Expose
1821
@ConfigOption(
1922
name = "Highlight Auctions",
20-
desc = "Highlight own items that are sold in green and that are expired in red."
23+
desc = "Highlight own items that are sold and expired."
2124
)
2225
@ConfigEditorBoolean
2326
@FeatureToggle
2427
var highlightAuctions: Boolean = true
2528

29+
@Expose
30+
@ConfigOption(name = "Sold Color", desc = "Color of sold items.")
31+
@ConfigEditorColour
32+
var soldColor: ChromaColour = LorenzColor.GREEN.toChromaColor(255)
33+
34+
@Expose
35+
@ConfigOption(name = "Expired Color", desc = "Color of expired items.")
36+
@ConfigEditorColour
37+
var expiredColor: ChromaColour = LorenzColor.RED.toChromaColor(255)
38+
2639
@Expose
2740
@ConfigOption(
2841
name = "Highlight Underbid Auctions",
@@ -32,6 +45,11 @@ class AuctionHouseConfig {
3245
@FeatureToggle
3346
var highlightAuctionsUnderbid: Boolean = false
3447

48+
@Expose
49+
@ConfigOption(name = "Underbid Color", desc = "Color of underbid BIN items.")
50+
@ConfigEditorColour
51+
var underbidColor: ChromaColour = LorenzColor.GOLD.toChromaColor(255)
52+
3553
@Expose
3654
@ConfigOption(
3755
name = "Auto Copy Underbid",

src/main/java/at/hannibal2/skyhanni/features/inventory/AuctionsHighlighter.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
99
import at.hannibal2.skyhanni.utils.InventoryUtils
1010
import at.hannibal2.skyhanni.utils.InventoryUtils.getUpperItems
1111
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
12-
import at.hannibal2.skyhanni.utils.LorenzColor
1312
import at.hannibal2.skyhanni.utils.NumberUtil.formatLong
1413
import at.hannibal2.skyhanni.utils.RegexUtils.firstMatcher
1514
import at.hannibal2.skyhanni.utils.RenderUtils.highlight
@@ -52,19 +51,19 @@ object AuctionsHighlighter {
5251
for ((slot, stack) in chest.getUpperItems()) {
5352
val lore = stack.getLore()
5453
if (lore.any { it == "§7Status: §aSold!" }) {
55-
slot.highlight(LorenzColor.GREEN)
54+
slot.highlight(config.soldColor)
5655
continue
5756
}
5857
if (lore.any { it == "§7Status: §cExpired!" }) {
59-
slot.highlight(LorenzColor.RED)
58+
slot.highlight(config.expiredColor)
6059
continue
6160
}
6261
if (config.highlightAuctionsUnderbid) {
6362
buyItNowPattern.firstMatcher(lore) {
6463
val coins = group("coins").formatLong()
6564
EstimatedItemValueCalculator.getTotalPrice(stack)?.let { totalPrice ->
6665
if (coins > totalPrice) {
67-
slot.highlight(LorenzColor.GOLD)
66+
slot.highlight(config.underbidColor)
6867
}
6968
}
7069
}

0 commit comments

Comments
 (0)