hiscore panel: fix total level breakage

This commit is contained in:
Lotto
2018-04-16 21:58:26 +02:00
parent f84f0b525b
commit 0c14613fa4
2 changed files with 36 additions and 24 deletions

View File

@@ -27,29 +27,29 @@ package net.runelite.http.api.hiscore;
public enum HiscoreSkill public enum HiscoreSkill
{ {
OVERALL("Overall"), OVERALL("Overall"),
ATTACK("Attack"), ATTACK("Attack", true),
DEFENCE("Defence"), DEFENCE("Defence", true),
STRENGTH("Strength"), STRENGTH("Strength", true),
HITPOINTS("Hitpoints"), HITPOINTS("Hitpoints", true),
RANGED("Ranged"), RANGED("Ranged", true),
PRAYER("Prayer"), PRAYER("Prayer", true),
MAGIC("Magic"), MAGIC("Magic", true),
COOKING("Cooking"), COOKING("Cooking", true),
WOODCUTTING("Woodcutting"), WOODCUTTING("Woodcutting", true),
FLETCHING("Fletching"), FLETCHING("Fletching", true),
FISHING("Fishing"), FISHING("Fishing", true),
FIREMAKING("Firemaking"), FIREMAKING("Firemaking", true),
CRAFTING("Crafting"), CRAFTING("Crafting", true),
SMITHING("Smithing"), SMITHING("Smithing", true),
MINING("Mining"), MINING("Mining", true),
HERBLORE("Herblore"), HERBLORE("Herblore", true),
AGILITY("Agility"), AGILITY("Agility", true),
THIEVING("Thieving"), THIEVING("Thieving", true),
SLAYER("Slayer"), SLAYER("Slayer", true),
FARMING("Farming"), FARMING("Farming", true),
RUNECRAFT("Runecraft"), RUNECRAFT("Runecraft", true),
HUNTER("Hunter"), HUNTER("Hunter", true),
CONSTRUCTION("Construction"), CONSTRUCTION("Construction", true),
CLUE_SCROLL_EASY("Clue Scrolls (easy)"), CLUE_SCROLL_EASY("Clue Scrolls (easy)"),
CLUE_SCROLL_MEDIUM("Clue Scrolls (medium)"), CLUE_SCROLL_MEDIUM("Clue Scrolls (medium)"),
CLUE_SCROLL_ALL("Clue Scrolls (all)"), CLUE_SCROLL_ALL("Clue Scrolls (all)"),
@@ -61,14 +61,26 @@ public enum HiscoreSkill
CLUE_SCROLL_MASTER("Clue Scrolls (master)"); CLUE_SCROLL_MASTER("Clue Scrolls (master)");
private final String name; private final String name;
private final boolean virtualLevels;
HiscoreSkill(String name) HiscoreSkill(String name)
{
this(name, false);
}
HiscoreSkill(String name, boolean virtualLevels)
{ {
this.name = name; this.name = name;
this.virtualLevels = virtualLevels;
} }
public String getName() public String getName()
{ {
return name; return name;
} }
public boolean hasVirtualLevels()
{
return virtualLevels;
}
} }

View File

@@ -550,7 +550,7 @@ public class HiscorePanel extends PluginPanel
Skill s = result.getSkill(skill); Skill s = result.getSkill(skill);
int level; int level;
if (config.virtualLevels() && s.getExperience() >= 0) if (config.virtualLevels() && skill.hasVirtualLevels())
{ {
level = Experience.getLevelForXp((int) s.getExperience()); level = Experience.getLevelForXp((int) s.getExperience());
} }