Casual tidy

This commit is contained in:
Rheon-D
2019-02-08 13:39:02 +09:30
parent 6f93a792bf
commit 5398cce353
6 changed files with 14 additions and 11 deletions

View File

@@ -117,15 +117,18 @@ public class StatusBarsOverlay extends Overlay
offsetRightBarY = (location.getY() - offsetRight.getY()); offsetRightBarY = (location.getY() - offsetRight.getY());
} }
BarRenderer left = plugin.getBarRenderers().get(config.leftBarMode()); BarRenderer left = plugin.getBarRenderers().get(config.leftBarMode());
BarRenderer right = plugin.getBarRenderers().get(config.rightBarMode()); BarRenderer right = plugin.getBarRenderers().get(config.rightBarMode());
if (left != null) if (left != null)
{
left.draw(client, this, g, offsetLeftBarX, offsetLeftBarY, height); left.draw(client, this, g, offsetLeftBarX, offsetLeftBarY, height);
}
if (right != null) if (right != null)
{
right.draw(client, this, g, offsetRightBarX, offsetRightBarY, height); right.draw(client, this, g, offsetRightBarX, offsetRightBarY, height);
}
return null; return null;
} }

View File

@@ -38,6 +38,7 @@ import net.runelite.client.ui.overlay.components.TextComponent;
import java.awt.Color; import java.awt.Color;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Image; import java.awt.Image;
import java.awt.Point;
@RequiredArgsConstructor(access = AccessLevel.PROTECTED) @RequiredArgsConstructor(access = AccessLevel.PROTECTED)
public abstract class BarRenderer public abstract class BarRenderer
@@ -58,7 +59,7 @@ public abstract class BarRenderer
protected final StatusBarsConfig config; protected final StatusBarsConfig config;
protected int maximumValue; protected int maximumValue;
protected int currentValue; protected int currentValue;
protected int heal; protected int restore;
protected Color standardColor; protected Color standardColor;
protected Color restoreColor; protected Color restoreColor;
protected Image icon; protected Image icon;
@@ -88,9 +89,8 @@ public abstract class BarRenderer
if (config.enableCounter()) if (config.enableCounter())
{ {
graphics.setFont(FontManager.getRunescapeSmallFont()); graphics.setFont(FontManager.getRunescapeSmallFont());
TEXT.setColor(Color.WHITE);
TEXT.setText(counterText); TEXT.setText(counterText);
TEXT.setPosition(new java.awt.Point(x + centerText + 1, y + COUNTER_ICON_HEIGHT)); TEXT.setPosition(new Point(x + centerText + 1, y + COUNTER_ICON_HEIGHT));
} }
else else
{ {
@@ -100,7 +100,7 @@ public abstract class BarRenderer
if (config.enableSkillIcon()) if (config.enableSkillIcon())
{ {
graphics.drawImage(icon, x + ICON_AND_COUNTER_OFFSET_X + PADDING, y + ICON_AND_COUNTER_OFFSET_Y - icon.getWidth(null), null); graphics.drawImage(icon, x + ICON_AND_COUNTER_OFFSET_X + PADDING, y + ICON_AND_COUNTER_OFFSET_Y - icon.getWidth(null), null);
TEXT.setPosition(new java.awt.Point(x + centerText + 1, y + SKILL_ICON_HEIGHT)); TEXT.setPosition(new Point(x + centerText + 1, y + SKILL_ICON_HEIGHT));
} }
TEXT.render(graphics); TEXT.render(graphics);
@@ -108,13 +108,13 @@ public abstract class BarRenderer
private void renderRestore(Graphics2D graphics, int x, int y, int height) private void renderRestore(Graphics2D graphics, int x, int y, int height)
{ {
if (heal <= 0) if (restore <= 0)
{ {
return; return;
} }
final int filledCurrentHeight = getBarHeight(maximumValue, currentValue, height); final int filledCurrentHeight = getBarHeight(maximumValue, currentValue, height);
int filledHeight = getBarHeight(maximumValue, heal, height); int filledHeight = getBarHeight(maximumValue, restore, height);
graphics.setColor(restoreColor); graphics.setColor(restoreColor);
if (filledHeight + filledCurrentHeight > height) if (filledHeight + filledCurrentHeight > height)

View File

@@ -55,6 +55,6 @@ public class EnergyRenderer extends BarRenderer
{ {
icon = spriteManager.getSprite(SpriteID.MINIMAP_ORB_RUN_ICON, 0); icon = spriteManager.getSprite(SpriteID.MINIMAP_ORB_RUN_ICON, 0);
currentValue = client.getEnergy(); currentValue = client.getEnergy();
heal = overlay.getRestoreValue("Run Energy"); restore = overlay.getRestoreValue("Run Energy");
} }
} }

View File

@@ -56,7 +56,7 @@ public class HitPointsRenderer extends BarRenderer
{ {
maximumValue = client.getRealSkillLevel(Skill.HITPOINTS); maximumValue = client.getRealSkillLevel(Skill.HITPOINTS);
currentValue = client.getBoostedSkillLevel(Skill.HITPOINTS); currentValue = client.getBoostedSkillLevel(Skill.HITPOINTS);
heal = overlay.getRestoreValue(Skill.HITPOINTS.getName()); restore = overlay.getRestoreValue(Skill.HITPOINTS.getName());
final int poisonState = client.getVar(VarPlayer.IS_POISONED); final int poisonState = client.getVar(VarPlayer.IS_POISONED);

View File

@@ -58,6 +58,6 @@ public class PrayerRenderer extends BarRenderer
maximumValue = client.getRealSkillLevel(Skill.PRAYER); maximumValue = client.getRealSkillLevel(Skill.PRAYER);
currentValue = client.getBoostedSkillLevel(Skill.PRAYER); currentValue = client.getBoostedSkillLevel(Skill.PRAYER);
standardColor = client.getVar(Varbits.QUICK_PRAYER) == 1 ? COLOR_ACTIVE : COLOR_STANDARD; standardColor = client.getVar(Varbits.QUICK_PRAYER) == 1 ? COLOR_ACTIVE : COLOR_STANDARD;
heal = overlay.getRestoreValue(Skill.PRAYER.getName()); restore = overlay.getRestoreValue(Skill.PRAYER.getName());
} }
} }

View File

@@ -55,6 +55,6 @@ public class SpecialAttackRenderer extends BarRenderer
{ {
icon = spriteManager.getSprite(SpriteID.MINIMAP_ORB_SPECIAL_ICON, 0); icon = spriteManager.getSprite(SpriteID.MINIMAP_ORB_SPECIAL_ICON, 0);
currentValue = client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT) / 10; currentValue = client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT) / 10;
heal = 0; restore = 0;
} }
} }