internal static void Load() { string filename = "bHaptics.x" + (MelonUtils.IsGame32Bit() ? "86" : "64") + ".dll"; string filepath = Path.Combine(Path.Combine(Path.Combine(MelonUtils.GameDirectory, "MelonLoader"), "Dependencies"), filename); if (!File.Exists(filepath)) { throw new Exception("Failed to find " + filename + "!"); } NativeLib = LoadLibrary(filepath); if (NativeLib == IntPtr.Zero) { throw new Exception("Unable to Load bHaptics Native Library!"); } GetDelegateFromProcAddress("Initialise", out Initialise); GetDelegateFromProcAddress("TurnOff", out TurnOff); GetDelegateFromProcAddress("Destroy", out Destroy); GetDelegateFromProcAddress("RegisterFeedbackFromTactFile", out RegisterFeedbackFromTactFile); GetDelegateFromProcAddress("RegisterFeedbackFromTactFileReflected", out RegisterFeedbackFromTactFileReflected); GetDelegateFromProcAddress("SubmitRegistered", out SubmitRegistered); GetDelegateFromProcAddress("SubmitRegisteredStartMillis", out SubmitRegisteredStartMillis); GetDelegateFromProcAddress("SubmitRegisteredWithOption", out SubmitRegisteredWithOption); GetDelegateFromProcAddress("SubmitByteArray", out SubmitByteArray); GetDelegateFromProcAddress("SubmitPathArray", out SubmitPathArray); GetDelegateFromProcAddress("IsFeedbackRegistered", out IsFeedbackRegistered); GetDelegateFromProcAddress("IsPlaying", out IsPlaying); GetDelegateFromProcAddress("IsPlayingKey", out IsPlayingKey); GetDelegateFromProcAddress("TurnOffKey", out TurnOffKey); GetDelegateFromProcAddress("IsDevicePlaying", out IsDevicePlaying); GetDelegateFromProcAddress("TryGetResponseForPosition", out TryGetResponseForPosition); GetDelegateFromProcAddress("TryGetExePath", out TryGetExePath); }