Skip to content

Commit

Permalink
Fix bad harmony patches
Browse files Browse the repository at this point in the history
  • Loading branch information
Keelhauled committed Oct 22, 2020
1 parent efeaa69 commit a4a57db
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 55 deletions.
9 changes: 1 addition & 8 deletions KeelPlugins.sln
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CharaStateX.Core", "src\Cha
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CharaStateX.Koikatu", "src\CharaStateX.Koikatu\CharaStateX.Koikatu.csproj", "{C9703EB1-626B-4D1D-AEB9-42E7CC0E4220}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DefaultParamEditor", "DefaultParamEditor", "{F41D7322-8267-4A9A-866D-6517616A5996}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefaultParamEditor.Koikatu", "src\DefaultParamEditor.Koikatu\DefaultParamEditor.Koikatu.csproj", "{EFE42A5E-391C-4261-8B4A-9C9FB5AAB9D8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ItemLayerEdit.Koikatu", "src\ItemLayerEdit.Koikatu\ItemLayerEdit.Koikatu.csproj", "{A9A5B556-B590-4948-9E89-87D38623DAF1}"
Expand Down Expand Up @@ -74,8 +72,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PosePng.Koikatu", "src\Pose
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlendShaper.Koikatu", "src\BlendShaper.Koikatu\BlendShaper.Koikatu.csproj", "{2CBE1772-D2A2-40A5-8014-81904AAB9781}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "DefaultParamEditor.Core", "src\DefaultParamEditor.Core\DefaultParamEditor.Core.shproj", "{4994D068-6E18-414B-8FBF-A035EC46CCEE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StudioAddonLite.Koikatu", "src\StudioAddonLite.Koikatu\StudioAddonLite.Koikatu.csproj", "{124A215F-69B4-4310-98DE-209FAFE16D44}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TitleShortcuts.HoneySelect", "src\TitleShortcuts.HoneySelect\TitleShortcuts.HoneySelect.csproj", "{5A7AE896-F7D0-4300-831B-CDD21A770E21}"
Expand Down Expand Up @@ -154,7 +150,6 @@ Global
src\Common.Core\Common.Core.projitems*{394bc9b7-db38-4172-9b2c-60918e87b763}*SharedItemsImports = 4
src\Common.Koikatu\Common.Koikatu.projitems*{394bc9b7-db38-4172-9b2c-60918e87b763}*SharedItemsImports = 4
src\MakerBridge.Core\MakerBridge.Core.projitems*{3b6cd84f-6327-46b6-91e1-5eb972bc60fe}*SharedItemsImports = 13
src\DefaultParamEditor.Core\DefaultParamEditor.Core.projitems*{4994d068-6e18-414b-8fbf-a035ec46ccee}*SharedItemsImports = 13
src\Common.Core.Event\Common.Core.Event.projitems*{4aeb033d-d953-4e02-9274-cb44160e6b7f}*SharedItemsImports = 4
src\Common.Core\Common.Core.projitems*{4aeb033d-d953-4e02-9274-cb44160e6b7f}*SharedItemsImports = 4
src\RealPOV.Core\RealPOV.Core.projitems*{4aeb033d-d953-4e02-9274-cb44160e6b7f}*SharedItemsImports = 4
Expand Down Expand Up @@ -328,8 +323,7 @@ Global
{E88E800F-6D94-450F-B756-66B3960E4795} = {BA55B5E5-B0FD-465F-93F2-D73BD193AC86}
{E6FC0727-CF45-4F39-80C6-8816DBA8D060} = {E88E800F-6D94-450F-B756-66B3960E4795}
{C9703EB1-626B-4D1D-AEB9-42E7CC0E4220} = {E88E800F-6D94-450F-B756-66B3960E4795}
{F41D7322-8267-4A9A-866D-6517616A5996} = {BA55B5E5-B0FD-465F-93F2-D73BD193AC86}
{EFE42A5E-391C-4261-8B4A-9C9FB5AAB9D8} = {F41D7322-8267-4A9A-866D-6517616A5996}
{EFE42A5E-391C-4261-8B4A-9C9FB5AAB9D8} = {BA55B5E5-B0FD-465F-93F2-D73BD193AC86}
{A9A5B556-B590-4948-9E89-87D38623DAF1} = {BA55B5E5-B0FD-465F-93F2-D73BD193AC86}
{21652626-F032-4986-B258-C36B4C9115E7} = {BA55B5E5-B0FD-465F-93F2-D73BD193AC86}
{17FF704B-6D86-4F64-8052-123DC8C2AC0A} = {BA55B5E5-B0FD-465F-93F2-D73BD193AC86}
Expand All @@ -350,7 +344,6 @@ Global
{A52280CD-3CC4-452A-8C11-67E440E0262F} = {58AAB72D-86B3-4445-B25E-62D6A7FF1237}
{987845C6-3389-4D18-9E1D-43CB0414573E} = {BA55B5E5-B0FD-465F-93F2-D73BD193AC86}
{2CBE1772-D2A2-40A5-8014-81904AAB9781} = {BA55B5E5-B0FD-465F-93F2-D73BD193AC86}
{4994D068-6E18-414B-8FBF-A035EC46CCEE} = {F41D7322-8267-4A9A-866D-6517616A5996}
{124A215F-69B4-4310-98DE-209FAFE16D44} = {BA55B5E5-B0FD-465F-93F2-D73BD193AC86}
{5A7AE896-F7D0-4300-831B-CDD21A770E21} = {E462D3D8-0715-45C9-869C-F1FA8CD2F5CD}
{4D175C74-23CC-45DB-8225-537DB7E33142} = {E462D3D8-0715-45C9-869C-F1FA8CD2F5CD}
Expand Down
13 changes: 0 additions & 13 deletions src/DefaultParamEditor.Core/DefaultParamEditor.Core.projitems

This file was deleted.

13 changes: 0 additions & 13 deletions src/DefaultParamEditor.Core/DefaultParamEditor.Core.shproj

This file was deleted.

1 change: 1 addition & 0 deletions src/DefaultParamEditor.Koikatu/CharacterParam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ internal class CharacterParam
public static void Init(ParamData.CharaData data)
{
_charaData = data;
Harmony.CreateAndPatchAll(typeof(Hooks));
}

public static void Save()
Expand Down
4 changes: 2 additions & 2 deletions src/DefaultParamEditor.Koikatu/DefaultParamEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace KeelPlugins
public class DefaultParamEditor : BaseUnityPlugin
{
public const string GUID = "keelhauled.defaultparameditor";
public const string Version = "1.1.0." + BuildNumber.Version;
public const string Version = "1.1.1." + BuildNumber.Version;
internal static new ManualLogSource Logger;

private static string savePath = Path.Combine(Paths.ConfigPath, "DefaultParamEditorData.json");
Expand All @@ -24,7 +24,7 @@ public class DefaultParamEditor : BaseUnityPlugin
private void Awake()
{
Logger = base.Logger;
Harmony.CreateAndPatchAll(GetType().Assembly);
Harmony.CreateAndPatchAll(typeof(Hooks));

if(File.Exists(savePath))
{
Expand Down
1 change: 1 addition & 0 deletions src/DefaultParamEditor.Koikatu/SceneParam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ internal class SceneParam
public static void Init(ParamData.SceneData data)
{
_sceneData = data;
Harmony.CreateAndPatchAll(typeof(Hooks));
}

public static void Save()
Expand Down
2 changes: 1 addition & 1 deletion src/LockOnPlugin.Core/LockOnPluginCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public abstract class LockOnPluginCore : BaseUnityPlugin
{
public const string GUID = "keelhauled.lockonplugin";
public const string PluginName = "LockOnPlugin";
public const string Version = "2.6.0." + BuildNumber.Version;

internal static new ManualLogSource Logger;

private const string SECTION_HOTKEYS = "Keyboard shortcuts";
Expand Down
4 changes: 3 additions & 1 deletion src/LockOnPlugin.Koikatu/LockOnPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

namespace KeelPlugins
{
[BepInPlugin(GUID, "LockOnPlugin", Version)]
[BepInPlugin(GUID, PluginName, Version)]
public class LockOnPlugin : LockOnPluginCore
{
public const string Version = "2.6.1." + BuildNumber.Version;

protected override void Awake()
{
base.Awake();
Expand Down
5 changes: 1 addition & 4 deletions src/MakerBridge.Core/MakerBridgeCore.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using System.IO;
using UnityEngine;

Expand All @@ -23,7 +22,7 @@ public abstract class MakerBridgeCore : BaseUnityPlugin
internal static ConfigEntry<KeyboardShortcut> SendChara { get; set; }
internal static ConfigEntry<bool> ShowMessages { get; set; }

private void Awake()
protected virtual void Awake()
{
Logger = base.Logger;
bepinex = gameObject;
Expand All @@ -34,8 +33,6 @@ private void Awake()
var tempFolder = Path.GetTempPath();
MakerCardPath = Path.Combine(tempFolder, "makerbridge1.png");
OtherCardPath = Path.Combine(tempFolder, "makerbridge2.png");

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

internal static void Log(object data)
Expand Down
8 changes: 7 additions & 1 deletion src/MakerBridge.Koikatu/MakerBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ namespace KeelPlugins
[BepInPlugin(GUID, PluginName, Version)]
public class MakerBridge : MakerBridgeCore
{
public const string Version = "1.0.1." + BuildNumber.Version;
public const string Version = "1.0.2." + BuildNumber.Version;

protected override void Awake()
{
base.Awake();
Harmony.CreateAndPatchAll(typeof(Hooks));
}

private class Hooks
{
Expand Down
12 changes: 0 additions & 12 deletions src/RealPOV.Core/RealPOVCore.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;

namespace KeelPlugins
Expand All @@ -10,13 +9,11 @@ public abstract class RealPOVCore : BaseUnityPlugin
{
public const string GUID = "keelhauled.realpov";
public const string PluginName = "RealPOV";
public const string Version = "1.0.2." + BuildNumber.Version;

internal const string SECTION_GENERAL = "General";
internal const string SECTION_HOTKEYS = "Keyboard shortcuts";

internal static new ManualLogSource Logger;
internal static Harmony Harmony;

internal static ConfigEntry<float> ViewOffset { get; set; }
internal static ConfigEntry<float> DefaultFOV { get; set; }
Expand All @@ -39,16 +36,7 @@ protected virtual void Awake()
DefaultFOV = Config.Bind(SECTION_GENERAL, "Default FOV", 70f, new ConfigDescription("", new AcceptableValueRange<float>(20f, 120f)));
MouseSens = Config.Bind(SECTION_GENERAL, "Mouse sensitivity", 1f, new ConfigDescription("", new AcceptableValueRange<float>(0.1f, 2f)));
ViewOffset = Config.Bind(SECTION_GENERAL, "View offset", 0.03f);

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

#if DEBUG
private void OnDestroy()
{
Harmony.UnpatchAll();
}
#endif

private void Update()
{
Expand Down
8 changes: 8 additions & 0 deletions src/RealPOV.Koikatu/RealPOV.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ namespace KeelPlugins
[BepInPlugin(GUID, PluginName, Version)]
public class RealPOV : RealPOVCore
{
public const string Version = "1.0.3." + BuildNumber.Version;

private static int backupLayer;
private static ChaControl currentChara;
private bool isStudio = Paths.ProcessName == "CharaStudio";

protected override void Awake()
{
base.Awake();
Harmony.CreateAndPatchAll(GetType());
}

internal override void EnablePOV()
{
if(isStudio)
Expand Down
9 changes: 9 additions & 0 deletions src/RealPOV.PlayHome/PointOfView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,17 @@ internal class PointOfView : MonoBehaviour

private static Vector3 rotation = new Vector3();

private Harmony harmony;

private void Awake()
{
harmony = Harmony.CreateAndPatchAll(GetType());
}

private void OnDestroy()
{
harmony.UnpatchAll();

if(lockNormalCamera)
Restore();
}
Expand Down
4 changes: 4 additions & 0 deletions src/RealPOV.PlayHome/RealPOV.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ namespace KeelPlugins
[BepInPlugin(GUID, PluginName, Version)]
public class RealPOV : RealPOVCore
{
public const string Version = "1.0.3." + BuildNumber.Version;

private const string SECTION_OFFSETS = "Offsets";

internal static ConfigEntry<float> FemaleOffsetX { get; set; }
Expand All @@ -28,6 +30,8 @@ protected override void Awake()
MaleOffsetX = Config.Bind(SECTION_OFFSETS, "Male offset X", 0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { IsAdvanced = true }));
MaleOffsetY = Config.Bind(SECTION_OFFSETS, "Male offset Y", 0.092f, new ConfigDescription("", null, new ConfigurationManagerAttributes { IsAdvanced = true }));
MaleOffsetZ = Config.Bind(SECTION_OFFSETS, "Male offset Z", 0.12f, new ConfigDescription("", null, new ConfigurationManagerAttributes { IsAdvanced = true }));

Harmony.CreateAndPatchAll(GetType());
}

[HarmonyPostfix, HarmonyPatch(typeof(H_Scene), "Awake")]
Expand Down

0 comments on commit a4a57db

Please sign in to comment.