corp: Add toggle for dark energy core highlighting (#12462)

This commit is contained in:
Matthew C
2020-09-09 12:30:41 +09:00
committed by GitHub
parent 2a3aede2ca
commit 230bba0ea7
2 changed files with 20 additions and 2 deletions

View File

@@ -40,19 +40,26 @@ class CoreOverlay extends Overlay
{ {
private final Client client; private final Client client;
private final CorpPlugin corpPlugin; private final CorpPlugin corpPlugin;
private final CorpConfig config;
@Inject @Inject
private CoreOverlay(Client client, CorpPlugin corpPlugin) private CoreOverlay(Client client, CorpPlugin corpPlugin, CorpConfig corpConfig)
{ {
setPosition(OverlayPosition.DYNAMIC); setPosition(OverlayPosition.DYNAMIC);
setLayer(OverlayLayer.ABOVE_SCENE); setLayer(OverlayLayer.ABOVE_SCENE);
this.client = client; this.client = client;
this.corpPlugin = corpPlugin; this.corpPlugin = corpPlugin;
this.config = corpConfig;
} }
@Override @Override
public Dimension render(Graphics2D graphics) public Dimension render(Graphics2D graphics)
{ {
if (!config.markDarkCore())
{
return null;
}
NPC core = corpPlugin.getCore(); NPC core = corpPlugin.getCore();
if (core != null) if (core != null)
{ {

View File

@@ -35,10 +35,21 @@ public interface CorpConfig extends Config
keyName = "showDamage", keyName = "showDamage",
name = "Show damage overlay", name = "Show damage overlay",
description = "Show total damage overlay", description = "Show total damage overlay",
position = 2 position = 0
) )
default boolean showDamage() default boolean showDamage()
{ {
return true; return true;
} }
@ConfigItem(
keyName = "markDarkCore",
name = "Mark dark core",
description = "Marks the dark energy core.",
position = 1
)
default boolean markDarkCore()
{
return true;
}
} }