Add timer tooltips
This commit is contained in:
@@ -38,29 +38,29 @@ import net.runelite.api.GraphicID;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public enum GameTimer
|
public enum GameTimer
|
||||||
{
|
{
|
||||||
STAMINA("stamina", 2, ChronoUnit.MINUTES),
|
STAMINA("stamina", "Stamina", 2, ChronoUnit.MINUTES),
|
||||||
ANTIFIRE("antifire", 6, ChronoUnit.MINUTES),
|
ANTIFIRE("antifire", "Antifire", 6, ChronoUnit.MINUTES),
|
||||||
EXANTIFIRE("exantifire", 12, ChronoUnit.MINUTES),
|
EXANTIFIRE("exantifire", "Extended antifire", 12, ChronoUnit.MINUTES),
|
||||||
OVERLOAD("overload", 5, ChronoUnit.MINUTES),
|
OVERLOAD("overload", "Overload", 5, ChronoUnit.MINUTES),
|
||||||
CANNON("cannon", 25, ChronoUnit.MINUTES),
|
CANNON("cannon", "Cannon", 25, ChronoUnit.MINUTES),
|
||||||
MAGICIMBUE("magicimbue", 15, ChronoUnit.SECONDS),
|
MAGICIMBUE("magicimbue", "Magic imbue", 15, ChronoUnit.SECONDS),
|
||||||
FULLTB("teleblock", 5, ChronoUnit.MINUTES),
|
FULLTB("teleblock", "Full Teleblock", 5, ChronoUnit.MINUTES),
|
||||||
HALFTB("teleblock", 150, ChronoUnit.SECONDS),
|
HALFTB("teleblock", "Half Teleblock", 150, ChronoUnit.SECONDS),
|
||||||
SUPERANTIVENOM("antivenom", 3, ChronoUnit.MINUTES),
|
SUPERANTIVENOM("antivenom", "Anti-venom+", 3, ChronoUnit.MINUTES),
|
||||||
SUPERANTIFIRE("superantifire", 2, ChronoUnit.MINUTES),
|
SUPERANTIFIRE("superantifire", "Super antifire", 2, ChronoUnit.MINUTES),
|
||||||
ANTIDOTEPLUSPLUS("antidoteplusplus", 12, ChronoUnit.MINUTES),
|
ANTIDOTEPLUSPLUS("antidoteplusplus", "Antidote++", 12, ChronoUnit.MINUTES),
|
||||||
BIND("bind", GraphicID.BIND, 5, ChronoUnit.SECONDS),
|
BIND("bind", "Bind", GraphicID.BIND, 5, ChronoUnit.SECONDS),
|
||||||
HALFBIND("bind", GraphicID.BIND, 2500, ChronoUnit.MILLIS),
|
HALFBIND("bind", "Half Bind", GraphicID.BIND, 2500, ChronoUnit.MILLIS),
|
||||||
SNARE("snare", GraphicID.SNARE, 10, ChronoUnit.SECONDS),
|
SNARE("snare", "Snare", GraphicID.SNARE, 10, ChronoUnit.SECONDS),
|
||||||
HALFSNARE("snare", GraphicID.SNARE, 5, ChronoUnit.SECONDS),
|
HALFSNARE("snare", "Half Snare", GraphicID.SNARE, 5, ChronoUnit.SECONDS),
|
||||||
ENTANGLE("entangle", GraphicID.ENTANGLE, 15, ChronoUnit.SECONDS),
|
ENTANGLE("entangle", "Engangle", GraphicID.ENTANGLE, 15, ChronoUnit.SECONDS),
|
||||||
HALFENTANGLE("entangle", GraphicID.ENTANGLE, 7500, ChronoUnit.MILLIS),
|
HALFENTANGLE("entangle", "Half Entangle", GraphicID.ENTANGLE, 7500, ChronoUnit.MILLIS),
|
||||||
ICERUSH("icerush", GraphicID.ICE_RUSH, 5, ChronoUnit.SECONDS),
|
ICERUSH("icerush", "Ice rush", GraphicID.ICE_RUSH, 5, ChronoUnit.SECONDS),
|
||||||
ICEBURST("iceburst", GraphicID.ICE_BURST, 10, ChronoUnit.SECONDS),
|
ICEBURST("iceburst", "Ice burst", GraphicID.ICE_BURST, 10, ChronoUnit.SECONDS),
|
||||||
ICEBLITZ("iceblitz", GraphicID.ICE_BLITZ, 15, ChronoUnit.SECONDS),
|
ICEBLITZ("iceblitz", "Ice blitz", GraphicID.ICE_BLITZ, 15, ChronoUnit.SECONDS),
|
||||||
ICEBARRAGE("icebarrage", GraphicID.ICE_BARRAGE, 20, ChronoUnit.SECONDS),
|
ICEBARRAGE("icebarrage", "Ice barrage", GraphicID.ICE_BARRAGE, 20, ChronoUnit.SECONDS),
|
||||||
IMBUEDHEART("imbuedheart", GraphicID.IMBUED_HEART, 420, ChronoUnit.SECONDS),
|
IMBUEDHEART("imbuedheart", "Imbued heart", GraphicID.IMBUED_HEART, 420, ChronoUnit.SECONDS),
|
||||||
VENGEANCE("vengeance", GraphicID.VENGEANCE, 30, ChronoUnit.SECONDS);
|
VENGEANCE("vengeance", "Vengeance", GraphicID.VENGEANCE, 30, ChronoUnit.SECONDS);
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final String imageResource;
|
private final String imageResource;
|
||||||
@@ -68,19 +68,22 @@ public enum GameTimer
|
|||||||
private final Duration duration;
|
private final Duration duration;
|
||||||
@Getter
|
@Getter
|
||||||
private final Integer graphicId;
|
private final Integer graphicId;
|
||||||
|
@Getter
|
||||||
|
private final String description;
|
||||||
|
|
||||||
private BufferedImage image;
|
private BufferedImage image;
|
||||||
|
|
||||||
GameTimer(String imageResource, Integer graphicId, long time, ChronoUnit unit)
|
GameTimer(String imageResource, String description, Integer graphicId, long time, ChronoUnit unit)
|
||||||
{
|
{
|
||||||
this.imageResource = imageResource;
|
this.imageResource = imageResource;
|
||||||
|
this.description = description;
|
||||||
this.graphicId = graphicId;
|
this.graphicId = graphicId;
|
||||||
this.duration = Duration.of(time, unit);
|
this.duration = Duration.of(time, unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
GameTimer(String imageResource, long time, ChronoUnit unit)
|
GameTimer(String imageResource, String description, long time, ChronoUnit unit)
|
||||||
{
|
{
|
||||||
this(imageResource, null, time, unit);
|
this(imageResource, description, null, time, unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BufferedImage getImage()
|
public BufferedImage getImage()
|
||||||
|
|||||||
@@ -336,6 +336,7 @@ public class TimersPlugin extends Plugin
|
|||||||
removeGameTimer(timer);
|
removeGameTimer(timer);
|
||||||
|
|
||||||
TimerTimer t = new TimerTimer(timer);
|
TimerTimer t = new TimerTimer(timer);
|
||||||
|
t.setTooltip(timer.getDescription());
|
||||||
infoBoxManager.addInfoBox(t);
|
infoBoxManager.addInfoBox(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,4 +344,4 @@ public class TimersPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
infoBoxManager.removeIf(t -> t instanceof TimerTimer && ((TimerTimer) t).getTimer() == timer);
|
infoBoxManager.removeIf(t -> t instanceof TimerTimer && ((TimerTimer) t).getTimer() == timer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user