mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-03 14:59:23 +00:00
[MenuScalePatch] Added FOV adjustment handling.
This commit is contained in:
parent
cf7e19511a
commit
b6c284857b
8 changed files with 32 additions and 6 deletions
|
@ -184,4 +184,20 @@ internal class HarmonyPatches
|
|||
|
||||
return patchedInstructions;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(CVR_DesktopCameraController), nameof(CVR_DesktopCameraController.UpdateFov))]
|
||||
private static void Postfix_CVR_DesktopCameraController_UpdateFov()
|
||||
{
|
||||
if (!MenuScalePatch.EntryUseFOVAdjustment.Value)
|
||||
{
|
||||
MSP_MenuInfo.FOVAdjustment = 1f;
|
||||
return;
|
||||
}
|
||||
|
||||
const float minFovValue = 60f;
|
||||
const float maxFovValue = 120f;
|
||||
MSP_MenuInfo.FOVAdjustment =
|
||||
1f + (2f * Mathf.Clamp01((CVR_DesktopCameraController.defaultFov - minFovValue) / (maxFovValue - minFovValue)));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue