aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/command/CopyBossbarCommand.kt20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyBossbarCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyBossbarCommand.kt
new file mode 100644
index 000000000..cac3ac02f
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyBossbarCommand.kt
@@ -0,0 +1,20 @@
+package at.hannibal2.skyhanni.test.command
+
+import at.hannibal2.skyhanni.data.BossbarData
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.OSUtils
+import at.hannibal2.skyhanni.utils.StringUtils.removeColor
+
+object CopyBossbarCommand {
+ fun command(args: Array<String>) {
+ val noFormattingCodes = args.size == 1 && args[0] == "true"
+ val bossbarName = if (noFormattingCodes) BossbarData.getBossbar().removeColor() else BossbarData.getBossbar()
+ val status = if (noFormattingCodes) "without" else "with"
+ if (bossbarName.isBlank()) {
+ LorenzUtils.chat("Boss bar appears to be blank.")
+ } else {
+ OSUtils.copyToClipboard(bossbarName)
+ LorenzUtils.chat("Boss bar name copied to clipboard $status formatting codes!")
+ }
+ }
+}