Recolor party pings and names based on name color hash
Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -61,7 +61,6 @@ public interface PartyConfig extends Config
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "messages",
|
||||
name = "Join messages",
|
||||
@@ -71,4 +70,14 @@ public interface PartyConfig extends Config
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "recolorNames",
|
||||
name = "Recolor names",
|
||||
description = "Recolor stats overlay names based on unique color hash"
|
||||
)
|
||||
default boolean recolorNames()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,6 +110,12 @@ class PartyPingOverlay extends Overlay
|
||||
return;
|
||||
}
|
||||
|
||||
OverlayUtil.renderPolygon(graphics, poly, new Color(255, 0, 0, ping.getAlpha()));
|
||||
final Color color = new Color(
|
||||
ping.getColor().getRed(),
|
||||
ping.getColor().getGreen(),
|
||||
ping.getColor().getBlue(),
|
||||
ping.getAlpha());
|
||||
|
||||
OverlayUtil.renderPolygon(graphics, poly, color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ package net.runelite.client.plugins.party;
|
||||
|
||||
import com.google.inject.Binder;
|
||||
import com.google.inject.Provides;
|
||||
import java.awt.Color;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
@@ -71,6 +72,7 @@ import net.runelite.client.task.Schedule;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.ui.overlay.worldmap.WorldMapPoint;
|
||||
import net.runelite.client.ui.overlay.worldmap.WorldMapPointManager;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
import net.runelite.client.ws.PartyMember;
|
||||
import net.runelite.client.ws.PartyService;
|
||||
import net.runelite.client.ws.WSClient;
|
||||
@@ -228,7 +230,9 @@ public class PartyPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
|
||||
event.consume();
|
||||
wsClient.send(new TilePing(selectedSceneTile.getWorldLocation()));
|
||||
final TilePing tilePing = new TilePing(selectedSceneTile.getWorldLocation());
|
||||
tilePing.setMemberId(party.getLocalMember().getMemberId());
|
||||
wsClient.send(tilePing);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@@ -238,7 +242,9 @@ public class PartyPlugin extends Plugin implements KeyListener
|
||||
|
||||
if (config.pings())
|
||||
{
|
||||
pendingTilePings.add(new PartyTilePingData(event.getPoint()));
|
||||
final PartyData partyData = getPartyData(event.getMemberId());
|
||||
final Color color = partyData != null ? partyData.getColor() : Color.RED;
|
||||
pendingTilePings.add(new PartyTilePingData(event.getPoint(), color));
|
||||
}
|
||||
|
||||
if (config.sounds())
|
||||
@@ -470,7 +476,7 @@ public class PartyPlugin extends Plugin implements KeyListener
|
||||
worldMapManager.add(worldMapPoint);
|
||||
}
|
||||
|
||||
return new PartyData(u, name, worldMapPoint);
|
||||
return new PartyData(u, name, worldMapPoint, ColorUtil.fromObject(name, true));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@ public class PartyStatsOverlay extends Overlay
|
||||
|
||||
final TitleComponent name = TitleComponent.builder()
|
||||
.text(v.getName())
|
||||
.color(config.recolorNames() ? v.getColor() : Color.WHITE)
|
||||
.build();
|
||||
|
||||
panel.getChildren().add(name);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.party.data;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.UUID;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -40,6 +41,7 @@ public class PartyData
|
||||
private final String name;
|
||||
private final WorldMapPoint worldMapPoint;
|
||||
private final PanelComponent panel = new PanelComponent();
|
||||
private final Color color;
|
||||
|
||||
private int hitpoints;
|
||||
private int maxHitpoints;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.party.data;
|
||||
|
||||
import java.awt.Color;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
@@ -35,5 +36,6 @@ import net.runelite.api.coords.WorldPoint;
|
||||
public class PartyTilePingData
|
||||
{
|
||||
private final WorldPoint point;
|
||||
private final Color color;
|
||||
private int alpha = 255;
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@ package net.runelite.client.plugins.party.messages;
|
||||
|
||||
import lombok.Value;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.http.api.ws.messages.party.PartyMessage;
|
||||
import net.runelite.http.api.ws.messages.party.PartyMemberMessage;
|
||||
|
||||
@Value
|
||||
public class TilePing extends PartyMessage
|
||||
public class TilePing extends PartyMemberMessage
|
||||
{
|
||||
private final WorldPoint point;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user