Merge pull request #7993 from deathbeam/get-tooltip-infobox
Cleanup infobox code
This commit is contained in:
@@ -32,7 +32,7 @@ public class CannonCounter extends InfoBox
|
||||
{
|
||||
private final CannonPlugin plugin;
|
||||
|
||||
public CannonCounter(BufferedImage img, CannonPlugin plugin)
|
||||
CannonCounter(BufferedImage img, CannonPlugin plugin)
|
||||
{
|
||||
super(img, plugin);
|
||||
this.plugin = plugin;
|
||||
|
||||
@@ -32,7 +32,7 @@ public class KingdomCounter extends Counter
|
||||
{
|
||||
private final KingdomPlugin plugin;
|
||||
|
||||
public KingdomCounter(BufferedImage image, KingdomPlugin plugin)
|
||||
KingdomCounter(BufferedImage image, KingdomPlugin plugin)
|
||||
{
|
||||
super(image, plugin, plugin.getFavor());
|
||||
this.plugin = plugin;
|
||||
|
||||
@@ -31,7 +31,7 @@ import net.runelite.client.ui.overlay.infobox.Counter;
|
||||
|
||||
public class GraveyardCounter extends Counter
|
||||
{
|
||||
public GraveyardCounter(BufferedImage image, Plugin plugin)
|
||||
GraveyardCounter(BufferedImage image, Plugin plugin)
|
||||
{
|
||||
super(image, plugin, 0);
|
||||
}
|
||||
|
||||
@@ -26,36 +26,23 @@ package net.runelite.client.plugins.nightmarezone;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.image.BufferedImage;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.ui.overlay.infobox.Counter;
|
||||
|
||||
@Setter
|
||||
public class AbsorptionCounter extends Counter
|
||||
{
|
||||
@Getter
|
||||
@Setter
|
||||
private int threshold;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private Color aboveThresholdColor = Color.GREEN;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private Color belowThresholdColor = Color.RED;
|
||||
|
||||
public AbsorptionCounter(BufferedImage image, Plugin plugin, int absorption, int threshold)
|
||||
AbsorptionCounter(BufferedImage image, Plugin plugin, int absorption, int threshold)
|
||||
{
|
||||
super(image, plugin, absorption);
|
||||
this.threshold = threshold;
|
||||
}
|
||||
|
||||
public void setAbsorption(int absorption)
|
||||
{
|
||||
setCount(absorption);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getTextColor()
|
||||
{
|
||||
|
||||
@@ -129,7 +129,7 @@ class NightmareZoneOverlay extends Overlay
|
||||
}
|
||||
else
|
||||
{
|
||||
absorptionCounter.setAbsorption(absorptionPoints);
|
||||
absorptionCounter.setCount(absorptionPoints);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,9 +29,9 @@ import net.runelite.client.ui.overlay.infobox.Counter;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
public class TaskCounter extends Counter
|
||||
class TaskCounter extends Counter
|
||||
{
|
||||
public TaskCounter(BufferedImage img, Plugin plugin, int amount)
|
||||
TaskCounter(BufferedImage img, Plugin plugin, int amount)
|
||||
{
|
||||
super(img, plugin, amount);
|
||||
}
|
||||
|
||||
@@ -26,24 +26,25 @@ package net.runelite.client.ui.overlay.infobox;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Image;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
|
||||
public abstract class InfoBox
|
||||
{
|
||||
@Getter
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private final Plugin plugin;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private Image image;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
private Image scaledImage;
|
||||
|
||||
@Getter
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@Setter
|
||||
private InfoBoxPriority priority;
|
||||
|
||||
|
||||
@@ -31,9 +31,11 @@ import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
|
||||
@Getter
|
||||
@ToString
|
||||
public class Timer extends InfoBox
|
||||
{
|
||||
private final Instant startTime;
|
||||
@@ -51,12 +53,6 @@ public class Timer extends InfoBox
|
||||
endTime = startTime.plus(duration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Timer{" + "startTime=" + startTime + ", endTime=" + endTime + ", duration=" + duration + '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user