Expanded SkillIconManager to include smaller versions

Needed small icons to use for the Skill Calc redesign, decided to expand
the skill icon manager to include these, created a new folder in the
resources with the small png's.
This commit is contained in:
Ruben Amendoeira
2018-05-21 17:17:49 +01:00
parent 2d6dc4428f
commit 48368019e6
26 changed files with 12 additions and 4 deletions

View File

@@ -35,11 +35,12 @@ import net.runelite.api.Skill;
@Slf4j
public class SkillIconManager
{
private final BufferedImage[] imgCache = new BufferedImage[Skill.values().length];
// * 2 to account for the small version of each icon
private final BufferedImage[] imgCache = new BufferedImage[Skill.values().length * 2];
public BufferedImage getSkillImage(Skill skill)
public BufferedImage getSkillImage(Skill skill, boolean small)
{
int skillIdx = skill.ordinal();
int skillIdx = skill.ordinal() + (small ? Skill.values().length : 0);
BufferedImage skillImage = null;
if (imgCache[skillIdx] != null)
@@ -49,7 +50,8 @@ public class SkillIconManager
try
{
String skillIconPath = "/skill_icons/" + skill.getName().toLowerCase() + ".png";
String skillIconPath = (small ? "/skill_icons_small/" : "/skill_icons/")
+ skill.getName().toLowerCase() + ".png";
log.debug("Loading skill icon from {}", skillIconPath);
synchronized (ImageIO.class)
{
@@ -64,4 +66,10 @@ public class SkillIconManager
return skillImage;
}
public BufferedImage getSkillImage(Skill skill)
{
return getSkillImage(skill, false);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B