Disable cheats by default

This commit is contained in:
Username404-59 2021-05-05 19:11:34 +02:00
parent a2ad88b298
commit 3c647aa44b
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
4 changed files with 19 additions and 6 deletions

View File

@ -53,6 +53,7 @@ object Configuration {
""" """
|Snowy { |Snowy {
| displayInitMessage = true | displayInitMessage = true
| riskyCheats = false
|} |}
""".trimMargin() """.trimMargin()
) )

View File

@ -1,13 +1,17 @@
package fr.username404.snowygui.misc package fr.username404.snowygui.misc
import fr.username404.snowygui.ClickGui import fr.username404.snowygui.ClickGui
import fr.username404.snowygui.config.Configuration
import fr.username404.snowygui.newBox import fr.username404.snowygui.newBox
import io.github.config4k.getValue
import net.minecraft.client.Minecraft import net.minecraft.client.Minecraft
object Storage { object Storage {
private var oldGamma = -1.0 private var oldGamma = -1.0
private const val redColor = 0x660000
var hurtCamera: Boolean = true; private set var hurtCamera: Boolean = true; private set
private val riskyCheats: Boolean by Configuration.obtained
fun ClickGui.addComponents() { fun ClickGui.addComponents() {
addComps( addComps(
newBox("snowy.clickbox.misc").addButtons( newBox("snowy.clickbox.misc").addButtons(
@ -20,10 +24,16 @@ object Storage {
} }
} }
), ),
newBox("snowy.clickbox.risky", color = 0x660000).addButtons(
"NoHurtCamera" to { hurtCamera = !hurtCamera },
"NoGravity" to { Minecraft.getInstance().player?.let { it.isNoGravity = !it.isNoGravity } }
),
) )
if (riskyCheats) {
addComps(
newBox("snowy.clickbox.risky.camera", color = redColor).addButtons(
"NoHurtCamera" to { hurtCamera = !hurtCamera }
),
newBox("snowy.clickbox.risky.movement", color = redColor).addButtons(
"NoGravity" to { Minecraft.getInstance().player?.let { it.isNoGravity = !it.isNoGravity } }
)
)
}
} }
} }

View File

@ -5,5 +5,6 @@
"key.snowy.opengui": "Open the snowy gui", "key.snowy.opengui": "Open the snowy gui",
"key.snowy.configkey": "Open the snowy configuration screen", "key.snowy.configkey": "Open the snowy configuration screen",
"snowy.clickbox.misc": "Miscellaneous", "snowy.clickbox.misc": "Miscellaneous",
"snowy.clickbox.risky": "Risky" "snowy.clickbox.risky.camera": "Camera",
"snowy.clickbox.risky.movement": "Movement"
} }

View File

@ -5,5 +5,6 @@
"key.snowy.opengui": "Ouvrir l'interface de snowy", "key.snowy.opengui": "Ouvrir l'interface de snowy",
"key.snowy.configkey": "Ouvrir l'écran de configuration de snowy", "key.snowy.configkey": "Ouvrir l'écran de configuration de snowy",
"snowy.clickbox.misc": "Divers", "snowy.clickbox.misc": "Divers",
"snowy.clickbox.risky": "Risqué" "snowy.clickbox.risky.camera": "Caméra",
"snowy.clickbox.risky.movement": "Mouvement"
} }