combat level: show next levels needed even past 99

In some cases, it is not possible to get a combat level solely from leveling
any one stat. If this happened previously the overlay would show an empty
tooltip due to the levels required all being >99. This just shows the levels
required even if it surpasses 99.
This commit is contained in:
Adam
2020-11-20 19:44:17 -05:00
parent 9baf4c4a45
commit 6f60750c31
2 changed files with 87 additions and 6 deletions

View File

@@ -24,6 +24,7 @@
*/
package net.runelite.client.plugins.combatlevel;
import com.google.common.annotations.VisibleForTesting;
import net.runelite.api.Client;
import net.runelite.api.Experience;
import net.runelite.api.Skill;
@@ -81,7 +82,8 @@ class CombatLevelOverlay extends Overlay
return null;
}
private String getLevelsUntilTooltip()
@VisibleForTesting
String getLevelsUntilTooltip()
{
// grab combat skills from player
int attackLevel = client.getRealSkillLevel(Skill.ATTACK);
@@ -108,23 +110,23 @@ class CombatLevelOverlay extends Overlay
StringBuilder sb = new StringBuilder();
sb.append(ColorUtil.wrapWithColorTag("Next combat level:</br>", COMBAT_LEVEL_COLOUR));
if ((attackLevel + strengthLevel + meleeNeed) <= Experience.MAX_REAL_LEVEL * 2)
if ((attackLevel + strengthLevel) < Experience.MAX_REAL_LEVEL * 2)
{
sb.append(meleeNeed).append(" Attack/Strength</br>");
}
if ((hitpointsLevel + defenceLevel + hpDefNeed) <= Experience.MAX_REAL_LEVEL * 2)
if ((hitpointsLevel + defenceLevel) < Experience.MAX_REAL_LEVEL * 2)
{
sb.append(hpDefNeed).append(" Defence/Hitpoints</br>");
}
if ((rangeLevel + rangeNeed) <= Experience.MAX_REAL_LEVEL)
if (rangeLevel < Experience.MAX_REAL_LEVEL)
{
sb.append(rangeNeed).append(" Ranged</br>");
}
if ((magicLevel + magicNeed) <= Experience.MAX_REAL_LEVEL)
if (magicLevel < Experience.MAX_REAL_LEVEL)
{
sb.append(magicNeed).append(" Magic</br>");
}
if ((prayerLevel + prayerNeed) <= Experience.MAX_REAL_LEVEL)
if (prayerLevel < Experience.MAX_REAL_LEVEL)
{
sb.append(prayerNeed).append(" Prayer");
}