diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-11 11:42:11 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-11 11:42:11 +0100 |
commit | 5477d22a05c366095f402de10c1e0b9b15e18320 (patch) | |
tree | 1ce68edfe72dbd54ec5f630119c7b79013edb98e | |
parent | 20cbb7d8e48757ae21230a650dcee06a56aaa190 (diff) | |
download | skyhanni-5477d22a05c366095f402de10c1e0b9b15e18320.tar.gz skyhanni-5477d22a05c366095f402de10c1e0b9b15e18320.tar.bz2 skyhanni-5477d22a05c366095f402de10c1e0b9b15e18320.zip |
Added /shdebugwaypoint as test/debug command.
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt | 1 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt index 89885ec4d..a2a1468a9 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -259,6 +259,7 @@ object Commands { private fun developersCodingHelp() { registerCommand("shtest", "Unused test command.") { SkyHanniDebugsAndTests.testCommand(it) } + registerCommand("shdebugwaypoint", "Mark a waypoint on that location") { SkyHanniDebugsAndTests.waypoint(it) } registerCommand("shreloadlocalrepo", "Reloading the local repo data") { SkyHanniMod.repo.reloadLocalRepo() } registerCommand("shchathistory", "Show the unfiltered chat history") { ChatManager.openChatFilterGUI() } registerCommand( diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt index 36042b977..1f8e0a626 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt @@ -8,10 +8,12 @@ import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.data.SlayerAPI import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.PlaySoundEvent import at.hannibal2.skyhanni.events.ReceiveParticleEvent import at.hannibal2.skyhanni.features.dungeon.DungeonAPI import at.hannibal2.skyhanni.features.garden.visitor.GardenVisitorColorNames +import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull @@ -19,15 +21,18 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarityOrNull import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyHeld import at.hannibal2.skyhanni.utils.LocationUtils +import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzDebug import at.hannibal2.skyhanni.utils.LorenzLogger import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.makeAccessible +import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NEUItems.getNpcPriceOrNull import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.OSUtils +import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText import at.hannibal2.skyhanni.utils.RenderUtils.renderString import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems import at.hannibal2.skyhanni.utils.SoundUtils @@ -68,6 +73,31 @@ class SkyHanniDebugsAndTests { LorenzDebug.log(text) } + private var testLocation: LorenzVec? = null + + @SubscribeEvent + fun onRenderWorld(event: LorenzRenderWorldEvent) { + testLocation?.let { + event.drawWaypointFilled(it, LorenzColor.WHITE.toColor()) + event.drawDynamicText(it, "Test", 1.5) + } + } + + fun waypoint(args: Array<String>) { + SoundUtils.playBeepSound() + + if (args.isEmpty()) { + testLocation = null + LorenzUtils.chat("reset test waypoint") + } + + val x = args[0].toDouble() + val y = args[1].toDouble() + val z = args[2].toDouble() + testLocation = LorenzVec(x, y, z) + LorenzUtils.chat("set test waypoint") + } + fun testCommand(args: Array<String>) { SoundUtils.playBeepSound() |