Raids: Add clan chat and world to scouting overlay

This commit is contained in:
Alexsuperfly
2019-11-26 20:20:43 -05:00
committed by Adam
parent 437a1a2286
commit bbdf76a0b6
2 changed files with 42 additions and 6 deletions

View File

@@ -88,6 +88,17 @@ public interface RaidsConfig extends Config
@ConfigItem(
position = 5,
keyName = "ccDisplay",
name = "CC and World in scout overlay",
description = "Display current Clan Chat and World in scouting overlay"
)
default boolean ccDisplay()
{
return false;
}
@ConfigItem(
position = 6,
keyName = "whitelistedRooms",
name = "Whitelisted rooms",
description = "Display whitelisted rooms in green on the overlay. Separate with comma (full name)"
@@ -98,7 +109,7 @@ public interface RaidsConfig extends Config
}
@ConfigItem(
position = 6,
position = 7,
keyName = "blacklistedRooms",
name = "Blacklisted rooms",
description = "Display blacklisted rooms in red on the overlay. Separate with comma (full name)"
@@ -109,7 +120,7 @@ public interface RaidsConfig extends Config
}
@ConfigItem(
position = 7,
position = 8,
keyName = "enableRotationWhitelist",
name = "Enable rotation whitelist",
description = "Enable the rotation whitelist"
@@ -120,7 +131,7 @@ public interface RaidsConfig extends Config
}
@ConfigItem(
position = 8,
position = 9,
keyName = "whitelistedRotations",
name = "Whitelisted rotations",
description = "Warn when boss rotation doesn't match a whitelisted one. Add rotations like: tekton, muttadiles, guardians - each rotation on its own line"
@@ -131,7 +142,7 @@ public interface RaidsConfig extends Config
}
@ConfigItem(
position = 9,
position = 10,
keyName = "enableLayoutWhitelist",
name = "Enable layout whitelist",
description = "Enable the layout whitelist"
@@ -142,7 +153,7 @@ public interface RaidsConfig extends Config
}
@ConfigItem(
position = 10,
position = 11,
keyName = "whitelistedLayouts",
name = "Whitelisted layouts",
description = "Warn when layout doesn't match a whitelisted one. Add layouts like CFSCPPCSCF separated with comma"
@@ -153,7 +164,7 @@ public interface RaidsConfig extends Config
}
@ConfigItem(
position = 11,
position = 12,
keyName = "layoutMessage",
name = "Send raid layout message when entering raid",
description = "Sends game message with raid layout on entering new raid"

View File

@@ -26,9 +26,11 @@ package net.runelite.client.plugins.raids;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import javax.inject.Inject;
import lombok.Setter;
import net.runelite.api.ClanMemberManager;
import net.runelite.api.Client;
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY;
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
@@ -38,6 +40,7 @@ import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
import net.runelite.client.ui.overlay.OverlayMenuEntry;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayPriority;
import net.runelite.client.ui.overlay.components.ComponentConstants;
import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
@@ -101,6 +104,28 @@ public class RaidsOverlay extends Overlay
.color(color)
.build());
if (config.ccDisplay())
{
color = Color.RED;
ClanMemberManager clanMemberManager = client.getClanMemberManager();
FontMetrics metrics = graphics.getFontMetrics();
String worldString = "W" + client.getWorld();
String clanOwner = "Join a CC";
if (clanMemberManager != null)
{
clanOwner = clanMemberManager.getClanOwner();
color = Color.ORANGE;
}
panelComponent.setPreferredSize(new Dimension(Math.max(ComponentConstants.STANDARD_WIDTH, metrics.stringWidth(worldString) + metrics.stringWidth(clanOwner) + 14), 0));
panelComponent.getChildren().add(LineComponent.builder()
.left(worldString)
.right(clanOwner)
.leftColor(Color.ORANGE)
.rightColor(color)
.build());
}
for (Room layoutRoom : plugin.getRaid().getLayout().getRooms())
{
int position = layoutRoom.getPosition();