Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ class AdvancedEnchantmentColors {
@ConfigEditorColour
val advancedUltimateColor: Property<ChromaColour> = Property.of(ChromaColour.fromStaticRGB(255, 255, 85, 1))

@Expose
@ConfigOption(
name = "Use Advanced Maxed Ultimate Color?",
desc = "Enable this to override the color selected for Maxed Ultimate enchantments from above."
)
@ConfigEditorBoolean
val useAdvancedMaxUltimateColor: Property<Boolean> = Property.of(false)

@Expose
@ConfigOption(name = "Advanced Maxed Ultimate Color", desc = "Select a custom color to use for maxed Ultimate enchantments.")
@ConfigEditorColour
val advancedMaxUltimateColor: Property<ChromaColour> = Property.of(ChromaColour.fromStaticRGB(255, 255, 85, 1))

@Expose
@ConfigOption(
name = "Use Advanced Perfect Color?",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ class EnchantParsingConfig {
@ConfigEditorDropdown
val ultimateEnchantColor: Property<LorenzColor> = Property.of(LorenzColor.LIGHT_PURPLE)

@Expose
@ConfigOption(
name = "Max Ultimate Enchantment Color",
desc = "The color the Ultimate enchantment will be if max level. (Will always be bold)"
)
@ConfigEditorDropdown
val maxUltimateEnchantColor: Property<LorenzColor> = Property.of(LorenzColor.LIGHT_PURPLE)

@Expose
@ConfigOption(name = "Perfect Enchantment Color", desc = "The color an enchantment will be at max level.")
@ConfigEditorDropdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ open class Enchant : Comparable<Enchant> {
private val goodLevel = 0

@Expose
private val maxLevel = 0
val maxLevel = 0

private fun isNormal() = this is Normal
private fun isUltimate() = this is Ultimate
Expand Down Expand Up @@ -139,14 +139,23 @@ open class Enchant : Comparable<Enchant> {

class Ultimate : Enchant() {
override fun getStyle(level: Int, itemStack: ItemStack?): Style {
return if (advanced.useAdvancedUltimateColor.get()) {
Style.EMPTY.withColor(advanced.advancedUltimateColor.get().getEffectiveColourRGB()).withBold(true)
val isMaxed = level >= maxLevel

val useAdvanced = if (isMaxed) advanced.useAdvancedMaxUltimateColor else advanced.useAdvancedUltimateColor
val advColor = if (isMaxed) advanced.advancedMaxUltimateColor else advanced.advancedUltimateColor
val stdColor = if (isMaxed) config.maxUltimateEnchantColor else config.ultimateEnchantColor

val rgb = if (useAdvanced.get()) {
advColor.get().getEffectiveColourRGB()
} else {
if (config.ultimateEnchantColor.get() == LorenzColor.CHROMA)
Style.EMPTY.withColor(TextColor(0xFFFFFF, "chroma")).withBold(true)
else
Style.EMPTY.withColor(config.ultimateEnchantColor.get().toColor().rgb).withBold(true)
val color = stdColor.get()
if (color == LorenzColor.CHROMA) {
return Style.EMPTY.withColor(TextColor(0xFFFFFF, "chroma")).withBold(true)
}
color.toColor().rgb
}

return Style.EMPTY.withColor(rgb).withBold(true)
}
}

Expand Down
Loading