babyhydra: These vars aren't constants

This commit is contained in:
sdburns1998
2019-07-07 14:32:46 +02:00
parent 00de080ac2
commit 19c788415f

View File

@@ -47,8 +47,8 @@ public class BabyHydraPrayOverlay extends Overlay
private final BabyHydraPlugin plugin;
private static final Color NOT_ACTIVATED_BACKGROUND_COLOR = new Color(150, 0, 0, 150);
private BufferedImage PRAY_MAGE;
private BufferedImage PRAY_RANGED;
private BufferedImage prayMage;
private BufferedImage prayRanged;
private final PanelComponent imagePanelComponent = new PanelComponent();
@Inject
@@ -69,13 +69,13 @@ public class BabyHydraPrayOverlay extends Overlay
@Override
public Dimension render(Graphics2D graphics)
{
if (PRAY_MAGE == null)
if (prayMage == null)
{
PRAY_MAGE = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MAGIC, 0);
prayMage = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MAGIC, 0);
}
if (PRAY_RANGED == null)
if (prayRanged == null)
{
PRAY_RANGED = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MISSILES, 0);
prayRanged = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MISSILES, 0);
}
if (plugin.getHydra() != null && plugin.getHydras().containsKey(plugin.getHydra().getIndex()))
@@ -89,7 +89,7 @@ public class BabyHydraPrayOverlay extends Overlay
if (val == 3)
{
imagePanelComponent.getChildren().clear();
imagePanelComponent.getChildren().add(new ImageComponent(PRAY_MAGE));
imagePanelComponent.getChildren().add(new ImageComponent(prayMage));
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MAGIC)
? ComponentConstants.STANDARD_BACKGROUND_COLOR
: NOT_ACTIVATED_BACKGROUND_COLOR);
@@ -99,7 +99,7 @@ public class BabyHydraPrayOverlay extends Overlay
else
{
imagePanelComponent.getChildren().clear();
imagePanelComponent.getChildren().add(new ImageComponent(PRAY_RANGED));
imagePanelComponent.getChildren().add(new ImageComponent(prayRanged));
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MISSILES)
? ComponentConstants.STANDARD_BACKGROUND_COLOR
: NOT_ACTIVATED_BACKGROUND_COLOR);
@@ -112,7 +112,7 @@ public class BabyHydraPrayOverlay extends Overlay
if (val == 3)
{
imagePanelComponent.getChildren().clear();
imagePanelComponent.getChildren().add(new ImageComponent(PRAY_RANGED));
imagePanelComponent.getChildren().add(new ImageComponent(prayRanged));
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MISSILES)
? ComponentConstants.STANDARD_BACKGROUND_COLOR
: NOT_ACTIVATED_BACKGROUND_COLOR);
@@ -122,7 +122,7 @@ public class BabyHydraPrayOverlay extends Overlay
else
{
imagePanelComponent.getChildren().clear();
imagePanelComponent.getChildren().add(new ImageComponent(PRAY_MAGE));
imagePanelComponent.getChildren().add(new ImageComponent(prayMage));
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MAGIC)
? ComponentConstants.STANDARD_BACKGROUND_COLOR
: NOT_ACTIVATED_BACKGROUND_COLOR);