From 92a9fa39dfc40cf116dc5128473df66f2203ff6a Mon Sep 17 00:00:00 2001 From: YuRaNnNzZZ Date: Mon, 30 Oct 2023 22:38:18 +0300 Subject: [PATCH] darken icons in disabled/pressed buttons --- .../screen/panels/button/LargeRectangleButtonPanel.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/button/LargeRectangleButtonPanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/button/LargeRectangleButtonPanel.kt index 5c1e22d90..5515b17af 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/button/LargeRectangleButtonPanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/button/LargeRectangleButtonPanel.kt @@ -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( @@ -28,10 +29,11 @@ open class LargeRectangleButtonPanel( 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) } }