using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using DooDesch.AvatarKit; using DooDesch.UI; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppScheduleOne.AvatarFramework; using Il2CppScheduleOne.UI.MainMenu; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Inkubator; using Inkubator.Editor; using MelonLoader; using MelonLoader.Utils; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using S1API.Rendering; using S1API.UI; using SideHustle; using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: MelonInfo(typeof(Core), "Inkubator", "1.0.4", "DooDesch", "https://github.com/DooDesch-Mods/ScheduleOne-Inkubator")] [assembly: MelonGame("TVGS", "Schedule I")] [assembly: MelonOptionalDependencies(new string[] { "SideHustle" })] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("DooDesch")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright © DooDesch")] [assembly: AssemblyFileVersion("1.0.4.0")] [assembly: AssemblyInformationalVersion("1.0.4+5d8727c22e93bcefcf408895cbdbf6a446937d30")] [assembly: AssemblyProduct("Inkubator")] [assembly: AssemblyTitle("Inkubator")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.4.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 DooDesch.AvatarKit { public static class AvatarLayerSlots { public const int BodySlots = 8; public const int VanillaClearedSlots = 6; public static void LoadAndClean(Avatar avatar, AvatarSettings settings) { if (!((Object)(object)avatar == (Object)null) && !((Object)(object)settings == (Object)null)) { avatar.LoadAvatarSettings(settings); List bodyLayerSettings = settings.BodyLayerSettings; int used = ((bodyLayerSettings != null && bodyLayerSettings.Count > 6) ? CountRenderable(bodyLayerSettings) : 6); ClearStaleBodySlots(avatar, used); } } public static int CountRenderable(List list) { if (list == null) { return 0; } int num = 0; for (int i = 0; i < list.Count; i++) { if (Renders(list[i].layerPath)) { num++; } } return num; } public static void ClearStaleBodySlots(Avatar avatar, int used) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)avatar == (Object)null || used >= 8) { return; } if (used < 0) { used = 0; } try { Il2CppReferenceArray bodyMeshes = avatar.BodyMeshes; for (int i = used + 1; i <= 8; i++) { avatar.SetBodyLayer(i, string.Empty, Color.white); if (bodyMeshes == null) { continue; } for (int j = 0; j < ((Il2CppArrayBase)(object)bodyMeshes).Length; j++) { SkinnedMeshRenderer val = ((Il2CppArrayBase)(object)bodyMeshes)[j]; if ((Object)(object)val != (Object)null && (Object)(object)((Renderer)val).material != (Object)null) { ((Renderer)val).material.SetTexture("_Layer_" + i + "_Normal", (Texture)null); } } } } catch (Exception) { } } public static List TrimToBudget(List list, Func rank, int max = 8) { List list2 = new List(); if (list == null || rank == null || list.Count <= max) { return list2; } for (int num = CountRenderable(list) - max; num > 0; num--) { int num2 = -1; int num3 = int.MaxValue; for (int i = 0; i < list.Count; i++) { if (Renders(list[i].layerPath)) { int num4 = rank(list[i].layerPath); if (num4 < num3) { num3 = num4; num2 = i; } } } if (num2 < 0) { break; } list2.Add(list[num2]); list.RemoveAt(num2); } return list2; } public static bool AddOnce(List list, string path, Color tint) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (list == null || string.IsNullOrEmpty(path)) { return false; } for (int i = 0; i < list.Count; i++) { if (list[i].layerPath == path) { return false; } } LayerSetting val = new LayerSetting(); val.layerPath = path; val.layerTint = tint; list.Add(val); return true; } private static bool Renders(string layerPath) { if (!string.IsNullOrEmpty(layerPath)) { return Resources.Load(layerPath) != (Object)null; } return false; } } } namespace DooDesch.UI { public static class Theme { public static readonly Color BgDeep = new Color(0.043f, 0.047f, 0.063f, 1f); public static readonly Color BgBase = new Color(0.063f, 0.071f, 0.094f, 1f); public static readonly Color BgPanel = new Color(0.086f, 0.098f, 0.133f, 1f); public static readonly Color BgElevated = new Color(0.114f, 0.129f, 0.173f, 1f); public static readonly Color SurfaceInput = new Color(0.051f, 0.059f, 0.082f, 1f); public static readonly Color Clear = new Color(0f, 0f, 0f, 0f); public static readonly Color Hairline = new Color(1f, 1f, 1f, 0.08f); public static readonly Color HairlineStrong = new Color(1f, 1f, 1f, 0.14f); public static readonly Color ScrimPanel = new Color(0.063f, 0.071f, 0.094f, 0.82f); public static readonly Color ScrimRow = new Color(0.114f, 0.129f, 0.173f, 0.72f); public static readonly Color TextPrimary = new Color(0.925f, 0.929f, 0.945f, 1f); public static readonly Color TextMuted = new Color(0.541f, 0.561f, 0.62f, 1f); public static readonly Color TextDisabled = new Color(0.337f, 0.357f, 0.408f, 1f); public static readonly Color Accent = new Color(0.369f, 0.416f, 0.824f, 1f); public static readonly Color AccentHover = new Color(0.431f, 0.475f, 0.859f, 1f); public static readonly Color AccentPressed = new Color(0.298f, 0.341f, 0.737f, 1f); public static readonly Color AccentSubtle = new Color(0.125f, 0.133f, 0.227f, 1f); public static readonly Color AccentBorder = new Color(0.486f, 0.525f, 0.91f, 1f); public static readonly Color Button = new Color(0.2f, 0.212f, 0.263f, 1f); public static readonly Color Danger = new Color(0.784f, 0.29f, 0.329f, 1f); public static readonly Color DangerText = new Color(0.945f, 0.439f, 0.478f, 1f); public static readonly Color DangerSubtle = new Color(0.165f, 0.082f, 0.094f, 1f); public static readonly Color Warning = new Color(0.788f, 0.569f, 0.18f, 1f); public static readonly Color WarningText = new Color(0.902f, 0.706f, 0.314f, 1f); public static readonly Color WarningSubtle = new Color(0.165f, 0.133f, 0.071f, 1f); public static readonly Color Success = new Color(0.184f, 0.659f, 0.467f, 1f); public static readonly Color SuccessText = new Color(0.373f, 0.816f, 0.604f, 1f); public static readonly Color SuccessSubtle = new Color(0.071f, 0.165f, 0.125f, 1f); public static readonly Color Info = new Color(0.239f, 0.498f, 0.753f, 1f); public static readonly Color InfoText = new Color(0.435f, 0.659f, 0.902f, 1f); public static readonly Color InfoSubtle = new Color(0.071f, 0.125f, 0.192f, 1f); public const int RadiusMd = 6; public const float Fade = 0.12f; public const int Caption = 11; public const int Body = 13; public const int Label = 14; public const int H3 = 16; public const int H2 = 20; public const int H1 = 28; private static Sprite _rounded; private static Sprite _frame; public static Color Lighten(Color c, float amount) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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) return new Color(Mathf.Clamp01(c.r + amount), Mathf.Clamp01(c.g + amount), Mathf.Clamp01(c.b + amount), c.a); } public static Color Darken(Color c, float amount) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) return Lighten(c, 0f - amount); } public static Color WithAlpha(Color c, float a) { //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_0013: Unknown result type (might be due to invalid IL or missing references) return new Color(c.r, c.g, c.b, a); } public static Sprite RoundedSprite() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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_014f: 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) if ((Object)(object)_rounded != (Object)null) { return _rounded; } Texture2D val = new Texture2D(32, 32, (TextureFormat)5, false); ((Object)val).hideFlags = (HideFlags)32; Color32 val2 = default(Color32); ((Color32)(ref val2))..ctor((byte)0, (byte)0, (byte)0, (byte)0); Color32 val3 = default(Color32); ((Color32)(ref val3))..ctor(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); for (int i = 0; i < 32; i++) { for (int j = 0; j < 32; j++) { bool flag = ((float)j < 6f && (float)i < 6f && Vector2.Distance(new Vector2((float)j, (float)i), new Vector2(6f, 6f)) > 6f) || ((float)j > 25f && (float)i < 6f && Vector2.Distance(new Vector2((float)j, (float)i), new Vector2(25f, 6f)) > 6f) || ((float)j < 6f && (float)i > 25f && Vector2.Distance(new Vector2((float)j, (float)i), new Vector2(6f, 25f)) > 6f) || ((float)j > 25f && (float)i > 25f && Vector2.Distance(new Vector2((float)j, (float)i), new Vector2(25f, 25f)) > 6f); val.SetPixel(j, i, Color32.op_Implicit(flag ? val2 : val3)); } } val.Apply(); _rounded = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0, new Vector4(8f, 8f, 8f, 8f)); return _rounded; } public static Sprite FrameSprite() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_007a: 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) if ((Object)(object)_frame != (Object)null) { return _frame; } Texture2D val = new Texture2D(32, 32, (TextureFormat)5, false); ((Object)val).hideFlags = (HideFlags)32; Color32 val2 = default(Color32); ((Color32)(ref val2))..ctor((byte)0, (byte)0, (byte)0, (byte)0); Color32 val3 = default(Color32); ((Color32)(ref val3))..ctor(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); for (int i = 0; i < 32; i++) { for (int j = 0; j < 32; j++) { bool flag = j < 3 || j >= 29 || i < 3 || i >= 29; val.SetPixel(j, i, Color32.op_Implicit(flag ? val3 : val2)); } } val.Apply(); _frame = Sprite.Create(val, new Rect(0f, 0f, 32f, 32f), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0, new Vector4(4f, 4f, 4f, 4f)); return _frame; } } public static class Interactions { public static void PolishButtons(Transform root, bool round = true) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)root == (Object)null) { return; } Il2CppArrayBase