-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#13 Generalize ChoreList (will be extended in following PRs). Disable…
… creation chore sync for one using global providers. Improve Unit tests.
- Loading branch information
Showing
19 changed files
with
846 additions
and
565 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 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
42 changes: 42 additions & 0 deletions
42
src/MultiplayerMod.Test/Environment/Unity/Patches/Unity/MaterialPatch.cs
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,42 @@ | ||
using System.Collections.Generic; | ||
using System.Reflection.Emit; | ||
using HarmonyLib; | ||
using JetBrains.Annotations; | ||
using UnityEngine; | ||
|
||
namespace MultiplayerMod.Test.Environment.Unity.Patches.Unity; | ||
|
||
[UsedImplicitly] | ||
[HarmonyPatch(typeof(Material))] | ||
public class MaterialPatch { | ||
|
||
[UsedImplicitly] | ||
[HarmonyTranspiler] | ||
[HarmonyPatch("CreateWithString")] | ||
private static IEnumerable<CodeInstruction> Material_CreateWithString(IEnumerable<CodeInstruction> instructions) { | ||
return new List<CodeInstruction> { | ||
new(OpCodes.Ret) | ||
}; | ||
} | ||
|
||
[UsedImplicitly] | ||
[HarmonyTranspiler] | ||
[HarmonyPatch("GetFirstPropertyNameIdByAttribute")] | ||
private static IEnumerable<CodeInstruction> Material_GetFirstPropertyNameIdByAttribute( | ||
IEnumerable<CodeInstruction> instructions | ||
) { | ||
return new List<CodeInstruction> { | ||
new(OpCodes.Ldc_I4_0), | ||
new(OpCodes.Ret) | ||
}; | ||
} | ||
|
||
[UsedImplicitly] | ||
[HarmonyTranspiler] | ||
[HarmonyPatch("SetColorImpl")] | ||
private static IEnumerable<CodeInstruction> Material_SetColorImpl(IEnumerable<CodeInstruction> instructions) { | ||
return new List<CodeInstruction> { | ||
new(OpCodes.Ret) | ||
}; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/MultiplayerMod.Test/Environment/Unity/Patches/Unity/RendererPatch.cs
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,29 @@ | ||
using System.Collections.Generic; | ||
using System.Reflection.Emit; | ||
using HarmonyLib; | ||
using JetBrains.Annotations; | ||
using UnityEngine; | ||
|
||
namespace MultiplayerMod.Test.Environment.Unity.Patches.Unity; | ||
|
||
[UsedImplicitly] | ||
[HarmonyPatch(typeof(Renderer))] | ||
public class RendererPatch { | ||
|
||
[UsedImplicitly] | ||
[HarmonyTranspiler] | ||
[HarmonyPatch("get_material")] | ||
private static IEnumerable<CodeInstruction> Renderer_get_material(IEnumerable<CodeInstruction> instructions) { | ||
return new List<CodeInstruction> { | ||
new(OpCodes.Ldarg_0), // this | ||
CodeInstruction.Call(typeof(RendererPatch), nameof(CreateMaterial)), | ||
new(OpCodes.Ret) | ||
}; | ||
} | ||
|
||
public static Material CreateMaterial(Renderer _) { | ||
#pragma warning disable CS0618 // Type or member is obsolete | ||
return new Material(""); | ||
#pragma warning restore CS0618 // Type or member is obsolete | ||
} | ||
} |
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
Oops, something went wrong.