Browse Source

Upgrade to Harmony v2.0.0

tags/v1.0.0
NGnius (Graham) 4 years ago
parent
commit
1f35b2a434
22 changed files with 32 additions and 32 deletions
  1. +1
    -1
      GamecraftModdingAPI/Blocks/BlockIdentifiers.cs
  2. +2
    -2
      GamecraftModdingAPI/Blocks/PlacementEngine.cs
  3. +2
    -2
      GamecraftModdingAPI/Blocks/RemovalEngine.cs
  4. +2
    -2
      GamecraftModdingAPI/Commands/CommandPatch.cs
  5. +2
    -2
      GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs
  6. +1
    -1
      GamecraftModdingAPI/Events/GameActivatedComposePatch.cs
  7. +1
    -1
      GamecraftModdingAPI/Events/GameReloadedPatch.cs
  8. +1
    -1
      GamecraftModdingAPI/Events/GameSwitchedToPatch.cs
  9. +1
    -1
      GamecraftModdingAPI/Events/MenuActivatedPatch.cs
  10. +1
    -1
      GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs
  11. +1
    -1
      GamecraftModdingAPI/GamecraftModdingAPI.csproj
  12. +1
    -1
      GamecraftModdingAPI/Inventory/Hotbar.cs
  13. +2
    -2
      GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs
  14. +3
    -3
      GamecraftModdingAPI/Main.cs
  15. +1
    -1
      GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs
  16. +1
    -1
      GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs
  17. +1
    -1
      GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs
  18. +3
    -3
      GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs
  19. +2
    -2
      GamecraftModdingAPI/Utility/AnalyticsDisablerPatch.cs
  20. +1
    -1
      GamecraftModdingAPI/Utility/FullGameFields.cs
  21. +1
    -1
      GamecraftModdingAPI/Utility/MinimumSpecsCheckPatch.cs
  22. +1
    -1
      GamecraftModdingAPI/Utility/SteamInitPatch.cs

+ 1
- 1
GamecraftModdingAPI/Blocks/BlockIdentifiers.cs View File

@@ -8,7 +8,7 @@ using System.Reflection;
using Svelto.ECS;
using RobocraftX.Common;

using Harmony;
using HarmonyLib;

namespace GamecraftModdingAPI.Blocks
{


+ 2
- 2
GamecraftModdingAPI/Blocks/PlacementEngine.cs View File

@@ -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];
}


+ 2
- 2
GamecraftModdingAPI/Blocks/RemovalEngine.cs View File

@@ -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];
}


+ 2
- 2
GamecraftModdingAPI/Commands/CommandPatch.cs View File

@@ -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;


+ 2
- 2
GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs View File

@@ -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));


+ 1
- 1
GamecraftModdingAPI/Events/GameActivatedComposePatch.cs View File

@@ -5,7 +5,7 @@ using System.Reflection;
using System.Text;
using System.Threading.Tasks;

using Harmony;
using HarmonyLib;
using RobocraftX;
using Svelto.ECS;



+ 1
- 1
GamecraftModdingAPI/Events/GameReloadedPatch.cs View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Harmony;
using HarmonyLib;
using RobocraftX;

using GamecraftModdingAPI.Utility;


+ 1
- 1
GamecraftModdingAPI/Events/GameSwitchedToPatch.cs View File

@@ -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;


+ 1
- 1
GamecraftModdingAPI/Events/MenuActivatedPatch.cs View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Harmony;
using HarmonyLib;
using RobocraftX;
using Svelto.ECS;



+ 1
- 1
GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Harmony;
using HarmonyLib;
using RobocraftX;
using Svelto.ECS;



+ 1
- 1
GamecraftModdingAPI/GamecraftModdingAPI.csproj View File

@@ -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" />


+ 1
- 1
GamecraftModdingAPI/Inventory/Hotbar.cs View File

@@ -5,7 +5,7 @@ using RobocraftX.Multiplayer.Input;

using GamecraftModdingAPI.Blocks;
using GamecraftModdingAPI.Utility;
using Harmony;
using HarmonyLib;

namespace GamecraftModdingAPI.Inventory
{


+ 2
- 2
GamecraftModdingAPI/Inventory/HotbarSlotSelectionHandlerEnginePatch.cs View File

@@ -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;
}


+ 3
- 3
GamecraftModdingAPI/Main.cs View File

@@ -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");


+ 1
- 1
GamecraftModdingAPI/Persistence/DeserializeFromDiskEntitiesEnginePatch.cs View File

@@ -7,7 +7,7 @@ using Svelto.DataStructures;
using Svelto.ECS;
using Svelto.ECS.Serialization;

using Harmony;
using HarmonyLib;
using GamecraftModdingAPI.Utility;

namespace GamecraftModdingAPI.Persistence


+ 1
- 1
GamecraftModdingAPI/Persistence/SaveAndLoadCompositionRootPatch.cs View File

@@ -3,7 +3,7 @@
using RobocraftX.SaveAndLoad;
using Svelto.ECS;

using Harmony;
using HarmonyLib;

namespace GamecraftModdingAPI.Persistence
{


+ 1
- 1
GamecraftModdingAPI/Persistence/SaveGameEnginePatch.cs View File

@@ -9,7 +9,7 @@ using Svelto.ECS;
using Svelto.ECS.Serialization;

using GamecraftModdingAPI.Utility;
using Harmony;
using HarmonyLib;

namespace GamecraftModdingAPI.Persistence
{


+ 3
- 3
GamecraftModdingAPI/Tests/GamecraftModdingAPIPluginTest.cs View File

@@ -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


+ 2
- 2
GamecraftModdingAPI/Utility/AnalyticsDisablerPatch.cs View File

@@ -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));
}


+ 1
- 1
GamecraftModdingAPI/Utility/FullGameFields.cs View File

@@ -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;


+ 1
- 1
GamecraftModdingAPI/Utility/MinimumSpecsCheckPatch.cs View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Harmony;
using HarmonyLib;
using RobocraftX.FrontEnd;

namespace GamecraftModdingAPI.Utility


+ 1
- 1
GamecraftModdingAPI/Utility/SteamInitPatch.cs View File

@@ -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…
Cancel
Save