highlight selected enum in tooltips
This commit is contained in:
parent
5c2791c30c
commit
824d75a680
@ -797,6 +797,8 @@ private fun gui(provider: MatteryLanguageProvider) {
|
||||
gui("slot_filter.filtered", "This slot is filtered for automation")
|
||||
gui("slot_filter.forbidden", "This slot is forbidden for automation mechanisms")
|
||||
gui("slot_filter.hint", "To remove slot filter press Ctrl + LMB")
|
||||
|
||||
gui("tooltip.enum.active", "> %s")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,12 +11,8 @@ import ru.dbotthepony.mc.otm.client.render.AbstractMatterySprite
|
||||
import ru.dbotthepony.mc.otm.client.render.IGUIRenderable
|
||||
import ru.dbotthepony.mc.otm.client.render.UVWindingOrder
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.EditablePanel
|
||||
import ru.dbotthepony.mc.otm.core.GetterSetter
|
||||
import ru.dbotthepony.mc.otm.core.TextComponent
|
||||
import ru.dbotthepony.mc.otm.core.next
|
||||
import ru.dbotthepony.mc.otm.core.prev
|
||||
import ru.dbotthepony.mc.otm.core.*
|
||||
import ru.dbotthepony.mc.otm.core.util.EnumValueCodec
|
||||
import ru.dbotthepony.mc.otm.core.value
|
||||
import ru.dbotthepony.mc.otm.menu.input.IPlayerInputWithFeedback
|
||||
import java.util.*
|
||||
import java.util.function.Predicate
|
||||
@ -164,7 +160,9 @@ abstract class EnumRectangleButtonPanel<out S : Screen, T : Enum<T>>(
|
||||
|
||||
for ((k, entry) in enumMapping) {
|
||||
if (entry.tooltip != null && predicate.test(k)) {
|
||||
listing.add(entry.tooltip.copy().withStyle(if (entry.key == prop.get()) ChatFormatting.WHITE else ChatFormatting.GRAY))
|
||||
val active = entry.key == prop.get()
|
||||
val tooltip = entry.tooltip.copy().withStyle(if (active) ChatFormatting.WHITE else ChatFormatting.GRAY)
|
||||
listing.add(if (active) TranslatableComponent("otm.gui.tooltip.enum.active", tooltip) else tooltip)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user