Position clickboxes correctly when riskyCheats is false
This commit is contained in:
parent
14b3d63b57
commit
f4979bfa94
@ -17,7 +17,7 @@ import org.lwjgl.opengl.GL20
|
|||||||
|
|
||||||
@ApiStatus.Internal
|
@ApiStatus.Internal
|
||||||
class ClickBox(
|
class ClickBox(
|
||||||
x: Double = baseXAxis, y: Double,
|
x: Double, y: Double,
|
||||||
color: Colors = Colors.BLUE,
|
color: Colors = Colors.BLUE,
|
||||||
val name: TranslatableComponent? = null
|
val name: TranslatableComponent? = null
|
||||||
): ColoredElement(x, y, 80, 10, color, 0.5F) {
|
): ColoredElement(x, y, 80, 10, color, 0.5F) {
|
||||||
@ -57,7 +57,6 @@ class ClickBox(
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
var baseXAxis: Double = 4.0; private set
|
|
||||||
const val clickboxHeightOffset: Int = 80
|
const val clickboxHeightOffset: Int = 80
|
||||||
private const val inclination: Double = 2.5
|
private const val inclination: Double = 2.5
|
||||||
}
|
}
|
||||||
@ -109,5 +108,4 @@ class ClickBox(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
init { baseXAxis += 86 }
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,15 @@ annotation class ButtonInfo(
|
|||||||
MISC("snowy.clickbox.misc", Colors.BLUE),
|
MISC("snowy.clickbox.misc", Colors.BLUE),
|
||||||
RISKY("snowy.clickbox.risky", Colors.RED),
|
RISKY("snowy.clickbox.risky", Colors.RED),
|
||||||
MACROS("snowy.clickbox.macros", Colors.GREEN);
|
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
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user