Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Gemstones in ModifierUtils #3381

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import at.hannibal2.skyhanni.utils.RenderDisplayHelper
import at.hannibal2.skyhanni.utils.RenderUtils.highlight
import at.hannibal2.skyhanni.utils.RenderUtils.renderRenderables
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import at.hannibal2.skyhanni.utils.renderables.Renderable
import at.hannibal2.skyhanni.utils.renderables.RenderableUtils.addRenderableButton
import at.hannibal2.skyhanni.utils.renderables.SearchTextInput
Expand Down Expand Up @@ -272,15 +273,15 @@ object SackDisplay {
var totalPrice = 0L
val table = buildMap {
for ((_, gem) in sort(SackApi.gemstoneItem.toList())) {
val name = "${gem.gemType} Gemstones"
val name = "${gem.gemType.toDisplayString()} Gemstones"
val row = buildList {
addString(" §7- ")
addItemStack(gem.internalName)
add(
Renderable.optionalLink(
name,
onClick = {
BazaarApi.searchForBazaarItem(name.dropLast(1))
BazaarApi.searchForBazaarItem(name.removeColor().dropLast(1))
},
highlightsOnHoverSlots = listOf(gem.slot),
) { !NeuItems.neuHasFocus() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,8 @@ object SkyBlockItemModifierUtils {

fun ItemStack.getExtraAttributes() = tagCompound?.extraAttributes

class GemstoneSlot(val type: GemstoneType, val quality: GemstoneQuality) {

fun getInternalName() = "${quality}_${type}_GEM".toInternalName()
class GemstoneSlot(private val type: GemstoneType, private val quality: GemstoneQuality) {
fun getInternalName() = "${quality.name}_${type.name}_GEM".toInternalName()
}

enum class GemstoneQuality(private val displayName: String, private val color: LorenzColor) {
Expand All @@ -304,7 +303,8 @@ object SkyBlockItemModifierUtils {
PERFECT("Perfect", LorenzColor.GOLD),
;

override fun toString() = "${color.getChatColor()}$displayName"
override fun toString() = displayName
fun toDisplayString() = "${color.getChatColor()}$displayName"

companion object {

Expand All @@ -327,7 +327,8 @@ object SkyBlockItemModifierUtils {
PERIDOT("Peridot", LorenzColor.DARK_GREEN),
;

override fun toString() = "${color.getChatColor()}$displayName"
override fun toString() = displayName
fun toDisplayString() = "${color.getChatColor()}$displayName"

companion object {

Expand Down
Loading