@@ -38,7 +38,7 @@ import net.runelite.client.game.ItemManager;
|
|||||||
import net.runelite.client.game.SpriteManager;
|
import net.runelite.client.game.SpriteManager;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public enum GameTimer
|
enum GameTimer
|
||||||
{
|
{
|
||||||
STAMINA(ItemID.STAMINA_POTION4, GameTimerImageType.ITEM, "Stamina", 2, ChronoUnit.MINUTES),
|
STAMINA(ItemID.STAMINA_POTION4, GameTimerImageType.ITEM, "Stamina", 2, ChronoUnit.MINUTES),
|
||||||
ANTIFIRE(ItemID.ANTIFIRE_POTION4, GameTimerImageType.ITEM, "Antifire", 6, ChronoUnit.MINUTES),
|
ANTIFIRE(ItemID.ANTIFIRE_POTION4, GameTimerImageType.ITEM, "Antifire", 6, ChronoUnit.MINUTES),
|
||||||
@@ -101,7 +101,7 @@ public enum GameTimer
|
|||||||
this(imageId, idType, description, null, time, unit);
|
this(imageId, idType, description, null, time, unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BufferedImage getImage(ItemManager itemManager, SpriteManager spriteManager)
|
BufferedImage getImage(ItemManager itemManager, SpriteManager spriteManager)
|
||||||
{
|
{
|
||||||
if (image != null)
|
if (image != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,11 +30,11 @@ import net.runelite.client.plugins.Plugin;
|
|||||||
import net.runelite.client.ui.overlay.infobox.InfoBoxPriority;
|
import net.runelite.client.ui.overlay.infobox.InfoBoxPriority;
|
||||||
import net.runelite.client.ui.overlay.infobox.Timer;
|
import net.runelite.client.ui.overlay.infobox.Timer;
|
||||||
|
|
||||||
public class TimerTimer extends Timer
|
class TimerTimer extends Timer
|
||||||
{
|
{
|
||||||
private final GameTimer timer;
|
private final GameTimer timer;
|
||||||
|
|
||||||
public TimerTimer(GameTimer timer, Plugin plugin, BufferedImage image)
|
TimerTimer(GameTimer timer, Plugin plugin, BufferedImage image)
|
||||||
{
|
{
|
||||||
super(timer.getDuration().toMillis(), ChronoUnit.MILLIS, image, plugin);
|
super(timer.getDuration().toMillis(), ChronoUnit.MILLIS, image, plugin);
|
||||||
this.timer = timer;
|
this.timer = timer;
|
||||||
|
|||||||
@@ -596,7 +596,7 @@ public class TimersPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createGameTimer(GameTimer timer)
|
private void createGameTimer(GameTimer timer)
|
||||||
{
|
{
|
||||||
removeGameTimer(timer);
|
removeGameTimer(timer);
|
||||||
|
|
||||||
@@ -606,7 +606,7 @@ public class TimersPlugin extends Plugin
|
|||||||
infoBoxManager.addInfoBox(t);
|
infoBoxManager.addInfoBox(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeGameTimer(GameTimer timer)
|
private void removeGameTimer(GameTimer timer)
|
||||||
{
|
{
|
||||||
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