Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of MoreEyes v1.0.1
plugins/MoreEyes/com.github.s1ckboii.MoreEyes.dll
Decompiled 5 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using MenuLib; using MenuLib.MonoBehaviors; using Microsoft.CodeAnalysis; using MoreEyes.Collections; using MoreEyes.Components; using MoreEyes.Core; using MoreEyes.Managers; using MoreEyes.SDK; using MoreEyes.Utility; using Photon.Pun; using TMPro; using Unity.VisualScripting; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("s1ckboy & darmuh")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright © 2025 s1ckboy & darmuh")] [assembly: AssemblyDescription("API for R.E.P.O eye customization")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1+048aeb649ce2dcf6f58226f26718349b7e4c5f86")] [assembly: AssemblyProduct("MoreEyes")] [assembly: AssemblyTitle("com.github.s1ckboii.MoreEyes")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/s1ckboii/MoreEyes")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.1.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 MoreEyes { internal static class MyPluginInfo { internal const string PLUGIN_GUID = "com.github.s1ckboii.MoreEyes"; internal const string PLUGIN_NAME = "MoreEyes"; internal const string PLUGIN_VERSION = "1.0.1"; } } namespace MoreEyes.Utility { public class Enums { internal enum ModLogLevel { WarningsOnly, Standard, Debug } internal enum ModInMenuDisplay { Never, Duplicates, Always } internal enum MenuOrderBy { NameOnly, ModNameOnly, ModNameAndName, None } public enum EyePart { Pupil, Iris } public enum EyeSide { Left, Right } internal enum PrefabSide { Left, Right, Both } public enum NumpadKey { Keypad0 = 256, Keypad1, Keypad2, Keypad3, Keypad4, Keypad5, Keypad6, Keypad7, Keypad8, Keypad9 } } internal sealed class EyeSelectionMenu { [CompilerGenerated] private static class <>O { public static Action <0>__CreatePopupMenu; public static Action <1>__BackButton; public static Action <2>__RandomizeLocalEyeSelection; public static Action <3>__ResetLocalEyeSelection; public static Action <4>__PupilLeftSliders; public static Action <5>__PupilRightSliders; public static Action <6>__IrisLeftSliders; public static Action <7>__IrisRightSliders; public static Action<int> <8>__RedSlider; public static Action<int> <9>__GreenSlider; public static Action<int> <10>__BlueSlider; public static ShouldCloseMenuDelegate <11>__ShouldCloseMenu; } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static BuilderDelegate <>9__51_0; public static BuilderDelegate <>9__51_1; public static BuilderDelegate <>9__51_2; public static BuilderDelegate <>9__60_0; public static BuilderDelegate <>9__60_1; public static BuilderDelegate <>9__60_2; internal void <Initialize>b__51_0(Transform p) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("More Eyes", (Action)CreatePopupMenu, p, buttonPosMain); } internal void <Initialize>b__51_1(Transform p) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("More Eyes", (Action)CreatePopupMenu, p, buttonPosLobby); } internal void <Initialize>b__51_2(Transform p) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("More Eyes", (Action)CreatePopupMenu, p, buttonPosEsc); } internal void <CreatePopupMenu>b__60_0(Transform e) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Back", (Action)BackButton, ((Component)MoreEyesMenu).transform, new Vector2(190f, 30f)); } internal void <CreatePopupMenu>b__60_1(Transform e) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Randomize", (Action)RandomizeLocalEyeSelection, ((Component)MoreEyesMenu).transform, new Vector2(270f, 30f)); } internal void <CreatePopupMenu>b__60_2(Transform e) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Reset", (Action)ResetLocalEyeSelection, ((Component)MoreEyesMenu).transform, new Vector2(400f, 30f)); } } internal static REPOPopupPage MoreEyesMenu = new REPOPopupPage(); internal static REPOAvatarPreview AvatarPreview; internal static REPOButton pupilLeft; internal static REPOButton pupilRight; internal static REPOButton irisLeft; internal static REPOButton irisRight; internal static REPOLabel zoomTip; internal static REPOLabel pupilLeftHeader; internal static REPOLabel pupilRightHeader; internal static REPOLabel irisLeftHeader; internal static REPOLabel irisRightHeader; internal static REPOSlider redSlider; internal static REPOSlider greenSlider; internal static REPOSlider blueSlider; private static int currentRed; private static int currentGreen; private static int currentBlue; internal static string eyePart; internal static string eyeSide; internal static string eyeStyle; internal static float yOffsetStart = 22f; internal static float yOffsetPlus = 35f; internal static int modCount = 0; internal static Vector2 buttonPosMain; internal static Vector2 buttonPosLobby = new Vector2(600f, 22f); internal static Vector2 buttonPosEsc = new Vector2(470f, 0f); internal static readonly Vector2 anchorOut = new Vector2(471.25f, 24.5f); internal static readonly Vector2 anchorIn = new Vector2(471.25f, 156.5f); internal static readonly Vector3 scaleOut = Vector3.one; internal static readonly Vector3 scaleIn = new Vector3(2f, 2f, 2f); internal static readonly Vector3 posOut = new Vector3(0f, -0.6f, 0f); internal static readonly Vector3 posIn = new Vector3(0f, -3.5f, 0f); internal static object ColorSelection { get; private set; } = null; internal static Enums.EyePart CurrentEyePart { get; private set; } internal static Enums.EyeSide CurrentEyeSide { get; private set; } internal static bool SlidersOn { get; private set; } = false; private static string GetEyePartName(Enums.EyePart part) { return part switch { Enums.EyePart.Pupil => "Pupil", Enums.EyePart.Iris => "Iris", _ => "", }; } private static string GetEyeSideName(Enums.EyeSide side) { return side switch { Enums.EyeSide.Left => "Left", Enums.EyeSide.Right => "Right", _ => "", }; } private static string GetEyeStyle() { Enums.EyePart currentEyePart = CurrentEyePart; Enums.EyeSide currentEyeSide = CurrentEyeSide; switch (currentEyePart) { case Enums.EyePart.Pupil: switch (currentEyeSide) { case Enums.EyeSide.Left: return ((TMP_Text)pupilLeft.labelTMP).text; case Enums.EyeSide.Right: return ((TMP_Text)pupilRight.labelTMP).text; } break; case Enums.EyePart.Iris: switch (currentEyeSide) { case Enums.EyeSide.Left: return ((TMP_Text)irisLeft.labelTMP).text; case Enums.EyeSide.Right: return ((TMP_Text)irisRight.labelTMP).text; } break; } return ""; } internal static void Initialize() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown if (ModCompats.IsSpawnManagerPresent) { modCount++; } if (ModCompats.IsTwitchChatAPIPresent) { modCount++; } if (ModCompats.IsTwitchTrollingPresent) { modCount++; } buttonPosMain = new Vector2(595f, yOffsetStart + yOffsetPlus * (float)modCount); object obj = <>c.<>9__51_0; if (obj == null) { BuilderDelegate val = delegate(Transform p) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("More Eyes", (Action)CreatePopupMenu, p, buttonPosMain); }; <>c.<>9__51_0 = val; obj = (object)val; } MenuAPI.AddElementToMainMenu((BuilderDelegate)obj); object obj2 = <>c.<>9__51_1; if (obj2 == null) { BuilderDelegate val2 = delegate(Transform p) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("More Eyes", (Action)CreatePopupMenu, p, buttonPosLobby); }; <>c.<>9__51_1 = val2; obj2 = (object)val2; } MenuAPI.AddElementToLobbyMenu((BuilderDelegate)obj2); object obj3 = <>c.<>9__51_2; if (obj3 == null) { BuilderDelegate val3 = delegate(Transform p) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("More Eyes", (Action)CreatePopupMenu, p, buttonPosEsc); }; <>c.<>9__51_2 = val3; obj3 = (object)val3; } MenuAPI.AddElementToEscapeMenu((BuilderDelegate)obj3); } private static void RandomizeLocalEyeSelection() { PatchedEyes.Local.RandomizeEyes(); UpdateButtons(); } private static void ResetLocalEyeSelection() { PatchedEyes.Local.ResetEyes(); UpdateButtons(); } internal static void UpdateButtons() { PlayerEyeSelection currentSelections = PatchedEyes.Local.CurrentSelections; ((TMP_Text)pupilLeft.labelTMP).text = MenuUtils.ApplyGradient(currentSelections.pupilLeft.MenuName, inverse: true); ((TMP_Text)pupilRight.labelTMP).text = MenuUtils.ApplyGradient(currentSelections.pupilRight.MenuName, inverse: true); ((TMP_Text)irisLeft.labelTMP).text = MenuUtils.ApplyGradient(currentSelections.irisLeft.MenuName, inverse: true); ((TMP_Text)irisRight.labelTMP).text = MenuUtils.ApplyGradient(currentSelections.irisRight.MenuName, inverse: true); UpdateHeaders(); } private static void SetSliders(int red, int green, int blue) { redSlider.SetValue((float)red, false); greenSlider.SetValue((float)green, false); blueSlider.SetValue((float)blue, false); currentRed = red; currentGreen = green; currentBlue = blue; } private static void UpdateSliders(object selection) { //IL_001f: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) if (selection == null) { return; } Color colorForMenu; if (selection is CustomPupilType pupil) { ColorSelection = selection; colorForMenu = PatchedEyes.Local.CurrentSelections.GetColorForMenu(pupil); } else { if (!(selection is CustomIrisType iris)) { Loggers.Warning("Selection is invalid type at UpdateSliders!"); return; } ColorSelection = selection; colorForMenu = PatchedEyes.Local.CurrentSelections.GetColorForMenu(iris); } int value = Mathf.RoundToInt(colorForMenu.r * 255f); int value2 = Mathf.RoundToInt(colorForMenu.g * 255f); int value3 = Mathf.RoundToInt(colorForMenu.b * 255f); RedSlider(value); GreenSlider(value2); BlueSlider(value3); SetSliders(currentRed, currentGreen, currentBlue); } private static void UpdateMaterialColor() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) if (ColorSelection != null) { Color color = default(Color); ((Color)(ref color))..ctor((float)currentRed / 255f, (float)currentGreen / 255f, (float)currentBlue / 255f); if (ColorSelection is CustomPupilType pupil) { PatchedEyes.Local.CurrentSelections.UpdateColorInMenu(pupil, color); } else if (ColorSelection is CustomIrisType iris) { PatchedEyes.Local.CurrentSelections.UpdateColorInMenu(iris, color); } else { Loggers.Warning("Unable to set color of current selection! Invalid type!"); } } } private static void UpdateHeaders() { eyePart = GetEyePartName(CurrentEyePart); eyeSide = GetEyeSideName(CurrentEyeSide); eyeStyle = GetEyeStyle(); ((TMP_Text)redSlider.labelTMP).text = eyeStyle ?? ""; ((TMP_Text)greenSlider.labelTMP).text = MenuUtils.ApplyGradient(eyePart ?? ""); ((TMP_Text)blueSlider.labelTMP).text = MenuUtils.ApplyGradient(eyeSide ?? ""); } private static void BackButton() { SlidersOn = true; MoreEyesMenu.ClosePage(true); MenuPageEsc instance = MenuPageEsc.instance; if (instance != null) { instance.ButtonEventContinue(); } if (FileManager.UpdateWrite) { MoreEyesNetwork.SyncMoreEyesChanges(); FileManager.WriteTextFile(); } } private static void CreatePopupMenu() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Expected O, but got Unknown //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Expected O, but got Unknown //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_064e: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Unknown result type (might be due to invalid IL or missing references) //IL_0711: Expected O, but got Unknown //IL_06f7: Unknown result type (might be due to invalid IL or missing references) //IL_06fc: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Expected O, but got Unknown if ((Object)(object)MoreEyesMenu.menuPage != (Object)null) { return; } PlayerEyeSelection currentSelections = PatchedEyes.Local.CurrentSelections; MoreEyesMenu = MenuAPI.CreateREPOPopupPage(MenuUtils.ApplyGradient("Eye Selections"), false, true, 0f, (Vector2?)new Vector2(-150f, 5f)); AvatarPreview = MenuAPI.CreateREPOAvatarPreview(((Component)MoreEyesMenu).transform, new Vector2(471.25f, 156.5f), false, (Color?)null); AvatarPreview.previewSize = new Vector2(266.6667f, 500f); ((REPOElement)AvatarPreview).rectTransform.sizeDelta = new Vector2(266.6667f, 210f); AvatarPreview.rigTransform.parent.localScale = scaleIn; AvatarPreview.rigTransform.parent.localPosition = posIn; MenuUtils.zoomLevel = 1f; MenuUtils.HandleScrollZoom(AvatarPreview, anchorIn, anchorOut, scaleIn, scaleOut, posIn, posOut); zoomTip = MenuAPI.CreateREPOLabel("! Scroll to zoom", ((Component)MoreEyesMenu).transform, new Vector2(480f, 0f)); MenuUtils.SetTipTextStyling(zoomTip); REPOPopupPage moreEyesMenu = MoreEyesMenu; object obj = <>c.<>9__60_0; if (obj == null) { BuilderDelegate val = delegate { //IL_0034: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Back", (Action)BackButton, ((Component)MoreEyesMenu).transform, new Vector2(190f, 30f)); }; <>c.<>9__60_0 = val; obj = (object)val; } moreEyesMenu.AddElement((BuilderDelegate)obj); REPOPopupPage moreEyesMenu2 = MoreEyesMenu; object obj2 = <>c.<>9__60_1; if (obj2 == null) { BuilderDelegate val2 = delegate { //IL_0034: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Randomize", (Action)RandomizeLocalEyeSelection, ((Component)MoreEyesMenu).transform, new Vector2(270f, 30f)); }; <>c.<>9__60_1 = val2; obj2 = (object)val2; } moreEyesMenu2.AddElement((BuilderDelegate)obj2); REPOPopupPage moreEyesMenu3 = MoreEyesMenu; object obj3 = <>c.<>9__60_2; if (obj3 == null) { BuilderDelegate val3 = delegate { //IL_0034: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Reset", (Action)ResetLocalEyeSelection, ((Component)MoreEyesMenu).transform, new Vector2(400f, 30f)); }; <>c.<>9__60_2 = val3; obj3 = (object)val3; } moreEyesMenu3.AddElement((BuilderDelegate)obj3); pupilLeft = MenuAPI.CreateREPOButton(MenuUtils.ApplyGradient(currentSelections.pupilLeft.MenuName, inverse: true), (Action)PupilLeftSliders, ((Component)MoreEyesMenu).transform, new Vector2(215f, 265f)); pupilRight = MenuAPI.CreateREPOButton(MenuUtils.ApplyGradient(currentSelections.pupilRight.MenuName, inverse: true), (Action)PupilRightSliders, ((Component)MoreEyesMenu).transform, new Vector2(360f, 265f)); irisLeft = MenuAPI.CreateREPOButton(MenuUtils.ApplyGradient(currentSelections.irisLeft.MenuName, inverse: true), (Action)IrisLeftSliders, ((Component)MoreEyesMenu).transform, new Vector2(215f, 215f)); irisRight = MenuAPI.CreateREPOButton(MenuUtils.ApplyGradient(currentSelections.irisRight.MenuName, inverse: true), (Action)IrisRightSliders, ((Component)MoreEyesMenu).transform, new Vector2(360f, 215f)); MenuUtils.SetTextStyling(new List<REPOButton>(4) { pupilLeft, pupilRight, irisLeft, irisRight }); pupilLeftHeader = MenuAPI.CreateREPOLabel("Pupil Left", ((Component)MoreEyesMenu).transform, new Vector2(151.5f, 285f)); pupilRightHeader = MenuAPI.CreateREPOLabel("Pupil Right", ((Component)MoreEyesMenu).transform, new Vector2(297.5f, 285f)); irisLeftHeader = MenuAPI.CreateREPOLabel("Iris Left", ((Component)MoreEyesMenu).transform, new Vector2(151.5f, 235f)); irisRightHeader = MenuAPI.CreateREPOLabel("Iris Right", ((Component)MoreEyesMenu).transform, new Vector2(297.5f, 235f)); MenuUtils.SetHeaderTextStyling(new List<REPOLabel>(4) { pupilLeftHeader, pupilRightHeader, irisLeftHeader, irisRightHeader }); (REPOButton, Enums.EyeSide, Enums.EyePart)[] array = new(REPOButton, Enums.EyeSide, Enums.EyePart)[4] { (pupilLeft, Enums.EyeSide.Left, Enums.EyePart.Pupil), (pupilRight, Enums.EyeSide.Right, Enums.EyePart.Pupil), (irisLeft, Enums.EyeSide.Left, Enums.EyePart.Iris), (irisRight, Enums.EyeSide.Right, Enums.EyePart.Iris) }; (REPOButton, Enums.EyeSide, Enums.EyePart)[] array2 = array; for (int i = 0; i < array2.Length; i++) { var (val4, side, part) = array2[i]; MenuAPI.CreateREPOButton("<", (Action)delegate { NewSelection(side, part, -1); }, ((Component)val4).transform, new Vector2(-25f, -10f)); MenuAPI.CreateREPOButton(">", (Action)delegate { NewSelection(side, part, 1); }, ((Component)val4).transform, new Vector2(70f, -10f)); } redSlider = MenuAPI.CreateREPOSlider(MenuUtils.ApplyGradient(eyeStyle ?? ""), "<color=#FF0000>Red</color>", (Action<int>)RedSlider, ((Component)MoreEyesMenu).transform, new Vector2(205f, 180f), 0, 255, 0, "", "", (BarBehavior)0); greenSlider = MenuAPI.CreateREPOSlider(MenuUtils.ApplyGradient(eyePart ?? ""), "<color=#00FF00>Green</color>", (Action<int>)GreenSlider, ((Component)MoreEyesMenu).transform, new Vector2(205f, 135f), 0, 255, 0, "", "", (BarBehavior)0); blueSlider = MenuAPI.CreateREPOSlider(MenuUtils.ApplyGradient(eyeSide ?? ""), "<color=#0000FF>Blue</color>", (Action<int>)BlueSlider, ((Component)MoreEyesMenu).transform, new Vector2(205f, 90f), 0, 255, 0, "", "", (BarBehavior)0); MenuUtils.SliderSetups(new List<REPOSlider>(3) { redSlider, greenSlider, blueSlider }); ((Component)redSlider).gameObject.SetActive(false); ((Component)greenSlider).gameObject.SetActive(false); ((Component)blueSlider).gameObject.SetActive(false); SlidersOn = false; MoreEyesMenu.OpenPage(false); REPOPopupPage moreEyesMenu4 = MoreEyesMenu; ShouldCloseMenuDelegate onEscapePressed = moreEyesMenu4.onEscapePressed; object obj4 = <>O.<11>__ShouldCloseMenu; if (obj4 == null) { ShouldCloseMenuDelegate val5 = ShouldCloseMenu; <>O.<11>__ShouldCloseMenu = val5; obj4 = (object)val5; } moreEyesMenu4.onEscapePressed = (ShouldCloseMenuDelegate)Delegate.Combine((Delegate?)(object)onEscapePressed, (Delegate?)obj4); } private static bool ShouldCloseMenu() { BackButton(); return true; } private static void CommonSliders(Enums.EyeSide eyeSide, Enums.EyePart eyePart) { if (!SlidersOn) { ((Component)redSlider).gameObject.SetActive(true); ((Component)greenSlider).gameObject.SetActive(true); ((Component)blueSlider).gameObject.SetActive(true); } SlidersOn = true; CurrentEyePart = eyePart; CurrentEyeSide = eyeSide; eyeStyle = GetEyeStyle(); UpdateHeaders(); if (CurrentEyePart == Enums.EyePart.Pupil) { if (eyeSide == Enums.EyeSide.Left && (Object)(object)PatchedEyes.Local.CurrentSelections.pupilLeft.Prefab != (Object)null) { UpdateSliders(PatchedEyes.Local.CurrentSelections.pupilLeft); } if (eyeSide == Enums.EyeSide.Right && (Object)(object)PatchedEyes.Local.CurrentSelections.pupilRight.Prefab != (Object)null) { UpdateSliders(PatchedEyes.Local.CurrentSelections.pupilRight); } } else { if (eyeSide == Enums.EyeSide.Left && (Object)(object)PatchedEyes.Local.CurrentSelections.irisLeft.Prefab != (Object)null) { UpdateSliders(PatchedEyes.Local.CurrentSelections.irisLeft); } if (eyeSide == Enums.EyeSide.Right && (Object)(object)PatchedEyes.Local.CurrentSelections.irisRight.Prefab != (Object)null) { UpdateSliders(PatchedEyes.Local.CurrentSelections.irisRight); } } } private static void PupilLeftSliders() { CommonSliders(Enums.EyeSide.Left, Enums.EyePart.Pupil); } private static void PupilRightSliders() { CommonSliders(Enums.EyeSide.Right, Enums.EyePart.Pupil); } private static void IrisLeftSliders() { CommonSliders(Enums.EyeSide.Left, Enums.EyePart.Iris); } private static void IrisRightSliders() { CommonSliders(Enums.EyeSide.Right, Enums.EyePart.Iris); } private static void RedSlider(int value) { currentRed = value; UpdateMaterialColor(); } private static void GreenSlider(int value) { currentGreen = value; UpdateMaterialColor(); } private static void BlueSlider(int value) { currentBlue = value; UpdateMaterialColor(); } private static void NewSelection(Enums.EyeSide side, Enums.EyePart part, int dir) { PlayerEyeSelection currentSelections = PatchedEyes.Local.CurrentSelections; if (part == Enums.EyePart.Pupil) { List<CustomPupilType> List = CustomPupilType.GetListing(side, currentSelections); MenuUtils.OrderListBy(ref List, ModConfig.MenuListOrder.Value); int num = CustomPupilType.IndexOf(side, List, currentSelections); int index = CycleIndex(num + dir, 0, List.Count - 1); CustomPupilType newSelection = List[index]; PatchedEyes.Local.SelectPupil(newSelection, side == Enums.EyeSide.Left); UpdateButtons(); } else { List<CustomIrisType> List2 = CustomIrisType.GetListing(side, currentSelections); MenuUtils.OrderListBy(ref List2, ModConfig.MenuListOrder.Value); int num2 = CustomIrisType.IndexOf(side, List2, currentSelections); int index2 = CycleIndex(num2 + dir, 0, List2.Count - 1); CustomIrisType newSelection2 = List2[index2]; PatchedEyes.Local.SelectIris(newSelection2, side == Enums.EyeSide.Left); UpdateButtons(); } CommonSliders(side, part); } public static int CycleIndex(int value, int min, int max) { if (value < min) { return max; } if (value > max) { return min; } return value; } } internal static class MenuUtils { [CompilerGenerated] private sealed class <AnimateZoom>d__4 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float targetZoom; public REPOAvatarPreview preview; public Vector3 scaleOut; public Vector3 scaleIn; public Vector3 posOut; public Vector3 posIn; public Vector2 anchorOut; public Vector2 anchorIn; private Vector2 <sizeOut>5__2; private Vector2 <sizeIn>5__3; private Vector2 <deltaOut>5__4; private Vector2 <deltaIn>5__5; private float <startZoom>5__6; private float <duration>5__7; private float <elapsed>5__8; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AnimateZoom>d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_0069: 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <sizeOut>5__2 = new Vector2(182.4f, 342f); <sizeIn>5__3 = new Vector2(266.6667f, 500f); <deltaOut>5__4 = new Vector2(182.4f, 342f); <deltaIn>5__5 = new Vector2(266.6667f, 210f); <startZoom>5__6 = zoomLevel; <duration>5__7 = 0.45f; <elapsed>5__8 = 0f; break; case 1: <>1__state = -1; break; } if (<elapsed>5__8 < <duration>5__7) { <elapsed>5__8 += Time.deltaTime; float num = Mathf.SmoothStep(0f, 1f, <elapsed>5__8 / <duration>5__7); float num2 = Mathf.Lerp(<startZoom>5__6, targetZoom, num); preview.previewSize = Vector2.Lerp(<sizeOut>5__2, <sizeIn>5__3, num2); ((REPOElement)preview).rectTransform.sizeDelta = Vector2.Lerp(<deltaOut>5__4, <deltaIn>5__5, num2); preview.rigTransform.parent.localScale = Vector3.Lerp(scaleOut, scaleIn, num2); preview.rigTransform.parent.localPosition = Vector3.Lerp(posOut, posIn, num2); ((REPOElement)preview).rectTransform.anchoredPosition = Vector2.Lerp(anchorOut, anchorIn, num2); <>2__current = null; <>1__state = 1; return true; } preview.previewSize = Vector2.Lerp(<sizeOut>5__2, <sizeIn>5__3, targetZoom); ((REPOElement)preview).rectTransform.sizeDelta = Vector2.Lerp(<deltaOut>5__4, <deltaIn>5__5, targetZoom); preview.rigTransform.parent.localScale = Vector3.Lerp(scaleOut, scaleIn, targetZoom); preview.rigTransform.parent.localPosition = Vector3.Lerp(posOut, posIn, targetZoom); ((REPOElement)preview).rectTransform.anchoredPosition = Vector2.Lerp(anchorOut, anchorIn, targetZoom); zoomCoroutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <AvatarZoomCoroutine>d__3 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public REPOAvatarPreview preview; public Vector2 anchorIn; public Vector2 anchorOut; public Vector3 scaleIn; public Vector3 scaleOut; public Vector3 posIn; public Vector3 posOut; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AvatarZoomCoroutine>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //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_00a2: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if ((Object)(object)preview != (Object)null && (Object)(object)preview.rigTransform != (Object)null) { float num = InputManager.instance.KeyPullAndPush(); if (Mathf.Abs(num) > 0.001f) { float num2 = Mathf.Clamp01(zoomLevel + Mathf.Sign(num)); if (!Mathf.Approximately(num2, zoomLevel)) { if (zoomCoroutine != null) { ((MonoBehaviour)preview).StopCoroutine(zoomCoroutine); zoomCoroutine = null; } zoomCoroutine = ((MonoBehaviour)preview).StartCoroutine(AnimateZoom(preview, num2, anchorIn, anchorOut, scaleIn, scaleOut, posIn, posOut)); zoomLevel = num2; } } <>2__current = null; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static Coroutine zoomCoroutine; internal static float zoomLevel; public static void HandleScrollZoom(REPOAvatarPreview preview, Vector2 anchorIn, Vector2 anchorOut, Vector3 scaleIn, Vector3 scaleOut, Vector3 posIn, Vector3 posOut) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)preview == (Object)null) && !((Object)(object)preview.rigTransform == (Object)null) && zoomCoroutine == null) { ((MonoBehaviour)preview).StartCoroutine(AvatarZoomCoroutine(preview, anchorIn, anchorOut, scaleIn, scaleOut, posIn, posOut)); } } [IteratorStateMachine(typeof(<AvatarZoomCoroutine>d__3))] private static IEnumerator AvatarZoomCoroutine(REPOAvatarPreview preview, Vector2 anchorIn, Vector2 anchorOut, Vector3 scaleIn, Vector3 scaleOut, Vector3 posIn, Vector3 posOut) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AvatarZoomCoroutine>d__3(0) { preview = preview, anchorIn = anchorIn, anchorOut = anchorOut, scaleIn = scaleIn, scaleOut = scaleOut, posIn = posIn, posOut = posOut }; } [IteratorStateMachine(typeof(<AnimateZoom>d__4))] private static IEnumerator AnimateZoom(REPOAvatarPreview preview, float targetZoom, Vector2 anchorIn, Vector2 anchorOut, Vector3 scaleIn, Vector3 scaleOut, Vector3 posIn, Vector3 posOut) { //IL_0015: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AnimateZoom>d__4(0) { preview = preview, targetZoom = targetZoom, anchorIn = anchorIn, anchorOut = anchorOut, scaleIn = scaleIn, scaleOut = scaleOut, posIn = posIn, posOut = posOut }; } public static void SetTipTextStyling(REPOLabel label) { ((TMP_Text)label.labelTMP).fontSize = 20f; ((TMP_Text)label.labelTMP).horizontalAlignment = (HorizontalAlignmentOptions)2; ((TMP_Text)label.labelTMP).alpha = 0.15f; } public static void SetTextStyling(List<REPOButton> buttons) { CollectionExtensions.Do<REPOButton>((IEnumerable<REPOButton>)buttons, (Action<REPOButton>)delegate(REPOButton t) { //IL_000b: 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_0040: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) t.overrideButtonSize = new Vector2(75f, 20f); ((TMP_Text)t.labelTMP).fontSize = 18f; GameObject val = new GameObject(((Object)t).name + " Mask Object"); Image val2 = val.AddComponent<Image>(); ((Graphic)val2).color = new Color(0f, 0f, 0f, 0.05f); val.AddComponent<Mask>(); val.transform.SetParent(((Component)t).transform); ((Graphic)val2).rectTransform.anchoredPosition = new Vector2(0f, -2f); ((Graphic)val2).rectTransform.sizeDelta = new Vector2(80f, 20f); ((Component)t.labelTMP).gameObject.transform.SetParent(val.transform); t.menuButton.buttonTextSelectedOriginalPos = new Vector3(-42f, -18f, 0f); HorizontalTextScroller horizontalTextScroller = ((Component)t.labelTMP).gameObject.AddComponent<HorizontalTextScroller>(); horizontalTextScroller.startPos = t.menuButton.buttonTextSelectedOriginalPos; horizontalTextScroller.SetButtonRef(t.menuButton); }); } public static void SetHeaderTextStyling(List<REPOLabel> labels) { CollectionExtensions.Do<REPOLabel>((IEnumerable<REPOLabel>)labels, (Action<REPOLabel>)delegate(REPOLabel t) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) ((TMP_Text)t.labelTMP).fontStyle = (FontStyles)4; ((TMP_Text)t.labelTMP).fontSize = 18f; ((TMP_Text)t.labelTMP).horizontalAlignment = (HorizontalAlignmentOptions)2; ((Graphic)t.labelTMP).color = Color.white; }); } public static void SliderSetups(List<REPOSlider> root) { //IL_001f: 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_002c: 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_0044: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: 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_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) if (root == null) { return; } Material bodyMaterial = PlayerAvatar.instance.playerHealth.bodyMaterial; Color color = bodyMaterial.GetColor(Shader.PropertyToID("_AlbedoColor")); Color val = default(Color); ((Color)(ref val))..ctor(1f - color.r, 1f - color.g, 1f - color.b, color.a); foreach (REPOSlider item in root) { Transform[] componentsInChildren = ((Component)item).GetComponentsInChildren<Transform>(true); foreach (Transform val2 in componentsInChildren) { switch (((Object)val2).name) { case "SliderBG": { RawImage[] componentsInChildren5 = ((Component)val2).GetComponentsInChildren<RawImage>(true); foreach (RawImage val6 in componentsInChildren5) { if ((Object)(object)val6 != (Object)null) { Color color2 = ((Graphic)val6).color; color2.a = 0f; ((Graphic)val6).color = color2; } } break; } case "Bar": { RawImage[] componentsInChildren3 = ((Component)val2).GetComponentsInChildren<RawImage>(true); foreach (RawImage val4 in componentsInChildren3) { if ((Object)(object)val4 != (Object)null) { float num = 0.299f * val.r + 0.587f * val.g + 0.114f * val.b; float num2 = 0.5f; if (num < num2) { float num3 = Mathf.Clamp01((num2 - num) * 0.5f); val = Color.Lerp(val, Color.white, num3); } ((Graphic)val4).color = val; } } break; } case "Bar Text": { TextMeshProUGUI[] componentsInChildren4 = ((Component)val2).GetComponentsInChildren<TextMeshProUGUI>(true); foreach (TextMeshProUGUI val5 in componentsInChildren4) { if ((Object)(object)val5 != (Object)null) { float num4 = 0.299f * val.r + 0.587f * val.g + 0.114f * val.b; float num5 = 0.5f; if (num4 < num5) { float num6 = Mathf.Clamp01((num5 - num4) * 0.5f); val = Color.Lerp(val, Color.white, num6); } ((Graphic)val5).color = val; } } break; } case "Bar Text (1)": { TextMeshProUGUI[] componentsInChildren2 = ((Component)val2).GetComponentsInChildren<TextMeshProUGUI>(true); foreach (TextMeshProUGUI val3 in componentsInChildren2) { if ((Object)(object)val3 != (Object)null) { ((Graphic)val3).color = Color.black; } } break; } } } } } public static string CleanName(string fileName) { string[] array = new string[7] { "pupil", "pupils", "iris", "irises", "left", "right", "both" }; string text = fileName.Replace('_', ' '); string[] array2 = array; foreach (string oldValue in array2) { text = text.Replace(oldValue, "", StringComparison.OrdinalIgnoreCase); } return string.Join(' ', text.Split(' ', StringSplitOptions.RemoveEmptyEntries)); } public static void OrderListBy(ref List<CustomPupilType> List, Enums.MenuOrderBy config) { switch (config) { case Enums.MenuOrderBy.NameOnly: List.OrderBy((CustomPupilType L) => L.Name); break; case Enums.MenuOrderBy.ModNameOnly: List.OrderBy((CustomPupilType L) => L.ModName); break; case Enums.MenuOrderBy.ModNameAndName: _ = from L in List orderby L.ModName, L.Name select L; break; } } public static void OrderListBy(ref List<CustomIrisType> List, Enums.MenuOrderBy config) { switch (config) { case Enums.MenuOrderBy.NameOnly: List.OrderBy((CustomIrisType L) => L.Name); break; case Enums.MenuOrderBy.ModNameOnly: List.OrderBy((CustomIrisType L) => L.ModName); break; case Enums.MenuOrderBy.ModNameAndName: _ = from L in List orderby L.ModName, L.Name select L; break; } } public static string ApplyGradient(string input, bool inverse = false, float minBrightness = 0.15f) { //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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_00f3: 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_0101: Unknown result type (might be due to invalid IL or missing references) Material bodyMaterial = PlayerAvatar.instance.playerHealth.bodyMaterial; Color color = bodyMaterial.GetColor(Shader.PropertyToID("_AlbedoColor")); Color val = color; float num = 0.299f * color.r + 0.587f * color.g + 0.114f * color.b; float num2 = 0.6f; Color val2 = ((num < 0.5f) ? Color.Lerp(color, Color.white, num2) : Color.Lerp(color, Color.black, num2)); if (inverse) { Color val3 = val; val = val2; val2 = val3; } string text = ""; int length = input.Length; for (int i = 0; i < length; i++) { float num3 = (float)i / (float)Mathf.Max(1, length - 1); Color val4 = Color.Lerp(val, val2, num3); float num4 = 0.299f * val4.r + 0.587f * val4.g + 0.114f * val4.b; if (num4 < minBrightness) { float num5 = Mathf.Clamp01((minBrightness - num4) * 0.5f); val4 = Color.Lerp(val4, Color.white, num5); } string arg = ColorUtility.ToHtmlStringRGB(val4); text += $"<color=#{arg}>{input[i]}</color>"; } return text; } } internal static class ModCompats { internal const string MenuLib_PLUGIN_GUID = "nickklmao.menulib"; internal const string SpawnManager_PLUGIN_GUID = "soundedsquash.spawnmanager"; internal const string TwitchChatAPI_PLUGIN_GUID = "TwitchChatAPI.REPO"; internal const string TwitchTrolling_PLUGIN_GUID = "com.github.zehsteam.TwitchTrolling"; internal static bool IsSpawnManagerPresent => Chainloader.PluginInfos.ContainsKey("soundedsquash.spawnmanager"); internal static bool IsTwitchChatAPIPresent => Chainloader.PluginInfos.ContainsKey("TwitchChatAPI.REPO"); internal static bool IsTwitchTrollingPresent => Chainloader.PluginInfos.ContainsKey("com.github.zehsteam.TwitchTrolling"); } internal class ModConfig { internal static ConfigEntry<Enums.ModLogLevel> ClientLogLevel { get; private set; } internal static ConfigEntry<Enums.ModInMenuDisplay> ModNamesInMenu { get; private set; } internal static ConfigEntry<Enums.MenuOrderBy> MenuListOrder { get; private set; } internal static ConfigEntry<float> MenuItemScrollSpeed { get; private set; } internal static ConfigFile ConfigFile { get; private set; } internal static void BindConfigItems(ConfigFile config) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown ConfigFile = config; ClientLogLevel = config.Bind<Enums.ModLogLevel>("General", "ClientLogLevel", Enums.ModLogLevel.Standard, "Set MoreEyes logging level"); ModNamesInMenu = config.Bind<Enums.ModInMenuDisplay>("Menus", "Display Mod Names", Enums.ModInMenuDisplay.Duplicates, "Set when should mod names be displayed in the MoreEyes Menu"); MenuListOrder = config.Bind<Enums.MenuOrderBy>("Menus", "Order By", Enums.MenuOrderBy.NameOnly, "Set pupil/iris ordering mode"); MenuItemScrollSpeed = config.Bind<float>("Menus", "Auto-scroll Speed", 14f, new ConfigDescription("Set how fast the name of a pupil or iris will scroll when the name doesn't fit the text box.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(8f, 90f), Array.Empty<object>())); } internal static void GenerateConfigItems() { if (ConfigFile == null) { return; } foreach (IGrouping<string, CustomPupilType> item in from p in CustomEyeManager.AllPupilTypes where !p.isVanilla group p by p.PairName) { ConfigEntry<bool> configToggle = ConfigFile.Bind<bool>(item.First().ModName + " Pupils", item.Key, true, "Enable/Disable pupil" + ((item.Count() > 1) ? " pair" : "") + " - " + item.Key); foreach (CustomPupilType item2 in item) { item2.ConfigToggle = configToggle; } } foreach (IGrouping<string, CustomIrisType> item3 in from i in CustomEyeManager.AllIrisTypes where !i.isVanilla group i by i.PairName) { ConfigEntry<bool> configToggle2 = ConfigFile.Bind<bool>(item3.First().ModName + " Irises", item3.Key, true, "Enable/Disable iris" + ((item3.Count() > 1) ? " pair" : "") + " - " + item3.Key); foreach (CustomIrisType item4 in item3) { item4.ConfigToggle = configToggle2; } } } } } namespace MoreEyes.SDK { [CreateAssetMenu(menuName = "MoreEyes/Mod", order = 0, fileName = "New MoreEyes Mod")] public class MoreEyesMod : ScriptableObject { [SerializeField] private string _name; [SerializeField] private string _author; [SerializeField] private string _version = "1.0.0"; [SerializeField] private List<GameObject> _prefabs = new List<GameObject>(); public string Name => _name; public string Author => _author; public string Version => _version; public string Identifier => Author + "-" + Name + "-" + Version; public List<GameObject> Prefabs => _prefabs; public void SetName(string value) { _name = value; } public void SetAuthor(string value) { _author = value; } public void SetVersion(string value) { _version = value; } public void SetPrefabs(List<GameObject> value) { _prefabs = value; } } } namespace MoreEyes.Managers { internal class CustomEyeManager { internal static List<PlayerEyeSelection> AllPlayerSelections = new List<PlayerEyeSelection>(); public static List<CustomPupilType> PupilsInUse = new List<CustomPupilType>(); public static List<CustomIrisType> IrisInUse = new List<CustomIrisType>(); public static bool isInitialized = false; public static CustomIrisType VanillaIris; public static List<CustomPupilType> AllPupilTypes { get; internal set; } = new List<CustomPupilType>(); public static List<CustomIrisType> AllIrisTypes { get; internal set; } = new List<CustomIrisType>(); public static List<PatchedEyes> AllPatchedEyes { get; internal set; } = new List<PatchedEyes>(); public static CustomPupilType VanillaPupilRight { get; internal set; } = new CustomPupilType("Standard Right"); public static CustomPupilType VanillaPupilLeft { get; internal set; } = new CustomPupilType("Standard Left"); public static bool VanillaPupilsExist { get { if ((Object)(object)VanillaPupilLeft?.Prefab != (Object)null) { return (Object)(object)VanillaPupilRight?.Prefab != (Object)null; } return false; } } internal static void Init() { AllIrisTypes = new List<CustomIrisType>(); VanillaPupilLeft.isVanilla = true; VanillaPupilRight.isVanilla = true; AllPupilTypes = new List<CustomPupilType>(2) { VanillaPupilLeft, VanillaPupilRight }; if (!isInitialized) { VanillaIris = new CustomIrisType(); VanillaIris.VanillaSetup(); CollectionExtensions.Do<LoadedAsset>((IEnumerable<LoadedAsset>)EyesAssetManager.LoadedAssets, (Action<LoadedAsset>)delegate(LoadedAsset asset) { GetAllTypes(asset); }); ModConfig.GenerateConfigItems(); FileManager.ReadTextFile(); } } internal static void GetAllTypes(LoadedAsset loadedAsset) { if ((Object)(object)loadedAsset.Bundle == (Object)null) { Loggers.Warning("Unable to get all types from loadedAsset, bundle is not loaded"); return; } ScriptableObject[] source = loadedAsset.Bundle.LoadAllAssets<ScriptableObject>(); ScriptableObject val = ((IEnumerable<ScriptableObject>)source).FirstOrDefault((Func<ScriptableObject, bool>)((ScriptableObject p) => p is MoreEyesMod)); if ((Object)(object)val == (Object)null) { Loggers.Error("Mod info is null for " + ((Object)loadedAsset.Bundle).name + "!"); return; } loadedAsset.ModInfo = val as MoreEyesMod; List<GameObject> prefabsLoaded = new List<GameObject>(); List<string> list = loadedAsset.Bundle.GetAllAssetNames().ToList(); List<string> list2 = list.FindAll((string n) => n.Contains("_iris_")); List<string> list3 = list.FindAll((string n) => n.Contains("_pupil_")); list2.RemoveAll((string i) => Utility.IsNullOrWhiteSpace(i)); list3.RemoveAll((string p) => Utility.IsNullOrWhiteSpace(p)); CollectionExtensions.Do<string>((IEnumerable<string>)list3, (Action<string>)delegate(string n) { CustomPupilType customPupilType = new CustomPupilType(loadedAsset, n, loadedAsset.ModInfo); prefabsLoaded.Add(customPupilType.Prefab); }); CollectionExtensions.Do<string>((IEnumerable<string>)list2, (Action<string>)delegate(string n) { CustomIrisType customIrisType = new CustomIrisType(); customIrisType.IrisSetup(loadedAsset, n, loadedAsset.ModInfo); prefabsLoaded.Add(customIrisType.Prefab); }); loadedAsset.ModInfo.SetPrefabs(prefabsLoaded); } } internal class EyesAssetManager { internal static List<LoadedAsset> LoadedAssets = new List<LoadedAsset>(); public static void InitBundles() { List<string> list = Directory.GetFiles(Path.Combine(Paths.BepInExRootPath, "plugins"), "*.eyes", SearchOption.AllDirectories).ToList(); foreach (string path in list) { LoadedAsset loadedAsset = LoadedAssets.FirstOrDefault((LoadedAsset a) => a.isLoaded && a.FilePath == path); if (loadedAsset == null) { loadedAsset = new LoadedAsset(path); } else { Loggers.Warning("The asset at path " + path + " has already been loaded!"); } } } internal static void UnloadBundle(string bundlePath) { LoadedAsset loadedAsset = LoadedAssets.FirstOrDefault((LoadedAsset a) => a.isLoaded && a.FilePath == bundlePath); if (loadedAsset == null) { Loggers.Warning("There is no bundles that are currently loaded at that path!"); } else { loadedAsset.UnloadBundle(); } } internal static void UnloadBundle(AssetBundle bundleRef) { if ((Object)(object)bundleRef == (Object)null) { Loggers.Warning("Cannot unload a null bundleRef!"); return; } LoadedAsset loadedAsset = LoadedAssets.FirstOrDefault((LoadedAsset a) => a.isLoaded && (Object)(object)a.Bundle == (Object)(object)bundleRef); if (loadedAsset == null) { Loggers.Warning("The provided bundleRef is not being detected as loaded."); } else { loadedAsset.UnloadBundle(); } } } internal class FileManager { internal static Dictionary<string, string> PlayerSelections { get; private set; } = new Dictionary<string, string>(); internal static bool UpdateWrite { get; set; } = false; internal static void ReadTextFile() { string name = Path.Combine("%userprofile%\\appdata\\locallow\\semiwork\\Repo", "moreEyes"); name = Environment.ExpandEnvironmentVariables(name); if (!Directory.Exists(name)) { Directory.CreateDirectory(name); } if (!File.Exists(name + "\\selections.txt")) { Loggers.Message("No saved player selections exist!"); return; } string text = File.ReadAllText(name + "\\selections.txt"); Loggers.Message("Assigning saved player selections!"); if (text.Length != 0) { PlayerSelections = new Dictionary<string, string>(); if (text.EndsWith(';')) { text = text.TrimEnd(';'); } PlayerSelections = (from item in text.Split(';') select item.Trim() into item select item.Split(':')).ToDictionary((string[] pair) => pair[0].Trim(), (string[] pair) => pair[1].Trim()); } } private static void UpdatePlayerSelections() { CollectionExtensions.Do<PlayerEyeSelection>((IEnumerable<PlayerEyeSelection>)CustomEyeManager.AllPlayerSelections, (Action<PlayerEyeSelection>)delegate(PlayerEyeSelection a) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) string value = "pupilLeft=" + a.pupilLeft.UID + ",pupilLeftColor=" + ColorUtility.ToHtmlStringRGB(a.PupilLeftColor) + ",pupilRight=" + a.pupilRight.UID + ",pupilRightColor=" + ColorUtility.ToHtmlStringRGB(a.PupilRightColor) + ",irisLeft=" + a.irisLeft.UID + ",irisLeftColor=" + ColorUtility.ToHtmlStringRGB(a.IrisLeftColor) + ",irisRight=" + a.irisRight.UID + ",irisRightColor=" + ColorUtility.ToHtmlStringRGB(a.IrisRightColor); if (PlayerSelections.ContainsKey(a.playerID)) { PlayerSelections[a.playerID] = value; } else { PlayerSelections.Add(a.playerID, value); } }); } internal static Dictionary<string, string> GetPairsFromString(string selections) { return (from item in selections.Split(',') select item.Trim() into item select item.Split('=')).ToDictionary((string[] pair) => pair[0].Trim(), (string[] pair) => pair[1].Trim()); } internal static Dictionary<string, string> GetSelectionPairsFromFile(string playerID) { Dictionary<string, string> result = new Dictionary<string, string>(); if (!CustomEyeManager.VanillaPupilsExist) { return result; } string playerSelections = GetPlayerSelections(playerID); if (string.IsNullOrEmpty(playerSelections)) { Loggers.Info("Unable to get saved selection for [ " + playerID + " ]"); return result; } return GetPairsFromString(playerSelections); } private static string GetPlayerSelections(string steamID) { if (PlayerSelections.ContainsKey(steamID)) { return PlayerSelections[steamID]; } return ""; } internal static void WriteTextFile() { Loggers.Message("Updating saved selections!"); UpdateWrite = false; UpdatePlayerSelections(); string text = Path.Combine("%userprofile%\\appdata\\locallow\\semiwork\\Repo", "moreEyes"); Loggers.Debug("Location: " + text); text = Environment.ExpandEnvironmentVariables(text); string fileContents = string.Empty; CollectionExtensions.Do<KeyValuePair<string, string>>((IEnumerable<KeyValuePair<string, string>>)PlayerSelections, (Action<KeyValuePair<string, string>>)delegate(KeyValuePair<string, string> p) { fileContents = fileContents + p.Key + ":"; fileContents = fileContents + p.Value + ";"; }); if (!Directory.Exists(text)) { Directory.CreateDirectory(text); } File.WriteAllText(text + "\\selections.txt", fileContents); } } } namespace MoreEyes.Core { [HarmonyPatch(typeof(RunManagerPUN), "Start")] internal class NetworkComponentPatch { public static void Postfix(RunManagerPUN __instance) { if ((Object)(object)MoreEyesNetwork.instance == (Object)null) { ComponentHolderProtocol.AddComponent<MoreEyesNetwork>((Object)(object)__instance); } if (PlayerEyeSelection.LocalCache == null) { new PlayerEyeSelection(isCache: true); } } } [HarmonyPatch(typeof(PlayerAvatarVisuals), "Start")] internal class LocalPlayerMenuPatch { public static void Postfix(PlayerAvatarVisuals __instance) { if (!((Object)(object)PlayerAvatar.instance == (Object)null) && !SemiFunc.IsSplashScreen() && __instance.isMenuAvatar) { PatchedEyes.Local.SetMenuEyes(__instance); } } } [HarmonyPatch(typeof(PlayerAvatar), "SpawnRPC")] internal class PlayerSpawnPatch { public static void Postfix(PlayerAvatar __instance) { PatchedEyes.GetPatchedEyes(__instance); } } [HarmonyPatch(typeof(MenuPageEsc), "Update")] internal class MenuEscPatch { private static GameObject playerTarget; private static Transform playerAvatar; public static void Postfix(MenuPageEsc __instance) { if ((Object)(object)EyeSelectionMenu.MoreEyesMenu.menuPage != (Object)null) { if ((Object)(object)playerTarget == (Object)null) { playerAvatar = ((Component)__instance).transform.Find("Menu Element Player Avatar"); if ((Object)(object)playerAvatar != (Object)null) { playerTarget = ((Component)playerAvatar).gameObject; } } if ((Object)(object)playerTarget != (Object)null && playerTarget.activeSelf) { playerTarget.SetActive(false); } } else if ((Object)(object)playerTarget != (Object)null && !playerTarget.activeSelf) { playerTarget.SetActive(true); } } } internal class Loggers { private static bool ShouldLog(LogLevel level) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 Enums.ModLogLevel value = ModConfig.ClientLogLevel.Value; if ((int)level > 4 && value == Enums.ModLogLevel.WarningsOnly) { return false; } if (((int)level == 32 || (int)level == 16) && value != Enums.ModLogLevel.Debug) { return false; } return true; } private static void Log(LogLevel logLevel, object data) { //IL_0000: 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) if (ShouldLog(logLevel)) { ManualLogSource logger = Plugin.Logger; if (logger != null) { logger.Log(logLevel, data); } } } internal static void Info(object data) { Log((LogLevel)16, data); } internal static void Debug(object data) { Log((LogLevel)32, data); } internal static void Message(object data) { Log((LogLevel)8, data); } internal static void Warning(object data) { Log((LogLevel)4, data); } internal static void Error(object data) { Log((LogLevel)2, data); } internal static void Fatal(object data) { Log((LogLevel)1, data); } } [BepInPlugin("com.github.s1ckboii.MoreEyes", "MoreEyes", "1.0.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] internal class Plugin : BaseUnityPlugin { internal static Random Rand = new Random(); internal const string moreEyesAscii = "\r\n _ .-') _ .-') ('-. ('-. ('-. .-') \r\n( '.( OO )_ ( \\( -O ) _( OO) _( OO) _( OO) ( OO ). \r\n ,--. ,--.).-'),-----. ,------. (,------. (,------. ,--. ,--.(,------.(_)---\\_) \r\n | `.' |( OO' .-. '| /`. ' | .---' | .---' \\ `.' / | .---'/ _ | \r\n | |/ | | | || / | | | | | | .-') / | | \\ :` `. \r\n | |'.'| |\\_) | |\\| || |_.' |(| '--. (| '--.(OO \\ / (| '--. '..`''.) \r\n | | | | \\ | | | || . '.' | .--' | .--' | / /\\_ | .--' .-._) \\ \r\n | | | | `' '-' '| |\\ \\ | `---. | `---.`-./ /.__) | `---.\\ / \r\n `--' `--' `-----' `--' '--' `------' `------' `--' `------' `-----' \r\n"; internal static ManualLogSource Logger { get; private set; } public void Awake() { Logger = Logger.CreateLogSource("com.github.s1ckboii.MoreEyes"); ModConfig.BindConfigItems(((BaseUnityPlugin)this).Config); EyesAssetManager.InitBundles(); EyeSelectionMenu.Initialize(); CustomEyeManager.Init(); Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); Loggers.Message("MoreEyes has been loaded with version - 1.0.1"); Loggers.Message("\r\n _ .-') _ .-') ('-. ('-. ('-. .-') \r\n( '.( OO )_ ( \\( -O ) _( OO) _( OO) _( OO) ( OO ). \r\n ,--. ,--.).-'),-----. ,------. (,------. (,------. ,--. ,--.(,------.(_)---\\_) \r\n | `.' |( OO' .-. '| /`. ' | .---' | .---' \\ `.' / | .---'/ _ | \r\n | |/ | | | || / | | | | | | .-') / | | \\ :` `. \r\n | |'.'| |\\_) | |\\| || |_.' |(| '--. (| '--.(OO \\ / (| '--. '..`''.) \r\n | | | | \\ | | | || . '.' | .--' | .--' | / /\\_ | .--' .-._) \\ \r\n | | | | `' '-' '| |\\ \\ | `---. | `---.`-./ /.__) | `---.\\ / \r\n `--' `--' `-----' `--' '--' `------' `------' `--' `------' `-----' \r\n"); } } } namespace MoreEyes.Components { internal class EyeRef : MonoBehaviour { internal Transform EyePlayerPos { get; set; } internal List<Transform> EyeMenuPos { get; set; } = new List<Transform>(); internal List<GameObject> PupilMenu { get; private set; } = new List<GameObject>(); internal GameObject PupilActual { get; private set; } internal List<GameObject> IrisMenu { get; private set; } = new List<GameObject>(); internal GameObject IrisActual { get; private set; } internal void PlayerSetup(GameObject pupil) { if ((Object)(object)pupil == (Object)null) { Loggers.Error("Null pupil at PlayerSetup!!!"); } SetFirstPupilActual(pupil); } internal void SetFirstPupilActual(GameObject pupil) { PupilActual = pupil; } internal void SetFirstPupilMenu(GameObject pupil) { PupilMenu.RemoveAll((GameObject x) => (Object)(object)x == (Object)null); PupilMenu.Add(pupil); } internal void SetColorPupil(Color color) { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) PupilMenu.RemoveAll((GameObject x) => (Object)(object)x == (Object)null); if (PupilMenu.Count > 0) { foreach (GameObject item in PupilMenu) { if ((Object)(object)item != (Object)null) { MeshRenderer componentInChildren = item.GetComponentInChildren<MeshRenderer>(); if (componentInChildren != null) { ((Renderer)componentInChildren).material.SetColor("_EmissionColor", color); } } } } if ((Object)(object)PupilActual != (Object)null) { MeshRenderer componentInChildren2 = PupilActual.GetComponentInChildren<MeshRenderer>(); if (componentInChildren2 != null) { ((Renderer)componentInChildren2).material.SetColor("_EmissionColor", color); } } FileManager.UpdateWrite = true; } internal void SetColorIris(Color color) { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) IrisMenu.RemoveAll((GameObject x) => (Object)(object)x == (Object)null); if (IrisMenu.Count > 0) { foreach (GameObject item in IrisMenu) { MeshRenderer componentInChildren = item.GetComponentInChildren<MeshRenderer>(); if (componentInChildren != null) { ((Renderer)componentInChildren).material.SetColor("_EmissionColor", color); } } } if ((Object)(object)IrisActual != (Object)null) { MeshRenderer componentInChildren2 = IrisActual.GetComponentInChildren<MeshRenderer>(); if (componentInChildren2 != null) { ((Renderer)componentInChildren2).material.SetColor("_EmissionColor", color); } } FileManager.UpdateWrite = true; } internal void RemovePupil() { for (int num = PupilMenu.Count - 1; num >= 0; num--) { Object.Destroy((Object)(object)PupilMenu[num]); } PupilMenu.RemoveAll((GameObject x) => (Object)(object)x == (Object)null); if ((Object)(object)PupilActual != (Object)null) { Object.Destroy((Object)(object)PupilActual); } } internal void CreatePupil(CustomPupilType selection) { if ((Object)(object)selection.Prefab == (Object)null) { Loggers.Warning("Cannot create NULL Pupil!!!"); return; } foreach (Transform eyeMenuPo in EyeMenuPos) { if (!((Object)(object)eyeMenuPo == (Object)null)) { GameObject val = Object.Instantiate<GameObject>(selection.Prefab, eyeMenuPo); PupilMenu.Add(val); SetTransformAndActive(val, selection.isVanilla); } } EyeMenuPos.RemoveAll((Transform x) => (Object)(object)x == (Object)null); if ((Object)(object)EyePlayerPos != (Object)null) { PupilActual = Object.Instantiate<GameObject>(selection.Prefab, EyePlayerPos); } SetTransformAndActive(PupilActual, selection.isVanilla); } private void SetTransformAndActive(GameObject gameObject, bool isVanilla) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)gameObject == (Object)null)) { Vector3 localPosition = default(Vector3); ((Vector3)(ref localPosition))..ctor(0f, 0f, -0.1067f); gameObject.SetActive(true); if (!isVanilla) { gameObject.transform.localPosition = localPosition; } } } internal void RemoveIris() { for (int num = IrisMenu.Count - 1; num >= 0; num--) { Object.Destroy((Object)(object)IrisMenu[num]); } IrisMenu.RemoveAll((GameObject x) => (Object)(object)x == (Object)null); if ((Object)(object)IrisActual != (Object)null) { Object.Destroy((Object)(object)IrisActual); } } internal void CreateIris(CustomIrisType selection) { if (selection.isVanilla) { return; } if ((Object)(object)selection.Prefab == (Object)null) { Loggers.Warning("Cannot create NULL Iris!!!"); return; } EyeMenuPos.RemoveAll((Transform x) => (Object)(object)x == (Object)null); foreach (Transform eyeMenuPo in EyeMenuPos) { GameObject val = Object.Instantiate<GameObject>(selection.Prefab, eyeMenuPo); IrisMenu.Add(val); SetTransformAndActive(val, selection.isVanilla); } if ((Object)(object)EyePlayerPos != (Object)null) { IrisActual = Object.Instantiate<GameObject>(selection.Prefab, EyePlayerPos); } SetTransformAndActive(IrisActual, selection.isVanilla); } } internal class HorizontalTextScroller : MonoBehaviour { internal float widthOfText = 180f; internal TextMeshProUGUI textMesh; private RectTransform textRect; private float scrollPos; private float xOffset; internal Vector3 startPos = Vector3.zero; private bool ready; private bool shouldScroll; private MenuButton _button; private void Awake() { textMesh = ((Component)this).GetComponent<TextMeshProUGUI>(); textRect = ((Component)this).GetComponent<RectTransform>(); } private void Start() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) xOffset = ((Transform)textRect).localPosition.x * -1f; scrollPos = ((Transform)textRect).localPosition.x - xOffset; ready = true; } private void LateUpdate() { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)textMesh == (Object)null) && ready) { shouldScroll = ((TMP_Text)textMesh).preferredWidth > 85f; if (shouldScroll && (Object)(object)_button != (Object)null) { shouldScroll = _button.hovering; } if (!shouldScroll) { ((Transform)textRect).localPosition = startPos; scrollPos = ((Transform)textRect).localPosition.x - xOffset; ((TMP_Text)textMesh).horizontalAlignment = (HorizontalAlignmentOptions)2; } else { ((Transform)textRect).localPosition = new Vector3(scrollPos % WidthMultiplier() + xOffset, startPos.y, startPos.z); scrollPos -= ModConfig.MenuItemScrollSpeed.Value * Time.deltaTime; } } } private float WidthMultiplier() { return ((TMP_Text)textMesh).preferredWidth * 1.5f; } internal void SetButtonRef(MenuButton button) { _button = button; } } internal class MoreEyesNetwork : MonoBehaviour { [CompilerGenerated] private sealed class <DelayedColorRPC>d__5 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string playerID; public bool isLeft; public bool isPupil; public Color color; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DelayedColorRPC>d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_006c: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; instance.photonView.RPC("SetSingleColorSelection", (RpcTarget)4, new object[4] { playerID, isLeft, isPupil, ColorToVector(color) }); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal static MoreEyesNetwork instance; internal PhotonView photonView; private void Awake() { instance = this; photonView = ((Component)this).GetComponent<PhotonView>(); } private void Start() { if (PhotonNetwork.MasterClient != null) { Loggers.Debug("MoreEyesNetwork Start: Sending other clients my selections"); PlayerEyeSelection currentSelections = PatchedEyes.Local.CurrentSelections; instance.photonView.RPC("SetSelectionsByText", (RpcTarget)4, new object[2] { currentSelections.playerID, currentSelections.GetSelectionsString() }); } } internal static void SyncMoreEyesChanges() { //IL_01d9: 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_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) PlayerEyeSelection localCache = PlayerEyeSelection.LocalCache; PlayerEyeSelection local; bool prefabChanged; if (PhotonNetwork.MasterClient != null && localCache != null) { Loggers.Debug("SyncMoreEyesChanges: Sending other clients my changes (if any)"); local = PatchedEyes.Local.CurrentSelections; prefabChanged = false; if (localCache.pupilLeft != local.pupilLeft) { instance.photonView.RPC("SetSingleSelection", (RpcTarget)4, new object[4] { local.playerID, true, true, local.pupilLeft.UID }); prefabChanged = true; } if (localCache.pupilRight != local.pupilRight) { instance.photonView.RPC("SetSingleSelection", (RpcTarget)4, new object[4] { local.playerID, false, true, local.pupilRight.UID }); prefabChanged = true; } if (localCache.irisLeft != local.irisLeft) { instance.photonView.RPC("SetSingleSelection", (RpcTarget)4, new object[4] { local.playerID, true, false, local.irisLeft.UID }); prefabChanged = true; } if (localCache.irisRight != local.irisRight) { instance.photonView.RPC("SetSingleSelection", (RpcTarget)4, new object[4] { local.playerID, false, false, local.irisRight.UID }); prefabChanged = true; } if (localCache.PupilLeftColor != local.PupilLeftColor) { SendColorInformation(isLeft: true, isPupil: true, local.PupilLeftColor); } if (localCache.PupilRightColor != local.PupilRightColor) { SendColorInformation(isLeft: false, isPupil: true, local.PupilRightColor); } if (localCache.IrisLeftColor != local.IrisLeftColor) { SendColorInformation(isLeft: true, isPupil: false, local.IrisLeftColor); } if (localCache.IrisRightColor != local.IrisRightColor) { SendColorInformation(isLeft: false, isPupil: false, local.IrisRightColor); } } void SendColorInformation(bool isLeft, bool isPupil, Color color) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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) if (prefabChanged) { ((MonoBehaviour)instance).StartCoroutine(DelayedColorRPC(local.playerID, isLeft, isPupil, color)); } else { instance.photonView.RPC("SetSingleColorSelection", (RpcTarget)4, new object[4] { local.playerID, isLeft, isPupil, ColorToVector(color) }); } } } [IteratorStateMachine(typeof(<DelayedColorRPC>d__5))] private static IEnumerator DelayedColorRPC(string playerID, bool isLeft, bool isPupil, Color color) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DelayedColorRPC>d__5(0) { playerID = playerID, isLeft = isLeft, isPupil = isPupil, color = color }; } private static Vector3 ColorToVector(Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0012: Unknown result type (might be due to invalid IL or missing references) return new Vector3(color.r, color.g, color.b); } [PunRPC] internal void SetSingleSelection(string playerID, bool isLeft, bool isPupil, string uniqueID) { if (!PlayerEyeSelection.TryGetSelections(playerID, out var playerSelections)) { return; } Loggers.Debug($"--- [SetSingleSelection RPC]\n{playerID}:L-{isLeft}:P-{isPupil}:UID-{uniqueID}"); if (isPupil) { CustomPupilType customPupilType = CustomEyeManager.AllPupilTypes.FirstOrDefault((CustomPupilType x) => x.UID == uniqueID); if (customPupilType == null) { Loggers.Warning("Unable to sync pupil with Unique ID: " + uniqueID + "\nPlease verify all clients have the same MoreEyes mods (and the same versions!)"); } playerSelections.patchedEyes.SelectPupil(customPupilType, isLeft); } else { CustomIrisType customIrisType = CustomEyeManager.AllIrisTypes.FirstOrDefault((CustomIrisType x) => x.UID == uniqueID); if (customIrisType == null) { Loggers.Warning("Unable to sync iris with Unique ID: " + uniqueID + "\nPlease verify all clients have the same MoreEyes mods (and the same versions!)"); } playerSelections.patchedEyes.SelectIris(customIrisType, isLeft); } playerSelections.ForceColors(); FileManager.UpdateWrite = true; } [PunRPC] internal void SetSingleColorSelection(string playerID, bool isLeft, bool isPupil, Vector3 colorVector) { //IL_000d: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) if (!PlayerEyeSelection.TryGetSelections(playerID, out var playerSelections)) { return; } Color val = default(Color); ((Color)(ref val))..ctor(colorVector.x, colorVector.y, colorVector.z); Loggers.Debug($"--- [SetSingleColorSelection RPC]\n{playerID}:L-{isLeft}:P-{isPupil}:C-{val}"); if (isPupil) { if (isLeft) { playerSelections.patchedEyes.LeftEye.SetColorPupil(val); } else { playerSelections.patchedEyes.RightEye.SetColorPupil(val); } } else if (isLeft) { playerSelections.patchedEyes.LeftEye.SetColorIris(val); } else { playerSelections.patchedEyes.RightEye.SetColorIris(val); } FileManager.UpdateWrite = true; } [PunRPC] private void SetSelectionsByText(string playerID, string selectionsValue) { PlayerEyeSelection playerEyeSelection = PlayerEyeSelection.GetPlayerEyeSelection(playerID); if (playerEyeSelection != null) { playerEyeSelection.SetSelectionsFromPairs(FileManager.GetPairsFromString(selectionsValue)); playerEyeSelection.PlayerEyesSpawn(); FileManager.WriteTextFile(); } } } internal class PatchedEyes : MonoBehaviour { internal string playerID = ""; internal PlayerAvatar Player { get; private set; } internal static PatchedEyes Local { get { if ((Object)(object)PlayerAvatar.instance == (Object)null) { Loggers.Error("Unable to return PatchedEyes Local, PlayerAvatar instance is null!"); return null; } PatchedEyes component = ((Component)PlayerAvatar.instance).GetComponent<PatchedEyes>(); if ((Object)(object)component == (Object)null) { return ComponentHolderProtocol.AddComponent<PatchedEyes>((Object)(object)PlayerAvatar.instance); } return component; } } internal EyeRef LeftEye { get; set; } internal EyeRef RightEye { get; set; } internal PlayerEyeSelection CurrentSelections { get { if (PlayerEyeSelection.TryGetSelections(playerID, out var playerSelections)) { return playerSelections; } Loggers.Error("TRYING TO GET NULL PLAYEREYESELECTIONS!! [" + playerID + "]"); return null; } } internal static PatchedEyes GetPatchedEyes(PlayerAvatar player) { if ((Object)(object)((Component)player).GetComponent<PatchedEyes>() == (Object)null) { return ComponentHolderProtocol.AddComponent<PatchedEyes>((Object)(object)player); } return ((Component)player).GetComponent<PatchedEyes>(); } private void Awake() { CustomEyeManager.AllPatchedEyes.RemoveAll((PatchedEyes p) => (Object)(object)p == (Object)null); Player = ((Component)this).GetComponent<PlayerAvatar>(); playerID = Player.steamID; if (!PlayerEyeSelection.TryGetSelections(Player.steamID, out var playerSelections)) { playerSelections = new PlayerEyeSelection(Player.steamID); } playerSelections.patchedEyes = this; SetPlayerSavedSelection(Player); CustomEyeManager.AllPatchedEyes.Add(this); } private void Start() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)Player.playerAvatarVisuals.playerEyes.pupilLeft.GetChild(0).GetChild(0)).gameObject; GameObject gameObject2 = ((Component)Player.playerAvatarVisuals.playerEyes.pupilRight.GetChild(0).GetChild(0)).gameObject; GameObject val = new GameObject("MoreEyes-LEFT"); val.transform.SetParent(Player.playerAvatarVisuals.playerEyes.pupilLeft.GetChild(0)); val.transform.localPosition = Vector3.zero; GameObject val2 = new GameObject("MoreEyes-RIGHT"); val2.transform.SetParent(Player.playerAvatarVisuals.playerEyes.pupilRight.GetChild(0)); val2.transform.localPosition = Vector3.zero; LeftEye = val.AddComponent<EyeRef>(); RightEye = val2.AddComponent<EyeRef>(); LeftEye.EyePlayerPos = val.transform; RightEye.EyePlayerPos = val2.transform; LeftEye.SetFirstPupilActual(gameObject); RightEye.SetFirstPupilActual(gameObject2); if (!CustomEyeManager.VanillaPupilsExist) { CustomEyeManager.VanillaPupilLeft.VanillaSetup(isLeft: true, gameObject); CustomEyeManager.VanillaPupilRight.VanillaSetup(isLeft: false, gameObject2); } if (!Player.isLocal) { SetPlayerSavedSelection(Player); CurrentSelections.PlayerEyesSpawn(); } } internal void SetMenuEyes(PlayerAvatarVisuals visuals) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown GameObject gameObject = ((Component)visuals.playerEyes.pupilLeft.GetChild(0).GetChild(0)).gameObject; GameObject gameObject2 = ((Component)visuals.playerEyes.pupilRight.GetChild(0).GetChild(0)).gameObject; GameObject val = new GameObject("MoreEyes-LEFT-MENU"); val.transform.SetParent(visuals.playerEyes.pupilLeft.GetChild(0)); GameObject val2 = new GameObject("MoreEyes-RIGHT-MENU"); val2.transform.SetParent(visuals.playerEyes.pupilRight.GetChild(0)); LeftEye.EyeMenuPos.Add(val.transform.parent); RightEye.EyeMenuPos.Add(val2.transform.parent); LeftEye.SetFirstPupilMenu(gameObject); RightEye.SetFirstPupilMenu(gameObject2); SetPlayerSavedSelection(Player); CurrentSelections.PlayerEyesSpawn(); } internal void SelectPupil(CustomPupilType newSelection, bool isLeft) { if ((Object)(object)newSelection.Prefab == (Object)null) { Loggers.Warning("Invalid Selection! Pupil reference object for " + newSelection.Name + " is null"); return; } EyeRef eyeRef = (isLeft ? LeftEye : RightEye); eyeRef.RemovePupil(); eyeRef.CreatePupil(newSelection); CurrentSelections.UpdateSelectionOf(isLeft, newSelection); FileManager.UpdateWrite = true; } internal void SelectIris(CustomIrisType newSelection, bool isLeft) { EyeRef eyeRef = (isLeft ? LeftEye : RightEye); eyeRef.RemoveIris(); eyeRef.CreateIris(newSelection); CurrentSelections.UpdateSelectionOf(isLeft, newSelection); FileManager.UpdateWrite = true; } internal void SetPlayerSavedSelection(PlayerAvatar player) { PlayerEyeSelection playerEyeSelection = PlayerEyeSelection.GetPlayerEyeSelection(player.steamID); if (playerEyeSelection == null) { Loggers.Warning(player.playerName + " does not have PlayerEyeSelection component!"); } else { playerEyeSelection.GetCachedSelections(); } } internal void RandomizeEyes() { List<CustomPupilType> list = CustomEyeManager.AllPupilTypes.FindAll((CustomPupilType p) => !p.Name.EndsWith("_right")); List<CustomPupilType> list2 = CustomEyeManager.AllPupilTypes.FindAll((CustomPupilType p) => !p.Name.EndsWith("_left")); List<CustomIrisType> list3 = CustomEyeManager.AllIrisTypes.FindAll((CustomIrisType i) => !i.Name.EndsWith("_right")); List<CustomIrisType> list4 = CustomEyeManager.AllIrisTypes.FindAll((CustomIrisType i) => !i.Name.EndsWith("_left")); CustomPupilType newSelection = list[Plugin.Rand.Next(0, list.Count)]; CustomPupilType newSelection2 = list2[Plugin.Rand.Next(0, list2.Count)]; CustomIrisType newSelection3 = list3[Plugin.Rand.Next(0, list3.Count)]; CustomIrisType newSelection4 = list4[Plugin.Rand.Next(0, list4.Count)]; SelectPupil(newSelection, isLeft: true); SelectPupil(newSelection2, isLeft: false); SelectIris(newSelection3, isLeft: true); SelectIris(newSelection4, isLeft: false); CurrentSelections.SetRandomColors(); } internal void ResetEyes() { SelectPupil(CustomEyeManager.VanillaPupilLeft, isLeft: true); SelectPupil(CustomEyeManager.VanillaPupilRight, isLeft: false); SelectIris(CustomEyeManager.VanillaIris, isLeft: true); SelectIris(CustomEyeManager.VanillaIris, isLeft: false); CurrentSelections.SetDefaultColors(); FileManager.UpdateWrite = true; } } } namespace MoreEyes.Collections { internal class CustomIrisType { internal string ModName = string.Empty; internal string Name = string.Empty; internal string AssetPath = string.Empty; internal string UID = string.Empty; internal string PairName = string.Empty; internal GameObject Prefab; internal LoadedAsset MyBundle; internal Enums.PrefabSide AllowedPos = Enums.PrefabSide.Both; internal bool isVanilla; internal bool inUse; internal string MenuName { get { if (string.IsNullOrEmpty(ModName)) { return MenuUtils.CleanName(Name); } switch (ModConfig.ModNamesInMenu.Value) { case Enums.ModInMenuDisplay.Never: return MenuUtils.CleanName(Name); case Enums.ModInMenuDisplay.Duplicates: if (!DuplicateNameExists) { return MenuUtils.CleanName(Name); } break; } return "[" + ModName + "] " + MenuUtils.CleanName(Name); } } internal bool DuplicateNameExists => CustomEyeManager.AllPupilTypes.Count((CustomPupilType i) => MenuUtils.CleanName(i.Name) == MenuUtils.CleanName(Name) && i.AllowedPos == AllowedPos) > 1; internal ConfigEntry<bool> ConfigToggle { get; set; } internal bool IsEnabled { get { if (ConfigToggle == null || isVanilla) { return true; } return ConfigToggle.Value; } } public override string ToString() { return Name; } internal void VanillaSetup() { Name = "None"; AssetPath = "None"; UID = "Vanilla"; isVanilla = true; CustomEyeManager.AllIrisTypes.Add(this); } internal void IrisSetup(LoadedAsset bundle, string assetName, MoreEyesMod mod) { MyBundle = bundle; AssetPath = assetName; ModName = ((Object)mod).name; string text = assetName; int num = assetName.LastIndexOf('/') + 1; Name = text.Substring(num, text.Length - num).Replace(".prefab", ""); string text2 = MenuUtils.CleanName(Name); string text3 = char.ToUpper(text2[0]).ToString(); text = text2; PairName = text3 + text.Substring(1, text.Length - 1) + " Iris(es)"; UID = Name + "-" + mod.Name + "-" + mod.Author + "-" + mod.Version; if (Name.EndsWith("_right", StringComparison.OrdinalIgnoreCase)) { AllowedPos = Enums.PrefabSide.Right; } else if (Name.EndsWith("_left", StringComparison.OrdinalIgnoreCase)) { AllowedPos = Enums.PrefabSide.Left; } else { AllowedPos = Enums.PrefabSide.Both; } MyBundle.LoadAssetGameObject(AssetPath, out Prefab); if ((Object)(object)Prefab == (Object)null) { Loggers.Warning("IRIS IS NULL FOR ASSETNAME - [ " + Name + " ]"); } Prefab.SetActive(false); Object.DontDestroyOnLoad((Object)(object)Prefab); CustomEyeManager.AllIrisTypes.Add(this); CustomEyeManager.AllIrisTypes.Distinct(); } internal static List<CustomIrisType> GetListing(Enums.EyeSide side, PlayerEyeSelection selected) { List<CustomIrisType> list = new List<CustomIrisType>(); if (side == Enums.EyeSide.Left) { list.AddRange(CustomEyeManager.AllIrisTypes.FindAll((CustomIrisType i) => i.AllowedPos != Enums.PrefabSide.Right)); list.RemoveAll((CustomIrisType i) => !i.IsEnabled); if (!list.Contains(selected.irisLeft)) { list.Add(selected.irisLeft); } LinqUtility.DistinctBy<CustomIrisType, string>((IEnumerable<CustomIrisType>)list, (Func<CustomIrisType, string>)((CustomIrisType i) => i.UID)); return list; } list.AddRange(CustomEyeManager.AllIrisTypes.FindAll((CustomIrisType i) => i.AllowedPos != Enums.PrefabSide.Left)); list.RemoveAll((CustomIrisType i) => !i.IsEnabled); if (!list.Contains(selected.irisRight)) { list.Add(selected.irisRight); } LinqUtility.DistinctBy<CustomIrisType, string>((IEnumerable<CustomIrisType>)list, (Func<CustomIrisType, string>)((CustomIrisType i) => i.UID)); return list; } internal static int IndexOf(Enums.EyeSide side, List<CustomIrisType> options, PlayerEyeSelection selected) { int num = ((side != 0) ? options.IndexOf(selected.irisRight) : options.IndexOf(selected.irisLeft)); if (num < 0) { Loggers.Warning($"Failed to get index of current selections! Setting index to 0.\nSide:{side}\noptionCount:{options.Count}"); num = 0; } Loggers.Debug($"Index of Iris from {side} {options.Count} is {num}"); return num; } } internal class CustomPupilType { internal string ModName = string.Empty; internal string Name = string.Empty; internal string AssetPath = string.Empty; internal string UID = string.Empty; internal string PairName = string.Empty; internal GameObject Prefab; internal LoadedAsset MyBundle; internal Enums.PrefabSide AllowedPos = Enums.PrefabSide.Both; internal bool isVanilla; internal bool inUse; internal string MenuName { g