From 120c6b39a26c441bc1122b82bffdd98389228606 Mon Sep 17 00:00:00 2001 From: YuRaNnNzZZ Date: Fri, 14 Oct 2022 14:38:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BA=D1=83=D0=BB=D0=B4=D0=B0=D1=83?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BD=D0=B0=20=D0=BA=D0=BE=D0=BB=D0=B5=D1=81?= =?UTF-8?q?=D0=B5=20#124?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mc/otm/client/AndroidMenuKeyMapping.kt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/AndroidMenuKeyMapping.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/AndroidMenuKeyMapping.kt index cdfceb7c4..9b72b2fcd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/AndroidMenuKeyMapping.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/AndroidMenuKeyMapping.kt @@ -16,10 +16,7 @@ import ru.dbotthepony.mc.otm.capability.matteryPlayer import ru.dbotthepony.mc.otm.client.render.TextAlign import ru.dbotthepony.mc.otm.client.render.drawAligned import ru.dbotthepony.mc.otm.client.render.drawArc -import ru.dbotthepony.mc.otm.core.RGBAColor -import ru.dbotthepony.mc.otm.core.angleDifference -import ru.dbotthepony.mc.otm.core.linearInterpolation -import ru.dbotthepony.mc.otm.core.normalizeAngle +import ru.dbotthepony.mc.otm.core.* import ru.dbotthepony.mc.otm.network.MatteryPlayerNetworkChannel import ru.dbotthepony.mc.otm.network.SwitchAndroidFeaturePacket import java.util.stream.Collectors @@ -239,6 +236,14 @@ object AndroidMenuKeyMapping : KeyMapping("key.otm.android_menu", KeyConflictCon feature.renderIcon(event.poseStack, -iconSize / 2f + shift * cos, -shift * sin - iconSize / 2f, iconSize, iconSize) minecraft.font.drawAligned(event.poseStack, feature.type.displayName, TextAlign.CENTER_CENTER, shift * cos + 1f, -shift * sin - iconSize / 1.5f + 1f, 0) minecraft.font.drawAligned(event.poseStack, feature.type.displayName, TextAlign.CENTER_CENTER, shift * cos, -shift * sin - iconSize / 1.5f, if (feature.isActive) RGBAColor.DARK_GREEN else RGBAColor.DARK_RED) + + if (feature.isOnCooldown && feature.getCooldownPercent() > 0.0f) { + RenderSystem.setShaderColor(1f, 1f, 1f, 0.5f) + drawArc(event.poseStack, shift * cos, -shift * sin, iconSize / 2f, 0f, PI / 2.0, PI / 2.0 + PI * 2.0 * feature.getCooldownPercent().toDouble()) + RenderSystem.setShaderColor(1f, 1f, 1f, 1f) + + minecraft.font.drawAligned(event.poseStack, formatTickDuration(feature.cooldown), TextAlign.CENTER_CENTER, shift * cos, -shift * sin + iconSize / 1.5f, RGBAColor.WHITE) + } } }