Position clickboxes correctly when riskyCheats is false

This commit is contained in:
Username404 2021-05-29 13:57:09 +02:00
parent 14b3d63b57
commit f4979bfa94
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
2 changed files with 10 additions and 4 deletions

View File

@ -17,7 +17,7 @@ import org.lwjgl.opengl.GL20
@ApiStatus.Internal
class ClickBox(
x: Double = baseXAxis, y: Double,
x: Double, y: Double,
color: Colors = Colors.BLUE,
val name: TranslatableComponent? = null
): ColoredElement(x, y, 80, 10, color, 0.5F) {
@ -57,7 +57,6 @@ class ClickBox(
}
companion object {
var baseXAxis: Double = 4.0; private set
const val clickboxHeightOffset: Int = 80
private const val inclination: Double = 2.5
}
@ -109,5 +108,4 @@ class ClickBox(
}
}
}
init { baseXAxis += 86 }
}

View File

@ -24,7 +24,15 @@ annotation class ButtonInfo(
MISC("snowy.clickbox.misc", Colors.BLUE),
RISKY("snowy.clickbox.risky", Colors.RED),
MACROS("snowy.clickbox.macros", Colors.GREEN);
init { ClickGui.components.add(ClickBox(y = 4.0, name = TranslatableComponent(translationKey), color = categoryColor)) }
init {
ClickGui.components.add(
ClickBox(
x = 4.0 + (if (ordinal >= 1 && !riskyCheats) ordinal - 1 else ordinal) * 86, y = 4.0,
name = TranslatableComponent(translationKey),
color = categoryColor
)
)
}
}
/**