Make a few overridden methods of ButtonImpl.kt final and rename the mixins .json files

This commit is contained in:
Username404 2021-07-28 19:57:59 +02:00
parent 596eb27fff
commit 3c7d145ca8
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
5 changed files with 6 additions and 6 deletions

View File

@ -61,7 +61,7 @@ subprojects {
officialMojangMappings().crane("dev.architectury:crane:${rootProject.architectury.minecraft}+build.+")
}
silentMojangMappingsLicense()
mixinConfig("snowygui-mixins.json")
mixinConfig("snowygui-${project.name}.mixins.json")
refmapName = "snowygui-${project.name}-refmap.json"
}
apply(plugin = "com.github.johnrengelman.shadow")

View File

@ -72,7 +72,7 @@ sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) {
}
private fun lightUp() { opacity += ButtonInfo.lightningFactor }
private fun lightDown() { opacity -= ButtonInfo.lightningFactor }
override fun mouseClicked(d: Double, e: Double, i: Int): Boolean {
final override fun mouseClicked(d: Double, e: Double, i: Int): Boolean {
wasWithinBounds = isWithinBounds(d, e).also {
if (it) {
if (info.kind == Type.TOGGLE) {
@ -83,13 +83,13 @@ sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) {
return false
}
override fun mouseReleased(d: Double, e: Double, i: Int): Boolean {
final override fun mouseReleased(d: Double, e: Double, i: Int): Boolean {
if (wasWithinBounds && (info.kind == Type.CLICK)) {
execAction()
lightDown()
}; return false
}
override fun render(poseStack: PoseStack?) {
final override fun render(poseStack: PoseStack?) {
prepareDraw()
defaultRectFunc()
endDraw()

View File

@ -29,8 +29,8 @@
]
},
"mixins": [
"snowygui-mixins.json",
"snowygui-mixins-fabric.json"
"snowygui-common.mixins.json",
"snowygui-fabric.mixins.json"
],
"depends": {
"fabricloader": ">=0.11.0",