aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test/command/CopyActionBarCommand.kt
blob: 2f07483b293af182db08bfc91254760a9ef93ce5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package at.hannibal2.skyhanni.test.command

import at.hannibal2.skyhanni.data.ActionBarData
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.OSUtils
import at.hannibal2.skyhanni.utils.StringUtils.removeColor

object CopyActionBarCommand {
    fun command(args: Array<String>) {
        val noFormattingCodes = args.size == 1 && args[0] == "true"

        val status = if (noFormattingCodes) "without" else "with"

        var actionBar = ActionBarData.getActionBar()
        if (noFormattingCodes) actionBar = actionBar.removeColor()

        OSUtils.copyToClipboard(actionBar)
        ChatUtils.chat("Action bar name copied to clipboard $status formatting codes!")
    }
}