using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Reptile;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("WoodzCamera")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Camera tweaks for Bomb Rush Cyberfunk")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("WoodzCamera")]
[assembly: AssemblyTitle("WoodzCamera")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace woodzcamera
{
[BepInPlugin("info.mariobluegloves.woodzcamerap", "Woodz Camera Tweaks", "1.0.0")]
[BepInProcess("Bomb Rush Cyberfunk.exe")]
public class WoodzCameraTweaks : BaseUnityPlugin
{
[HarmonyPatch(typeof(StageChunk), "UpdateChunk")]
public class Patch_UpdateChunk
{
public static void Prefix(ref bool __runOriginal)
{
if (CameraTweaksWoodz.applyWoodzChunkPatches.Value)
{
__runOriginal = false;
}
else
{
__runOriginal = true;
}
}
public static void Postfix(StageChunk __instance)
{
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
if (CameraTweaksWoodz.applyWoodzChunkPatches.Value)
{
if (!__instance.isActive)
{
__instance.ActivateChunk(true);
}
Vector3 currentCameraPosition = WorldHandler.instance.CurrentCameraPosition;
__instance.UpdateStreetLife(currentCameraPosition);
__instance.UpdateMoveObjects(currentCameraPosition);
JunkBehaviour.JunkUpdate(__instance.junkBehaviour, Core.dt);
}
}
}
public float C;
public float ofd;
public float js;
private bool sceneLoaded = false;
private void Awake()
{
SceneManager.sceneLoaded += OnSceneLoaded;
ApplyCullingCfg(CameraTweaksWoodz.setCulling.Value);
ApplyOfdCfg(CameraTweaksWoodz.setOfd.Value);
ApplyJoyCfg(CameraTweaksWoodz.setJoy.Value);
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
sceneLoaded = true;
}
private void ApplyCullingCfg(float culling)
{
C = culling;
}
private void ApplyOfdCfg(float ofdfactor)
{
ofd = ofdfactor;
}
private void ApplyJoyCfg(float joyFcator)
{
js = joyFcator;
}
private void Update()
{
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
if (!sceneLoaded)
{
return;
}
GameObject val = GameObject.Find("gameplayCamera(Clone)");
if ((Object)(object)val != (Object)null)
{
Camera component = val.GetComponent<Camera>();
GameplayCamera component2 = val.GetComponent<GameplayCamera>();
if ((Object)(object)component2 != (Object)null)
{
component2.joystickFactor = js;
component2.lookAngleHighest = 89f;
component2.lookAngleLowest = -89f;
component2.orbitFadeDuration = ofd;
}
if ((Object)(object)component != (Object)null)
{
component.farClipPlane = C;
Scene activeScene = SceneManager.GetActiveScene();
Debug.Log((object)("Camera settings adjusted for gameplayCamera(Clone)'s Camera in scene: " + ((Scene)(ref activeScene)).name));
sceneLoaded = false;
}
}
}
[HarmonyPatch(typeof(GrindAbility), "Init")]
[HarmonyPostfix]
public static void InitGRPatch(GrindAbility __instance)
{
if (CameraTweaksWoodz.setOfd.Value < 0f)
{
((Ability)__instance).customCameraMode = null;
}
}
[HarmonyPatch(typeof(WallrunLineAbility), "Init")]
[HarmonyPostfix]
public static void InitWRPatch(WallrunLineAbility __instance)
{
if (CameraTweaksWoodz.applyWoodzWallrideCamPatch.Value)
{
((Ability)__instance).customCameraMode = null;
}
}
[HarmonyPatch(typeof(WallrunLineAbility), "FixedUpdateAbility")]
[HarmonyPostfix]
public static void UpdateWRPatch(WallrunLineAbility __instance)
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Expected O, but got Unknown
if (CameraTweaksWoodz.applyWoodzWallrideCamPatch.Value)
{
((Ability)__instance).customCameraMode = null;
}
else
{
((Ability)__instance).customCameraMode = (CameraMode)new CameraModeWallrun(__instance);
}
}
[HarmonyPatch(typeof(VertAbility), "Init")]
[HarmonyPostfix]
public static void InitVertPatch(VertAbility __instance)
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Expected O, but got Unknown
if (CameraTweaksWoodz.applyWoodzVertCamPatch.Value)
{
((Ability)__instance).customCameraMode = null;
}
else
{
((Ability)__instance).customCameraMode = (CameraMode)new CameraModeVert(__instance);
}
}
[HarmonyPatch(typeof(HandplantAbility), "Init")]
[HarmonyPostfix]
public static void InitHandplantPatch(HandplantAbility __instance)
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Expected O, but got Unknown
if (CameraTweaksWoodz.applyWoodzHandplantCamPatch.Value)
{
((Ability)__instance).customCameraMode = null;
}
else
{
((Ability)__instance).customCameraMode = (CameraMode)new CameraModeHandplant(__instance);
}
}
}
[BepInPlugin("info.mariobluegloves.woodzcamera", "Woodz Camera Tweaks", "1.0.0")]
[BepInProcess("Bomb Rush Cyberfunk.exe")]
public class CameraTweaksWoodz : BaseUnityPlugin
{
public static ConfigEntry<bool> applyWoodzChunkPatches;
public static ConfigEntry<bool> applyWoodzWallrideCamPatch;
public static ConfigEntry<bool> applyWoodzVertCamPatch;
public static ConfigEntry<bool> applyWoodzHandplantCamPatch;
public static ConfigEntry<float> setCulling;
public static ConfigEntry<float> setOfd;
public static ConfigEntry<float> setJoy;
public void Awake()
{
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Expected O, but got Unknown
applyWoodzChunkPatches = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "KeepChunksLoaded", false, "Keeps chunks always loaded regardless of camera position. Not recommended for low-end PCs. Will cause problems on certain maps, for example Brink Terminal's LOD.");
applyWoodzWallrideCamPatch = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "DisableWallrideCam", false, "Disables the wallride custom camera.");
applyWoodzVertCamPatch = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "DisableVertCam", false, "Disables the vert custom camera. (Requires map restart to take effect.)");
applyWoodzHandplantCamPatch = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "DisableHandplantCam", false, "Disables the handplant/invert custom camera. (Requires map restart to take effect.)");
setCulling = ((BaseUnityPlugin)this).Config.Bind<float>("Settings", "SetClipping", 1000f, "Sets the far clip plane, which is what cuts off things from being rendered at a distance. Set higher to have things that are further away be rendered that normally wouldn't.");
setOfd = ((BaseUnityPlugin)this).Config.Bind<float>("Settings", "SetOfd", 5f, "Sets the orbit fade duration. Set this to -1 to disable camera's automatic re-centering (and custom grind camera,) set to 5 for vanilla, lower will be a lower time it will take to re-center and higher will be a higher one.");
setJoy = ((BaseUnityPlugin)this).Config.Bind<float>("Settings", "SetJoy", 1.5f, "Sets joystick sensitivity. This is a separate value than the one in your options menu which will scale this one, so feel free to set both. Vanilla is 1.5.");
Harmony val = new Harmony("info.mariobluegloves.woodzcamerap");
val.PatchAll();
val.PatchAll(typeof(WoodzCameraTweaks));
}
}
}