This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: unessercary type cast fix: show destroyed bodies as dead chore: remove merge conflict marker refactor: use HashSet style: remove newline refactor(MeetingIntroPatch): use init method refactor: use extension method refactor: check if game is still active
- Loading branch information
Showing
5 changed files
with
75 additions
and
45 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
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
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
This file was deleted.
Oops, something went wrong.
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,36 @@ | ||
using HarmonyLib; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using UnhollowerBaseLib; | ||
|
||
using PlayerData = GameData.PlayerInfo; | ||
|
||
namespace TownOfUs | ||
{ | ||
public static class MeetingIntroPatch | ||
{ | ||
public static List<PlayerData> DeadPlayers = | ||
new List<PlayerData>(); | ||
|
||
[HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.Start))] | ||
public static class MeetingHud_Start | ||
{ | ||
public static void Postfix() => | ||
Utils.ShowDeadBodies = PlayerControl.LocalPlayer.Data.IsDead; | ||
} | ||
|
||
[HarmonyPatch(typeof(MeetingIntroAnimation), nameof(MeetingIntroAnimation.Init))] | ||
public static class IntroPatch | ||
{ | ||
public static void Prefix( | ||
[HarmonyArgument(1)] ref Il2CppReferenceArray<PlayerData> deadPlayers | ||
) | ||
{ | ||
var players = deadPlayers.ToHashSet(); | ||
players.UnionWith(DeadPlayers); | ||
deadPlayers = players.ToArray(); | ||
DeadPlayers.Clear(); | ||
} | ||
} | ||
} | ||
} |