aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/api')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt50
1 files changed, 37 insertions, 13 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt
index 22b72f3b0..a1e74a17e 100644
--- a/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt
@@ -193,30 +193,54 @@ object SkillAPI {
}
@SubscribeEvent
- fun onDebugDataCollect(event: DebugDataCollectEvent) {
- event.title("Skills")
+ fun onDebugDataCollectCurrent(event: DebugDataCollectEvent) {
+ event.title("Current Skill")
val storage = storage
if (storage == null) {
event.addIrrelevant("SkillMap is empty")
return
}
+
event.addData {
- for ((skillName, skillInfo) in storage) {
- add("- Name: $skillName")
- add("- Level: ${skillInfo.level}")
- add("- CurrentXp: ${skillInfo.currentXp}")
- add("- CurrentXpMax: ${skillInfo.currentXpMax}")
- add("- TotalXp: ${skillInfo.totalXp}")
- add("- OverflowLevel: ${skillInfo.overflowLevel}")
- add("- OverflowCurrentXp: ${skillInfo.overflowCurrentXp}")
- add("- OverflowCurrentXpMax: ${skillInfo.overflowCurrentXpMax}")
- add("- OverflowTotalXp: ${skillInfo.overflowTotalXp}")
- add("- CustomGoalLevel: ${skillInfo.customGoalLevel}\n")
+ val skillType = activeSkill
+ if (skillType == null) {
+ event.addIrrelevant("activeSkill is null")
+ }
+ storage[skillType]?.let { skillInfo ->
+ addDebug(skillType, skillInfo)
}
+ }
+ }
+
+ @SubscribeEvent
+ fun onDebugDataCollectAll(event: DebugDataCollectEvent) {
+ event.title("All Skills")
+ val storage = storage
+ if (storage == null) {
+ event.addIrrelevant("SkillMap is empty")
+ return
+ }
+ event.addIrrelevant {
+ for ((skillType, skillInfo) in storage) {
+ addDebug(skillType, skillInfo)
+ }
}
}
+ private fun MutableList<String>.addDebug(skillType: SkillType?, skillInfo: SkillInfo) {
+ add("Name: $skillType")
+ add("- Level: ${skillInfo.level}")
+ add("- CurrentXp: ${skillInfo.currentXp}")
+ add("- CurrentXpMax: ${skillInfo.currentXpMax}")
+ add("- TotalXp: ${skillInfo.totalXp}")
+ add("- OverflowLevel: ${skillInfo.overflowLevel}")
+ add("- OverflowCurrentXp: ${skillInfo.overflowCurrentXp}")
+ add("- OverflowCurrentXpMax: ${skillInfo.overflowCurrentXpMax}")
+ add("- OverflowTotalXp: ${skillInfo.overflowTotalXp}")
+ add("- CustomGoalLevel: ${skillInfo.customGoalLevel}\n")
+ }
+
private fun runTimer(skillName: String, info: SkillXPInfo) {
fixedRateTimer(name = "skyhanni-skillprogress-timer-$skillName", initialDelay = 1_000L, period = 1_000L) {
if (info.shouldStartTimer) cancel()