1234567891011121314151617181920212223242526272829303132333435363738 |
- using HarmonyLib;
- using IPA;
- using System;
- using System.Reflection;
- using IPALogger = IPA.Logging.Logger;
- namespace BeatSaberTweakers.HapticFeedbackAdjust
- {
- /// <summary>
- /// Entry point of the plugin.
- /// </summary>
- [Plugin(RuntimeOptions.SingleStartInit)]
- public sealed class Plugin //: IPlugin
- {
- internal static IPALogger Logger;
- [Init]
- public void Init(IPALogger logger)
- {
- Logger = logger;
- Logger.Debug("Init");
- try
- {
- Logger?.Debug("Applying Harmony patches.");
- harmony.PatchAll(Assembly.GetExecutingAssembly());
- }
- catch (Exception ex)
- {
- Logger?.Critical("Error applying Harmony patches: " + ex.Message);
- Logger?.Debug(ex);
- }
- }
- public const string HarmonyId = nameof(BeatSaberTweakers) + "." + nameof(HapticFeedbackAdjust);
- internal static Harmony harmony => new Harmony(HarmonyId);
- }
- }
|