aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-01-18 20:23:49 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-01-18 20:23:49 +0100
commit16e9a946212a270f63dfc5647374581dd122586f (patch)
tree0f9c05858cc925590d4c5e8aca1e81091e468d84
parent4b44988d83f1522c8279d9571e7b438d8f17cac0 (diff)
downloadskyhanni-16e9a946212a270f63dfc5647374581dd122586f.tar.gz
skyhanni-16e9a946212a270f63dfc5647374581dd122586f.tar.bz2
skyhanni-16e9a946212a270f63dfc5647374581dd122586f.zip
move into own functions
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/DebugCommand.kt119
1 files changed, 69 insertions, 50 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/DebugCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/DebugCommand.kt
index a89a3bb05..ded048300 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/DebugCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/DebugCommand.kt
@@ -32,29 +32,64 @@ object DebugCommand {
val event = DebugDataCollectEvent(list, search)
- event.title("Player")
- event.ignore {
- add("name: '${LorenzUtils.getPlayerName()}'")
- add("uuid: '${LorenzUtils.getPlayerUuid()}'")
+ // calling default debug stuff
+ player(event)
+ repoAutoUpdate(event)
+ globalRender(event)
+ skyblockStatus(event)
+ profileName(event)
+ profileType(event)
+
+ event.postAndCatch()
+
+ if (event.empty) {
+ list.add("")
+ list.add("Nothing interesting to show right now!")
+ list.add("Looking for something specific? /shdebug <search>")
+ list.add("Wanna see everything? /shdebug all")
}
- event.title("Repo Auto Update")
- if (SkyHanniMod.feature.dev.repoAutoUpdate) {
- event.ignore("normal enabled")
+ list.add("```")
+ OSUtils.copyToClipboard(list.joinToString("\n"))
+ LorenzUtils.chat("§eCopied SkyHanni debug data in the clipboard.")
+ }
+
+ private fun profileType(event: DebugDataCollectEvent) {
+ event.title("Profile Type")
+ if (!LorenzUtils.inSkyBlock) {
+ event.ignore("Not on SkyBlcok")
} else {
- event.addData("The repo does not auto update because auto update is disabled!")
+ val classic = !LorenzUtils.noTradeMode
+ if (classic) {
+ event.ignore("on classic")
+ } else {
+ if (HypixelData.ironman) {
+ event.addData("on ironman")
+ }
+ if (HypixelData.stranded) {
+ event.addData("on stranded")
+ }
+ if (HypixelData.bingo) {
+ event.addData("on bingo")
+ }
+ }
}
+ }
- event.title("Global Render")
- if (SkyHanniDebugsAndTests.globalRender) {
- event.ignore("normal enabled")
+ private fun profileName(event: DebugDataCollectEvent) {
+ event.title("Profile Name")
+ if (!LorenzUtils.inSkyBlock) {
+ event.ignore("Not on SkyBlcok")
} else {
- event.addData {
- add("Global renderer is disabled!")
- add("No renderable elements from SkyHanni will show up anywhere!")
+ if (HypixelData.profileName != "") {
+ event.ignore("profileName: '${HypixelData.profileName}'")
+ } else {
+ event.addData("profile name is empty!")
}
}
+ }
+ private fun skyblockStatus(event: DebugDataCollectEvent) {
event.title("SkyBlock Status")
if (!LorenzUtils.onHypixel) {
event.addData("not on Hypixel")
@@ -73,50 +108,34 @@ object DebugCommand {
}
}
}
+ }
- event.title("Profile Name")
- if (!LorenzUtils.inSkyBlock) {
- event.ignore("Not on SkyBlcok")
+ private fun globalRender(event: DebugDataCollectEvent) {
+ event.title("Global Render")
+ if (SkyHanniDebugsAndTests.globalRender) {
+ event.ignore("normal enabled")
} else {
- if (HypixelData.profileName != "") {
- event.ignore("profileName: '${HypixelData.profileName}'")
- } else {
- event.addData("profile name is empty!")
+ event.addData {
+ add("Global renderer is disabled!")
+ add("No renderable elements from SkyHanni will show up anywhere!")
}
}
+ }
-
- event.title("Profile Type")
- if (!LorenzUtils.inSkyBlock) {
- event.ignore("Not on SkyBlcok")
+ private fun repoAutoUpdate(event: DebugDataCollectEvent) {
+ event.title("Repo Auto Update")
+ if (SkyHanniMod.feature.dev.repoAutoUpdate) {
+ event.ignore("normal enabled")
} else {
- val classic = !LorenzUtils.noTradeMode
- if (classic) {
- event.ignore("on classic")
- } else {
- if (HypixelData.ironman) {
- event.addData("on ironman")
- }
- if (HypixelData.stranded) {
- event.addData("on stranded")
- }
- if (HypixelData.bingo) {
- event.addData("on bingo")
- }
- }
+ event.addData("The repo does not auto update because auto update is disabled!")
}
+ }
- event.postAndCatch()
-
- if (event.empty) {
- list.add("")
- list.add("Nothing interesting to show right now!")
- list.add("Looking for something specific? /shdebug <search>")
- list.add("Wanna see everything? /shdebug all")
+ private fun player(event: DebugDataCollectEvent) {
+ event.title("Player")
+ event.ignore {
+ add("name: '${LorenzUtils.getPlayerName()}'")
+ add("uuid: '${LorenzUtils.getPlayerUuid()}'")
}
-
- list.add("```")
- OSUtils.copyToClipboard(list.joinToString("\n"))
- LorenzUtils.chat("§eCopied SkyHanni debug data in the clipboard.")
}
}