aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-10-27 22:42:58 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-10-27 22:42:58 +0100
commita420116af642a1eb8b257e8a88cece92eecc6def (patch)
tree78700042d4063ef7f6fd655bd8de1181763ae45c
parent31c884c8123ad5f6c9376503effce3fb2ded5d55 (diff)
downloadSkyHanni-a420116af642a1eb8b257e8a88cece92eecc6def.tar.gz
SkyHanni-a420116af642a1eb8b257e8a88cece92eecc6def.tar.bz2
SkyHanni-a420116af642a1eb8b257e8a88cece92eecc6def.zip
added response to /shcopylocation
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
index ae9b5e45b..4a19357f1 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
@@ -328,18 +328,15 @@ object SkyHanniDebugsAndTests {
val x = (location.x + 0.001).roundTo(1)
val y = (location.y + 0.001).roundTo(1)
val z = (location.z + 0.001).roundTo(1)
- if (args.size == 1) {
- if (args[0].equals("json", false)) {
- OSUtils.copyToClipboard("\"$x:$y:$z\"")
- return
- }
- if (args[0].equals("pathfind", false)) {
- OSUtils.copyToClipboard("`/shtestwaaypoint $x $y $z pathfind`")
- return
- }
- }
+ val (clipboard, format) = formatLocation(x, y, z, args.getOrNull(0))
+ OSUtils.copyToClipboard(clipboard)
+ ChatUtils.chat("Copied the current location to clipboard ($format format)!", replaceSameMessage = true)
+ }
- OSUtils.copyToClipboard("LorenzVec($x, $y, $z)")
+ private fun formatLocation(x: Double, y: Double, z: Double, parameter: String?): Pair<String, String> = when (parameter) {
+ "json" -> "$x:$y:$z" to "json"
+ "pathfind" -> "`/shtestwaypoint $x $y $z pathfind`" to "pathfind"
+ else -> "LorenzVec($x, $y, $z)" to "LorenzVec"
}
fun debugVersion() {