Skip to content

Commit

Permalink
Create PingTrackerPatch.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hardel-DW committed Feb 24, 2021
1 parent 4b81946 commit 17e8035
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions RolesMods/Patch/PingTrackerPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using HarmonyLib;
using UnityEngine;

namespace RolesMods.Patch {

[HarmonyPatch(typeof(PingTracker), nameof(PingTracker.Update))]
[HarmonyPriority(Priority.First)]
public static class PingTrackerPatch {
private static Vector3 lastDist = Vector3.zero;

public static void Postfix(ref PingTracker __instance) {
if (!GlobalVariable.isGameStarted) {
AspectPosition aspect = __instance.text.gameObject.GetComponent<AspectPosition>();
if (aspect.DistanceFromEdge != lastDist) {
aspect.DistanceFromEdge += new Vector3(0.6f, 0);
aspect.AdjustPosition();

lastDist = aspect.DistanceFromEdge;
}
__instance.text.Text += $"\n[2294E6FF]Too Many Roles Mods[] \ndiscord.gg/AP9axbXXNC";
}
}
}
}

0 comments on commit 17e8035

Please sign in to comment.