diff --git a/Patch.cs b/Patch.cs index 5b19b08..09ff35b 100644 --- a/Patch.cs +++ b/Patch.cs @@ -15,10 +15,21 @@ public class FrameratePatch [HarmonyPostfix] static void UncapFramerate() { - Plugin.Log.LogInfo("Uncap framerate."); if (Application.targetFrameRate != 0) { DefaultFrameRate = Application.targetFrameRate; + + if (Plugin.enableVsync.Value) + { + Plugin.Log.LogInfo("VSync enabled."); + QualitySettings.vSyncCount = 1; + } + else + { + Plugin.Log.LogInfo("Uncap framerate."); + QualitySettings.vSyncCount = 0; + } + Application.targetFrameRate = 0; } } diff --git a/Plugin.cs b/Plugin.cs index 3e328ee..aa2b624 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -8,12 +8,13 @@ namespace FFPR_Fix { - [BepInPlugin("d3xMachina.ffpr_fix", "FFPR Fix", "1.1.0")] + [BepInPlugin("d3xMachina.ffpr_fix", "FFPR Fix", "1.1.1")] public class Plugin : BasePlugin { internal static new ManualLogSource Log; public static ConfigEntry uncapFPS; + public static ConfigEntry enableVsync; public static ConfigEntry hideFieldMinimap; public static ConfigEntry hideWorldMinimap; public static ConfigEntry skipSplashscreens; @@ -37,7 +38,7 @@ public override void Load() private void ApplyPatches() { - if (uncapFPS.Value) + if (uncapFPS.Value || enableVsync.Value) { Harmony.CreateAndPatchAll(typeof(FrameratePatch)); } @@ -66,7 +67,14 @@ private void InitConfig() "Framerate", "Uncap", false, - "Remove the 60 FPS limit. Use with SpecialK or Rivatuner to cap it to the intended FPS and force VSync." + "Remove the 60 FPS limit. Use with SpecialK or Rivatuner to cap it to the intended FPS for best frame pacing." + ); + + enableVsync = Config.Bind( + "Framerate", + "Vsync", + false, + "Enable VSync. The framerate will match your monitor refresh rate." ); hideFieldMinimap = Config.Bind( diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 4c7fa9c..ce8733b 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] +[assembly: AssemblyVersion("1.1.1.0")] +[assembly: AssemblyFileVersion("1.1.1.0")]