diff --git a/src/main/kotlin/org/polyfrost/crosshair/CrosshairHUD.kt b/src/main/kotlin/org/polyfrost/crosshair/CrosshairHUD.kt index bde18a3..c69660c 100644 --- a/src/main/kotlin/org/polyfrost/crosshair/CrosshairHUD.kt +++ b/src/main/kotlin/org/polyfrost/crosshair/CrosshairHUD.kt @@ -32,9 +32,7 @@ object CrosshairHUD : LegacyHud() { var currentCrosshair: String? = null @Button(title = "Open Editor") - private val openEditor = Runnable { - PolyCrosshairUI.open() - } + fun openEditor() { PolyCrosshairUI.open() } val id = GL.generateTexture() private var texSize = 15f diff --git a/src/main/kotlin/org/polyfrost/crosshair/PolyCrosshair.kt b/src/main/kotlin/org/polyfrost/crosshair/PolyCrosshair.kt index 010831a..c7b9163 100644 --- a/src/main/kotlin/org/polyfrost/crosshair/PolyCrosshair.kt +++ b/src/main/kotlin/org/polyfrost/crosshair/PolyCrosshair.kt @@ -2,6 +2,8 @@ package org.polyfrost.crosshair import net.minecraftforge.fml.common.Mod import net.minecraftforge.fml.common.event.FMLInitializationEvent +import org.polyfrost.oneconfig.api.commands.v1.CommandManager +import org.polyfrost.oneconfig.api.commands.v1.factories.annotated.Command import org.polyfrost.oneconfig.api.hud.v1.HudManager @Mod( @@ -18,6 +20,12 @@ object PolyCrosshair { @Mod.EventHandler fun onFMLInitialization(event: FMLInitializationEvent) { HudManager.register(CrosshairHUD) + CommandManager.registerCommand(@Command("polycrosshair") object { + @Command + private fun main() { + PolyCrosshairUI.open() + } + }) } } \ No newline at end of file diff --git a/src/main/resources/assets/polycrosshair/icon.svg b/src/main/resources/assets/polycrosshair/icon.svg new file mode 100644 index 0000000..edcdcf6 --- /dev/null +++ b/src/main/resources/assets/polycrosshair/icon.svg @@ -0,0 +1,8 @@ + + + + + + + +