aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ApiDataLoader.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/SkyBLockLevelGuideHelper.kt40
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt6
6 files changed, 62 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
index f623b22a4..b2361b399 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
@@ -175,6 +175,7 @@ public class SkyHanniMod {
loadModule(new BarnFishingTimer());
loadModule(new CrimsonIsleReputationHelper(this));
loadModule(new SharkFishCounter());
+ loadModule(new SkyBLockLevelGuideHelper());
loadModule(new OdgerWaypoint());
loadModule(new TiaRelayHelper());
loadModule(new TiaRelayWaypoints());
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java b/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java
index 61b11da6c..6c4496af3 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java
@@ -128,4 +128,10 @@ public class Inventory {
desc = "Highlights used Bonzo's Masks with a background")
@ConfigEditorBoolean
public boolean highlightDepletedBonzosMasks = false;
+
+ @Expose
+ @ConfigOption(name = "Highlight Missing SkyBlock Level Guide",
+ desc = "Highlight stuff that is missing in the skyblock level guide inventory.")
+ @ConfigEditorBoolean
+ public boolean highlightMissingSkyBlockLevelGuide = true;
}
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ApiDataLoader.kt b/src/main/java/at/hannibal2/skyhanni/data/ApiDataLoader.kt
index bea039212..17cb04d35 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/ApiDataLoader.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/ApiDataLoader.kt
@@ -52,7 +52,7 @@ class ApiDataLoader {
}
@SubscribeEvent
- fun onStatusBar(event: ProfileJoinEvent) {
+ fun onProfileJoin(event: ProfileJoinEvent) {
currentProfileName = event.name
updateApiData()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt b/src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt
index 7b5df45df..0312342da 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.data
import at.hannibal2.skyhanni.events.LorenzActionBarEvent
import at.hannibal2.skyhanni.events.ProfileApiDataLoadedEvent
+import at.hannibal2.skyhanni.events.ProfileJoinEvent
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.ItemUtils.name
@@ -16,6 +17,7 @@ import java.util.regex.Pattern
class SkillExperience {
private val actionBarPattern = Pattern.compile("(?:.*)§3\\+(?:.*) (.*) \\((.*)\\/(.*)\\)(?:.*)")
+ private val inventoryPattern = Pattern.compile("(?:.*) §e(.*)§6\\/(?:.*)")
@SubscribeEvent
fun onProfileDataLoad(event: ProfileApiDataLoadedEvent) {
@@ -30,6 +32,11 @@ class SkillExperience {
}
@SubscribeEvent
+ fun onProfileJoin(event: ProfileJoinEvent) {
+ skillExp.clear()
+ }
+
+ @SubscribeEvent
fun onActionBar(event: LorenzActionBarEvent) {
if (!LorenzUtils.inSkyBlock) return
@@ -76,8 +83,7 @@ class SkillExperience {
val skillName = split[0].lowercase()
val level = split[1].romanToDecimal()
val baseExp = getExpForLevel(level)
- val pattern = Pattern.compile("(?:.*) §e(.*)§6\\/(?:.*)")
- val matcher = pattern.matcher(line)
+ val matcher = inventoryPattern.matcher(line)
if (matcher.matches()) {
val rawNumber = matcher.group(1)
val overflow = rawNumber.formatNumber()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyBLockLevelGuideHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyBLockLevelGuideHelper.kt
new file mode 100644
index 000000000..634aa5758
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyBLockLevelGuideHelper.kt
@@ -0,0 +1,40 @@
+package at.hannibal2.skyhanni.features.inventory
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.GuiContainerEvent
+import at.hannibal2.skyhanni.utils.InventoryUtils
+import at.hannibal2.skyhanni.utils.ItemUtils.name
+import at.hannibal2.skyhanni.utils.LorenzColor
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.RenderUtils.highlight
+import net.minecraft.client.gui.inventory.GuiChest
+import net.minecraft.inventory.ContainerChest
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class SkyBLockLevelGuideHelper {
+
+ @SubscribeEvent
+ fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) {
+ if (!LorenzUtils.inSkyBlock) return
+ if (!SkyHanniMod.feature.inventory.highlightMissingSkyBlockLevelGuide) return
+
+ if (InventoryUtils.openInventoryName().contains("Guide ➜")) {
+
+ if (event.gui !is GuiChest) return
+ val guiChest = event.gui
+ val chest = guiChest.inventorySlots as ContainerChest
+
+ for (slot in chest.inventorySlots) {
+ if (slot == null) continue
+ if (slot.slotNumber != slot.slotIndex) continue
+ val name = slot.stack?.name ?: continue
+
+ if (name.startsWith("§a✔")) {
+// slot highlight LorenzColor.GREEN
+ } else if (name.startsWith("§c✖")) {
+ slot highlight LorenzColor.RED
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt
index 088836401..275e7173d 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionCounter.kt
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.misc
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.ProfileApiDataLoadedEvent
+import at.hannibal2.skyhanni.events.ProfileJoinEvent
import at.hannibal2.skyhanni.features.bazaar.BazaarApi
import at.hannibal2.skyhanni.features.bazaar.BazaarData
import at.hannibal2.skyhanni.utils.InventoryUtils
@@ -157,6 +158,11 @@ class CollectionCounter {
}
@SubscribeEvent
+ fun onProfileJoin(event: ProfileJoinEvent) {
+ apiCollectionData.clear()
+ }
+
+ @SubscribeEvent
fun onProfileDataLoad(event: ProfileApiDataLoadedEvent) {
val profileData = event.profileData