raids plugin: send raids layout message to party

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2019-02-05 12:18:21 +00:00
committed by Adam
parent 00a4c627c5
commit 51abc3614a

View File

@@ -65,6 +65,10 @@ import net.runelite.client.plugins.raids.solver.RotationSolver;
import net.runelite.client.ui.overlay.OverlayManager;
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
import net.runelite.client.util.Text;
import net.runelite.client.ws.PartyMember;
import net.runelite.client.ws.PartyService;
import net.runelite.client.ws.WSClient;
import net.runelite.http.api.ws.messages.party.PartyChatMessage;
@PluginDescriptor(
name = "Chambers Of Xeric",
@@ -110,6 +114,12 @@ public class RaidsPlugin extends Plugin
@Inject
private ClientThread clientThread;
@Inject
private PartyService party;
@Inject
private WSClient ws;
@Getter
private final ArrayList<String> roomWhitelist = new ArrayList<>();
@@ -305,15 +315,28 @@ public class RaidsPlugin extends Plugin
final String rooms = getRaid().toRoomString();
final String raidData = "[" + layout + "]: " + rooms;
chatMessageManager.queue(QueuedMessage.builder()
.type(ChatMessageType.FRIENDSCHATNOTIFICATION)
.runeLiteFormattedMessage(new ChatMessageBuilder()
.append(ChatColorType.HIGHLIGHT)
.append("Layout: ")
.append(ChatColorType.NORMAL)
.append(raidData)
.build())
.build());
final String layoutMessage = new ChatMessageBuilder()
.append(ChatColorType.HIGHLIGHT)
.append("Layout: ")
.append(ChatColorType.NORMAL)
.append(raidData)
.build();
final PartyMember localMember = party.getLocalMember();
if (party.getMembers().isEmpty() || localMember == null)
{
chatMessageManager.queue(QueuedMessage.builder()
.type(ChatMessageType.FRIENDSCHATNOTIFICATION)
.runeLiteFormattedMessage(layoutMessage)
.build());
}
else
{
final PartyChatMessage message = new PartyChatMessage(layoutMessage);
message.setMemberId(localMember.getMemberId());
ws.send(message);
}
}
private void updateInfoBoxState()