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

Commit

Permalink
Added hud stats in level editor
Browse files Browse the repository at this point in the history
  • Loading branch information
REHERC committed Dec 26, 2020
1 parent 7eaaa80 commit 858fc86
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Distance.NitronicHUD/Distance.NitronicHUD.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,12 @@
<Compile Include="Data\VisualDisplayContent.cs" />
<Compile Include="Entry.cs" />
<Compile Include="Flags.cs" />
<Compile Include="Harmony\Assembly-CSharp\StatsManager\OnEventPlayerAdded.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Scripts\VisualCountdown.cs" />
<Compile Include="Scripts\VisualDisplay.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Harmony\Assembly-CSharp\" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using HarmonyLib;
using System.Collections.Generic;
using System.Linq;

namespace Distance.NitronicHUD.Harmony
{
[HarmonyPatch(typeof(StatsManager), "OnEventPlayerAdded")]
internal static class StatsManager__OnEventPlayerAdded
{
[HarmonyTranspiler]
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instr)
{
return instr.Skip(5); // Skip the default check "if is in level editor, don't create player stats object"
}
}
}

0 comments on commit 858fc86

Please sign in to comment.