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 BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using CrimsonFOV.Structs;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using ProjectM;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("CrimsonFOV")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Modifies the camera field of view")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+Branch.master.Sha.ee9735dc034ab316ac9fb1c86f8a6fd37da23caa.ee9735dc034ab316ac9fb1c86f8a6fd37da23caa")]
[assembly: AssemblyProduct("CrimsonFOV")]
[assembly: AssemblyTitle("CrimsonFOV")]
[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 CrimsonFOV
{
[BepInPlugin("CrimsonFOV", "CrimsonFOV", "1.0.0")]
public class Plugin : BasePlugin
{
private Harmony _harmony;
public static Settings Settings { get; private set; }
public static ManualLogSource Logger { get; private set; }
public override void Load()
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Expected O, but got Unknown
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Expected O, but got Unknown
Settings = new Settings(((BasePlugin)this).Config);
Logger = ((BasePlugin)this).Log;
ManualLogSource logger = Logger;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(27, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("CrimsonFOV");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" version ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.0.0");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!");
}
logger.LogInfo(val);
_harmony = new Harmony("CrimsonFOV");
_harmony.PatchAll(Assembly.GetExecutingAssembly());
}
public override bool Unload()
{
Harmony harmony = _harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
return true;
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "CrimsonFOV";
public const string PLUGIN_NAME = "CrimsonFOV";
public const string PLUGIN_VERSION = "1.0.0";
}
}
namespace CrimsonFOV.Structs
{
public readonly struct Settings
{
internal readonly ConfigFile CONFIG;
internal readonly ConfigEntry<bool> ENABLE_MOD;
internal readonly ConfigEntry<float> FIELD_OF_VIEW;
public Settings(ConfigFile config)
{
CONFIG = config;
ENABLE_MOD = config.Bind<bool>("Config", "EnableMod", true, "Enable or disable the mod");
FIELD_OF_VIEW = config.Bind<float>("Config", "FieldOfView", 60f, "The desired field of view");
}
}
}
namespace CrimsonFOV.Hooks
{
[HarmonyPatch]
public class Bootstrap
{
[HarmonyPatch(typeof(GameBootstrap), "Start")]
[HarmonyPostfix]
public static void Postfix(GameBootstrap __instance)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Expected O, but got Unknown
if (Application.productName == "VRisingServer")
{
ManualLogSource logger = Plugin.Logger;
bool flag = default(bool);
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(26, 0, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("This is a client-only mod.");
}
logger.LogWarning(val);
}
else
{
CameraManager.GetCamera().fieldOfView = Plugin.Settings.FIELD_OF_VIEW.Value;
}
}
}
}