feat: make buffer color hash seed configurable, bump to 0.1.0
This commit is contained in:
@@ -10,10 +10,13 @@ internal static class ClaimLinkVisualizerClient
|
|||||||
private const int HighlightSlotId = 8341;
|
private const int HighlightSlotId = 8341;
|
||||||
private static ICoreClientAPI capi = null!;
|
private static ICoreClientAPI capi = null!;
|
||||||
private static bool visible;
|
private static bool visible;
|
||||||
|
private static ClaimLinkVisualizerConfig config = null!;
|
||||||
|
|
||||||
internal static void Start(ICoreClientAPI api)
|
internal static void Start(ICoreClientAPI api)
|
||||||
{
|
{
|
||||||
capi = api;
|
capi = api;
|
||||||
|
config = api.LoadModConfig<ClaimLinkVisualizerConfig>("claimlinkvisualizer.json") ?? new ClaimLinkVisualizerConfig();
|
||||||
|
api.StoreModConfig(config, "claimlinkvisualizer.json");
|
||||||
|
|
||||||
api.Network.RegisterChannel(ClaimLinkVisualizerModSystem.ChannelName)
|
api.Network.RegisterChannel(ClaimLinkVisualizerModSystem.ChannelName)
|
||||||
.RegisterMessageType<ClaimLinkBufferRequest>()
|
.RegisterMessageType<ClaimLinkBufferRequest>()
|
||||||
@@ -82,7 +85,7 @@ internal static class ClaimLinkVisualizerClient
|
|||||||
{
|
{
|
||||||
unchecked
|
unchecked
|
||||||
{
|
{
|
||||||
uint h = (uint)groupId * 2654435761u;
|
uint h = (uint)groupId * config.ColorHashSeed;
|
||||||
int r = (byte)(h >> 16);
|
int r = (byte)(h >> 16);
|
||||||
int g = (byte)(h >> 8);
|
int g = (byte)(h >> 8);
|
||||||
int b = (byte)h;
|
int b = (byte)h;
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace ClaimLinkVisualizer;
|
||||||
|
|
||||||
|
internal class ClaimLinkVisualizerConfig
|
||||||
|
{
|
||||||
|
public uint ColorHashSeed = 2654435761u;
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
"anth64"
|
"anth64"
|
||||||
],
|
],
|
||||||
"description": "Visualizes ClaimLink buffer zones client-side.",
|
"description": "Visualizes ClaimLink buffer zones client-side.",
|
||||||
"version": "0.0.2",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"game": "1.22.5"
|
"game": "1.22.5"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user