Upgrade to Harmony v2.0.0
This commit is contained in:
parent
f244eb9683
commit
1f35b2a434
22 changed files with 32 additions and 32 deletions
|
@ -8,7 +8,7 @@ using System.Reflection;
|
|||
using Svelto.ECS;
|
||||
using RobocraftX.Common;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace GamecraftModdingAPI.Blocks
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@ using System;
|
|||
using System.Reflection;
|
||||
|
||||
using DataLoader;
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using RobocraftX.Blocks;
|
||||
using RobocraftX.Blocks.Ghost;
|
||||
using RobocraftX.Blocks.Scaling;
|
||||
|
@ -137,7 +137,7 @@ namespace GamecraftModdingAPI.Blocks
|
|||
Logging.MetaDebugLog("Block entity factory injected.");
|
||||
}
|
||||
|
||||
static MethodBase TargetMethod(HarmonyInstance instance)
|
||||
static MethodBase TargetMethod(Harmony instance)
|
||||
{
|
||||
return AccessTools.TypeByName("RobocraftX.CR.MachineEditing.PlaceBlockEngine").GetConstructors()[0];
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using System.Reflection;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using RobocraftX.Blocks;
|
||||
using RobocraftX.Blocks.Ghost;
|
||||
using RobocraftX.Character.Camera;
|
||||
|
@ -65,7 +65,7 @@ namespace GamecraftModdingAPI.Blocks
|
|||
Logging.MetaDebugLog("Requirements injected.");
|
||||
}
|
||||
|
||||
static MethodBase TargetMethod(HarmonyInstance instance)
|
||||
static MethodBase TargetMethod(Harmony instance)
|
||||
{
|
||||
return AccessTools.TypeByName("RobocraftX.CR.MachineEditing.RemoveBlockEngine").GetConstructors()[0];
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
using System.Threading.Tasks;
|
||||
using System.Reflection;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using Svelto.Context;
|
||||
using Svelto.ECS;
|
||||
using RobocraftX;
|
||||
|
@ -33,7 +33,7 @@ namespace GamecraftModdingAPI.Commands
|
|||
CommandManager.RegisterEngines(enginesRoot);
|
||||
}
|
||||
|
||||
public static MethodBase TargetMethod(HarmonyInstance instance)
|
||||
public static MethodBase TargetMethod(Harmony instance)
|
||||
{
|
||||
return typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object));
|
||||
//return func.Method;
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Reflection;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using Svelto.ECS;
|
||||
using RobocraftX.Common;
|
||||
using RobocraftX.StateSync;
|
||||
|
@ -37,7 +37,7 @@ namespace GamecraftModdingAPI.Events
|
|||
}
|
||||
|
||||
[HarmonyTargetMethod]
|
||||
public static MethodBase TargetMethod(HarmonyInstance harmonyInstance)
|
||||
public static MethodBase TargetMethod(Harmony harmonyInstance)
|
||||
{
|
||||
return AccessTools.Method(AccessTools.TypeByName("RobocraftX.StateSync.GameHostTransitionDeterministicGroupEngine"), "EndTransition");
|
||||
//.MakeGenericMethod(typeof(CosmeticEnginesSequenceBuildOrder), typeof(CosmeticEnginesSequenceSimOrder), typeof(DeterministicToCosmeticSyncBuildOrder), typeof(DeterministicToCosmeticSyncSimOrder));
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Reflection;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using RobocraftX;
|
||||
using Svelto.ECS;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using RobocraftX;
|
||||
|
||||
using GamecraftModdingAPI.Utility;
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
using System.Threading.Tasks;
|
||||
using System.Reflection;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using RobocraftX;
|
||||
using RobocraftX.CR.MainGame;
|
||||
using Svelto.ECS;
|
||||
|
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using RobocraftX;
|
||||
using Svelto.ECS;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using RobocraftX;
|
||||
using Svelto.ECS;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Lib.Harmony" Version="1.2.0.1" />
|
||||
<PackageReference Include="Lib.Harmony" Version="2.0.0.10" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
|
|
|
@ -5,7 +5,7 @@ using RobocraftX.Multiplayer.Input;
|
|||
|
||||
using GamecraftModdingAPI.Blocks;
|
||||
using GamecraftModdingAPI.Utility;
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace GamecraftModdingAPI.Inventory
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@ using RobocraftX.GUI;
|
|||
using RobocraftX.GUI.Hotbar;
|
||||
using Svelto.ECS;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using GamecraftModdingAPI.Blocks;
|
||||
|
||||
namespace GamecraftModdingAPI.Inventory
|
||||
|
@ -24,7 +24,7 @@ namespace GamecraftModdingAPI.Inventory
|
|||
selectedBlockInt = selectedDBPartID;
|
||||
}
|
||||
|
||||
public static MethodBase TargetMethod(HarmonyInstance instance)
|
||||
public static MethodBase TargetMethod(Harmony harmonyInstance)
|
||||
{
|
||||
return PatchedMethod;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
using System.Threading.Tasks;
|
||||
using System.Reflection;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
|
||||
using GamecraftModdingAPI.Utility;
|
||||
using GamecraftModdingAPI.Events;
|
||||
|
@ -19,7 +19,7 @@ namespace GamecraftModdingAPI
|
|||
/// </summary>
|
||||
public static class Main
|
||||
{
|
||||
private static HarmonyInstance harmony;
|
||||
private static Harmony harmony;
|
||||
|
||||
public static bool IsInitialized {
|
||||
get { return harmony != null; }
|
||||
|
@ -43,7 +43,7 @@ namespace GamecraftModdingAPI
|
|||
}
|
||||
Logging.MetaDebugLog($"Patching Gamecraft");
|
||||
var currentAssembly = Assembly.GetExecutingAssembly();
|
||||
harmony = HarmonyInstance.Create(currentAssembly.GetName().Name);
|
||||
harmony = new Harmony(currentAssembly.GetName().Name);
|
||||
harmony.PatchAll(currentAssembly);
|
||||
// init utility
|
||||
Logging.MetaDebugLog($"Initializing Utility");
|
||||
|
|
|
@ -7,7 +7,7 @@ using Svelto.DataStructures;
|
|||
using Svelto.ECS;
|
||||
using Svelto.ECS.Serialization;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using GamecraftModdingAPI.Utility;
|
||||
|
||||
namespace GamecraftModdingAPI.Persistence
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
using RobocraftX.SaveAndLoad;
|
||||
using Svelto.ECS;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace GamecraftModdingAPI.Persistence
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@ using Svelto.ECS;
|
|||
using Svelto.ECS.Serialization;
|
||||
|
||||
using GamecraftModdingAPI.Utility;
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace GamecraftModdingAPI.Persistence
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
// test
|
||||
using Svelto.ECS;
|
||||
using RobocraftX.Blocks;
|
||||
|
@ -24,7 +24,7 @@ namespace GamecraftModdingAPI.Tests
|
|||
: IllusionPlugin.IEnhancedPlugin
|
||||
#endif
|
||||
{
|
||||
private static HarmonyInstance harmony { get; set; }
|
||||
private static Harmony harmony { get; set; }
|
||||
|
||||
public string[] Filter { get; } = new string[] { "Gamecraft", "GamecraftPreview" };
|
||||
|
||||
|
@ -42,7 +42,7 @@ namespace GamecraftModdingAPI.Tests
|
|||
public void OnApplicationStart()
|
||||
{
|
||||
FileLog.Reset();
|
||||
HarmonyInstance.DEBUG = true;
|
||||
Harmony.DEBUG = true;
|
||||
GamecraftModdingAPI.Main.Init();
|
||||
Logging.MetaDebugLog($"Version group id {(uint)ApiExclusiveGroups.versionGroup}");
|
||||
// in case Steam is not installed/running
|
||||
|
|
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
|||
using System.Reflection;
|
||||
|
||||
using Analytics;
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using RobocraftX.Common;
|
||||
using Svelto.ECS;
|
||||
|
||||
|
@ -30,7 +30,7 @@ namespace GamecraftModdingAPI.Utility
|
|||
return !DisableAnalytics;
|
||||
}
|
||||
|
||||
public static MethodBase TargetMethod(HarmonyInstance instance)
|
||||
public static MethodBase TargetMethod(Harmony instance)
|
||||
{
|
||||
return typeof(Analytics.AnalyticsCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object));
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
using System.Threading.Tasks;
|
||||
|
||||
using DataLoader;
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using RobocraftX;
|
||||
using RobocraftX.Common.Utilities;
|
||||
using RobocraftX.GUI;
|
||||
|
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using RobocraftX.FrontEnd;
|
||||
|
||||
namespace GamecraftModdingAPI.Utility
|
||||
|
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Harmony;
|
||||
using HarmonyLib;
|
||||
using RobocraftX.Common;
|
||||
|
||||
namespace GamecraftModdingAPI.Utility
|
||||
|
|
Loading…
Reference in a new issue