release
This commit is contained in:
parent
963699710b
commit
c8728e5769
@ -1,21 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
using EFT.UI;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace CameraResolutionScale
|
|
||||||
{
|
|
||||||
public class DisableFOVScaling
|
|
||||||
{
|
|
||||||
public SelectSlider getFOVSelectSlider()
|
|
||||||
{
|
|
||||||
string rootObjectPath = "Common UI/Common UI/SettingsScreen";
|
|
||||||
GameObject rootObject = GameObject.Find(rootObjectPath);
|
|
||||||
|
|
||||||
string fovObjectPath = "Game Settings/Image/Other Settings/FOV/FOV";
|
|
||||||
GameObject fovObject = rootObject.transform.Find(fovObjectPath).gameObject;
|
|
||||||
|
|
||||||
return fovObject.GetComponent<SelectSlider>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -7,18 +7,17 @@ using System.Reflection;
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
|
|
||||||
namespace CameraResolutionScale
|
namespace ScopeTweaks
|
||||||
{
|
{
|
||||||
[BepInPlugin("com.notGreg.cameraScaleControl", "notGreg's Camera Resolution Settings", "1.0.0")]
|
[BepInPlugin("com.notGreg.scopeTweaks", "notGreg's Scope Tweaks", "1.0.0")]
|
||||||
public class Plugin : BaseUnityPlugin
|
public class Plugin : BaseUnityPlugin
|
||||||
{
|
{
|
||||||
Utils utils = new Utils();
|
Utils utils = new Utils();
|
||||||
DisableFOVScaling fovScaling = new DisableFOVScaling();
|
CameraUtils scopeRes = new CameraUtils();
|
||||||
UpdateScopeResolution scopeRes = new UpdateScopeResolution();
|
|
||||||
|
|
||||||
ConfigEntry<int> cameraResolutionScale;
|
ConfigEntry<int> cameraResolutionScale;
|
||||||
ConfigEntry<int> scopeCameraResolutionScale;
|
ConfigEntry<int> scopeCameraResolutionScale;
|
||||||
ConfigEntry<int> fovCompDistScale;
|
ConfigEntry<bool> fovCompDistScale;
|
||||||
|
|
||||||
enum fovScalingMode
|
enum fovScalingMode
|
||||||
{
|
{
|
||||||
@ -41,10 +40,10 @@ namespace CameraResolutionScale
|
|||||||
new ConfigDescription("Scope camera resolution scale", new AcceptableValueRange<int>(25, 100)));
|
new ConfigDescription("Scope camera resolution scale", new AcceptableValueRange<int>(25, 100)));
|
||||||
|
|
||||||
fovCompDistScale = Config.Bind(
|
fovCompDistScale = Config.Bind(
|
||||||
"Experimental",
|
"Fixes",
|
||||||
"FOV Compensation Dist. Scale",
|
"High FOV scope fix",
|
||||||
0,
|
true,
|
||||||
new ConfigDescription("Adjusts _fovCompensatoryDistance variable, makes scopes more useable at high FOV values", new AcceptableValueRange<int>(0, 100)));
|
new ConfigDescription("Makes scopes more useable at high FOV values"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -63,12 +62,12 @@ namespace CameraResolutionScale
|
|||||||
|
|
||||||
void setUpCameras()
|
void setUpCameras()
|
||||||
{
|
{
|
||||||
Logger.LogInfo("Game started!");
|
//Logger.LogInfo("Game started!");
|
||||||
|
|
||||||
Logger.LogInfo("Get FPS Camera");
|
//Logger.LogInfo("Get FPS Camera");
|
||||||
StartCoroutine(tryGetMainCamera());
|
StartCoroutine(tryGetMainCamera());
|
||||||
|
|
||||||
Logger.LogInfo("Get Scope Camera");
|
//Logger.LogInfo("Get Scope Camera");
|
||||||
StartCoroutine(tryGetScopeCamera());
|
StartCoroutine(tryGetScopeCamera());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,14 +82,14 @@ namespace CameraResolutionScale
|
|||||||
}
|
}
|
||||||
FPSCamera = scopeRes.getMainCamera();
|
FPSCamera = scopeRes.getMainCamera();
|
||||||
|
|
||||||
Logger.LogInfo("Get SSAAInstance (Camera)");
|
//Logger.LogInfo("Get SSAAInstance (Camera)");
|
||||||
ssaaInstance = scopeRes.getSSAAInstance(FPSCamera);
|
ssaaInstance = scopeRes.getSSAAInstance(FPSCamera);
|
||||||
|
|
||||||
Logger.LogInfo("Set SSRatios");
|
//Logger.LogInfo("Set SSRatios");
|
||||||
_nextSSRation = scopeRes.getFieldInfo("_nextSSRation");
|
_nextSSRation = scopeRes.getFieldInfo("_nextSSRation");
|
||||||
_currentSSRatio = scopeRes.getFieldInfo("_currentSSRatio");
|
_currentSSRatio = scopeRes.getFieldInfo("_currentSSRatio");
|
||||||
|
|
||||||
Logger.LogInfo($"Updating defaultSSRatio to {_nextSSRation.GetValue(ssaaInstance)}");
|
//Logger.LogInfo($"Updating defaultSSRatio to {_nextSSRation.GetValue(ssaaInstance)}");
|
||||||
defaultSSRatio = (float)_nextSSRation.GetValue(ssaaInstance);
|
defaultSSRatio = (float)_nextSSRation.GetValue(ssaaInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +97,7 @@ namespace CameraResolutionScale
|
|||||||
{
|
{
|
||||||
if (scopeRes.getScopeCamera() == null)
|
if (scopeRes.getScopeCamera() == null)
|
||||||
{
|
{
|
||||||
Logger.LogInfo("ScopeCamera not found! Restarting...");
|
//Logger.LogInfo("ScopeCamera not found! Restarting...");
|
||||||
yield return myDelaySec;
|
yield return myDelaySec;
|
||||||
StartCoroutine(tryGetScopeCamera());
|
StartCoroutine(tryGetScopeCamera());
|
||||||
yield break;
|
yield break;
|
||||||
@ -106,21 +105,18 @@ namespace CameraResolutionScale
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.LogInfo("Assigning scopeCamera");
|
//Logger.LogInfo("Assigning scopeCamera");
|
||||||
scopeCamera = scopeRes.getScopeCamera();
|
scopeCamera = scopeRes.getScopeCamera();
|
||||||
}
|
}
|
||||||
|
|
||||||
void subscribeToOnAimingChanged()
|
void subscribeToOnAimingChanged()
|
||||||
{
|
{
|
||||||
Logger.LogInfo($"subscribeToOnAimingChanged: player = {mainPlayer}");
|
//Logger.LogInfo($"subscribeToOnAimingChanged: player = {mainPlayer}");
|
||||||
mainPlayer.HandsController.OnAimingChanged += (args) =>
|
mainPlayer.HandsController.OnAimingChanged += (args) =>
|
||||||
{
|
{
|
||||||
Logger.LogInfo("Changing fovCompDist");
|
|
||||||
mainPlayer.ProceduralWeaponAnimation._fovCompensatoryDistance = -0.03f * fovCompDistScale.Value / 100f;
|
|
||||||
|
|
||||||
if (mainPlayer.HandsController.IsAiming)
|
if (mainPlayer.HandsController.IsAiming)
|
||||||
{
|
{
|
||||||
Logger.LogInfo("Updating camera resolutions");
|
//Logger.LogInfo("Updating camera resolutions");
|
||||||
_nextSSRation.SetValue(ssaaInstance, (float)(defaultSSRatio * cameraResolutionScale.Value / 100f));
|
_nextSSRation.SetValue(ssaaInstance, (float)(defaultSSRatio * cameraResolutionScale.Value / 100f));
|
||||||
|
|
||||||
if (scopeCamera != null && scopeCamera.isActiveAndEnabled)
|
if (scopeCamera != null && scopeCamera.isActiveAndEnabled)
|
||||||
@ -132,7 +128,7 @@ namespace CameraResolutionScale
|
|||||||
|
|
||||||
if (!mainPlayer.HandsController.IsAiming)
|
if (!mainPlayer.HandsController.IsAiming)
|
||||||
{
|
{
|
||||||
Logger.LogInfo("Restoring camera resolutions");
|
//Logger.LogInfo("Restoring camera resolutions");
|
||||||
_nextSSRation.SetValue(ssaaInstance, (float)(defaultSSRatio));
|
_nextSSRation.SetValue(ssaaInstance, (float)(defaultSSRatio));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -146,7 +142,7 @@ namespace CameraResolutionScale
|
|||||||
if (lastGameState != currentState)
|
if (lastGameState != currentState)
|
||||||
{
|
{
|
||||||
lastGameState = currentState;
|
lastGameState = currentState;
|
||||||
Logger.LogInfo($"GameState changed! {currentState}");
|
//Logger.LogInfo($"GameState changed! {currentState}");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//Logger.LogInfo("GameState unchanged.");
|
//Logger.LogInfo("GameState unchanged.");
|
||||||
@ -165,7 +161,8 @@ namespace CameraResolutionScale
|
|||||||
{
|
{
|
||||||
if (mainPlayer.HandsController.IsAiming)
|
if (mainPlayer.HandsController.IsAiming)
|
||||||
{
|
{
|
||||||
mainPlayer.ProceduralWeaponAnimation._fovCompensatoryDistance = -0.03f * fovCompDistScale.Value / 100f;
|
//Logger.LogInfo("Changing fovCompDist");
|
||||||
|
if (fovCompDistScale.Value) { mainPlayer.ProceduralWeaponAnimation._fovCompensatoryDistance = 0; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,29 +170,29 @@ namespace CameraResolutionScale
|
|||||||
|
|
||||||
if ((currentGameState == GameStatus.SoftStopping || currentGameState == GameStatus.Stopped))
|
if ((currentGameState == GameStatus.SoftStopping || currentGameState == GameStatus.Stopped))
|
||||||
{
|
{
|
||||||
Logger.LogInfo("Game is stopping, resetting stuffs for the next raid");
|
//Logger.LogInfo("Game is stopping, resetting stuffs for the next raid");
|
||||||
mainPlayer = null;
|
mainPlayer = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentGameState == GameStatus.Started)
|
if (currentGameState == GameStatus.Started)
|
||||||
{
|
{
|
||||||
Logger.LogInfo("Getting local player");
|
//Logger.LogInfo("Getting local player");
|
||||||
mainPlayer = utils.getLocalPlayer();
|
mainPlayer = utils.getLocalPlayer();
|
||||||
Logger.LogInfo($"Returned: {mainPlayer.GetType()}");
|
//Logger.LogInfo($"Returned: {mainPlayer.GetType()}");
|
||||||
|
|
||||||
Logger.LogInfo("Updating default FOV value");
|
//Logger.LogInfo("Updating default FOV value");
|
||||||
if (defaultFOVValue != Camera.main.fieldOfView) { defaultFOVValue = (int)Camera.main.fieldOfView; }
|
if (defaultFOVValue != Camera.main.fieldOfView) { defaultFOVValue = (int)Camera.main.fieldOfView; }
|
||||||
|
|
||||||
Logger.LogInfo("setUpCameras()");
|
//Logger.LogInfo("setUpCameras()");
|
||||||
setUpCameras();
|
setUpCameras();
|
||||||
|
|
||||||
Logger.LogInfo("UpdateSSRatio()");
|
//Logger.LogInfo("UpdateSSRatio()");
|
||||||
defaultSSRatio = (float)_nextSSRation.GetValue(ssaaInstance);
|
defaultSSRatio = (float)_nextSSRation.GetValue(ssaaInstance);
|
||||||
Logger.LogInfo($"Updating defaultSSRatio to {defaultSSRatio}");
|
//Logger.LogInfo($"Updating defaultSSRatio to {defaultSSRatio}");
|
||||||
//updateSSRatio();
|
//updateSSRatio();
|
||||||
|
|
||||||
Logger.LogInfo("subscibeToOnAimingChanged()");
|
//Logger.LogInfo("subscibeToOnAimingChanged()");
|
||||||
subscribeToOnAimingChanged();
|
subscribeToOnAimingChanged();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -207,7 +204,7 @@ namespace CameraResolutionScale
|
|||||||
// if (!isAiming && FPSCamera != null)
|
// if (!isAiming && FPSCamera != null)
|
||||||
// {
|
// {
|
||||||
// defaultSSRatio = (float)_nextSSRation.GetValue(ssaaInstance);
|
// defaultSSRatio = (float)_nextSSRation.GetValue(ssaaInstance);
|
||||||
// Logger.LogInfo($"Updating defaultSSRatio to {defaultSSRatio}");
|
// //Logger.LogInfo($"Updating defaultSSRatio to {defaultSSRatio}");
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace CameraResolutionScale
|
namespace ScopeTweaks
|
||||||
{
|
{
|
||||||
public class UpdateScopeResolution
|
public class CameraUtils
|
||||||
{
|
{
|
||||||
public Camera getMainCamera()
|
public Camera getMainCamera()
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using Comfort.Common;
|
using Comfort.Common;
|
||||||
using EFT;
|
using EFT;
|
||||||
|
|
||||||
namespace CameraResolutionScale
|
namespace ScopeTweaks
|
||||||
{
|
{
|
||||||
public class Utils
|
public class Utils
|
||||||
{
|
{
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
<ProjectGuid>{41D9C9BC-1D1B-4A90-8543-DD303712A766}</ProjectGuid>
|
<ProjectGuid>{41D9C9BC-1D1B-4A90-8543-DD303712A766}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>CameraResolutionScale</RootNamespace>
|
<RootNamespace>ScopeTweaks</RootNamespace>
|
||||||
<AssemblyName>CameraResolutionScale</AssemblyName>
|
<AssemblyName>notGreg.ScopeTweaks</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
@ -67,7 +67,6 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="DisableFOVScaling.cs" />
|
|
||||||
<Compile Include="Plugin.cs" />
|
<Compile Include="Plugin.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="UpdateScopeResolution.cs" />
|
<Compile Include="UpdateScopeResolution.cs" />
|
@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.3.32825.248
|
VisualStudioVersion = 17.3.32825.248
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CameraResolutionScale", "CameraResolutionScale\CameraResolutionScale.csproj", "{41D9C9BC-1D1B-4A90-8543-DD303712A766}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "notGreg.ScopeTweaks", "CameraResolutionScale\notGreg.ScopeTweaks.csproj", "{41D9C9BC-1D1B-4A90-8543-DD303712A766}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@ -11,8 +11,8 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{41D9C9BC-1D1B-4A90-8543-DD303712A766}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{41D9C9BC-1D1B-4A90-8543-DD303712A766}.Debug|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{41D9C9BC-1D1B-4A90-8543-DD303712A766}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{41D9C9BC-1D1B-4A90-8543-DD303712A766}.Debug|Any CPU.Build.0 = Release|Any CPU
|
||||||
{41D9C9BC-1D1B-4A90-8543-DD303712A766}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{41D9C9BC-1D1B-4A90-8543-DD303712A766}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{41D9C9BC-1D1B-4A90-8543-DD303712A766}.Release|Any CPU.Build.0 = Release|Any CPU
|
{41D9C9BC-1D1B-4A90-8543-DD303712A766}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
Loading…
x
Reference in New Issue
Block a user