diff --git a/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt b/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt index 08451e8..cc02761 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt @@ -12,8 +12,9 @@ import fr.username404.snowygui.gui.feature.Macro import fr.username404.snowygui.gui.feature.riskyCheats import net.minecraft.client.gui.screens.Screen import net.minecraft.network.chat.Component +import net.minecraft.network.chat.TextComponent import net.minecraft.network.chat.TranslatableComponent -import java.util.* +import java.util.Optional private const val confPrefix: String = "screen.snowy.config" private val translationComponent = TranslatableComponent(confPrefix) @@ -58,7 +59,9 @@ val SnowyConfigScreen: Screen = object: Screen(translationComponent) { .requireRestart() .setSaveConsumer { riskyCheats = it - }.setTooltip(Component.nullToEmpty("WARNING: Do not use this on servers or you might get banned.")).build() + }.setTooltip(TextComponent("WARNING: Do not use this on servers or you might get banned.").apply { + style = style.withColor(Colors.RED.asTextColor()) + }).build() ).addEntry(startSubCategory(TranslatableComponent("$confPrefix.colors")).also { builder -> builder.addAll( ClickGui.clickBoxes.map { box -> diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Colors.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Colors.kt index 2ca5b52..26425ed 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Colors.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Colors.kt @@ -1,5 +1,7 @@ package fr.username404.snowygui.gui.feature +import net.minecraft.network.chat.TextColor + enum class Colors(val hexValue: Int) { TRANSPARENT(-0x1), BLACK(0x000000), @@ -10,5 +12,6 @@ enum class Colors(val hexValue: Int) { RED(0x660000), GREEN(0x00FF7F), ORANGE(0xf18e33), - PURPLE(0xA97BFF) + PURPLE(0xA97BFF); + fun asTextColor(): TextColor = TextColor.fromRgb(hexValue) }