darken icons in disabled/pressed buttons

This commit is contained in:
YuRaNnNzZZ 2023-10-30 22:38:18 +03:00
parent 608771f441
commit 92a9fa39df
Signed by: YuRaNnNzZZ
GPG Key ID: 5F71738C85A6006D

View File

@ -7,6 +7,7 @@ import ru.dbotthepony.mc.otm.client.render.IGUIRenderable
import ru.dbotthepony.mc.otm.client.render.UVWindingOrder
import ru.dbotthepony.mc.otm.client.render.Widgets18
import ru.dbotthepony.mc.otm.client.screen.panels.EditablePanel
import ru.dbotthepony.mc.otm.core.math.RGBAColor
import ru.dbotthepony.mc.otm.menu.MatteryMenu
open class LargeRectangleButtonPanel<out S : Screen>(
@ -28,10 +29,11 @@ open class LargeRectangleButtonPanel<out S : Screen>(
override fun innerRender(graphics: GuiGraphics, mouseX: Float, mouseY: Float, partialTick: Float) {
super.innerRender(graphics, mouseX, mouseY, partialTick)
val color = if (isDisabled || isPressed) RGBAColor.DARK_GRAY else RGBAColor.WHITE
if (iconWinding != null) {
icon?.render(graphics, width = width, height = height, winding = iconWinding!!)
icon?.render(graphics, width = width, height = height, winding = iconWinding!!, color = color)
} else {
icon?.render(graphics, width = width, height = height)
icon?.render(graphics, width = width, height = height, color = color)
}
}