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.
@@ -35,11 +35,12 @@ import net.runelite.api.Skill;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class SkillIconManager
|
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;
|
BufferedImage skillImage = null;
|
||||||
|
|
||||||
if (imgCache[skillIdx] != null)
|
if (imgCache[skillIdx] != null)
|
||||||
@@ -49,7 +50,8 @@ public class SkillIconManager
|
|||||||
|
|
||||||
try
|
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);
|
log.debug("Loading skill icon from {}", skillIconPath);
|
||||||
synchronized (ImageIO.class)
|
synchronized (ImageIO.class)
|
||||||
{
|
{
|
||||||
@@ -64,4 +66,10 @@ public class SkillIconManager
|
|||||||
|
|
||||||
return skillImage;
|
return skillImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BufferedImage getSkillImage(Skill skill)
|
||||||
|
{
|
||||||
|
return getSkillImage(skill, false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
runelite-client/src/main/resources/skill_icons_small/agility.png
Normal file
|
After Width: | Height: | Size: 203 B |
BIN
runelite-client/src/main/resources/skill_icons_small/attack.png
Normal file
|
After Width: | Height: | Size: 225 B |
BIN
runelite-client/src/main/resources/skill_icons_small/combat.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 216 B |
BIN
runelite-client/src/main/resources/skill_icons_small/cooking.png
Normal file
|
After Width: | Height: | Size: 220 B |
|
After Width: | Height: | Size: 220 B |
BIN
runelite-client/src/main/resources/skill_icons_small/defence.png
Normal file
|
After Width: | Height: | Size: 190 B |
BIN
runelite-client/src/main/resources/skill_icons_small/farming.png
Normal file
|
After Width: | Height: | Size: 373 B |
|
After Width: | Height: | Size: 240 B |
BIN
runelite-client/src/main/resources/skill_icons_small/fishing.png
Normal file
|
After Width: | Height: | Size: 240 B |
|
After Width: | Height: | Size: 201 B |
|
After Width: | Height: | Size: 222 B |
|
After Width: | Height: | Size: 223 B |
BIN
runelite-client/src/main/resources/skill_icons_small/hunter.png
Normal file
|
After Width: | Height: | Size: 277 B |
BIN
runelite-client/src/main/resources/skill_icons_small/magic.png
Normal file
|
After Width: | Height: | Size: 231 B |
BIN
runelite-client/src/main/resources/skill_icons_small/mining.png
Normal file
|
After Width: | Height: | Size: 212 B |
BIN
runelite-client/src/main/resources/skill_icons_small/overall.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
runelite-client/src/main/resources/skill_icons_small/prayer.png
Normal file
|
After Width: | Height: | Size: 321 B |
BIN
runelite-client/src/main/resources/skill_icons_small/ranged.png
Normal file
|
After Width: | Height: | Size: 258 B |
|
After Width: | Height: | Size: 251 B |
BIN
runelite-client/src/main/resources/skill_icons_small/slayer.png
Normal file
|
After Width: | Height: | Size: 546 B |
|
After Width: | Height: | Size: 237 B |
|
After Width: | Height: | Size: 232 B |
|
After Width: | Height: | Size: 169 B |
|
After Width: | Height: | Size: 240 B |