Skip to content
This repository has been archived by the owner on Dec 25, 2022. It is now read-only.

Commit

Permalink
You can now disable anti-color-yoinking.
Browse files Browse the repository at this point in the history
  • Loading branch information
DillyzThe1 committed Apr 14, 2021
1 parent 711e244 commit 1f8bf0d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
23 changes: 16 additions & 7 deletions source/1.1.0/ColorPatches.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
using DillyzRolesAPI.Roles;
using HarmonyLib;

namespace DillyzRolesAPI
namespace DillyzRolesAPI.Colors
{
// https://github.com/CrowdedMods/CrowdedMod/blob/master/src/CrowdedMod/Patches/GenericPatches.cs
class ColorPatches
Expand All @@ -13,8 +14,12 @@ public static class CheckColorPatch
{
public static bool Prefix(PlayerControl __instance, [HarmonyArgument(0)] byte colorId)
{
__instance.RpcSetColor(colorId);
return false;
if (staticvars.noColorYoinking)
{
__instance.RpcSetColor(colorId);
return false;
}
return true;
}
}

Expand All @@ -23,10 +28,14 @@ public static class AvailableColorPatch
{
public static bool Prefix(PlayerTab __instance)
{
PlayerControl.SetPlayerMaterialColors(PlayerControl.LocalPlayer._cachedData.ColorId, __instance.DemoImage);
for (int i = 0; i < Palette.PlayerColors.Length; i++)
__instance.AvailableColors.Add(i);
return false;
if (staticvars.noColorYoinking)
{
PlayerControl.SetPlayerMaterialColors(PlayerControl.LocalPlayer._cachedData.ColorId, __instance.DemoImage);
for (int i = 0; i < Palette.PlayerColors.Length; i++)
__instance.AvailableColors.Add(i);
return false;
}
return true;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/1.1.0/RoleMonos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace DillyzRolesAPI.Roles
{
public class staticvars
{
public static bool noColorYoinking = false;
public static bool noColorYoinking = true;
}
public class RoleGenerator : MonoBehaviour
{
Expand Down

0 comments on commit 1f8bf0d

Please sign in to comment.