Skip to content

Commit

Permalink
add command and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nextdayy committed Dec 21, 2024
1 parent 8247677 commit a28024e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/kotlin/org/polyfrost/crosshair/CrosshairHUD.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/main/kotlin/org/polyfrost/crosshair/PolyCrosshair.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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()
}
})
}

}
8 changes: 8 additions & 0 deletions src/main/resources/assets/polycrosshair/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a28024e

Please sign in to comment.