Send raid layout message on raid enter
Sends raid layout message as clan chat game message when entering raid. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -151,4 +151,15 @@ public interface RaidsConfig extends Config
|
|||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
position = 11,
|
||||||
|
keyName = "layoutMessage",
|
||||||
|
name = "Send raid layout message when entering raid",
|
||||||
|
description = "Sends game message with raid layout on entering new raid"
|
||||||
|
)
|
||||||
|
default boolean layoutMessage()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,21 +242,21 @@ public class RaidsPlugin extends Plugin
|
|||||||
double percentage = personalPoints / (totalPoints / 100.0);
|
double percentage = personalPoints / (totalPoints / 100.0);
|
||||||
|
|
||||||
String chatMessage = new ChatMessageBuilder()
|
String chatMessage = new ChatMessageBuilder()
|
||||||
.append(ChatColorType.NORMAL)
|
.append(ChatColorType.NORMAL)
|
||||||
.append("Total points: ")
|
.append("Total points: ")
|
||||||
.append(ChatColorType.HIGHLIGHT)
|
.append(ChatColorType.HIGHLIGHT)
|
||||||
.append(POINTS_FORMAT.format(totalPoints))
|
.append(POINTS_FORMAT.format(totalPoints))
|
||||||
.append(ChatColorType.NORMAL)
|
.append(ChatColorType.NORMAL)
|
||||||
.append(", Personal points: ")
|
.append(", Personal points: ")
|
||||||
.append(ChatColorType.HIGHLIGHT)
|
.append(ChatColorType.HIGHLIGHT)
|
||||||
.append(POINTS_FORMAT.format(personalPoints))
|
.append(POINTS_FORMAT.format(personalPoints))
|
||||||
.append(ChatColorType.NORMAL)
|
.append(ChatColorType.NORMAL)
|
||||||
.append(" (")
|
.append(" (")
|
||||||
.append(ChatColorType.HIGHLIGHT)
|
.append(ChatColorType.HIGHLIGHT)
|
||||||
.append(DECIMAL_FORMAT.format(percentage))
|
.append(DECIMAL_FORMAT.format(percentage))
|
||||||
.append(ChatColorType.NORMAL)
|
.append(ChatColorType.NORMAL)
|
||||||
.append("%)")
|
.append("%)")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
chatMessageManager.queue(QueuedMessage.builder()
|
chatMessageManager.queue(QueuedMessage.builder()
|
||||||
.type(ChatMessageType.CLANCHAT_INFO)
|
.type(ChatMessageType.CLANCHAT_INFO)
|
||||||
@@ -302,6 +302,7 @@ public class RaidsPlugin extends Plugin
|
|||||||
raid.updateLayout(layout);
|
raid.updateLayout(layout);
|
||||||
RotationSolver.solve(raid.getCombatRooms());
|
RotationSolver.solve(raid.getCombatRooms());
|
||||||
overlay.setScoutOverlayShown(true);
|
overlay.setScoutOverlayShown(true);
|
||||||
|
sendRaidLayoutMessage();
|
||||||
}
|
}
|
||||||
else if (!config.scoutOverlayAtBank())
|
else if (!config.scoutOverlayAtBank())
|
||||||
{
|
{
|
||||||
@@ -316,6 +317,28 @@ public class RaidsPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendRaidLayoutMessage()
|
||||||
|
{
|
||||||
|
if (!config.layoutMessage())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String layout = getRaid().getLayout().toCodeString();
|
||||||
|
final String rooms = getRaid().toRoomString();
|
||||||
|
final String raidData = "[" + layout + "]: " + rooms;
|
||||||
|
|
||||||
|
chatMessageManager.queue(QueuedMessage.builder()
|
||||||
|
.type(ChatMessageType.CLANCHAT_INFO)
|
||||||
|
.runeLiteFormattedMessage(new ChatMessageBuilder()
|
||||||
|
.append(ChatColorType.HIGHLIGHT)
|
||||||
|
.append("Layout: ")
|
||||||
|
.append(ChatColorType.NORMAL)
|
||||||
|
.append(raidData)
|
||||||
|
.build())
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
private void updateInfoBoxState()
|
private void updateInfoBoxState()
|
||||||
{
|
{
|
||||||
if (timer == null)
|
if (timer == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user