aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/events/DebugDataCollectEvent.kt30
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/DebugCommand.kt16
7 files changed, 24 insertions, 36 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt
index c86563361..ee6899340 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt
@@ -75,7 +75,7 @@ object SlayerAPI {
event.title("Slayer")
if (!hasActiveSlayerQuest()) {
- event.ignore("no active slayer quest")
+ event.addIrrelevant("no active slayer quest")
return
}
diff --git a/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt b/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt
index 4e8b95080..5296053d1 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt
@@ -179,7 +179,7 @@ class RepoManager(private val configLocation: File) {
event.title("Repo Status")
if (unsuccessfulConstants.isEmpty() && successfulConstants.isNotEmpty()) {
- event.ignore("Repo working fine")
+ event.addIrrelevant("Repo working fine")
return
}
diff --git a/src/main/java/at/hannibal2/skyhanni/events/DebugDataCollectEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/DebugDataCollectEvent.kt
index 1a4eabb92..eb8dd5bfc 100644
--- a/src/main/java/at/hannibal2/skyhanni/events/DebugDataCollectEvent.kt
+++ b/src/main/java/at/hannibal2/skyhanni/events/DebugDataCollectEvent.kt
@@ -6,7 +6,7 @@ class DebugDataCollectEvent(private val list: MutableList<String>, private val s
var empty = true
private var currentTitle = ""
- private var ignore = false
+ private var irrelevant = false
fun title(title: String) {
if (currentTitle != "") error("Title already set: '$currentTitle'")
@@ -14,40 +14,28 @@ class DebugDataCollectEvent(private val list: MutableList<String>, private val s
currentTitle = title
}
- fun ignore(block: MutableList<String>.() -> Unit) {
- val list = mutableListOf<String>()
- block(list)
- ignore(list)
- }
+ fun addIrrelevant(builder: MutableList<String>.() -> Unit) = addIrrelevant(buildList(builder))
- fun ignore(text: String) {
- ignore(listOf(text))
- }
+ fun addIrrelevant(text: String) = addIrrelevant(listOf(text))
- private fun ignore(text: List<String>) {
- ignore = true
+ private fun addIrrelevant(text: List<String>) {
+ irrelevant = true
addData(text)
}
- fun addData(block: MutableList<String>.() -> Unit) {
- val list = mutableListOf<String>()
- block(list)
- addData(list)
- }
+ fun addData(builder: MutableList<String>.() -> Unit) = addData(buildList(builder))
- fun addData(text: String) {
- addData(listOf(text))
- }
+ fun addData(text: String) = addData(listOf(text))
fun addData(text: List<String>) {
if (currentTitle == "") error("Title not set")
writeData(text)
currentTitle = ""
- ignore = false
+ irrelevant = false
}
private fun writeData(text: List<String>) {
- if (ignore && search == null) return
+ if (irrelevant && search == null) return
search?.let {
if (!search.equalsIgnoreColor("all")) {
if (!currentTitle.contains(search, ignoreCase = true)) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt
index 7657a27e4..af3518141 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt
@@ -226,7 +226,7 @@ class DungeonAPI {
event.title("Dungeon")
if (!LorenzUtils.inDungeons) {
- event.ignore("not in dungeons")
+ event.addIrrelevant("not in dungeons")
return
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt
index 27c7b1b0d..1b9e12195 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt
@@ -70,16 +70,16 @@ class BurrowWarpHelper {
event.title("Diana Burrow Nearest Warp")
if (!DianaAPI.isDoingDiana()) {
- event.ignore("not doing diana")
+ event.addIrrelevant("not doing diana")
return
}
if (!config.burrowNearestWarp) {
- event.ignore("disabled in config")
+ event.addIrrelevant("disabled in config")
return
}
val target = GriffinBurrowHelper.targetLocation
if (target == null) {
- event.ignore("targetLocation is null")
+ event.addIrrelevant("targetLocation is null")
return
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
index 6a9ef7c8c..0fcb4c4b2 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
@@ -616,7 +616,7 @@ class GardenVisitorFeatures {
event.title("Garden Visitor Stats")
if (!GardenAPI.inGarden()) {
- event.ignore("not in garden")
+ event.addIrrelevant("not in garden")
return
}
diff --git a/src/main/java/at/hannibal2/skyhanni/test/DebugCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/DebugCommand.kt
index 0cf0e4b5a..e2ff4dbb4 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/DebugCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/DebugCommand.kt
@@ -57,13 +57,13 @@ object DebugCommand {
private fun profileType(event: DebugDataCollectEvent) {
event.title("Profile Type")
if (!LorenzUtils.inSkyBlock) {
- event.ignore("Not on SkyBlcok")
+ event.addIrrelevant("Not on SkyBlcok")
return
}
val classic = !LorenzUtils.noTradeMode
if (classic) {
- event.ignore("on classic")
+ event.addIrrelevant("on classic")
} else {
if (HypixelData.ironman) {
event.addData("on ironman")
@@ -80,12 +80,12 @@ object DebugCommand {
private fun profileName(event: DebugDataCollectEvent) {
event.title("Profile Name")
if (!LorenzUtils.inSkyBlock) {
- event.ignore("Not on SkyBlcok")
+ event.addIrrelevant("Not on SkyBlcok")
return
}
if (HypixelData.profileName != "") {
- event.ignore("profileName: '${HypixelData.profileName}'")
+ event.addIrrelevant("profileName: '${HypixelData.profileName}'")
} else {
event.addData("profile name is empty!")
}
@@ -105,7 +105,7 @@ object DebugCommand {
event.addData("Unknown SkyBlock island!")
return
}
- event.ignore {
+ event.addIrrelevant {
add("on Hypixel SkyBlock")
add("skyBlockIsland: ${LorenzUtils.skyBlockIsland}")
add("skyBlockArea: '${LorenzUtils.skyBlockArea}'")
@@ -115,7 +115,7 @@ object DebugCommand {
private fun globalRender(event: DebugDataCollectEvent) {
event.title("Global Render")
if (SkyHanniDebugsAndTests.globalRender) {
- event.ignore("normal enabled")
+ event.addIrrelevant("normal enabled")
} else {
event.addData {
add("Global renderer is disabled!")
@@ -127,7 +127,7 @@ object DebugCommand {
private fun repoAutoUpdate(event: DebugDataCollectEvent) {
event.title("Repo Auto Update")
if (SkyHanniMod.feature.dev.repoAutoUpdate) {
- event.ignore("normal enabled")
+ event.addIrrelevant("normal enabled")
} else {
event.addData("The repo does not auto update because auto update is disabled!")
}
@@ -135,7 +135,7 @@ object DebugCommand {
private fun player(event: DebugDataCollectEvent) {
event.title("Player")
- event.ignore {
+ event.addIrrelevant {
add("name: '${LorenzUtils.getPlayerName()}'")
add("uuid: '${LorenzUtils.getPlayerUuid()}'")
}