Skip to content

Commit

Permalink
boosts: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Jun 19, 2022
1 parent fcd869f commit 1d616c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import net.runelite.client.ui.overlay.infobox.InfoBox;
import net.runelite.client.ui.overlay.infobox.InfoBoxPriority;

public class BoostIndicator extends InfoBox
class BoostIndicator extends InfoBox
{
private final BoostsPlugin plugin;
private final BoostsConfig config;
Expand Down Expand Up @@ -87,7 +87,7 @@ public Color getTextColor()
@Override
public boolean render()
{
return config.displayInfoboxes() && plugin.canShowBoosts() && plugin.getSkillsToDisplay().contains(getSkill());
return plugin.canShowBoosts() && plugin.getSkillsToDisplay().contains(getSkill()) && config.displayInfoboxes();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ private BoostsOverlay(Client client, BoostsConfig config, BoostsPlugin plugin)
@Override
public Dimension render(Graphics2D graphics)
{
if (config.displayInfoboxes())
final Set<Skill> boostedSkills = plugin.getSkillsToDisplay();
if (boostedSkills.isEmpty() || !config.displayPanel())
{
return null;
}

int nextChange = plugin.getChangeDownTicks();

if (nextChange != -1)
{
panelComponent.getChildren().add(LineComponent.builder()
Expand All @@ -77,7 +77,6 @@ public Dimension render(Graphics2D graphics)
}

nextChange = plugin.getChangeUpTicks();

if (nextChange != -1)
{
panelComponent.getChildren().add(LineComponent.builder()
Expand All @@ -86,13 +85,6 @@ public Dimension render(Graphics2D graphics)
.build());
}

final Set<Skill> boostedSkills = plugin.getSkillsToDisplay();

if (boostedSkills.isEmpty())
{
return super.render(graphics);
}

if (plugin.canShowBoosts())
{
for (Skill skill : boostedSkills)
Expand Down Expand Up @@ -136,6 +128,5 @@ private Color getTextColor(int boost)
}

return boost <= config.boostThreshold() ? Color.YELLOW : Color.GREEN;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import net.runelite.client.ui.overlay.infobox.InfoBox;
import net.runelite.client.ui.overlay.infobox.InfoBoxPriority;

public class StatChangeIndicator extends InfoBox
class StatChangeIndicator extends InfoBox
{
private final boolean up;
private final BoostsPlugin plugin;
Expand Down Expand Up @@ -61,6 +61,6 @@ public Color getTextColor()
public boolean render()
{
final int time = up ? plugin.getChangeUpTicks() : plugin.getChangeDownTicks();
return config.displayInfoboxes() && time != -1;
return time != -1 && config.displayInfoboxes();
}
}

0 comments on commit 1d616c9

Please sign in to comment.