Skip to content

Commit

Permalink
Harmony not searching the whole ass
Browse files Browse the repository at this point in the history
  • Loading branch information
Keelhauled committed Oct 18, 2020
1 parent b694f30 commit 867cbb1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 1 addition & 11 deletions src/LockOnPlugin.Core/LockOnPluginCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ public abstract class LockOnPluginCore : BaseUnityPlugin
internal static ConfigEntry<KeyboardShortcut> PrevCharaKey { get; set; }
internal static ConfigEntry<KeyboardShortcut> NextCharaKey { get; set; }

private static Harmony harmony;
internal static GameObject bepinex;

private void Awake()
protected virtual void Awake()
{
bepinex = gameObject;
Logger = base.Logger;
Expand All @@ -50,15 +49,6 @@ private void Awake()
LockOnKey = Config.Bind(SECTION_HOTKEYS, "Lock on", new KeyboardShortcut(KeyCode.Mouse4), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 10 }));
PrevCharaKey = Config.Bind(SECTION_HOTKEYS, "Select previous character", new KeyboardShortcut(KeyCode.None), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 8 }));
NextCharaKey = Config.Bind(SECTION_HOTKEYS, "Select next character", new KeyboardShortcut(KeyCode.None), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 9 }));

harmony = Harmony.CreateAndPatchAll(GetType().Assembly);
}

#if DEBUG
private void OnDestroy()
{
harmony.UnpatchAll();
}
#endif
}
}
3 changes: 3 additions & 0 deletions src/LockOnPlugin.Koikatu/LockOnPlugin.Koikatu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,7 @@
<Import Project="..\Common.Core\Common.Core.projitems" Label="Shared" />
<Import Project="..\Common.Core.Event\Common.Core.Event.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>IF EXIST "$(SolutionDir)PostBuild.ps1" powershell "$(SolutionDir)PostBuild.ps1" "KOIKATU" "$(TargetPath)" "$(ProjectPath)" "$(ConfigurationName)"</PostBuildEvent>
</PropertyGroup>
</Project>
7 changes: 7 additions & 0 deletions src/LockOnPlugin.Koikatu/LockOnPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ namespace KeelPlugins
[BepInPlugin(GUID, "LockOnPlugin", Version)]
public class LockOnPlugin : LockOnPluginCore
{
protected override void Awake()
{
base.Awake();

Harmony.CreateAndPatchAll(typeof(Entrypoints));
}

private class Entrypoints
{
[HarmonyPrefix, HarmonyPatch(typeof(CustomScene), "Start")]
Expand Down

0 comments on commit 867cbb1

Please sign in to comment.