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.Logging;
using HarmonyLib;
using JuukenQoLMod.Config;
using Microsoft.CodeAnalysis;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: AssemblyCompany("JuukenQoLMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("JuukenQoLMod")]
[assembly: AssemblyTitle("JuukenQoLMod")]
[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 JuukenQoLMod
{
[BepInPlugin("JuukenQoLMod", "JuukenQoLMod", "1.0.0")]
public class JuukenQoLMod : BaseUnityPlugin
{
private static JuukenQoLMod Instance;
private readonly Harmony harmony = new Harmony("JuukenQoLMod");
internal static JuukenQoLModConfig config { get; private set; }
internal static ManualLogSource Logger { get; private set; }
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = new JuukenQoLMod();
}
Logger = ((BaseUnityPlugin)this).Logger;
config = new JuukenQoLModConfig(((BaseUnityPlugin)this).Config);
Logger.LogInfo((object)"Plugin JuukenQoLMod is loaded!");
harmony.PatchAll(Assembly.GetExecutingAssembly());
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "JuukenQoLMod";
public const string PLUGIN_NAME = "JuukenQoLMod";
public const string PLUGIN_VERSION = "1.0.0";
}
}
namespace JuukenQoLMod.Patches
{
[HarmonyPatch(typeof(VideoCamera))]
internal class VideoCameraPatch
{
[HarmonyPostfix]
[HarmonyPatch("ConfigItem")]
private static void CameraTimePatch(ref VideoInfoEntry ___m_recorderInfoEntry)
{
if (___m_recorderInfoEntry.maxTime == 90f)
{
float value = JuukenQoLMod.config.VIDEO_CLIP_DURATION.Value;
___m_recorderInfoEntry.maxTime = value;
___m_recorderInfoEntry.timeLeft = value;
((ItemDataEntry)___m_recorderInfoEntry).SetDirty();
JuukenQoLMod.Logger.LogInfo((object)$"Changed camera max record time to {value}");
}
}
}
}
namespace JuukenQoLMod.Config
{
internal class JuukenQoLModConfig
{
internal ConfigEntry<float> VIDEO_CLIP_DURATION;
internal JuukenQoLModConfig(ConfigFile cfgFile)
{
VIDEO_CLIP_DURATION = cfgFile.Bind<float>("Duration", "VideoClipDuration", 180f, "How many seconds the camera can record?" + Environment.NewLine + "Game default is 90.");
}
}
}