Merge pull request #517 from SomeoneWithAnInternetConnection/boosts-fixes

Fix NullPointerExceptions from Boosts Plugin
This commit is contained in:
Tomas Slusny
2018-02-02 11:49:51 +01:00
committed by GitHub
2 changed files with 24 additions and 8 deletions

View File

@@ -47,6 +47,7 @@ import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
class BoostsOverlay extends Overlay
{
private final BufferedImage[] imgCache = new BufferedImage[Skill.values().length - 1];
@Getter
private final BoostIndicator[] indicators = new BoostIndicator[Skill.values().length - 1];
@@ -56,6 +57,7 @@ class BoostsOverlay extends Overlay
@Inject
private BoostsPlugin plugin;
private PanelComponent panelComponent;
@Inject

View File

@@ -84,6 +84,15 @@ public class BoostsPlugin extends Plugin
return boostsOverlay;
}
@Override
protected void startUp()
{
if (config.enabled())
{
updateShownSkills(config.enableSkill());
}
}
@Subscribe
public void onConfigChanged(ConfigChanged event)
{
@@ -92,14 +101,7 @@ public class BoostsPlugin extends Plugin
return;
}
if (config.enableSkill())
{
shownSkills = ObjectArrays.concat(COMBAT, SKILLING, Skill.class);
}
else
{
shownSkills = COMBAT;
}
updateShownSkills(config.enableSkill());
if (event.getKey().equals("displayIndicators"))
{
@@ -121,4 +123,16 @@ public class BoostsPlugin extends Plugin
}
}
}
private void updateShownSkills(boolean showSkillingSkills)
{
if (showSkillingSkills)
{
shownSkills = ObjectArrays.concat(COMBAT, SKILLING, Skill.class);
}
else
{
shownSkills = COMBAT;
}
}
}