Fixed a few things worked on a couple things situated it so that the menu can be scrolled set color coding and made it so it actually shows the username
This commit is contained in:
@@ -173,9 +173,11 @@ public final class ConnectionManager {
|
||||
try {
|
||||
JsonObject root = JsonParser.parseString(raw).getAsJsonObject();
|
||||
if (socketPlatform == Platform.TWITCH && handleStreamerBotControl(root)) return;
|
||||
if (config.debugLogging) LOGGER.info("Received from " + socketPlatform + ": " + raw);
|
||||
StreamEvent event = socketPlatform == Platform.TIKTOK
|
||||
? StreamEventParser.parseTikFinity(raw)
|
||||
: StreamEventParser.parseStreamerBot(raw);
|
||||
if (event.platform() == Platform.TIKTOK && "config".equals(event.type())) return;
|
||||
synchronized (this) {
|
||||
lastEvents.put(event.platform(), Instant.now());
|
||||
statuses.put(event.platform(), "Connected");
|
||||
@@ -290,7 +292,7 @@ public final class ConnectionManager {
|
||||
private boolean isKnownEvent(StreamEvent event) {
|
||||
if (event.platform() == Platform.TIKTOK) {
|
||||
return switch (event.type()) {
|
||||
case "chat", "gift", "share", "follow", "like", "roomUser", "subscribe" -> true;
|
||||
case "chat", "gift", "share", "follow", "like", "join", "subscribe" -> true;
|
||||
default -> false;
|
||||
};
|
||||
}
|
||||
@@ -306,7 +308,7 @@ public final class ConnectionManager {
|
||||
|
||||
private void display(StreamEvent event, DisplayTarget target) {
|
||||
String text = config.format(event);
|
||||
Component component = Component.literal(text);
|
||||
Component component = ColorText.parse(text);
|
||||
switch (target) {
|
||||
case CHAT -> {
|
||||
if (client.gui != null) client.gui.getChat().addMessage(component);
|
||||
@@ -318,7 +320,7 @@ public final class ConnectionManager {
|
||||
client.getToasts(),
|
||||
SystemToast.SystemToastIds.TUTORIAL_HINT,
|
||||
Component.literal(event.platform() + " " + event.type()),
|
||||
Component.literal(text));
|
||||
component);
|
||||
case HIDDEN -> {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user