diff options
Diffstat (limited to 'src/main/kotlin/features/macros')
| -rw-r--r-- | src/main/kotlin/features/macros/ComboProcessor.kt | 11 | ||||
| -rw-r--r-- | src/main/kotlin/features/macros/RadialMenu.kt | 17 |
2 files changed, 13 insertions, 15 deletions
diff --git a/src/main/kotlin/features/macros/ComboProcessor.kt b/src/main/kotlin/features/macros/ComboProcessor.kt index 5c5ac0e..1f77ff6 100644 --- a/src/main/kotlin/features/macros/ComboProcessor.kt +++ b/src/main/kotlin/features/macros/ComboProcessor.kt @@ -56,12 +56,11 @@ object ComboProcessor { fun onRender(event: HudRenderEvent) { if (!isInputting) return if (!event.isRenderingHud) return - event.context.matrices.push() + event.context.matrices.pushMatrix() val width = 120 event.context.matrices.translate( (MC.window.scaledWidth - width) / 2F, - (MC.window.scaledHeight) / 2F + 8, - 0F + (MC.window.scaledHeight) / 2F + 8 ) val breadCrumbText = breadCrumbs.joinToString(" > ") event.context.drawText( @@ -72,7 +71,7 @@ object ComboProcessor { -1, true ) - event.context.matrices.translate(0F, MC.font.fontHeight + 2F, 0F) + event.context.matrices.translate(0F, MC.font.fontHeight + 2F) for ((key, value) in activeTrie.nodes) { event.context.drawText( MC.font, @@ -82,9 +81,9 @@ object ComboProcessor { -1, true ) - event.context.matrices.translate(0F, MC.font.fontHeight + 1F, 0F) + event.context.matrices.translate(0F, MC.font.fontHeight + 1F) } - event.context.matrices.pop() + event.context.matrices.popMatrix() } @Subscribe diff --git a/src/main/kotlin/features/macros/RadialMenu.kt b/src/main/kotlin/features/macros/RadialMenu.kt index 9e5222f..5134994 100644 --- a/src/main/kotlin/features/macros/RadialMenu.kt +++ b/src/main/kotlin/features/macros/RadialMenu.kt @@ -63,11 +63,10 @@ object RadialMenuViewer { fun onRender(event: HudRenderEvent) { val menu = activeMenu ?: return val mat = event.context.matrices - mat.push() + mat.pushMatrix() mat.translate( (MC.window.scaledWidth) / 2F, (MC.window.scaledHeight) / 2F, - 0F ) val sliceWidth = (τ / menu.options.size).toFloat() var selectedAngle = wrapAngle(atan2(delta.y, delta.x)) @@ -75,8 +74,8 @@ object RadialMenuViewer { selectedAngle = Float.NaN for ((idx, option) in menu.options.withIndex()) { val range = (sliceWidth * idx)..(sliceWidth * (idx + 1)) - mat.push() - mat.scale(64F, 64F, 1F) + mat.pushMatrix() + mat.scale(64F, 64F) val cutout = INNER_CIRCLE_RADIUS / 64F / 2 RenderCircleProgress.renderCircularSlice( event.context, @@ -86,16 +85,16 @@ object RadialMenuViewer { color = if (selectedAngle in range) 0x70A0A0A0 else 0x70FFFFFF, innerCutoutRadius = cutout ) - mat.pop() - mat.push() + mat.popMatrix() + mat.pushMatrix() val centreAngle = lerpAngle(range.start, range.endInclusive, 0.5F) val vec = Vector2f(cos(centreAngle), sin(centreAngle)).mul(40F) - mat.translate(vec.x, vec.y, 0F) + mat.translate(vec.x, vec.y) option.renderSlice(event.context) - mat.pop() + mat.popMatrix() } event.context.drawLine(1, 1, delta.x.toInt(), delta.y.toInt(), me.shedaniel.math.Color.ofOpaque(0x00FF00)) - mat.pop() + mat.popMatrix() } @Subscribe |
