using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using PluginConfig.API;
using PluginConfig.API.Fields;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Rendering;
using UnityEngine.Timeline;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("EyeOfProvidence")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EyeOfProvidence")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4f3178f0-3d13-4083-8082-9c202d685155")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace EyeOfProvidence;
public class AssetHandler
{
public static AssetBundle bundle;
public static bool bundleLoaded = false;
public static Dictionary<string, GameObject> prefabs = new Dictionary<string, GameObject>();
public static void LoadBundle(string name)
{
if (bundleLoaded)
{
Debug.Log((object)("AssetBundle " + name + " already loaded"));
return;
}
bundle = AssetBundle.LoadFromFile(Path.Combine(Path.Combine(Utils.ModDir(), "Data"), name));
if ((Object)(object)bundle != (Object)null)
{
Debug.Log((object)("AssetBundle " + name + " successfully loaded"));
bundleLoaded = true;
}
else
{
Debug.Log((object)("AssetBundle " + name + " failed to loaded"));
bundleLoaded = false;
}
}
public static T LoadAsset<T>(string name) where T : Object
{
if (!bundleLoaded)
{
Debug.Log((object)"Bundle is not loaded");
return default(T);
}
T val = bundle.LoadAsset<T>(name);
if ((Object)(object)val == (Object)null)
{
Debug.Log((object)(name + " didn't load"));
}
return val;
}
public static void UnloadBundle()
{
if (!bundleLoaded)
{
Debug.Log((object)"Bundle already unloaded");
return;
}
Debug.Log((object)"Bundle succesfully unloaded");
bundle.Unload(true);
bundle = null;
}
}
public class CamInfo
{
public float posDist = 1f;
public Quaternion camRot = Quaternion.identity;
public Vector2 scale = Vector2.one;
}
public enum GlobeRayMehtod
{
General,
Cube
}
public class GlobeInfo
{
public string name = "Globe";
public CamInfo[] camInfos;
public GlobeRayMehtod rayMethod = GlobeRayMehtod.General;
}
public class GlobeRender : MonoBehaviour
{
public CommandBuffer bloodOilCB;
public CommandBuffer limboCB;
public Camera mainCam;
public Dictionary<GlobeSkyboxType, GlobeSkybox> skyboxGlobes = new Dictionary<GlobeSkyboxType, GlobeSkybox>();
private Mesh mesh;
public void Start()
{
Init();
}
public void Init()
{
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Expected O, but got Unknown
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Expected O, but got Unknown
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Expected O, but got Unknown
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Expected O, but got Unknown
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Expected O, but got Unknown
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Expected O, but got Unknown
skyboxGlobes.Add(GlobeSkyboxType.Limbo, null);
skyboxGlobes.Add(GlobeSkyboxType.Theater, null);
skyboxGlobes.Add(GlobeSkyboxType.Space, null);
if (bloodOilCB == null)
{
bloodOilCB = new CommandBuffer();
bloodOilCB.name = "Globe Blood and Oil";
Plugin.cams[0].AddCommandBuffer((CameraEvent)20, bloodOilCB);
}
if (limboCB == null)
{
limboCB = new CommandBuffer();
limboCB.name = "Limbo Butt Fart";
}
Camera.onPreRender = (CameraCallback)Delegate.Combine((Delegate?)(object)Camera.onPreRender, (Delegate?)new CameraCallback(OnPreRenderCallback));
Camera.onPostRender = (CameraCallback)Delegate.Combine((Delegate?)(object)Camera.onPostRender, (Delegate?)new CameraCallback(OnPostRenderCallback));
}
public bool HasSkybox(GlobeSkyboxType type)
{
return (Object)(object)skyboxGlobes[type] != (Object)null;
}
public bool RenderSkybox(GlobeSkyboxType type)
{
if ((Object)(object)skyboxGlobes[type] == (Object)null)
{
return false;
}
skyboxGlobes[type].RenderSkybox();
return true;
}
public Texture GetSkyboxTexture(GlobeSkyboxType type, int index)
{
if ((Object)(object)skyboxGlobes[type] == (Object)null)
{
return null;
}
return skyboxGlobes[type].GetSkyboxTexture(index);
}
public void CreateSkyboxGlobe(GlobeSkyboxType type, Transform target)
{
if ((Object)(object)skyboxGlobes[type] != (Object)null)
{
skyboxGlobes[type].DestroySkyboxGlobe();
}
skyboxGlobes[type] = GlobeSkybox.CreateSkyboxGlobe(target);
}
public void UpdateSkyboxGlobes()
{
GlobeSkybox[] array = skyboxGlobes.Values.ToArray();
for (int i = 0; i < array.Length; i++)
{
if (Object.op_Implicit((Object)(object)array[i]))
{
array[i].UpdateSkyboxCams();
}
}
}
public void DestroySkyboxGlobes()
{
GlobeSkybox[] array = skyboxGlobes.Values.ToArray();
for (int i = 0; i < array.Length; i++)
{
if (Object.op_Implicit((Object)(object)array[i]))
{
array[i].DestroySkyboxGlobe();
}
}
}
public void Render2(Camera cam)
{
Shader.SetGlobalTexture("_LimboSky", Plugin.texst);
Shader.SetGlobalFloat("_LimboSkyWidth", (float)Plugin.texst.width);
Shader.SetGlobalFloat("_LimboSkyHeight", (float)Plugin.texst.height);
}
public void Render(Camera cam)
{
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//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)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_0129: 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)
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
BloodsplatterManager instance = MonoSingleton<BloodsplatterManager>.Instance;
StainVoxelManager instance2 = MonoSingleton<StainVoxelManager>.Instance;
PostProcessV2_Handler instance3 = MonoSingleton<PostProcessV2_Handler>.Instance;
mainCam = cam;
if (instance.usedComputeShadersAtStart)
{
instance.stainMat.SetBuffer("instanceBuffer", instance.instanceBuffer);
instance.stainMat.SetBuffer("parentBuffer", instance.parentBuffer);
instance2.gasStainMat.SetBuffer("instanceBuffer", instance2.propBuffer);
instance2.gasStainMat.SetBuffer("stainMatrices", instance2.stainBuffer);
}
bloodOilCB.Clear();
Matrix4x4 val = GL.GetGPUProjectionMatrix(instance3.mainCam.projectionMatrix, true) * instance3.mainCam.worldToCameraMatrix;
Matrix4x4 inverse = ((Matrix4x4)(ref val)).inverse;
bloodOilCB.SetRenderTarget(RenderTargetIdentifier.op_Implicit(instance3.reusableBufferB.colorBuffer));
bloodOilCB.ClearRenderTarget(false, true, Color.clear);
if (instance.usedComputeShadersAtStart)
{
bloodOilCB.DrawMeshInstancedIndirect(instance.optimizedBloodMesh, 0, instance.stainMat, 0, instance.argsBuffer, 0, (MaterialPropertyBlock)null);
}
else
{
bloodOilCB.DrawMesh(instance.totalStainMesh, Matrix4x4.identity, instance.stainMat);
}
bloodOilCB.SetRenderTarget(RenderTargetIdentifier.op_Implicit(mainCam.targetTexture.colorBuffer));
bloodOilCB.DrawProcedural(PostProcessV2_Handler.identityMatrix, instance.bloodCompositeMaterial, 1, (MeshTopology)0, 3, 1);
bloodOilCB.DrawMesh(Plugin.meshTest, Matrix4x4.identity, Plugin.meshMat);
}
private void OnPostRenderCallback(Camera cam)
{
if (!(((Object)cam).name == "Camera Front"))
{
}
}
private void OnPreRenderCallback(Camera cam)
{
Texture bexst = Plugin.bexst;
int index = 0;
bool flag = false;
switch (((Object)cam).name)
{
case "Globe Cam 1":
flag = true;
index = 0;
break;
case "Globe Cam 2":
flag = true;
index = 1;
break;
case "Globe Cam 3":
flag = true;
index = 2;
bexst = Plugin.texst;
break;
case "Globe Cam 4":
flag = true;
index = 3;
break;
case "Globe Cam 5":
flag = true;
index = 4;
break;
case "Globe Cam 6":
flag = true;
index = 5;
break;
}
if (flag)
{
Texture skyboxTexture = GetSkyboxTexture(GlobeSkyboxType.Limbo, index);
if (Object.op_Implicit((Object)(object)skyboxTexture))
{
Shader.SetGlobalTexture("_LimboSky", skyboxTexture);
Shader.SetGlobalFloat("_LimboSkyWidth", (float)skyboxTexture.width);
Shader.SetGlobalFloat("_LimboSkyHeight", (float)skyboxTexture.height);
}
Texture skyboxTexture2 = GetSkyboxTexture(GlobeSkyboxType.Space, index);
if (Object.op_Implicit((Object)(object)skyboxTexture2))
{
Shader.SetGlobalTexture("_SpaceSky", skyboxTexture2);
}
}
}
}
public enum ProjectionMode
{
Equirectangular,
Mercator,
Fisheye,
Stereographic,
Panini,
Hammer,
Winkel,
Quincuncial,
Bonne,
Polyconic,
Orthographic
}
public enum GlobeMode
{
Cube,
TriPrism,
Tetrahedron
}
public enum OrthoMode
{
Hemisphere,
Duel,
DuelCentered,
SplitBack,
SplitSide
}
public enum FisheyeMode
{
Equidistant,
EqualArea
}
public static class ConfigManager
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static PostFloatSliderValueChangeEvent <>9__45_0;
public static PostBoolValueChangeEvent <>9__45_1;
public static PostIntValueChangeEvent <>9__45_2;
public static PostEnumValueChangeEvent<ProjectionMode> <>9__45_3;
public static PostEnumValueChangeEvent<GlobeMode> <>9__45_4;
public static PostEnumValueChangeEvent<OrthoMode> <>9__45_5;
public static PostEnumValueChangeEvent<FisheyeMode> <>9__45_6;
public static PostFloatValueChangeEvent <>9__45_7;
internal void <Setup>b__45_0(float e, Tuple<float, float> f)
{
UpdateValeus();
}
internal void <Setup>b__45_1(bool e)
{
UpdateValeus();
}
internal void <Setup>b__45_2(int e)
{
UpdateValeus();
}
internal void <Setup>b__45_3(ProjectionMode e)
{
UpdateValeus();
}
internal void <Setup>b__45_4(GlobeMode e)
{
UpdateValeus();
}
internal void <Setup>b__45_5(OrthoMode e)
{
UpdateValeus();
}
internal void <Setup>b__45_6(FisheyeMode e)
{
UpdateValeus();
}
internal void <Setup>b__45_7(float e)
{
UpdateValeus();
}
}
public static PluginConfigurator config;
public static BoolField UltraFOV;
public static FloatField PlayerFOVUncapped;
public static FloatSliderField PlayerFOV;
public static BoolField PlayerFOVShouldUncap;
public static EnumField<ProjectionMode> Projection;
public static EnumField<OrthoMode> OrthoType;
public static EnumField<FisheyeMode> FisheyeType;
public static EnumField<GlobeMode> Globe;
public static BoolField Stretch;
public static BoolField VerticalFit;
public static FloatSliderField FisheyeFit;
public static FloatSliderField PaniniFactor;
public static FloatSliderField WinkelFit;
public static FloatSliderField WernerFactor;
public static FloatSliderField WernerFit;
public static FloatSliderField BonneShift;
public static FloatField Quality;
public static KeyCodeField UltraFOVBind;
public static BoolField EnableZooming;
public static BoolField Grid;
public static KeyCodeField GridBind;
public static FloatSliderField GridOpac;
public static BoolField Map;
public static KeyCodeField MapBind;
public static FloatSliderField MapOpac;
public static BoolField EffectViewModel;
public static FloatSliderField GlobeRotateX;
public static FloatSliderField GlobeRotateY;
public static FloatSliderField GlobeRotateZ;
public static BoolField EnableGlobeSkybox;
public static IntField GlobeSkyboxFramerate;
public static List<BoolField> GlobeEnablePlanes = new List<BoolField>();
public static int GlobeEnabledPlaneMask = int.MaxValue;
public static BoolField GlobeChangeAllPlaneQualitys;
public static FloatField GlobeQuality;
public static List<FloatField> GlobePlaneQualitys = new List<FloatField>();
public static List<KeyCodeField> projectionBinds = new List<KeyCodeField>();
public static List<FloatSliderField> projectionFOV = new List<FloatSliderField>();
public static List<BoolField> projectionStretch = new List<BoolField>();
public static List<BoolField> projectionVertFit = new List<BoolField>();
public static List<ConfigField> configs = new List<ConfigField>();
public static ConfigPanel ProjectionPanel;
public static ConfigPanel GlobePanel;
public static ConfigPanel MiscPanel;
public static void Setup()
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Expected O, but got Unknown
//IL_003f: Expected O, but got Unknown
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Expected O, but got Unknown
//IL_006a: Expected O, but got Unknown
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Expected O, but got Unknown
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Expected O, but got Unknown
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Expected O, but got Unknown
//IL_0212: Unknown result type (might be due to invalid IL or missing references)
//IL_0217: Unknown result type (might be due to invalid IL or missing references)
//IL_021d: Expected O, but got Unknown
//IL_0222: Expected O, but got Unknown
//IL_024c: Unknown result type (might be due to invalid IL or missing references)
//IL_0251: Unknown result type (might be due to invalid IL or missing references)
//IL_0257: Expected O, but got Unknown
//IL_025c: Expected O, but got Unknown
//IL_0286: Unknown result type (might be due to invalid IL or missing references)
//IL_028b: Unknown result type (might be due to invalid IL or missing references)
//IL_0291: Expected O, but got Unknown
//IL_0296: Expected O, but got Unknown
//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
//IL_02cb: Expected O, but got Unknown
//IL_02d0: Expected O, but got Unknown
//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0305: Expected O, but got Unknown
//IL_030a: Expected O, but got Unknown
//IL_0334: Unknown result type (might be due to invalid IL or missing references)
//IL_0339: Unknown result type (might be due to invalid IL or missing references)
//IL_033f: Expected O, but got Unknown
//IL_0344: Expected O, but got Unknown
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Expected O, but got Unknown
//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
//IL_03a8: Expected O, but got Unknown
//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
//IL_03db: Expected O, but got Unknown
//IL_047b: Unknown result type (might be due to invalid IL or missing references)
//IL_0482: Expected O, but got Unknown
//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
//IL_04ef: Expected O, but got Unknown
//IL_04f4: Expected O, but got Unknown
//IL_0530: Unknown result type (might be due to invalid IL or missing references)
//IL_0535: Unknown result type (might be due to invalid IL or missing references)
//IL_053b: Expected O, but got Unknown
//IL_0540: Expected O, but got Unknown
//IL_0557: Unknown result type (might be due to invalid IL or missing references)
//IL_055c: Unknown result type (might be due to invalid IL or missing references)
//IL_0562: Expected O, but got Unknown
//IL_0567: Expected O, but got Unknown
//IL_0591: Unknown result type (might be due to invalid IL or missing references)
//IL_0596: Unknown result type (might be due to invalid IL or missing references)
//IL_059c: Expected O, but got Unknown
//IL_05a1: Expected O, but got Unknown
//IL_05cb: Unknown result type (might be due to invalid IL or missing references)
//IL_05d0: Unknown result type (might be due to invalid IL or missing references)
//IL_05d6: Expected O, but got Unknown
//IL_05db: Expected O, but got Unknown
//IL_0605: Unknown result type (might be due to invalid IL or missing references)
//IL_060a: Unknown result type (might be due to invalid IL or missing references)
//IL_0610: Expected O, but got Unknown
//IL_0615: Expected O, but got Unknown
//IL_0650: Unknown result type (might be due to invalid IL or missing references)
//IL_0657: Expected O, but got Unknown
//IL_0698: Unknown result type (might be due to invalid IL or missing references)
//IL_069d: Unknown result type (might be due to invalid IL or missing references)
//IL_06a3: Expected O, but got Unknown
//IL_06a8: Expected O, but got Unknown
//IL_06be: Unknown result type (might be due to invalid IL or missing references)
//IL_06c3: Unknown result type (might be due to invalid IL or missing references)
//IL_06c9: Expected O, but got Unknown
//IL_06ce: Expected O, but got Unknown
//IL_06f8: Unknown result type (might be due to invalid IL or missing references)
//IL_06fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0703: Expected O, but got Unknown
//IL_0708: Expected O, but got Unknown
//IL_071e: Unknown result type (might be due to invalid IL or missing references)
//IL_0723: Unknown result type (might be due to invalid IL or missing references)
//IL_0729: Expected O, but got Unknown
//IL_072e: Expected O, but got Unknown
//IL_0744: Unknown result type (might be due to invalid IL or missing references)
//IL_0749: Unknown result type (might be due to invalid IL or missing references)
//IL_074f: Expected O, but got Unknown
//IL_0754: Expected O, but got Unknown
//IL_077e: Unknown result type (might be due to invalid IL or missing references)
//IL_0783: Unknown result type (might be due to invalid IL or missing references)
//IL_0789: Expected O, but got Unknown
//IL_078e: Expected O, but got Unknown
//IL_07a4: Unknown result type (might be due to invalid IL or missing references)
//IL_07a9: Unknown result type (might be due to invalid IL or missing references)
//IL_07af: Expected O, but got Unknown
//IL_07b4: Expected O, but got Unknown
//IL_07ca: Unknown result type (might be due to invalid IL or missing references)
//IL_07cf: Unknown result type (might be due to invalid IL or missing references)
//IL_07d5: Expected O, but got Unknown
//IL_07da: Expected O, but got Unknown
//IL_083b: Unknown result type (might be due to invalid IL or missing references)
//IL_0840: Unknown result type (might be due to invalid IL or missing references)
//IL_0846: Expected O, but got Unknown
//IL_08ef: Unknown result type (might be due to invalid IL or missing references)
//IL_08f4: Unknown result type (might be due to invalid IL or missing references)
//IL_08fa: Expected O, but got Unknown
//IL_091d: Unknown result type (might be due to invalid IL or missing references)
//IL_0922: Unknown result type (might be due to invalid IL or missing references)
//IL_0928: Expected O, but got Unknown
//IL_09fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0a02: Unknown result type (might be due to invalid IL or missing references)
//IL_0a08: Expected O, but got Unknown
config = PluginConfigurator.Create("Eye of Providence", "ironfarm.uk.xbox369");
List<ConfigField> list = configs;
BoolField val = new BoolField(config.rootPanel, "Enable Mod", "bool.ultrafov", true);
UltraFOV = val;
list.Add((ConfigField)val);
List<ConfigField> list2 = configs;
KeyCodeField val2 = new KeyCodeField(config.rootPanel, "Activation Keybind", "keycode.ultrafov", (KeyCode)0);
UltraFOVBind = val2;
list2.Add((ConfigField)val2);
ProjectionPanel = new ConfigPanel(config.rootPanel, "Projection Settings", "panel.projection");
GlobePanel = new ConfigPanel(config.rootPanel, "Globe Settings", "panel.globe");
MiscPanel = new ConfigPanel(config.rootPanel, "Misc Settings", "panel.misc");
for (int i = 0; i < Enum.GetNames(typeof(ProjectionMode)).Length; i++)
{
float num = 360f;
switch ((ProjectionMode)i)
{
case ProjectionMode.Panini:
num = 180f;
break;
case ProjectionMode.Stereographic:
num = 180f;
break;
}
ConfigPanel projectionPanel = ProjectionPanel;
ProjectionMode projectionMode = (ProjectionMode)i;
FloatSliderField item = new FloatSliderField(projectionPanel, "Player Fov", "slider.playerfov." + projectionMode.ToString().ToLower(), new Tuple<float, float>(0f, 360f), num, 0, true, true);
configs.Add((ConfigField)(object)item);
projectionFOV.Add(item);
}
configs.Add((ConfigField)(object)(Projection = new EnumField<ProjectionMode>(ProjectionPanel, "Projection", "enum.projection", ProjectionMode.Panini)));
configs.Add((ConfigField)(object)(FisheyeType = new EnumField<FisheyeMode>(ProjectionPanel, "Fisheye Mode", "enum.fisheyemode", FisheyeMode.Equidistant)));
configs.Add((ConfigField)(object)(OrthoType = new EnumField<OrthoMode>(ProjectionPanel, "Orthograhpic Mode", "enum.orthomode", OrthoMode.Duel)));
List<ConfigField> list3 = configs;
FloatSliderField val3 = new FloatSliderField(ProjectionPanel, "Fisheye Fit", "slider.fisheyefit", new Tuple<float, float>(0f, 2f), 0f, 2);
FisheyeFit = val3;
list3.Add((ConfigField)val3);
List<ConfigField> list4 = configs;
FloatSliderField val4 = new FloatSliderField(ProjectionPanel, "Panini Intensity", "slider.paninifactor", new Tuple<float, float>(0f, 1f), 1f, 2);
PaniniFactor = val4;
list4.Add((ConfigField)val4);
List<ConfigField> list5 = configs;
FloatSliderField val5 = new FloatSliderField(ProjectionPanel, "Winkel Fit", "slider.winkelfit", new Tuple<float, float>(0f, 1f), 0f, 2);
WinkelFit = val5;
list5.Add((ConfigField)val5);
List<ConfigField> list6 = configs;
FloatSliderField val6 = new FloatSliderField(ProjectionPanel, "Werner Factor", "slider.wernerfactor", new Tuple<float, float>(0f, 1f), 1f, 2);
WernerFactor = val6;
list6.Add((ConfigField)val6);
List<ConfigField> list7 = configs;
FloatSliderField val7 = new FloatSliderField(ProjectionPanel, "Werner Fit", "slider.wernerfit", new Tuple<float, float>(0f, 1f), 1f, 2);
WernerFit = val7;
list7.Add((ConfigField)val7);
List<ConfigField> list8 = configs;
FloatSliderField val8 = new FloatSliderField(ProjectionPanel, "Bonne Centering", "slider.bonneshift", new Tuple<float, float>(0f, 1f), 1f, 2);
BonneShift = val8;
list8.Add((ConfigField)val8);
for (int j = 0; j < Enum.GetNames(typeof(ProjectionMode)).Length; j++)
{
bool flag = false;
ProjectionMode projectionMode2 = (ProjectionMode)j;
ProjectionMode projectionMode3 = projectionMode2;
if (projectionMode3 == ProjectionMode.Fisheye || (uint)(projectionMode3 - 6) <= 1u || projectionMode3 == ProjectionMode.Polyconic)
{
flag = true;
}
ConfigPanel projectionPanel2 = ProjectionPanel;
ProjectionMode projectionMode = (ProjectionMode)j;
BoolField item2 = new BoolField(projectionPanel2, "Ignore Aspect Ratio", "bool.stretch." + projectionMode.ToString().ToLower(), false);
ConfigPanel projectionPanel3 = ProjectionPanel;
projectionMode = (ProjectionMode)j;
BoolField item3 = new BoolField(projectionPanel3, "Vertical Fit", "bool.vertfit." + projectionMode.ToString().ToLower(), flag);
configs.Add((ConfigField)(object)item2);
projectionStretch.Add(item2);
configs.Add((ConfigField)(object)item3);
projectionVertFit.Add(item3);
}
for (int k = 0; k < Enum.GetNames(typeof(ProjectionMode)).Length; k++)
{
ConfigPanel projectionPanel4 = ProjectionPanel;
ProjectionMode projectionMode = (ProjectionMode)k;
string text = projectionMode.ToString() + " Keybind";
projectionMode = (ProjectionMode)k;
KeyCodeField item4 = new KeyCodeField(projectionPanel4, text, "keycode.projection." + projectionMode.ToString().ToLower(), (KeyCode)0);
configs.Add((ConfigField)(object)item4);
projectionBinds.Add(item4);
}
List<ConfigField> list9 = configs;
FloatField val9 = new FloatField(GlobePanel, "Quality", "float.quality", 9f, 0f, 10f);
Quality = val9;
list9.Add((ConfigField)val9);
configs.Add((ConfigField)(object)(Globe = new EnumField<GlobeMode>(GlobePanel, "Globe", "enum.globe", GlobeMode.Cube)));
List<ConfigField> list10 = configs;
BoolField val10 = new BoolField(GlobePanel, "Enable Globe Skybox", "bool.globeskybox", true);
EnableGlobeSkybox = val10;
list10.Add((ConfigField)val10);
List<ConfigField> list11 = configs;
IntField val11 = new IntField(GlobePanel, "Globe Skybox Refresh Rate", "int.globeskyboxfps", 60);
GlobeSkyboxFramerate = val11;
list11.Add((ConfigField)val11);
List<ConfigField> list12 = configs;
FloatSliderField val12 = new FloatSliderField(GlobePanel, "Globe X Rotation", "slider.globerotx", new Tuple<float, float>(-1f, 1f), 0f, 2);
GlobeRotateX = val12;
list12.Add((ConfigField)val12);
List<ConfigField> list13 = configs;
FloatSliderField val13 = new FloatSliderField(GlobePanel, "Globe Y Rotation", "slider.globeroty", new Tuple<float, float>(-1f, 1f), 0f, 2);
GlobeRotateY = val13;
list13.Add((ConfigField)val13);
List<ConfigField> list14 = configs;
FloatSliderField val14 = new FloatSliderField(GlobePanel, "Globe Z Rotation", "slider.globerotz", new Tuple<float, float>(-1f, 1f), 0f, 2);
GlobeRotateZ = val14;
list14.Add((ConfigField)val14);
for (int l = 0; l < 6; l++)
{
BoolField item5 = new BoolField(GlobePanel, "Globe Enable Panel " + (l + 1), "bool.globeenablepanel." + (l + 1), true);
configs.Add((ConfigField)(object)item5);
GlobeEnablePlanes.Add(item5);
}
List<ConfigField> list15 = configs;
BoolField val15 = new BoolField(MiscPanel, "Grid View", "bool.grid", false);
Grid = val15;
list15.Add((ConfigField)val15);
List<ConfigField> list16 = configs;
KeyCodeField val16 = new KeyCodeField(MiscPanel, "Grid Keybind", "keycode.grid", (KeyCode)0);
GridBind = val16;
list16.Add((ConfigField)val16);
List<ConfigField> list17 = configs;
FloatSliderField val17 = new FloatSliderField(MiscPanel, "Grid Opacity", "slider.gridopac", new Tuple<float, float>(0f, 1f), 0.2f, 2);
GridOpac = val17;
list17.Add((ConfigField)val17);
List<ConfigField> list18 = configs;
BoolField val18 = new BoolField(MiscPanel, "Map View", "bool.map", false);
Map = val18;
list18.Add((ConfigField)val18);
List<ConfigField> list19 = configs;
KeyCodeField val19 = new KeyCodeField(MiscPanel, "Map Keybind", "keycode.map", (KeyCode)0);
MapBind = val19;
list19.Add((ConfigField)val19);
List<ConfigField> list20 = configs;
FloatSliderField val20 = new FloatSliderField(MiscPanel, "Map Opacity", "slider.mapopac", new Tuple<float, float>(0f, 1f), 0.75f, 2);
MapOpac = val20;
list20.Add((ConfigField)val20);
List<ConfigField> list21 = configs;
BoolField val21 = new BoolField(MiscPanel, "Enable Zooming", "bool.zooming", true);
EnableZooming = val21;
list21.Add((ConfigField)val21);
List<ConfigField> list22 = configs;
BoolField val22 = new BoolField(MiscPanel, "Projection Affects View Model", "bool.viewmodel", false);
EffectViewModel = val22;
list22.Add((ConfigField)val22);
for (int m = 0; m < configs.Count(); m++)
{
Type type = ((object)configs[m]).GetType();
if (configs[m] is FloatSliderField)
{
ConfigField obj = configs[m];
FloatSliderField val23 = (FloatSliderField)(object)((obj is FloatSliderField) ? obj : null);
object obj2 = <>c.<>9__45_0;
if (obj2 == null)
{
PostFloatSliderValueChangeEvent val24 = delegate
{
UpdateValeus();
};
<>c.<>9__45_0 = val24;
obj2 = (object)val24;
}
val23.postValueChangeEvent += (PostFloatSliderValueChangeEvent)obj2;
continue;
}
ConfigField val25 = configs[m];
ConfigField val26 = val25;
BoolField val27 = (BoolField)(object)((val26 is BoolField) ? val26 : null);
if (val27 == null)
{
IntField val28 = (IntField)(object)((val26 is IntField) ? val26 : null);
if (val28 == null)
{
if (!(val26 is EnumField<ProjectionMode> val29))
{
if (!(val26 is EnumField<GlobeMode> val30))
{
if (!(val26 is EnumField<OrthoMode> val31))
{
if (!(val26 is EnumField<FisheyeMode> val32))
{
FloatField val33 = (FloatField)(object)((val26 is FloatField) ? val26 : null);
if (val33 == null)
{
continue;
}
object obj3 = <>c.<>9__45_7;
if (obj3 == null)
{
PostFloatValueChangeEvent val34 = delegate
{
UpdateValeus();
};
<>c.<>9__45_7 = val34;
obj3 = (object)val34;
}
val33.postValueChangeEvent += (PostFloatValueChangeEvent)obj3;
}
else
{
val32.postValueChangeEvent += delegate
{
UpdateValeus();
};
}
}
else
{
val31.postValueChangeEvent += delegate
{
UpdateValeus();
};
}
}
else
{
val30.postValueChangeEvent += delegate
{
UpdateValeus();
};
}
}
else
{
val29.postValueChangeEvent += delegate
{
UpdateValeus();
};
}
continue;
}
object obj4 = <>c.<>9__45_2;
if (obj4 == null)
{
PostIntValueChangeEvent val35 = delegate
{
UpdateValeus();
};
<>c.<>9__45_2 = val35;
obj4 = (object)val35;
}
val28.postValueChangeEvent += (PostIntValueChangeEvent)obj4;
continue;
}
object obj5 = <>c.<>9__45_1;
if (obj5 == null)
{
PostBoolValueChangeEvent val36 = delegate
{
UpdateValeus();
};
<>c.<>9__45_1 = val36;
obj5 = (object)val36;
}
val27.postValueChangeEvent += (PostBoolValueChangeEvent)obj5;
}
UpdateValeus();
string path = Utils.ModDir();
string text2 = Path.Combine(Path.Combine(path, "Data"), "icon.png");
config.SetIconWithURL("file://" + text2);
}
public static void Update()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: 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)
if (Input.GetKeyUp(UltraFOVBind.value))
{
UltraFOV.value = !UltraFOV.value;
UpdateValeus();
}
if (!UltraFOV.value)
{
return;
}
if (Input.GetKeyUp(MapBind.value))
{
Map.value = !Map.value;
UpdateValeus();
}
if (Input.GetKeyUp(GridBind.value))
{
Grid.value = !Grid.value;
UpdateValeus();
}
for (int i = 0; i < projectionBinds.Count(); i++)
{
if (Input.GetKeyUp(projectionBinds[i].value))
{
Projection.value = (ProjectionMode)i;
UpdateValeus();
}
}
}
public static void UpdateValeus()
{
Plugin.UltraFOV = UltraFOV.value;
Plugin.EnableGlobeSkybox = EnableGlobeSkybox.value;
Plugin.GlobeSkyboxFramerate = GlobeSkyboxFramerate.value;
PostProssesingBaby.Grid = Grid.value;
PostProssesingBaby.GridOpac = GridOpac.value;
PostProssesingBaby.Map = Map.value;
PostProssesingBaby.MapOpac = MapOpac.value;
PostProssesingBaby.Projection = Projection.value;
Plugin.Globe = Globe.value;
Plugin.EffectViewModel = EffectViewModel.value;
if (Plugin.DefaultFOV != projectionFOV[(int)Projection.value].value)
{
Plugin.DefaultFOV = projectionFOV[(int)Projection.value].value;
Plugin.FOV = Plugin.DefaultFOV;
PostProssesingBaby.PlayerFOV = Plugin.FOV;
}
Plugin.EnableZooming = EnableZooming.value;
PostProssesingBaby.Quality = Quality.value;
PostProssesingBaby.FisheyeFit = FisheyeFit.value;
PostProssesingBaby.Stretch = projectionStretch[(int)Projection.value].value;
PostProssesingBaby.VertFit = projectionVertFit[(int)Projection.value].value;
PostProssesingBaby.PaniniFactor = PaniniFactor.value;
PostProssesingBaby.WinkelFit = WinkelFit.value;
PostProssesingBaby.FisheyeType = FisheyeType.value;
PostProssesingBaby.OrthoType = OrthoType.value;
PostProssesingBaby.WernerFactor = WernerFactor.value;
PostProssesingBaby.WernerFit = WernerFit.value;
PostProssesingBaby.BonneShift = BonneShift.value;
PostProssesingBaby.GlobeRotX = GlobeRotateX.value;
Plugin.GlobeRotX = GlobeRotateX.value;
PostProssesingBaby.GlobeRotY = GlobeRotateY.value;
Plugin.GlobeRotY = GlobeRotateY.value;
PostProssesingBaby.GlobeRotZ = GlobeRotateZ.value;
Plugin.GlobeRotZ = GlobeRotateZ.value;
GlobeEnabledPlaneMask = 0;
for (int i = 0; i < GlobeEnablePlanes.Count; i++)
{
int num = (GlobeEnablePlanes[i].value ? 1 : 0);
GlobeEnabledPlaneMask += num << i;
}
Plugin.GlobeMask = GlobeEnabledPlaneMask;
for (int j = 0; j < configs.Count(); j++)
{
if (configs[j].guid != "bool.ultrafov")
{
configs[j].hidden = true;
}
}
((ConfigField)UltraFOV).hidden = false;
if (UltraFOV.value)
{
((ConfigField)UltraFOVBind).hidden = false;
}
((ConfigField)Projection).hidden = false;
((ConfigField)projectionBinds[(int)Projection.value]).hidden = false;
((ConfigField)projectionFOV[(int)Projection.value]).hidden = false;
((ConfigField)projectionStretch[(int)Projection.value]).hidden = false;
((ConfigField)projectionVertFit[(int)Projection.value]).hidden = false;
((ConfigField)EnableZooming).hidden = false;
switch (Projection.value)
{
case ProjectionMode.Fisheye:
((ConfigField)FisheyeFit).hidden = false;
((ConfigField)FisheyeType).hidden = false;
break;
case ProjectionMode.Panini:
((ConfigField)PaniniFactor).hidden = false;
break;
case ProjectionMode.Winkel:
((ConfigField)WinkelFit).hidden = false;
break;
case ProjectionMode.Bonne:
((ConfigField)WernerFactor).hidden = false;
((ConfigField)WernerFit).hidden = false;
((ConfigField)BonneShift).hidden = false;
break;
case ProjectionMode.Orthographic:
((ConfigField)OrthoType).hidden = false;
break;
}
((ConfigField)Globe).hidden = false;
((ConfigField)Quality).hidden = false;
((ConfigField)EnableGlobeSkybox).hidden = false;
if (EnableGlobeSkybox.value)
{
((ConfigField)GlobeSkyboxFramerate).hidden = false;
}
((ConfigField)GlobeRotateX).hidden = false;
((ConfigField)GlobeRotateY).hidden = false;
((ConfigField)GlobeRotateZ).hidden = false;
for (int k = 0; k < GlobeEnablePlanes.Count; k++)
{
((ConfigField)GlobeEnablePlanes[k]).hidden = false;
}
((ConfigField)Grid).hidden = false;
((ConfigField)Map).hidden = false;
if (Grid.value)
{
((ConfigField)GridOpac).hidden = false;
((ConfigField)GridBind).hidden = false;
}
if (Map.value)
{
((ConfigField)MapOpac).hidden = false;
((ConfigField)MapBind).hidden = false;
}
((ConfigField)EffectViewModel).hidden = false;
}
}
public enum GlobeSkyboxType
{
Limbo,
Space,
Theater
}
public class GlobeSkybox : MonoBehaviour
{
public Camera[] skyboxCams = (Camera[])(object)new Camera[6];
public RenderTexture[] skyboxTexs = (RenderTexture[])(object)new RenderTexture[6];
public bool skyboxSetup = false;
public static GlobeSkybox CreateSkyboxGlobe(Transform target)
{
GlobeSkybox globeSkybox = Object.Instantiate<GameObject>(Plugin.globePref, target).AddComponent<GlobeSkybox>();
globeSkybox.SetupSkyboxCams();
return globeSkybox;
}
public void SetupSkyboxCams()
{
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Expected O, but got Unknown
skyboxCams = ((Component)this).GetComponentsInChildren<Camera>();
skyboxTexs = (RenderTexture[])(object)new RenderTexture[skyboxCams.Length];
for (int i = 0; i < skyboxCams.Length; i++)
{
if (Object.op_Implicit((Object)(object)skyboxCams[i]))
{
((Behaviour)skyboxCams[i]).enabled = false;
skyboxTexs[i] = new RenderTexture(512, 512, 24, (RenderTextureFormat)0);
skyboxCams[i].targetTexture = skyboxTexs[i];
}
}
UpdateSkyboxCams();
RenderSkybox();
skyboxSetup = true;
}
public void DestroySkyboxGlobe()
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
public Texture GetSkyboxTexture(int index)
{
return (Texture)(object)skyboxTexs[index];
}
public void UpdateSkyboxCams()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
((Component)this).transform.localRotation = Plugin.globeRotation;
for (int i = 0; i < skyboxCams.Length && i < Plugin.cams.Length; i++)
{
if (Object.op_Implicit((Object)(object)skyboxCams[i]) && Object.op_Implicit((Object)(object)Plugin.cams[i]))
{
skyboxCams[i].nearClipPlane = Plugin.cams[i].nearClipPlane;
skyboxCams[i].farClipPlane = Plugin.cams[i].farClipPlane;
skyboxCams[i].cullingMask = Plugin.cams[i].cullingMask;
skyboxCams[i].aspect = Plugin.cams[i].aspect;
skyboxCams[i].fieldOfView = Plugin.cams[i].fieldOfView;
((Component)skyboxCams[i]).transform.localRotation = ((Component)Plugin.cams[i]).transform.localRotation;
}
}
}
public void RenderSkybox()
{
for (int i = 0; i < skyboxCams.Length && i < Plugin.cams.Length; i++)
{
if (Object.op_Implicit((Object)(object)skyboxCams[i]) && Object.op_Implicit((Object)(object)Plugin.cams[i]) && ((Behaviour)Plugin.cams[i]).enabled)
{
skyboxCams[i].Render();
}
}
}
}
[BepInPlugin("ironfarm.uk.xbox369", "Eye of Providence", "0.7.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
[HarmonyPatch]
public static class XboxGamePass
{
public static bool reinitTex = UltraFOV;
public static bool renderCam = false;
[HarmonyPostfix]
[HarmonyPatch(typeof(PostProcessV2_Handler), "OnPreRenderCallback")]
public static void FUUUUUUUU(PostProcessV2_Handler __instance)
{
}
[HarmonyPostfix]
[HarmonyPatch(typeof(PostProcessV2_Handler), "HeatWaves")]
public static void skinitsundermyskinoffpeelitoffskinoffpeeloffskin(PostProcessV2_Handler __instance)
{
}
[HarmonyPostfix]
[HarmonyPatch(typeof(PostProcessV2_Handler), "ReleaseTextures")]
public static void DisbandTrollLegion(PostProcessV2_Handler __instance)
{
if (Object.op_Implicit((Object)(object)tex))
{
tex.Release();
}
if (Object.op_Implicit((Object)(object)tex))
{
Object.Destroy((Object)(object)tex);
}
tex = null;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(PostProcessV2_Handler), "ChangeCamera")]
public static void remember(PostProcessV2_Handler __instance)
{
if (UltraFOV)
{
reinitTex = true;
}
}
[HarmonyPostfix]
[HarmonyPatch(typeof(CameraController), "LateUpdate")]
public static void updateFov(CameraController __instance)
{
if (!UltraFOV || !EnableZooming || !Object.op_Implicit((Object)(object)__instance))
{
return;
}
if (__instance.zooming)
{
FOV = Mathf.MoveTowards(FOV, __instance.zoomTarget, Time.deltaTime * 300f);
}
else if (Object.op_Implicit((Object)(object)__instance.nm) && __instance.nm.boost)
{
if (__instance.dodgeDirection == 0)
{
FOV = DefaultFOV - DefaultFOV / 20f;
}
else if (__instance.dodgeDirection == 1)
{
FOV = DefaultFOV + DefaultFOV / 10f;
}
}
else
{
FOV = Mathf.MoveTowards(FOV, DefaultFOV, Time.deltaTime * 300f);
}
PostProssesingBaby.PlayerFOV = FOV;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(LimboSkybox), "UpdateCamera")]
public static bool NoMario(LimboSkybox __instance, Camera cam)
{
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
if (UltraFOV && enableGlobeSkybox && Object.op_Implicit((Object)(object)globeRender))
{
if (!((Behaviour)__instance).isActiveAndEnabled)
{
return false;
}
__instance.InitializeRT();
if (Application.isPlaying)
{
__instance.playerCam = __instance.cc.cam;
}
if ((Object)(object)cam != (Object)null)
{
__instance.playerCam = cam;
}
if ((Object)(object)__instance.playerCam == (Object)null)
{
return false;
}
Vector3 val = (((Component)__instance.playerCam).transform.position - __instance.playerStartPos) / 16f;
float num = (__instance.lockMinimumHeight ? Mathf.Max(val.y, 0f) : val.y);
((Component)__instance.fakeCam).transform.position = __instance.fakeCamStart.position + new Vector3(val.x, num, val.z);
((Component)__instance.fakeCam).transform.rotation = ((Component)__instance.playerCam).transform.rotation;
if (globeRender.HasSkybox(GlobeSkyboxType.Limbo))
{
globeSkyboxAcc += Time.deltaTime;
if (globeSkyboxAcc >= 1f / (float)globeSkyboxFramerate)
{
globeRender.RenderSkybox(GlobeSkyboxType.Limbo);
globeSkyboxAcc = 0f;
}
}
else if (Object.op_Implicit((Object)(object)__instance.fakeCam))
{
globeRender.CreateSkyboxGlobe(GlobeSkyboxType.Limbo, ((Component)__instance.fakeCam).transform);
}
return false;
}
return true;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(FraudTheatreSkybox), "UpdateCamera")]
public static void NoWario(FraudTheatreSkybox __instance)
{
}
[HarmonyPrefix]
[HarmonyPatch(typeof(SpaceSkybox), "UpdateCamera")]
public static bool NoLucario(SpaceSkybox __instance, Camera cam)
{
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
if (UltraFOV && enableGlobeSkybox)
{
if (Object.op_Implicit((Object)(object)globeRender))
{
if (!((Behaviour)__instance).isActiveAndEnabled)
{
return false;
}
__instance.InitializeRT();
if (Application.isPlaying)
{
__instance.playerCam = __instance.cc.cam;
}
if ((Object)(object)cam != (Object)null)
{
__instance.playerCam = cam;
}
if ((Object)(object)__instance.playerCam == (Object)null)
{
return false;
}
((Component)__instance.fakeCam).transform.rotation = ((Component)__instance.playerCam).transform.rotation;
if (globeRender.HasSkybox(GlobeSkyboxType.Space))
{
globeSkyboxAcc += Time.deltaTime;
if (globeSkyboxAcc >= 1f / (float)globeSkyboxFramerate)
{
globeRender.RenderSkybox(GlobeSkyboxType.Space);
globeSkyboxAcc = 0f;
}
}
else if (Object.op_Implicit((Object)(object)__instance.fakeCam))
{
globeRender.CreateSkyboxGlobe(GlobeSkyboxType.Space, ((Component)__instance.fakeCam).transform);
}
return false;
}
}
else
{
Shader.SetGlobalTexture("_SpaceSky", (Texture)(object)__instance.skybox);
}
return true;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(LimboSkybox), "OnEnable")]
public static void setupSkyCams(LimboSkybox __instance)
{
}
[HarmonyPostfix]
[HarmonyPatch(typeof(PostProcessV2_Handler), "SetupRTs")]
public static void rage(PostProcessV2_Handler __instance)
{
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Expected O, but got Unknown
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)tex))
{
}
if (Object.op_Implicit((Object)(object)tex))
{
}
bool flag = __instance.width != __instance.lastWidth || __instance.height != __instance.lastHeight;
if (reinitTex || flag)
{
tex = new RenderTexture(__instance.width, __instance.height, 0, (RenderTextureFormat)0)
{
name = "Xx_TrollLegion_xX",
antiAliasing = 1,
filterMode = (FilterMode)0
};
Graphics.Blit(texst, tex);
__instance.mainTex = tex;
__instance.buffers[0] = __instance.mainTex.colorBuffer;
__instance.buffers[1] = __instance.reusableBufferA.colorBuffer;
__instance.buffers[2] = __instance.viewNormal.colorBuffer;
__instance.SetupOutlines(false);
__instance.postProcessV2_VSRM.SetTexture("_MainTex", (Texture)(object)__instance.mainTex);
reinitTex = false;
}
}
}
private Harmony harmony = new Harmony("ironfarm.uk.xbox369");
public static Plugin instance;
private AssetBundle bundle;
public static GameObject globePref;
private GameObject globeCube;
private GameObject globeTP;
private GameObject globeTH;
public static int globeIndex = 1;
public static bool enableGlobeSkybox = true;
public static int globeSkyboxFramerate = 0;
public static float globeSkyboxAcc = 0f;
public static Camera[] cams = (Camera[])(object)new Camera[6];
private static GameObject globe;
public static GlobeMode Globe = GlobeMode.Cube;
public static float GlobeRotX = 0f;
public static float GlobeRotY = 0f;
public static float GlobeRotZ = 0f;
public static PostProssesingBaby post;
public static GlobeRender globeRender;
public static Quaternion globeRotation = Quaternion.identity;
public static int GlobeMask = int.MaxValue;
public int globeMask = 0;
private Material mat;
private RenderBuffer[] chumBuckets = (RenderBuffer[])(object)new RenderBuffer[3];
private List<GlobeInfo> globeInfos = new List<GlobeInfo>();
public static RenderTexture tex;
private static RenderTexture tempxter;
public static Texture texst;
public static Texture bexst;
public static GameObject testObj;
public static Mesh meshTest;
public static Material meshMat;
public static bool UltraFOV = true;
public static float DefaultFOV = 180f;
public static float FOV = 180f;
public static bool EnableZooming = true;
public static bool EnableGlobeSkybox = true;
public static int GlobeSkyboxFramerate = 24;
public static bool EffectViewModel = false;
private bool effectViewModel = false;
public static bool test = false;
public CommandBuffer bloodOilCB;
public void Awake()
{
}
public void Start()
{
Debug.Log((object)"Reddit, I think I know what we're gonna do today!");
AssetHandler.LoadBundle("ultra_nato");
testObj = AssetHandler.LoadAsset<GameObject>("Cube");
meshTest = AssetHandler.LoadAsset<GameObject>("default").GetComponent<MeshFilter>().mesh;
meshMat = ((Renderer)AssetHandler.LoadAsset<GameObject>("default").GetComponent<MeshRenderer>()).material;
globePref = AssetHandler.LoadAsset<GameObject>("GlobeCam");
globeCube = AssetHandler.LoadAsset<GameObject>("GlobeCam Cube");
globeTP = AssetHandler.LoadAsset<GameObject>("GlobeCam TP");
globeTH = AssetHandler.LoadAsset<GameObject>("GlobeCam TH");
mat = AssetHandler.LoadAsset<Material>("coolMat");
texst = AssetHandler.LoadAsset<Texture>("Gun Color Small");
bexst = AssetHandler.LoadAsset<Texture>("test");
harmony.PatchAll(typeof(XboxGamePass));
ConfigManager.Setup();
instance = this;
globeMask = GlobeMask;
}
public void Update()
{
if (UltraFOV)
{
if (Object.op_Implicit((Object)(object)MonoSingleton<CameraController>.Instance) && Object.op_Implicit((Object)(object)MonoSingleton<CameraController>.Instance.cam) && !Object.op_Implicit((Object)(object)globe))
{
SetupGlobe();
}
}
else if (Object.op_Implicit((Object)(object)globe))
{
if (Object.op_Implicit((Object)(object)MonoSingleton<CameraController>.Instance.cam.targetTexture))
{
}
ClearGlobe();
}
UpdateGlobe();
ConfigManager.Update();
}
public void GlobeMaskCheck()
{
globeMask = GlobeMask;
int num = globeMask;
int num2 = 6;
if (globeIndex < globeInfos.Count() && globeInfos[globeIndex] != null)
{
GlobeInfo globeInfo = globeInfos[globeIndex];
num2 = globeInfo.camInfos.Length;
}
for (int i = 0; i < cams.Length; i++)
{
((Behaviour)cams[i]).enabled = num % 2 == 1 && i < num2;
num >>= 1;
}
}
public void SetupGlobeInfos()
{
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_019e: Unknown result type (might be due to invalid IL or missing references)
//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
//IL_02da: Unknown result type (might be due to invalid IL or missing references)
globeInfos.Clear();
for (int i = 0; i < Enum.GetNames(typeof(GlobeMode)).Length; i++)
{
GlobeInfo globeInfo = new GlobeInfo();
switch ((GlobeMode)i)
{
case GlobeMode.Cube:
{
globeInfo.name = "Cube";
globeInfo.rayMethod = GlobeRayMehtod.Cube;
GameObject val = Object.Instantiate<GameObject>(globeCube, ((Component)MonoSingleton<CameraController>.Instance.cam).transform);
if (Object.op_Implicit((Object)(object)val))
{
Camera[] componentsInChildren = val.GetComponentsInChildren<Camera>();
globeInfo.camInfos = new CamInfo[componentsInChildren.Length];
for (int k = 0; k < componentsInChildren.Length && k < 6; k++)
{
CamInfo camInfo2 = new CamInfo();
camInfo2.camRot = ((Component)componentsInChildren[k]).transform.localRotation;
camInfo2.posDist = 1f;
camInfo2.scale = new Vector2(1f, 1f);
globeInfo.camInfos[k] = camInfo2;
}
globeInfos.Add(globeInfo);
Object.Destroy((Object)(object)val);
}
break;
}
case GlobeMode.TriPrism:
{
globeInfo.name = "Triangular Prism";
GameObject val = Object.Instantiate<GameObject>(globeTP, ((Component)MonoSingleton<CameraController>.Instance.cam).transform);
if (!Object.op_Implicit((Object)(object)val))
{
break;
}
Camera[] componentsInChildren = val.GetComponentsInChildren<Camera>();
globeInfo.camInfos = new CamInfo[componentsInChildren.Length];
for (int l = 0; l < componentsInChildren.Length && l < 6; l++)
{
CamInfo camInfo3 = new CamInfo();
camInfo3.camRot = ((Component)componentsInChildren[l]).transform.localRotation;
camInfo3.posDist = 1f;
camInfo3.scale = new Vector2(1f, 1f);
if (l == 0 || l == 1 || l == 2)
{
camInfo3.posDist = 1f / Mathf.Sqrt(3f);
}
else
{
camInfo3.posDist = 1f;
camInfo3.scale.y *= 1.15f;
}
globeInfo.camInfos[l] = camInfo3;
}
globeInfos.Add(globeInfo);
Object.Destroy((Object)(object)val);
break;
}
case GlobeMode.Tetrahedron:
{
globeInfo.name = "Tetrahedron";
GameObject val = Object.Instantiate<GameObject>(globeTH, ((Component)MonoSingleton<CameraController>.Instance.cam).transform);
if (!Object.op_Implicit((Object)(object)val))
{
break;
}
Camera[] componentsInChildren = val.GetComponentsInChildren<Camera>();
globeInfo.camInfos = new CamInfo[componentsInChildren.Length];
for (int j = 0; j < componentsInChildren.Length && j < 6; j++)
{
CamInfo camInfo = new CamInfo();
camInfo.camRot = ((Component)componentsInChildren[j]).transform.localRotation;
camInfo.posDist = 1f / (2f * Mathf.Sqrt(3f));
camInfo.scale = new Vector2(1f, 1f);
if (j != 3)
{
camInfo.scale.y *= 0.5f;
}
globeInfo.camInfos[j] = camInfo;
}
globeInfos.Add(globeInfo);
Object.Destroy((Object)(object)val);
break;
}
}
}
}
public void ResetGlobe()
{
ClearGlobe();
SetupGlobe();
}
public void UpdateGlobe()
{
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)globe))
{
return;
}
if (globeMask != GlobeMask)
{
GlobeMaskCheck();
ResetGlobe();
}
if (globeIndex != (int)Globe)
{
globeIndex = (int)Globe;
ResetGlobe();
}
if (globeSkyboxFramerate != GlobeSkyboxFramerate)
{
globeSkyboxFramerate = GlobeSkyboxFramerate;
globeSkyboxAcc = 0f;
}
if (enableGlobeSkybox != EnableGlobeSkybox)
{
enableGlobeSkybox = EnableGlobeSkybox;
ResetGlobe();
}
if (effectViewModel != EffectViewModel)
{
effectViewModel = EffectViewModel;
if (!effectViewModel)
{
Camera hudCamera = MonoSingleton<CameraController>.Instance.hudCamera;
hudCamera.cullingMask |= 0x2000;
}
ResetGlobe();
}
if (globeRotation != PostProssesingBaby.globeRotation)
{
globeRotation = Quaternion.Euler(0f, 0f, 1f) * Quaternion.Inverse(PostProssesingBaby.globeRotation);
globe.transform.localRotation = globeRotation;
if (Object.op_Implicit((Object)(object)globeRender))
{
globeRender.UpdateSkyboxGlobes();
}
}
if (Object.op_Implicit((Object)(object)tex) && (Object)(object)post.mainCam.targetTexture != (Object)(object)tex)
{
post.mainCam.targetTexture = tex;
}
}
public void SetupGlobe()
{
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
XboxGamePass.reinitTex = true;
MonoSingleton<PostProcessV2_Handler>.Instance.reinitializeTextures = true;
MonoSingleton<PostProcessV2_Handler>.Instance.SetupRTs();
globe = Object.Instantiate<GameObject>(globePref, ((Component)MonoSingleton<CameraController>.Instance.cam).transform);
post = ((Component)((Component)MonoSingleton<CameraController>.Instance.cam).transform).gameObject.AddComponent<PostProssesingBaby>();
for (int i = 0; i < cams.Length; i++)
{
cams[i] = ((Component)globe.transform.GetChild(i)).GetComponent<Camera>();
((Object)cams[i]).name = "Globe Cam " + (i + 1);
cams[i].nearClipPlane = MonoSingleton<CameraController>.Instance.cam.nearClipPlane;
cams[i].farClipPlane = MonoSingleton<CameraController>.Instance.cam.farClipPlane;
cams[i].cullingMask = MonoSingleton<CameraController>.Instance.cam.cullingMask;
if (effectViewModel)
{
Camera obj = cams[i];
obj.cullingMask |= 0x2000;
}
}
if (effectViewModel)
{
Camera hudCamera = MonoSingleton<CameraController>.Instance.hudCamera;
hudCamera.cullingMask &= 0;
}
SetupGlobeInfos();
GlobeMaskCheck();
post.mainCam = ((Component)post).GetComponent<Camera>();
post.mainCam.targetTexture = tex;
post.postEffectMaterial = mat;
post.cams = cams;
globe.transform.localPosition = Vector3.zero;
globe.transform.localRotation = Quaternion.Euler(0f, 0f, 1f);
if (globeIndex < globeInfos.Count() && globeInfos[globeIndex] != null)
{
GlobeInfo globeInfo = globeInfos[globeIndex];
post.UpdateCamInfo(globeInfo.camInfos);
post.SetRayMethod((int)globeInfo.rayMethod);
}
else
{
Debug.LogError((object)"No custom globes found! Falling back to basic globe");
post.UpdateCamInfo();
}
globeRender = globe.AddComponent<GlobeRender>();
}
public void ClearGlobe()
{
if (Object.op_Implicit((Object)(object)globe))
{
Object.Destroy((Object)(object)globe);
}
globe = null;
for (int i = 0; i < cams.Length; i++)
{
cams[i] = null;
}
Camera hudCamera = MonoSingleton<CameraController>.Instance.hudCamera;
hudCamera.cullingMask |= 0x2000;
post.mainCam.targetTexture = MonoSingleton<PostProcessV2_Handler>.Instance.mainTex;
XboxGamePass.reinitTex = false;
MonoSingleton<PostProcessV2_Handler>.Instance.reinitializeTextures = true;
MonoSingleton<PostProcessV2_Handler>.Instance.SetupRTs();
PostProssesingBaby postProssesingBaby = default(PostProssesingBaby);
if (((Component)MonoSingleton<CameraController>.Instance).gameObject.TryGetComponent<PostProssesingBaby>(ref postProssesingBaby))
{
Object.Destroy((Object)(object)postProssesingBaby);
}
}
}
internal class PluginInfo
{
public const string Name = "Eye of Providence";
public const string Version = "0.7.0";
public const string GUID = "ironfarm.uk.xbox369";
}
public class PostProssesingBaby : MonoBehaviour
{
private enum CameraFace
{
Front,
Back,
Left,
Right,
Up,
Down
}
public static float PlayerFOV = 360f;
public static PostProssesingBaby instance;
public static ProjectionMode Projection = ProjectionMode.Equirectangular;
public static float Quality = 9f;
public static Quaternion globeRotation = Quaternion.identity;
public static bool Debug = false;
public static bool Grid = false;
public static float GridOpac = 0f;
public static bool Map = false;
public static float MapOpac = 0f;
public static bool Stretch = true;
public static bool VertFit = false;
public static float GlobeRotX = 0f;
public static float GlobeRotY = 0f;
public static float GlobeRotZ = 0f;
public static float FisheyeFit = 0f;
public static float PaniniFactor = 1f;
public static float WinkelFit = 0f;
public static float WernerFactor = 0f;
public static float WernerFit = 0f;
public static float BonneShift = 0f;
public static OrthoMode OrthoType;
public static FisheyeMode FisheyeType;
public Camera mainCam;
private Shader postShader;
public Material postEffectMaterial;
public Camera[] cams;
private List<RenderTexture> camTexs = new List<RenderTexture>();
public float fov = 360f;
public float quality = 9f;
private float prevQuality;
public bool debugMode = false;
public bool mapMode = false;
public float mapOpac = 0.5f;
public bool gridMode = false;
public float gridOpac = 0.5f;
public float globeRotX = 0f;
public float globeRotY = 0f;
public float globeRotZ = 0f;
public bool stretch = true;
public bool vertFit = false;
public float fisheyeFit = 0f;
public float paniniFactor = 1f;
public float winkelFit = 0f;
public float wernerFactor = 0f;
public float wernerFit = 0f;
public float bonneShift = 0f;
public OrthoMode orthoMode = OrthoMode.Hemisphere;
public FisheyeMode fisheyeMode = FisheyeMode.Equidistant;
public int projectionMode = 0;
private int qualityPixel = 1;
public float aspect = 1f;
public float prevAspect = 1f;
private float width = 2f;
private float height = 1f;
private float prevWidth = 0f;
private float prevHeight = 0f;
private bool unconditionalUpdate = false;
public FilterMode filterMode = (FilterMode)0;
private void Start()
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
mainCam = ((Component)this).GetComponent<Camera>();
mainCam.depthTextureMode = (DepthTextureMode)(mainCam.depthTextureMode | 2);
UpdateValues(forceUpdate: true);
UpdateGlobeRotations();
instance = this;
RefreshRenderTextures();
}
private void SetGlobeRotations(float yaw, float pitch, float roll)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
globeRotation = Quaternion.Euler(roll * 180f, pitch * 180f, yaw * 180f);
Matrix4x4 val = Matrix4x4.Rotate(globeRotation);
Plugin.instance.UpdateGlobe();
postEffectMaterial.SetMatrix("_rotMatrix", val);
postEffectMaterial.SetFloat("_GLOBE_ROTATE", 1f);
}
public void UpdateGlobeRotations()
{
SetGlobeRotations(globeRotZ, globeRotX, globeRotY);
}
private void Update()
{
UpdateValues();
}
public void UpdateValues(bool forceUpdate = false)
{
unconditionalUpdate = forceUpdate;
SetFOV(PlayerFOV);
SetProjectionMode(Projection);
SetStretch(Stretch);
SetQuality(Quality);
SetFisheyeMode(FisheyeType);
SetOrthographicMode(OrthoType);
SetVerticalFit(VertFit);
SetFisheyeFit(FisheyeFit);
SetPaniniFactor(PaniniFactor);
SetWernerFactor(WernerFactor);
SetWernerFit(WernerFit);
SetBonneShift(BonneShift);
SetGridEnable(Grid);
SetGridOpac(GridOpac);
SetMapEnable(Map);
SetMapOpac(MapOpac);
SetGlobeRot(GlobeRotX, GlobeRotY, GlobeRotZ);
unconditionalUpdate = false;
}
public void UpdateCamInfo()
{
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: 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_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0209: Unknown result type (might be due to invalid IL or missing references)
//IL_020e: Unknown result type (might be due to invalid IL or missing references)
//IL_0213: Unknown result type (might be due to invalid IL or missing references)
//IL_021e: Unknown result type (might be due to invalid IL or missing references)
//IL_0223: Unknown result type (might be due to invalid IL or missing references)
//IL_022a: Unknown result type (might be due to invalid IL or missing references)
//IL_022f: Unknown result type (might be due to invalid IL or missing references)
//IL_023a: Unknown result type (might be due to invalid IL or missing references)
//IL_023f: Unknown result type (might be due to invalid IL or missing references)
//IL_0246: Unknown result type (might be due to invalid IL or missing references)
//IL_024b: Unknown result type (might be due to invalid IL or missing references)
//IL_0259: Unknown result type (might be due to invalid IL or missing references)
//IL_025e: Unknown result type (might be due to invalid IL or missing references)
//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = default(Vector3);
for (int i = 0; i < 6; i++)
{
if (!Object.op_Implicit((Object)(object)cams[i]))
{
((Vector3)(ref val))..ctor(30000000f, 3000000f, 300000f);
Vector3 val2 = val;
Vector3 val3 = val;
Vector3 val4 = val;
List<Vector4> list = new List<Vector4>
{
Vector4.op_Implicit(val),
Vector4.op_Implicit(val2),
Vector4.op_Implicit(val3),
Vector4.op_Implicit(val4)
};
postEffectMaterial.SetVectorArray("_Cam" + (i + 1) + "_Info", list);
continue;
}
Transform transform = ((Component)cams[i]).transform;
Transform parent = ((Component)transform).transform.parent;
float num = 1f;
float num2 = 1f;
float num3 = 1f;
float num4 = 1f;
float num5 = 2f;
float num6 = 2f;
if (!((Object)cams[i]).name.Contains("Up") && !((Object)cams[i]).name.Contains("Down"))
{
num = 1f / Mathf.Sqrt(3f);
}
num = 1f;
if (((Object)cams[i]).name.Contains("Down") || ((Object)cams[i]).name.Contains("Up"))
{
}
if (!((Object)cams[i]).name.Contains("Back"))
{
}
float num7 = 1f / num4;
float num8 = 1f / num3;
num5 *= 1f / num8;
num6 *= 1f / num7;
num2 = num5 / num6;
Vector3 val5 = parent.InverseTransformDirection(((Component)transform).transform.forward) * num;
Vector3 val6 = parent.InverseTransformDirection(((Component)transform).transform.forward);
Vector3 val7 = parent.InverseTransformDirection(((Component)transform).transform.up) * num7;
Vector3 val8 = parent.InverseTransformDirection(((Component)transform).transform.right) * num8;
float num9 = num2;
float num10 = Mathf.Atan(num5 / 2f / Vector3.Distance(Vector3.zero, val5)) * 2f;
cams[i].aspect = num9;
cams[i].fieldOfView = Camera.VerticalToHorizontalFieldOfView(num10 * 57.29578f, 1f / cams[i].aspect);
List<Vector4> list2 = new List<Vector4>
{
Vector4.op_Implicit(val5),
Vector4.op_Implicit(val6),
Vector4.op_Implicit(val7),
Vector4.op_Implicit(val8)
};
postEffectMaterial.SetVectorArray("_Cam" + (i + 1) + "_Info", list2);
}
}
public void UpdateCamInfo(CamInfo[] infos)
{
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_0142: Unknown result type (might be due to invalid IL or missing references)
//IL_015c: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(1000000f, 1000000f, 1000000f);
Vector2 val2 = default(Vector2);
for (int i = 0; i < cams.Length; i++)
{
if (i >= infos.Length)
{
postEffectMaterial.SetVectorArray("_Cam" + (i + 1) + "_Info", new List<Vector4>
{
Vector4.op_Implicit(val),
Vector4.op_Implicit(val),
Vector4.op_Implicit(val),
Vector4.op_Implicit(val)
});
continue;
}
CamInfo camInfo = infos[i];
Vector2 scale = camInfo.scale;
((Vector2)(ref val2))..ctor(1f / scale.x, 1f / scale.y);
Vector3 val3 = camInfo.camRot * Vector3.forward;
Vector3 val4 = val3 * camInfo.posDist;
Vector3 val5 = camInfo.camRot * Vector3.right * val2.x;
Vector3 val6 = camInfo.camRot * Vector3.up * val2.y;
float num = 2f;
float num2 = 2f;
num *= 1f / val2.x;
num2 *= 1f / val2.y;
float num3 = num / num2;
float num4 = Mathf.Atan(num / 2f / Vector3.Distance(Vector3.zero, val4)) * 2f;
((Component)cams[i]).transform.localRotation = camInfo.camRot;
cams[i].aspect = num3;
cams[i].fieldOfView = Camera.VerticalToHorizontalFieldOfView(num4 * 57.29578f, 1f / num3);
List<Vector4> list = new List<Vector4>
{
Vector4.op_Implicit(val4),
Vector4.op_Implicit(val3),
Vector4.op_Implicit(val6),
Vector4.op_Implicit(val5)
};
postEffectMaterial.SetVectorArray("_Cam" + (i + 1) + "_Info", list);
}
}
public void SetRayMethod(int rayMethod)
{
postEffectMaterial.SetInt("_RAY_METHOD", rayMethod);
}
public void RefreshRenderTextures()
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Expected O, but got Unknown
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < cams.Length; i++)
{
if (Object.op_Implicit((Object)(object)cams[i]))
{
if ((Object)(object)cams[i].targetTexture != (Object)null)
{
cams[i].targetTexture.Release();
}
RenderTexture val = new RenderTexture(qualityPixel, qualityPixel, 24);
((Texture)val).filterMode = filterMode;
cams[i].targetTexture = val;
}
}
}
private void OnRenderImage(RenderTexture src, RenderTexture dest)
{
for (int i = 0; i < 6; i++)
{
if (Object.op_Implicit((Object)(object)cams[i]))
{
postEffectMaterial.SetTexture("_Cam" + (i + 1), (Texture)(object)cams[i].targetTexture);
}
}
Graphics.Blit((Texture)(object)src, dest, postEffectMaterial);
}
private void SetFOV(float _fov)
{
if (fov != _fov || unconditionalUpdate)
{
fov = _fov;
postEffectMaterial.SetFloat("_FOV", fov);
}
}
private void SetProjectionMode(ProjectionMode _projectionMode)
{
if (projectionMode != (int)_projectionMode || unconditionalUpdate)
{
projectionMode = (int)_projectionMode;
postEffectMaterial.SetFloat("_MODE", (float)projectionMode);
width = Screen.width;
height = Screen.height;
prevWidth = width;
prevHeight = height;
RefreshRenderTextures();
}
}
private void SetAspect(float _aspect)
{
if (aspect != _aspect || unconditionalUpdate)
{
aspect = _aspect;
postEffectMaterial.SetFloat("_ASPECT", aspect);
}
}
private void SetStretch(bool _stretch)
{
if (stretch != _stretch || unconditionalUpdate)
{
stretch = _stretch;
width = Screen.width;
height = Screen.height;
aspect = (stretch ? 1f : ((float)Screen.width / (float)Screen.height));
SetAspect(aspect);
postEffectMaterial.SetFloat("_STRETCH", stretch ? 1f : 0f);
prevWidth = width;
prevHeight = height;
}
}
private void SetQuality(float _quality)
{
if (quality != _quality || unconditionalUpdate)
{
quality = Mathf.Clamp(_quality, 0f, 10f);
prevQuality = quality;
qualityPixel = (int)Mathf.Pow(2f, quality);
RefreshRenderTextures();
}
}
private void SetVerticalFit(bool _vertFit)
{
if (vertFit != _vertFit || unconditionalUpdate)
{
vertFit = _vertFit;
postEffectMaterial.SetFloat("_VERT_FIT", (float)(vertFit ? 1 : 0));
}
}
private void SetFisheyeFit(float _fisheyeFit)
{
if (fisheyeFit != _fisheyeFit || unconditionalUpdate)
{
fisheyeFit = _fisheyeFit;
postEffectMaterial.SetFloat("_FISHEYE_EQUIDIST_FIT", fisheyeFit);
}
}
private void SetPaniniFactor(float _paniniFactor)
{
if (paniniFactor != _paniniFactor || unconditionalUpdate)
{
paniniFactor = _paniniFactor;
postEffectMaterial.SetFloat("_PANINI_FACTOR", paniniFactor);
}
}
private void SetWernerFactor(float _wernerFactor)
{
if (wernerFactor != _wernerFactor || unconditionalUpdate)
{
wernerFactor = _wernerFactor;
postEffectMaterial.SetFloat("_WERNER_FACTOR", wernerFactor);
}
}
private void SetWernerFit(float _wernerFit)
{
if (wernerFit != _wernerFit || unconditionalUpdate)
{
wernerFit = _wernerFit;
postEffectMaterial.SetFloat("_WERNER_FIT", wernerFit);
}
}
private void SetBonneShift(float _bonneShift)
{
if (bonneShift != _bonneShift || unconditionalUpdate)
{
bonneShift = _bonneShift;
postEffectMaterial.SetFloat("_BONNE_SHIFT", bonneShift);
}
}
private void SetFisheyeMode(FisheyeMode _fisheyeMode)
{
if (fisheyeMode != _fisheyeMode || unconditionalUpdate)
{
fisheyeMode = _fisheyeMode;
postEffectMaterial.SetFloat("_FISHEYE_MODE", (float)fisheyeMode);
}
}
private void SetOrthographicMode(OrthoMode _orthoMode)
{
if (orthoMode != _orthoMode || unconditionalUpdate)
{
orthoMode = _orthoMode;
postEffectMaterial.SetFloat("_ORTHO_MODE", (float)orthoMode);
}
}
private void SetGridEnable(bool _gridEnable)
{
if (gridMode != _gridEnable || unconditionalUpdate)
{
gridMode = _gridEnable;
postEffectMaterial.SetFloat("_GRID", (float)(gridMode ? 1 : 0));
}
}
private void SetGridOpac(float _gridOpac)
{
if (gridOpac != _gridOpac || unconditionalUpdate)
{
gridOpac = _gridOpac;
postEffectMaterial.SetFloat("_GRID_FACTOR", gridOpac);
}
}
private void SetMapEnable(bool _mapEnable)
{
if (mapMode != _mapEnable || unconditionalUpdate)
{
mapMode = _mapEnable;
postEffectMaterial.SetFloat("_MAP", (float)(mapMode ? 1 : 0));
}
}
private void SetMapOpac(float _mapOpac)
{
if (mapOpac != _mapOpac || unconditionalUpdate)
{
mapOpac = _mapOpac;
postEffectMaterial.SetFloat("_MAP_FACTOR", mapOpac);
}
}
private void SetGlobeRot(float _globeRotX, float _globeRotY, float _globeRotZ)
{
if (globeRotX != _globeRotX || unconditionalUpdate)
{
globeRotX = _globeRotX;
}
if (globeRotY != _globeRotY || unconditionalUpdate)
{
globeRotY = _globeRotY;
}
if (globeRotZ != _globeRotZ || unconditionalUpdate)
{
globeRotZ = _globeRotZ;
}
SetGlobeRotations(globeRotZ, globeRotX, globeRotY);
}
}
public static class Utils
{
public const float TIMESTEP_BANDAGE = 60f;
private static List<GameObject> descendants = new List<GameObject>();
private static int descendantDepth = 0;
public static string ModDir()
{
return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
}
public static string ModDataDir()
{
return Path.Combine(ModDir(), "Data");
}
public static Vector3 RandPos(float x, float y, float z)
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
return new Vector3(Random.Range(0f - x, x), Random.Range(0f - y, y), Random.Range(0f - z, z));
}
public static Vector3 RandPos(float x, float y)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
return new Vector3(Random.Range(0f - x, x), Random.Range(0f - y, y), 0f);
}
public static Vector3 Uniform(float num)
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
return new Vector3(num, num, num);
}
public static Vector3 Scale(float num)
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
return new Vector3(num, num, num);
}
public static float Sin01(float x)
{
return (Mathf.Sin(x) + 1f) * 0.5f;
}
public static float Normalize(float num, bool oneDefault = true)
{
if (num == 0f)
{
if (oneDefault)
{
return 1f;
}
return 0f;
}
return num / Mathf.Abs(num);
}
public static float DirToAngle(Vector3 dir)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
return Mathf.Atan2(dir.y, dir.x) * 57.29578f;
}
public static float UpDirToAngle(Vector3 dir)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
dir = Quaternion.AngleAxis(-90f, Vector3.forward) * dir;
return Mathf.Atan2(dir.y, dir.x) * 57.29578f;
}
public static float AngleRelToDir(Vector3 dir, Vector3 relDir)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
dir = Quaternion.AngleAxis(0f - DirToAngle(relDir), Vector3.forward) * dir;
return Mathf.Atan2(dir.y, dir.x) * 57.29578f;
}
public static float AngleRelToDir(Vector3 dir, float angle)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
dir = Quaternion.AngleAxis(angle, Vector3.forward) * dir;
return Mathf.Atan2(dir.y, dir.x) * 57.29578f;
}
public static Vector3 AngleToDir(float angle)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
return Quaternion.Euler(0f, 0f, 0f - angle) * Vector3.right;
}
public static Vector3 UpAngleToDir(float angle)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
return Quaternion.Euler(0f, 0f, angle) * Vector3.up;
}
public static void SetTimelineBinding(PlayableDirector pd, int index, Object obj)
{
? val = pd;
PlayableAsset playableAsset = pd.playableAsset;
((PlayableDirector)val).SetGenericBinding((Object)(object)((TimelineAsset)((playableAsset is TimelineAsset) ? playableAsset : null)).GetOutputTrack(index), obj);
}
public static string GetTransformPath(Transform transform)
{
List<string> list = new List<string>();
Transform val = transform;
while ((Object)(object)val != (Object)null)
{
list.Add(((Object)val).name);
val = val.parent;
}
string text = "";
for (int num = list.Count() - 1; num >= 0; num--)
{
text += list[num];
if (num != 0)
{
text += "/";
}
}
return text;
}
private static void GatherDescendants(this GameObject from)
{
for (int i = 0; i < from.transform.childCount; i++)
{
((Component)from.transform.GetChild(i)).gameObject.GatherDescendants();
descendants.Add(((Component)from.transform.GetChild(i)).gameObject);
}
}
public static List<GameObject> DescendantsList(this GameObject from)
{
if (descendants.Count > 0)
{
descendants.Clear();
}
from.GatherDescendants();
return descendants;
}
public static GameObject DescendantByName(this GameObject from, string name)
{
if (from.transform.childCount > 0)
{
for (int i = 0; i < from.transform.childCount; i++)
{
GameObject gameObject = ((Component)from.transform.GetChild(i)).gameObject;
if (((Object)gameObject).name == name)
{
return gameObject;
}
descendantDepth++;
GameObject val = gameObject.DescendantByName(name);
descendantDepth--;
if ((Object)(object)val != (Object)null)
{
return val;
}
}
}
if (descendantDepth == 0)
{
Debug.Log((object)("No child with name " + name + " found in " + ((Object)from).name));
}
return null;
}
}