wintertodt plugin: add option to disable overlay
Co-authored-by: Jonathan Taylor <jonathan@taylorhq.com> Co-authored-by: Pharros <thepharros@gmail.com>
This commit is contained in:
@@ -37,6 +37,17 @@ import net.runelite.client.plugins.wintertodt.config.WintertodtNotifyDamage;
|
|||||||
@ConfigGroup("wintertodt")
|
@ConfigGroup("wintertodt")
|
||||||
public interface WintertodtConfig extends Config
|
public interface WintertodtConfig extends Config
|
||||||
{
|
{
|
||||||
|
@ConfigItem(
|
||||||
|
position = 0,
|
||||||
|
keyName = "showOverlay",
|
||||||
|
name = "Show Overlay",
|
||||||
|
description = "Toggles the status overlay"
|
||||||
|
)
|
||||||
|
default boolean showOverlay()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 1,
|
position = 1,
|
||||||
keyName = "damageNotificationColor",
|
keyName = "damageNotificationColor",
|
||||||
|
|||||||
@@ -40,12 +40,14 @@ import net.runelite.client.ui.overlay.components.TitleComponent;
|
|||||||
class WintertodtOverlay extends OverlayPanel
|
class WintertodtOverlay extends OverlayPanel
|
||||||
{
|
{
|
||||||
private final WintertodtPlugin plugin;
|
private final WintertodtPlugin plugin;
|
||||||
|
private final WintertodtConfig wintertodtConfig;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private WintertodtOverlay(WintertodtPlugin plugin)
|
private WintertodtOverlay(WintertodtPlugin plugin, WintertodtConfig wintertodtConfig)
|
||||||
{
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
this.wintertodtConfig = wintertodtConfig;
|
||||||
setPosition(OverlayPosition.BOTTOM_LEFT);
|
setPosition(OverlayPosition.BOTTOM_LEFT);
|
||||||
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Wintertodt overlay"));
|
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Wintertodt overlay"));
|
||||||
}
|
}
|
||||||
@@ -53,7 +55,7 @@ class WintertodtOverlay extends OverlayPanel
|
|||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
if (!plugin.isInWintertodt())
|
if (!plugin.isInWintertodt() || !wintertodtConfig.showOverlay())
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user