From 3e9b8377f304f1f20de31e620d0ca188366df50b Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sun, 14 Jul 2024 02:17:22 +1000 Subject: Add support for Toxophilite enchant in the combat skill overlay (#1240) --- .../notenoughupdates/overlays/CombatSkillOverlay.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java index 3f2618fe..e04ffe97 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java @@ -47,6 +47,7 @@ public class CombatSkillOverlay private int championXp = -1; private int championXpLast = -1; private final LinkedList killQueue = new LinkedList<>(); + private boolean hasToxophilite = false; private XPInformation.SkillInfo skillInfo = null; private XPInformation.SkillInfo skillInfoLast = null; @@ -113,8 +114,12 @@ public class CombatSkillOverlay kill = ea.getInteger("stats_book"); killQueue.add(0, kill); } + hasToxophilite = false; if (ea.hasKey("champion_combat_xp", 99)) { championXp = (int) ea.getDouble("champion_combat_xp"); + } else if (ea.hasKey("toxophilite_combat_xp", 99)) { + championXp = (int) ea.getDouble("toxophilite_combat_xp"); + hasToxophilite = true; } } } @@ -174,8 +179,6 @@ public class CombatSkillOverlay break; } - String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); - skillInfoLast = skillInfo; var s = NotEnoughUpdates.INSTANCE.config.skillOverlays.combatText; skillInfo = XPInformation.getInstance().getSkillInfo( @@ -255,11 +258,16 @@ public class CombatSkillOverlay lineMap.put(0, EnumChatFormatting.AQUA + "Kills: " + EnumChatFormatting.YELLOW + format.format(counterInterp)); } + String enchantText = "Champion: "; + if (hasToxophilite) { + enchantText = "Toxophilite: "; + } + if (championTier <= 9 && championXp >= 0) { int counterInterp = (int) interp(championXp, championXpLast); lineMap.put( 6, - EnumChatFormatting.AQUA + "Champion: " + EnumChatFormatting.YELLOW + format.format(counterInterp) + "/" + + EnumChatFormatting.AQUA + enchantText + EnumChatFormatting.YELLOW + format.format(counterInterp) + "/" + championTierAmount ); } @@ -267,7 +275,7 @@ public class CombatSkillOverlay int counterInterp = (int) interp(championXp, championXpLast); lineMap.put( 6, - EnumChatFormatting.AQUA + "Champion: " + EnumChatFormatting.YELLOW + format.format(counterInterp) + " " + + EnumChatFormatting.AQUA + enchantText + EnumChatFormatting.YELLOW + format.format(counterInterp) + " " + EnumChatFormatting.RED + championTierAmount ); } -- cgit