aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md5
-rw-r--r--FEATURES.md1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt55
5 files changed, 70 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b19120cd8..6e357c66e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,8 +3,9 @@
## Version 0.13
### Features
-+ Player Rank Hider works now with all messages
-+ Add two more chat filter categories: Powder Mining and Winter Gifts
++ Player Rank Hider works now with all messages.
++ Add two more chat filter categories: Powder Mining and Winter Gifts.
++ Add catacombs class level color to party finder.
### Removals
- Removed additional settings for the chat design, like channel prefix and skyblock level
diff --git a/FEATURES.md b/FEATURES.md
index 7add9071c..e9a20ac32 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -39,6 +39,7 @@
- Highlight Skeleton Skulls in dungeon when combining into a skeleton in orange color (not useful combined with feature Hide Skeleton Skull)
- Hide the damage, ability damage and defence orbs that spawn when the healer is killing mobs.
- Hide the golden fairy that follows the healer in dungeon.
+- Catacombs class level color in party finder inventory.
## Inventory
- Not Clickable Items: Mark items gray in your inventory when they are not supposed to be moved in certain GUIs (in NPC sell inventories, ender chests and backpacks, salvaging in the dungeon hub, player trade, bazaar, action house, accessory bag, sack of sacks, fishing bag, potion bag, chests on the private island, attribute fusion and equipment GUI)
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
index a20ce7bc0..b3622499f 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
@@ -164,6 +164,7 @@ public class SkyHanniMod {
registerEvent(new GriffinBurrowParticleFinder());
registerEvent(new BurrowWarpHelper());
registerEvent(new HighlightBonzoMasks());
+ registerEvent(new DungeonLevelColor());
Commands.INSTANCE.init();
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java b/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java
index 40f58df81..f706446a1 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java
@@ -149,6 +149,16 @@ public class Dungeon {
@ConfigAccordionId(id = 5)
public Position copilotPos = new Position(10, 10, false, true);
+ @ConfigOption(name = "Party Finder", desc = "")
+ @ConfigEditorAccordion(id = 6)
+ public boolean partyFinder = false;
+
+ @Expose
+ @ConfigOption(name = "Colored Class Level", desc = "Show the class levels in party finder in colors.")
+ @ConfigAccordionId(id = 6)
+ @ConfigEditorBoolean
+ public boolean partyFinderColoredClassLevel = true;
+
@Expose
@ConfigOption(name = "Moving Skeleton Skulls", desc = "Highlight Skeleton Skulls when combining into a " +
"Skeletor in orange color (not useful combined with feature Hide Skeleton Skull)")
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt
new file mode 100644
index 000000000..796f93ef4
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLevelColor.kt
@@ -0,0 +1,55 @@
+package at.hannibal2.skyhanni.features.dungeon
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.utils.ItemUtils.getLore
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import net.minecraft.client.Minecraft
+import net.minecraft.client.gui.inventory.GuiChest
+import net.minecraft.inventory.ContainerChest
+import net.minecraftforge.event.entity.player.ItemTooltipEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import java.util.regex.Pattern
+
+class DungeonLevelColor {
+
+ private val pattern = Pattern.compile(" §.(.*)§f: §e(.*)§b \\(§e(.*)§b\\)")
+
+ @SubscribeEvent
+ fun onItemTooltip(event: ItemTooltipEvent) {
+ if (!LorenzUtils.inSkyblock) return
+ if (!SkyHanniMod.feature.dungeon.partyFinderColoredClassLevel) return
+
+ if (event.toolTip == null) return
+ val guiChest = Minecraft.getMinecraft().currentScreen
+ if (guiChest !is GuiChest) return
+ val chest = guiChest.inventorySlots as ContainerChest
+ val chestName = chest.lowerChestInventory.displayName.unformattedText.trim()
+ if (chestName != "Party Finder") return
+
+ val stack = event.itemStack
+ var index = 0
+ for (line in stack.getLore()) {
+ index++
+ val matcher = pattern.matcher(line)
+ if (!matcher.matches()) continue
+
+ val playerName = matcher.group(1)
+ val className = matcher.group(2)
+ val level = matcher.group(3).toInt()
+ val color = getColor(level)
+ event.toolTip[index] = " §b$playerName§f: §e$className $color$level"
+ }
+ }
+
+ private fun getColor(level: Int): String {
+ if (level >= 50) return "§c§l"
+ if (level >= 45) return "§c"
+ if (level >= 40) return "§d"
+ if (level >= 35) return "§b"
+ if (level >= 30) return "§5"
+ if (level >= 25) return "§9"
+ if (level >= 20) return "§a"
+ if (level >= 10) return "§f"
+ return "§7"
+ }
+}