diff options
| author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2024-07-14 02:17:22 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-13 18:17:22 +0200 |
| commit | 3e9b8377f304f1f20de31e620d0ca188366df50b (patch) | |
| tree | 38c093cfad128dd55d2792b392f1869a5a0b0064 | |
| parent | d64cac8d58c2007ec31260b39b0f3a459e430bcb (diff) | |
| download | notenoughupdates-3e9b8377f304f1f20de31e620d0ca188366df50b.tar.gz notenoughupdates-3e9b8377f304f1f20de31e620d0ca188366df50b.tar.bz2 notenoughupdates-3e9b8377f304f1f20de31e620d0ca188366df50b.zip | |
Add support for Toxophilite enchant in the combat skill overlay (#1240)
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java | 16 |
1 files 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<Integer> 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 ); } |
