using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AIGraph;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Unity.IL2CPP;
using GTFO.API.Utilities;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using LevelGeneration;
using Microsoft.CodeAnalysis;
using Player;
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("CelShadeTFO")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("CelShadeTFO")]
[assembly: AssemblyTitle("CelShadeTFO")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
}
namespace CelShadeTFO
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("CelShadeTFO", "CelShadeTFO", "0.0.1")]
public class Plugin : BasePlugin
{
public class CelShadeTFO : MonoBehaviour
{
public static void OnFileChanged(LiveEditEventArgs e)
{
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
Debug.Log(Object.op_Implicit("CelShadeTFO - configuration changed, reloading.."));
config.Reload();
string[] array = _cfgColor.Value.Split(",");
int.TryParse(array[0], out var result);
int.TryParse(array[1], out var result2);
int.TryParse(array[2], out var result3);
int.TryParse(array[3], out var result4);
float num = 0f;
float num2 = 0f;
float num3 = 0f;
float num4 = 0f;
if (result > 0)
{
num = (float)result / 255f;
}
if (result2 > 0)
{
num2 = (float)result2 / 255f;
}
if (result3 > 0)
{
num3 = (float)result3 / 255f;
}
if (result4 > 0)
{
num4 = (float)result4 / 255f;
}
worldColor = new Color(num, num2, num3, num4);
Doit();
}
public static void Awake()
{
Debug.Log(Object.op_Implicit("CelShadeTFO is loaded"));
}
public static void Doit()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Expected O, but got Unknown
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
Texture2D val = new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height);
for (int i = 0; i < ((Texture)val).width; i++)
{
for (int j = 0; j < ((Texture)val).height; j++)
{
val.SetPixel(i, j, worldColor);
}
}
val.Apply();
Enumerator<LG_Zone> enumerator = Builder.CurrentFloor.allZones.GetEnumerator();
while (enumerator.MoveNext())
{
Enumerator<AIG_CourseNode> enumerator2 = enumerator.Current.m_courseNodes.GetEnumerator();
while (enumerator2.MoveNext())
{
AIG_CourseNode current = enumerator2.Current;
_ = current.Position;
Il2CppArrayBase<Transform> componentsInChildren = current.gameObject.GetComponentsInChildren<Transform>(true);
if (componentsInChildren == null)
{
continue;
}
Debug.Log(Object.op_Implicit($"CelShadeTFO - coursenode {current.Position} yoinking {componentsInChildren.Count} objects.."));
foreach (Transform item in componentsInChildren)
{
if ((Object)(object)item != (Object)null && ((Component)item).gameObject.active)
{
MeshRenderer component = ((Component)item).GetComponent<MeshRenderer>();
if ((Object)(object)component != (Object)null && (Object)(object)((Component)item).GetComponent<CanvasRenderer>() == (Object)null)
{
((Renderer)component).material.SetTexture("_MainTex", (Texture)(object)val);
}
}
}
}
}
PlayerAgent localPlayerAgent = PlayerManager.GetLocalPlayerAgent();
if ((Object)(object)((Component)localPlayerAgent).gameObject.GetComponent<EffectLight>() == (Object)null)
{
light = ((Component)localPlayerAgent).gameObject.AddComponent<EffectLight>();
}
if (_cfgFullBright.Value)
{
((LightBase)light).Intensity = 0.2f;
((LightBase)light).Range = 200f;
((LightBase)light).Color = new Color(1f, 1f, 0.78431f) * 0.65f;
}
if (!_cfgFullBright.Value)
{
((LightBase)light).Intensity = 0f;
((LightBase)light).Range = 0f;
}
}
}
public static string CONFIG_PATH = Path.Combine(Paths.ConfigPath, "CelShadeTFO.cfg");
public static ConfigFile config = new ConfigFile(CONFIG_PATH, true);
public static ConfigEntry<string> _cfgColor;
public static ConfigEntry<bool> _cfgFullBright;
public static Color worldColor = Color.red;
public static EffectLight light = new EffectLight();
public override void Load()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Expected O, but got Unknown
//IL_002e: Expected O, but got Unknown
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Expected O, but got Unknown
//IL_005d: Expected O, but got Unknown
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Expected O, but got Unknown
//IL_0147: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
_cfgColor = config.Bind<string>(new ConfigDefinition("General", "Color"), "255, 0, 0, 255", new ConfigDescription("World texture color (unity Color r,g,b,a values 0-255 no decimals, default value is blood red)", (AcceptableValueBase)null, Array.Empty<object>()));
_cfgFullBright = config.Bind<bool>(new ConfigDefinition("General", "FullBright"), false, new ConfigDescription("Fullbright visuals for the eye opening brightness", (AcceptableValueBase)null, Array.Empty<object>()));
((BasePlugin)this).AddComponent<CelShadeTFO>();
LG_Factory.OnFactoryBuildDone += Action.op_Implicit((Action)CelShadeTFO.Doit);
LiveEditListener obj = LiveEdit.CreateListener(Paths.ConfigPath, "CelShadeTFO.cfg", false);
obj.FileChangedEventCooldown = 0.75f;
obj.FileChanged += new LiveEditEventHandler(CelShadeTFO.OnFileChanged);
string[] array = _cfgColor.Value.Split(",");
int.TryParse(array[0], out var result);
int.TryParse(array[1], out var result2);
int.TryParse(array[2], out var result3);
int.TryParse(array[3], out var result4);
float num = 0f;
float num2 = 0f;
float num3 = 0f;
float num4 = 0f;
if (result > 0)
{
num = (float)result / 255f;
}
if (result2 > 0)
{
num2 = (float)result2 / 255f;
}
if (result3 > 0)
{
num3 = (float)result3 / 255f;
}
if (result4 > 0)
{
num4 = (float)result4 / 255f;
}
worldColor = new Color(num, num2, num3, num4);
}
}
[GeneratedCode("VersionInfoGenerator", "2.0.0+git50a4b1a-master")]
[CompilerGenerated]
internal static class VersionInfo
{
public const string RootNamespace = "CelShadeTFO";
public const string Version = "1.0.0";
public const string VersionPrerelease = null;
public const string VersionMetadata = null;
public const string SemVer = "1.0.0";
public const string GitRevShort = null;
public const string GitRevLong = null;
public const string GitBranch = null;
public const string GitTag = null;
public const bool GitIsDirty = false;
}
}