-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} | ||
} | ||
} | ||
} |