diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-04-24 09:31:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-24 09:31:44 +0200 |
commit | c6b6f1fd9377896df0d17f1951cb84c2a1ffd24a (patch) | |
tree | 08469230a6bcd1eca867d839d6d2b789087450bb /src/main/java/at/hannibal2/skyhanni/test | |
parent | f9b776fc3c3d09e0992816932118569ac5399431 (diff) | |
download | skyhanni-c6b6f1fd9377896df0d17f1951cb84c2a1ffd24a.tar.gz skyhanni-c6b6f1fd9377896df0d17f1951cb84c2a1ffd24a.tar.bz2 skyhanni-c6b6f1fd9377896df0d17f1951cb84c2a1ffd24a.zip |
Backend: Replace Internal Commands (#1522)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt | 13 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt | 18 |
2 files changed, 12 insertions, 19 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt index 43e3974da..0d820f09a 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt @@ -190,16 +190,13 @@ class SkyHanniDebugsAndTests { } } - fun configManagerResetCommand(args: Array<String>) { - if (args.size == 1 && args[0] == "confirm") { - configManagerReset() - return - } - + fun configManagerResetCommand() { ChatUtils.clickableChat( "§cTHIS WILL RESET YOUR SkyHanni CONFIG! Click here to procceed.", - "shconfigmanagerreset confirm", - false + onClick = { + configManagerReset() + }, + prefix = false ) } diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt index 8c82ff0cd..622aaeba1 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt @@ -62,18 +62,12 @@ object ErrorManager { throw exception } - fun command(array: Array<String>) { - if (array.size != 1) { - ChatUtils.userError("Use /shcopyerror <error id>") - return - } - - val id = array[0] + private fun copyError(errorId: String) { val fullErrorMessage = KeyboardManager.isModifierKeyDown() val errorMessage = if (fullErrorMessage) { - fullErrorMessages[id] + fullErrorMessages[errorId] } else { - errorMessages[id] + errorMessages[errorId] } val name = if (fullErrorMessage) "Full error" else "Error" ChatUtils.chat(errorMessage?.let { @@ -152,8 +146,10 @@ object ErrorManager { ChatUtils.clickableChat( "§c[SkyHanni-${SkyHanniMod.version}]: $message§c. Click here to copy the error into the clipboard.", - "shcopyerror $randomId", - false + onClick = { + copyError(randomId) + }, + prefix = false ) } |