Skip to content

Commit

Permalink
status bars: use skill icon manager cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Nov 4, 2024
1 parent 14c873e commit 784f932
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ class StatusBarsOverlay extends Overlay
private final StatusBarsPlugin plugin;
private final StatusBarsConfig config;
private final ItemStatChangesService itemStatService;
private final SkillIconManager skillIconManager;
private final SpriteManager spriteManager;

private final Image prayerIcon;
private final Image firemakingIcon;
private final Image heartDisease;
private final Image heartPoison;
private final Image heartVenom;
Expand All @@ -102,10 +101,9 @@ private StatusBarsOverlay(Client client, StatusBarsPlugin plugin, StatusBarsConf
this.plugin = plugin;
this.config = config;
this.itemStatService = itemstatservice;
this.skillIconManager = skillIconManager;
this.spriteManager = spriteManager;

prayerIcon = skillIconManager.getSkillImage(Skill.PRAYER, true);
firemakingIcon = skillIconManager.getSkillImage(Skill.FIREMAKING, true);
heartDisease = ImageUtil.loadImageResource(AlternateSprites.class, AlternateSprites.DISEASE_HEART);
heartPoison = ImageUtil.loadImageResource(AlternateSprites.class, AlternateSprites.POISON_HEART);
heartVenom = ImageUtil.loadImageResource(AlternateSprites.class, AlternateSprites.VENOM_HEART);
Expand Down Expand Up @@ -188,7 +186,7 @@ private void initRenderers()
return prayerColor;
},
() -> PRAYER_HEAL_COLOR,
() -> prayerIcon
() -> skillIconManager.getSkillImage(Skill.PRAYER, true)
));
barRenderers.put(StatusBarsConfig.BarMode.RUN_ENERGY, new BarRenderer(
() -> MAX_RUN_ENERGY_VALUE,
Expand Down Expand Up @@ -222,7 +220,7 @@ private void initRenderers()
() -> 0,
() -> new Color(244, 97, 0),
() -> null,
() -> firemakingIcon
() -> skillIconManager.getSkillImage(Skill.FIREMAKING, true)
));
}

Expand Down

0 comments on commit 784f932

Please sign in to comment.