using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using AOT; using B83.Win32; using BaboonAPI.Hooks; using BaboonAPI.Hooks.Initializer; using BaboonAPI.Hooks.Tracks; using BaboonAPI.Internal.BaseGame; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using Microsoft.FSharp.Core; using Newtonsoft.Json; using Steamworks; using TMPro; using TootTallyCore; using TootTallyCore.APIServices; using TootTallyCore.Graphics; using TootTallyCore.Graphics.Animations; using TootTallyCore.Graphics.ProgressCounters; using TootTallyCore.Utils.Assets; using TootTallyCore.Utils.Helpers; using TootTallyCore.Utils.SoundEffects; using TootTallyCore.Utils.Steam; using TootTallyCore.Utils.TootTallyGlobals; using TootTallyCore.Utils.TootTallyModules; using TootTallyCore.Utils.TootTallyNotifs; using TrombLoader.CustomTracks; using TrombLoader.Helpers; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Localization.Components; using UnityEngine.Networking; using UnityEngine.Scripting; using UnityEngine.UI; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("TootTally")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("TootTally API for Trombone Champ modding")] [assembly: AssemblyFileVersion("1.3.10.0")] [assembly: AssemblyInformationalVersion("1.3.10+087ec1bb693d322f8652ad0cf9df749655ce9adc")] [assembly: AssemblyProduct("TootTallyCore")] [assembly: AssemblyTitle("TootTallyCore")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/TootTally/TootTallyCore")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.10.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 B83.Win32 { public enum HookType { WH_JOURNALRECORD, WH_JOURNALPLAYBACK, WH_KEYBOARD, WH_GETMESSAGE, WH_CALLWNDPROC, WH_CBT, WH_SYSMSGFILTER, WH_MOUSE, WH_HARDWARE, WH_DEBUG, WH_SHELL, WH_FOREGROUNDIDLE, WH_CALLWNDPROCRET, WH_KEYBOARD_LL, WH_MOUSE_LL } public enum WM : uint { NULL = 0u, CREATE = 1u, DESTROY = 2u, MOVE = 3u, SIZE = 5u, ACTIVATE = 6u, SETFOCUS = 7u, KILLFOCUS = 8u, ENABLE = 10u, SETREDRAW = 11u, SETTEXT = 12u, GETTEXT = 13u, GETTEXTLENGTH = 14u, PAINT = 15u, CLOSE = 16u, QUERYENDSESSION = 17u, QUERYOPEN = 19u, ENDSESSION = 22u, QUIT = 18u, ERASEBKGND = 20u, SYSCOLORCHANGE = 21u, SHOWWINDOW = 24u, WININICHANGE = 26u, SETTINGCHANGE = 26u, DEVMODECHANGE = 27u, ACTIVATEAPP = 28u, FONTCHANGE = 29u, TIMECHANGE = 30u, CANCELMODE = 31u, SETCURSOR = 32u, MOUSEACTIVATE = 33u, CHILDACTIVATE = 34u, QUEUESYNC = 35u, GETMINMAXINFO = 36u, PAINTICON = 38u, ICONERASEBKGND = 39u, NEXTDLGCTL = 40u, SPOOLERSTATUS = 42u, DRAWITEM = 43u, MEASUREITEM = 44u, DELETEITEM = 45u, VKEYTOITEM = 46u, CHARTOITEM = 47u, SETFONT = 48u, GETFONT = 49u, SETHOTKEY = 50u, GETHOTKEY = 51u, QUERYDRAGICON = 55u, COMPAREITEM = 57u, GETOBJECT = 61u, COMPACTING = 65u, [Obsolete] COMMNOTIFY = 68u, WINDOWPOSCHANGING = 70u, WINDOWPOSCHANGED = 71u, [Obsolete] POWER = 72u, COPYDATA = 74u, CANCELJOURNAL = 75u, NOTIFY = 78u, INPUTLANGCHANGEREQUEST = 80u, INPUTLANGCHANGE = 81u, TCARD = 82u, HELP = 83u, USERCHANGED = 84u, NOTIFYFORMAT = 85u, CONTEXTMENU = 123u, STYLECHANGING = 124u, STYLECHANGED = 125u, DISPLAYCHANGE = 126u, GETICON = 127u, SETICON = 128u, NCCREATE = 129u, NCDESTROY = 130u, NCCALCSIZE = 131u, NCHITTEST = 132u, NCPAINT = 133u, NCACTIVATE = 134u, GETDLGCODE = 135u, SYNCPAINT = 136u, NCMOUSEMOVE = 160u, NCLBUTTONDOWN = 161u, NCLBUTTONUP = 162u, NCLBUTTONDBLCLK = 163u, NCRBUTTONDOWN = 164u, NCRBUTTONUP = 165u, NCRBUTTONDBLCLK = 166u, NCMBUTTONDOWN = 167u, NCMBUTTONUP = 168u, NCMBUTTONDBLCLK = 169u, NCXBUTTONDOWN = 171u, NCXBUTTONUP = 172u, NCXBUTTONDBLCLK = 173u, INPUT_DEVICE_CHANGE = 254u, INPUT = 255u, KEYFIRST = 256u, KEYDOWN = 256u, KEYUP = 257u, CHAR = 258u, DEADCHAR = 259u, SYSKEYDOWN = 260u, SYSKEYUP = 261u, SYSCHAR = 262u, SYSDEADCHAR = 263u, UNICHAR = 265u, KEYLAST = 264u, IME_STARTCOMPOSITION = 269u, IME_ENDCOMPOSITION = 270u, IME_COMPOSITION = 271u, IME_KEYLAST = 271u, INITDIALOG = 272u, COMMAND = 273u, SYSCOMMAND = 274u, TIMER = 275u, HSCROLL = 276u, VSCROLL = 277u, INITMENU = 278u, INITMENUPOPUP = 279u, MENUSELECT = 287u, MENUCHAR = 288u, ENTERIDLE = 289u, MENURBUTTONUP = 290u, MENUDRAG = 291u, MENUGETOBJECT = 292u, UNINITMENUPOPUP = 293u, MENUCOMMAND = 294u, CHANGEUISTATE = 295u, UPDATEUISTATE = 296u, QUERYUISTATE = 297u, CTLCOLORMSGBOX = 306u, CTLCOLOREDIT = 307u, CTLCOLORLISTBOX = 308u, CTLCOLORBTN = 309u, CTLCOLORDLG = 310u, CTLCOLORSCROLLBAR = 311u, CTLCOLORSTATIC = 312u, MOUSEFIRST = 512u, MOUSEMOVE = 512u, LBUTTONDOWN = 513u, LBUTTONUP = 514u, LBUTTONDBLCLK = 515u, RBUTTONDOWN = 516u, RBUTTONUP = 517u, RBUTTONDBLCLK = 518u, MBUTTONDOWN = 519u, MBUTTONUP = 520u, MBUTTONDBLCLK = 521u, MOUSEWHEEL = 522u, XBUTTONDOWN = 523u, XBUTTONUP = 524u, XBUTTONDBLCLK = 525u, MOUSEHWHEEL = 526u, MOUSELAST = 526u, PARENTNOTIFY = 528u, ENTERMENULOOP = 529u, EXITMENULOOP = 530u, NEXTMENU = 531u, SIZING = 532u, CAPTURECHANGED = 533u, MOVING = 534u, POWERBROADCAST = 536u, DEVICECHANGE = 537u, MDICREATE = 544u, MDIDESTROY = 545u, MDIACTIVATE = 546u, MDIRESTORE = 547u, MDINEXT = 548u, MDIMAXIMIZE = 549u, MDITILE = 550u, MDICASCADE = 551u, MDIICONARRANGE = 552u, MDIGETACTIVE = 553u, MDISETMENU = 560u, ENTERSIZEMOVE = 561u, EXITSIZEMOVE = 562u, DROPFILES = 563u, MDIREFRESHMENU = 564u, IME_SETCONTEXT = 641u, IME_NOTIFY = 642u, IME_CONTROL = 643u, IME_COMPOSITIONFULL = 644u, IME_SELECT = 645u, IME_CHAR = 646u, IME_REQUEST = 648u, IME_KEYDOWN = 656u, IME_KEYUP = 657u, MOUSEHOVER = 673u, MOUSELEAVE = 675u, NCMOUSEHOVER = 672u, NCMOUSELEAVE = 674u, WTSSESSION_CHANGE = 689u, TABLET_FIRST = 704u, TABLET_LAST = 735u, CUT = 768u, COPY = 769u, PASTE = 770u, CLEAR = 771u, UNDO = 772u, RENDERFORMAT = 773u, RENDERALLFORMATS = 774u, DESTROYCLIPBOARD = 775u, DRAWCLIPBOARD = 776u, PAINTCLIPBOARD = 777u, VSCROLLCLIPBOARD = 778u, SIZECLIPBOARD = 779u, ASKCBFORMATNAME = 780u, CHANGECBCHAIN = 781u, HSCROLLCLIPBOARD = 782u, QUERYNEWPALETTE = 783u, PALETTEISCHANGING = 784u, PALETTECHANGED = 785u, HOTKEY = 786u, PRINT = 791u, PRINTCLIENT = 792u, APPCOMMAND = 793u, THEMECHANGED = 794u, CLIPBOARDUPDATE = 797u, DWMCOMPOSITIONCHANGED = 798u, DWMNCRENDERINGCHANGED = 799u, DWMCOLORIZATIONCOLORCHANGED = 800u, DWMWINDOWMAXIMIZEDCHANGE = 801u, GETTITLEBARINFOEX = 831u, HANDHELDFIRST = 856u, HANDHELDLAST = 863u, AFXFIRST = 864u, AFXLAST = 895u, PENWINFIRST = 896u, PENWINLAST = 911u, APP = 32768u, USER = 1024u, CPL_LAUNCH = 5120u, CPL_LAUNCHED = 5121u, SYSTIMER = 280u } public struct CWPSTRUCT { public IntPtr lParam; public IntPtr wParam; public WM message; public IntPtr hwnd; } public struct POINT { public int x; public int y; public POINT(int aX, int aY) { x = aX; y = aY; } public override string ToString() { return "(" + x + ", " + y + ")"; } } public struct MSG { public IntPtr hwnd; public WM message; public IntPtr wParam; public IntPtr lParam; public ushort time; public POINT pt; } public struct RECT { public int Left; public int Top; public int Right; public int Bottom; public RECT(int left, int top, int right, int bottom) { Left = left; Top = top; Right = right; Bottom = bottom; } public override string ToString() { return "(" + Left + ", " + Top + ", " + Right + ", " + Bottom + ")"; } } public delegate IntPtr HookProc(int code, IntPtr wParam, ref MSG lParam); public delegate bool EnumThreadDelegate(IntPtr Hwnd, IntPtr lParam); public static class Window { [DllImport("user32.dll")] public static extern bool EnumThreadWindows(uint dwThreadId, EnumThreadDelegate lpfn, IntPtr lParam); [DllImport("user32.dll", SetLastError = true)] public static extern bool GetWindowRect(IntPtr hwnd, out RECT lpRect); [DllImport("user32.dll")] public static extern bool IsWindowVisible(IntPtr hWnd); [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] private static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount); public static string GetClassName(IntPtr hWnd) { StringBuilder stringBuilder = new StringBuilder(256); int className = GetClassName(hWnd, stringBuilder, 256); return stringBuilder.ToString(0, className); } [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] private static extern int GetWindowTextLength(IntPtr hWnd); [DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = true)] private static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount); public static string GetWindowText(IntPtr hWnd) { int num = GetWindowTextLength(hWnd) + 2; StringBuilder stringBuilder = new StringBuilder(num); int windowText = GetWindowText(hWnd, stringBuilder, num); return stringBuilder.ToString(0, windowText); } } public static class WinAPI { [DllImport("kernel32.dll", CharSet = CharSet.Auto)] public static extern IntPtr GetModuleHandle(string lpModuleName); [DllImport("kernel32.dll")] public static extern uint GetCurrentThreadId(); [DllImport("user32.dll", SetLastError = true)] public static extern IntPtr SetWindowsHookEx(HookType hookType, HookProc lpfn, IntPtr hMod, uint dwThreadId); [DllImport("user32.dll", SetLastError = true)] public static extern bool UnhookWindowsHookEx(IntPtr hhk); [DllImport("user32.dll")] public static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, ref MSG lParam); [DllImport("shell32.dll")] public static extern void DragAcceptFiles(IntPtr hwnd, bool fAccept); [DllImport("shell32.dll", CharSet = CharSet.Unicode)] public static extern uint DragQueryFile(IntPtr hDrop, uint iFile, StringBuilder lpszFile, uint cch); [DllImport("shell32.dll")] public static extern void DragFinish(IntPtr hDrop); [DllImport("shell32.dll")] public static extern void DragQueryPoint(IntPtr hDrop, out POINT pos); } public static class UnityDragAndDropHook { public delegate void DroppedFilesEvent(List aPathNames, POINT aDropPoint); private static uint threadId; private static IntPtr mainWindow = IntPtr.Zero; private static IntPtr m_Hook; private static string m_ClassName = "UnityWndClass"; public static event DroppedFilesEvent OnDroppedFiles; [MonoPInvokeCallback(typeof(EnumThreadDelegate))] private static bool EnumCallback(IntPtr W, IntPtr _) { if (Window.IsWindowVisible(W) && (mainWindow == IntPtr.Zero || (m_ClassName != null && Window.GetClassName(W) == m_ClassName))) { mainWindow = W; } return true; } public static void InstallHook() { threadId = WinAPI.GetCurrentThreadId(); if (threadId != 0) { Window.EnumThreadWindows(threadId, EnumCallback, IntPtr.Zero); } IntPtr moduleHandle = WinAPI.GetModuleHandle(null); m_Hook = WinAPI.SetWindowsHookEx(HookType.WH_GETMESSAGE, Callback, moduleHandle, threadId); WinAPI.DragAcceptFiles(mainWindow, fAccept: true); Plugin.LogInfo("DragAccept is working yeehaw!"); } public static void UninstallHook() { WinAPI.UnhookWindowsHookEx(m_Hook); WinAPI.DragAcceptFiles(mainWindow, fAccept: false); m_Hook = IntPtr.Zero; } [MonoPInvokeCallback(typeof(HookProc))] private static IntPtr Callback(int code, IntPtr wParam, ref MSG lParam) { if (code == 0 && lParam.message == WM.DROPFILES) { WinAPI.DragQueryPoint(lParam.wParam, out var pos); uint num = WinAPI.DragQueryFile(lParam.wParam, uint.MaxValue, null, 0u); StringBuilder stringBuilder = new StringBuilder(1024); List list = new List(); for (uint num2 = 0u; num2 < num; num2++) { int num3 = (int)WinAPI.DragQueryFile(lParam.wParam, num2, stringBuilder, 1024u); list.Add(stringBuilder.ToString(0, num3)); stringBuilder.Length = 0; } WinAPI.DragFinish(lParam.wParam); if (UnityDragAndDropHook.OnDroppedFiles != null) { UnityDragAndDropHook.OnDroppedFiles(list, pos); } } return WinAPI.CallNextHookEx(m_Hook, code, wParam, ref lParam); } } } namespace TootTallyCore { [BepInPlugin("TootTallyCore", "TootTallyCore", "1.3.10")] [BepInIncompatibility("TootTally")] public class Plugin : BaseUnityPlugin { public static int BUILDDATE = 20261607; private const string DEFAULT_THEME = "Default"; public static Plugin Instance; private Harmony _harmony; public readonly ReloadManager reloadManager; public ConfigEntry DebugMode { get; private set; } public ConfigEntry ShouldShowNotifs { get; private set; } public ConfigEntry ThemeName { get; private set; } public ConfigEntry RunGCWhilePlaying { get; private set; } public ConfigEntry ChangePitch { get; private set; } public ConfigEntry OffsetAtDefaultSpeed { get; private set; } public ConfigEntry CompatibilityHasConvertedOffsetCheck { get; private set; } public static void LogInfo(string msg) { ((BaseUnityPlugin)Instance).Logger.LogInfo((object)msg); } public static void LogWarning(string msg) { ((BaseUnityPlugin)Instance).Logger.LogWarning((object)msg); } public static void LogError(string msg) { ((BaseUnityPlugin)Instance).Logger.LogError((object)msg); } public static void LogDebug(string msg) { if (Instance.DebugMode.Value) { ((BaseUnityPlugin)Instance).Logger.LogDebug((object)msg); } } public static void LogException(Exception ex) { LogError(ex.Message); LogError(ex.StackTrace); } public Plugin() { reloadManager = new ReloadManager(this); } private void Awake() { //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Expected O, but got Unknown if (!((Object)(object)Instance != (Object)null)) { Instance = this; ShouldShowNotifs = ((BaseUnityPlugin)this).Config.Bind("General", "Display Toasts", true, "Activate toast notifications for important events."); DebugMode = ((BaseUnityPlugin)this).Config.Bind("General", "Debug Mode", false, "Add extra logging information for debugging."); ThemeName = ((BaseUnityPlugin)this).Config.Bind("Themes", "ThemeName", "Default".ToString(), (ConfigDescription)null); RunGCWhilePlaying = ((BaseUnityPlugin)this).Config.Bind("General", "Deactivate Garbage Collector While Playing.", false, "Deactivate the garbage collector during gameplay to prevent lag spikes."); ChangePitch = ((BaseUnityPlugin)this).Config.Bind("General", "Change Pitch", false, "Change the pitch on speed changes."); OffsetAtDefaultSpeed = ((BaseUnityPlugin)this).Config.Bind("General", "Offset At Default Speed", 0f, "Add an offset when playing charts at 1.0x to compensate for the pitch shift filter latency. RECOMMENDED: 15ms"); CompatibilityHasConvertedOffsetCheck = ((BaseUnityPlugin)this).Config.Bind("General", "CompatibilityHasConvertedOffsetCheck", false, "DO NOT TOUCH THIS SETTING :) thanks!"); ((BaseUnityPlugin)this).Config.SettingChanged += ThemeManager.Config_SettingChanged; string targetFolderPath = Path.Combine(Paths.BepInExRootPath, "Themes"); string sourceFolderPath = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)Instance).Info.Location), "Themes"); FileHelper.TryMigrateFolder(sourceFolderPath, targetFolderPath); if (!Directory.Exists(FileHelper.FILE_PATH_TOOTTALLY_APPDATA)) { LogInfo("Couldn't find " + FileHelper.FILE_PATH_TOOTTALLY_APPDATA + ", creating directory."); Directory.CreateDirectory(FileHelper.FILE_PATH_TOOTTALLY_APPDATA); } if (!CompatibilityHasConvertedOffsetCheck.Value) { OffsetAtDefaultSpeed.Value = 0f - OffsetAtDefaultSpeed.Value; CompatibilityHasConvertedOffsetCheck.Value = true; } _harmony = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID); UnityDragAndDropHook.InstallHook(); GameInitializationEvent.Register(((BaseUnityPlugin)this).Info, (Action)TryInitialize); } } private void Update() { reloadManager.Update(); if (!reloadManager.IsCurrentlyReloading && Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)114)) { TootTallyNotifManager.DisplayNotif("Reloading tracks..."); reloadManager.ReloadAll(new ProgressCallbacks { onComplete = delegate { TootTallyNotifManager.DisplayNotif("Reloading complete!"); }, onError = delegate(Exception err) { TootTallyNotifManager.DisplayNotif("Reloading failed! " + err.Message); } }); } else if (Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)103)) { TootTallyNotifManager.DisplayNotif("Forcing garbage collection."); for (int num = 0; num < 9; num++) { GC.Collect(num % 3, GCCollectionMode.Forced); } } } [Obsolete("Use ReloadManager#ReloadAll instead")] public void ReloadTracks() { reloadManager.ReloadAll(null); } private void TryInitialize() { AssetManager.LoadAssets(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)Instance).Info.Location), "Assets")); _harmony.PatchAll(typeof(ThemeManager)); _harmony.PatchAll(typeof(GameObjectFactory)); _harmony.PatchAll(typeof(TootTallyPatches)); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); TootTallyModuleManager.LoadModules(); LogInfo(string.Format("Plugin {0} [Build {1}] is loaded!", "TootTallyCore", BUILDDATE)); LogInfo("Game Version: " + Application.version); } } public static class Theme { public class CapsulesColors { public Color year; public Color yearShadow; public Color composer; public Color composerShadow; public Color genre; public Color genreShadow; public Color description; public Color descriptionShadow; public Color tempo; } public class DiffStarColors { public Color gradientStart; public Color gradientEnd; } public class LeaderboardColors { public Color panelBody; public Color scoresBody; public Color rowEntry; public Color yourRowEntry; public Color headerText; public Color text; public Color textOutline; public SliderColors slider; public ColorBlock tabs; } public class NotificationColors { public Color border; public Color background; public Color defaultText; public Color warningText; public Color errorText; public Color textOutline; } public class PlayBackButtonColors { public Color background; public Color backgroundOver; public Color outline; public Color outlineOver; public Color text; public Color textOver; public Color shadow; public Color shadowOver; } public class RandomButtonColors { public Color background; public Color backgroundOver; public Color outline; public Color outlineOver; public Color text; public Color textOver; public Color shadow; public Color shadowOver; } public class ReplayButtonColors { public Color text; public ColorBlock colors; } public class ScrollSpeedSliderColors { public Color handle; public Color text; public Color background; public Color fill; } public class SliderColors { public Color handle; public Color background; public Color fill; } public class SongButtonColors { public Color background; public Color text; public Color textOver; public Color selectedText; public Color outline; public Color outlineOver; public Color shadow; public Color square; public ScoreText scoreText; } public class ScoreText { public Color rankS; public Color rankA; public Color rankB; public Color rankC; public Color rankD; public Color rankF; public Color notPlayed; } public class PointerColors { public Color background; public Color shadow; public Color outline; } public class BackgroundColors { public Color waves; public Color waves2; public Color dots; public Color dots2; public Color shape; public Color diamond; public Color background; } public class TitleColors { public Color songName; public Color titleBar; public Color title; public Color titleShadow; public Color outline; } public class ThemeColors { public LeaderboardColors leaderboard; public ScrollSpeedSliderColors scrollSpeedSlider; public NotificationColors notification; public ReplayButtonColors replayButton; public CapsulesColors capsules; public RandomButtonColors randomButton; public PlayBackButtonColors backButton; public PlayBackButtonColors playButton; public SongButtonColors songButton; public DiffStarColors diffStar; public PointerColors pointer; public BackgroundColors background; public TitleColors title; public void InitializeEmpty() { leaderboard = new LeaderboardColors { slider = new SliderColors() }; scrollSpeedSlider = new ScrollSpeedSliderColors(); notification = new NotificationColors(); replayButton = new ReplayButtonColors(); capsules = new CapsulesColors(); randomButton = new RandomButtonColors(); backButton = new PlayBackButtonColors(); playButton = new PlayBackButtonColors(); songButton = new SongButtonColors { scoreText = new ScoreText() }; diffStar = new DiffStarColors(); pointer = new PointerColors(); backButton = new PlayBackButtonColors(); background = new BackgroundColors(); title = new TitleColors(); } } public const string version = "0.0.2"; public static bool isDefault; public static ThemeColors colors; public static void SetDefaultTheme() { //IL_0021: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_005a: 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_0079: 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_0093: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0144: 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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_019d: 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_01c7: 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_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) isDefault = true; ThemeColors themeColors = new ThemeColors(); LeaderboardColors obj = new LeaderboardColors { panelBody = new Color(0.95f, 0.22f, 0.35f), scoresBody = new Color(0.06f, 0.06f, 0.06f), rowEntry = new Color(0.1f, 0.1f, 0.1f), yourRowEntry = new Color(0.65f, 0.65f, 0.65f, 0.25f), headerText = new Color(0.95f, 0.22f, 0.35f), text = new Color(1f, 1f, 1f), textOutline = new Color(0f, 0f, 0f, 0.5f), slider = new SliderColors { background = new Color(0f, 0f, 0f), fill = new Color(1f, 1f, 1f), handle = new Color(1f, 1f, 1f) } }; ColorBlock tabs = default(ColorBlock); ((ColorBlock)(ref tabs)).normalColor = new Color(1f, 1f, 1f); ((ColorBlock)(ref tabs)).pressedColor = new Color(1f, 1f, 0f); ((ColorBlock)(ref tabs)).highlightedColor = new Color(0.75f, 0.75f, 0.75f); ((ColorBlock)(ref tabs)).colorMultiplier = 1f; ((ColorBlock)(ref tabs)).fadeDuration = 0.2f; obj.tabs = tabs; themeColors.leaderboard = obj; themeColors.notification = new NotificationColors { border = new Color(1f, 0.3f, 0.5f, 0.75f), background = new Color(0f, 0f, 0f, 0.95f), defaultText = new Color(1f, 1f, 1f), textOutline = new Color(0f, 0f, 0f), warningText = new Color(1f, 1f, 0f), errorText = new Color(1f, 0f, 0f) }; ReplayButtonColors obj2 = new ReplayButtonColors { text = new Color(1f, 1f, 1f) }; tabs = default(ColorBlock); ((ColorBlock)(ref tabs)).normalColor = new Color(0.95f, 0.22f, 0.35f); ((ColorBlock)(ref tabs)).highlightedColor = new Color(0.77f, 0.18f, 0.29f); ((ColorBlock)(ref tabs)).pressedColor = new Color(1f, 1f, 0f); obj2.colors = tabs; themeColors.replayButton = obj2; themeColors.scrollSpeedSlider = new ScrollSpeedSliderColors { background = new Color(0f, 0f, 0f), text = new Color(0f, 0f, 0f), handle = new Color(1f, 1f, 0f), fill = new Color(0.95f, 0.22f, 0.35f) }; colors = themeColors; } public static void SetNightTheme() { //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_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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: 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_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: 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_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_05b9: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_0603: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0642: Unknown result type (might be due to invalid IL or missing references) //IL_0657: Unknown result type (might be due to invalid IL or missing references) //IL_065c: Unknown result type (might be due to invalid IL or missing references) //IL_0671: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06ca: Unknown result type (might be due to invalid IL or missing references) //IL_06cf: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Unknown result type (might be due to invalid IL or missing references) //IL_06e9: Unknown result type (might be due to invalid IL or missing references) //IL_06fe: Unknown result type (might be due to invalid IL or missing references) //IL_0703: Unknown result type (might be due to invalid IL or missing references) //IL_0723: Unknown result type (might be due to invalid IL or missing references) //IL_0728: Unknown result type (might be due to invalid IL or missing references) //IL_073d: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Unknown result type (might be due to invalid IL or missing references) //IL_0762: Unknown result type (might be due to invalid IL or missing references) //IL_0767: Unknown result type (might be due to invalid IL or missing references) //IL_077c: Unknown result type (might be due to invalid IL or missing references) //IL_0781: Unknown result type (might be due to invalid IL or missing references) //IL_0796: Unknown result type (might be due to invalid IL or missing references) //IL_079b: Unknown result type (might be due to invalid IL or missing references) //IL_07c0: Unknown result type (might be due to invalid IL or missing references) //IL_07c5: Unknown result type (might be due to invalid IL or missing references) //IL_07df: Unknown result type (might be due to invalid IL or missing references) //IL_07e4: Unknown result type (might be due to invalid IL or missing references) //IL_07fe: Unknown result type (might be due to invalid IL or missing references) //IL_0803: Unknown result type (might be due to invalid IL or missing references) //IL_081d: Unknown result type (might be due to invalid IL or missing references) //IL_0822: Unknown result type (might be due to invalid IL or missing references) //IL_083c: Unknown result type (might be due to invalid IL or missing references) //IL_0841: Unknown result type (might be due to invalid IL or missing references) //IL_085b: Unknown result type (might be due to invalid IL or missing references) //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_087a: Unknown result type (might be due to invalid IL or missing references) //IL_087f: Unknown result type (might be due to invalid IL or missing references) //IL_089f: Unknown result type (might be due to invalid IL or missing references) //IL_08a4: Unknown result type (might be due to invalid IL or missing references) //IL_08b9: Unknown result type (might be due to invalid IL or missing references) //IL_08be: Unknown result type (might be due to invalid IL or missing references) //IL_08d3: Unknown result type (might be due to invalid IL or missing references) //IL_08d8: Unknown result type (might be due to invalid IL or missing references) //IL_08ed: Unknown result type (might be due to invalid IL or missing references) //IL_08f2: Unknown result type (might be due to invalid IL or missing references) ThemeColors themeColors = new ThemeColors(); LeaderboardColors obj = new LeaderboardColors { panelBody = new Color(0.2f, 0.2f, 0.2f), scoresBody = new Color(0.1f, 0.1f, 0.1f, 0.65f), rowEntry = new Color(0.17f, 0.17f, 0.17f), yourRowEntry = new Color(0f, 0f, 0f, 0.65f), headerText = new Color(1f, 1f, 1f), text = new Color(1f, 1f, 1f), textOutline = new Color(0f, 0f, 0f), slider = new SliderColors { background = new Color(0.15f, 0.15f, 0.15f), fill = new Color(0.35f, 0.35f, 0.35f), handle = new Color(0.35f, 0.35f, 0.35f) } }; ColorBlock tabs = default(ColorBlock); ((ColorBlock)(ref tabs)).normalColor = new Color(1f, 1f, 1f); ((ColorBlock)(ref tabs)).pressedColor = new Color(1f, 1f, 0f); ((ColorBlock)(ref tabs)).highlightedColor = new Color(0.75f, 0.75f, 0.75f); ((ColorBlock)(ref tabs)).colorMultiplier = 1f; ((ColorBlock)(ref tabs)).fadeDuration = 0.2f; obj.tabs = tabs; themeColors.leaderboard = obj; themeColors.notification = new NotificationColors { border = new Color(0.2f, 0.2f, 0.2f, 0.75f), background = new Color(0f, 0f, 0f, 0.95f), defaultText = new Color(1f, 1f, 1f), textOutline = new Color(0.2f, 0.2f, 0.2f), warningText = new Color(1f, 1f, 0f), errorText = new Color(1f, 0f, 0f) }; ReplayButtonColors obj2 = new ReplayButtonColors { text = new Color(1f, 1f, 1f) }; tabs = default(ColorBlock); ((ColorBlock)(ref tabs)).normalColor = new Color(0f, 0f, 0f); ((ColorBlock)(ref tabs)).highlightedColor = new Color(0.2f, 0.2f, 0.2f); ((ColorBlock)(ref tabs)).pressedColor = new Color(0.1f, 0.1f, 0.1f); ((ColorBlock)(ref tabs)).colorMultiplier = 1f; ((ColorBlock)(ref tabs)).fadeDuration = 0.2f; obj2.colors = tabs; themeColors.replayButton = obj2; themeColors.capsules = new CapsulesColors { year = new Color(0f, 0f, 0f), tempo = new Color(0.2f, 0.2f, 0.2f, 0.45f), genre = new Color(0.12f, 0.12f, 0.12f), composer = new Color(0.12f, 0.12f, 0.12f), description = new Color(0f, 0f, 0f), yearShadow = Color.gray, genreShadow = Color.gray, composerShadow = Color.gray, descriptionShadow = Color.gray }; themeColors.randomButton = new RandomButtonColors { background = new Color(0f, 0f, 0f), backgroundOver = new Color(0.2f, 0.2f, 0.2f), outline = new Color(0.2f, 0.2f, 0.2f), outlineOver = new Color(0f, 0f, 0f), text = new Color(0.92f, 0.92f, 0.92f), textOver = new Color(0.8f, 0.8f, 0.8f) }; themeColors.backButton = new PlayBackButtonColors { background = new Color(0f, 0f, 0f), backgroundOver = new Color(0.2f, 0.2f, 0.2f), outline = new Color(0.2f, 0.2f, 0.2f), outlineOver = new Color(0f, 0f, 0f), text = new Color(0.92f, 0.92f, 0.92f), textOver = new Color(0.8f, 0.8f, 0.8f), shadow = Color.gray, shadowOver = Color.black }; themeColors.playButton = new PlayBackButtonColors { background = new Color(0f, 0f, 0f), backgroundOver = new Color(0.2f, 0.2f, 0.2f), outline = new Color(0.2f, 0.2f, 0.2f), outlineOver = new Color(0f, 0f, 0f), text = new Color(0.92f, 0.92f, 0.92f), textOver = new Color(0.8f, 0.8f, 0.8f), shadow = Color.gray, shadowOver = Color.black }; themeColors.songButton = new SongButtonColors { background = new Color(0f, 0f, 0f), outline = new Color(0.12f, 0.12f, 0.12f), outlineOver = new Color(0.2f, 0.2f, 0.2f), selectedText = new Color(0.35f, 0.35f, 0.35f), shadow = Color.gray, textOver = new Color(0.92f, 0.92f, 0.92f), text = new Color(0.35f, 0.35f, 0.35f), square = new Color(0f, 0f, 0f) }; themeColors.scrollSpeedSlider = new ScrollSpeedSliderColors { background = new Color(0.15f, 0.15f, 0.15f), text = new Color(1f, 1f, 1f), handle = new Color(0.35f, 0.35f, 0.35f), fill = new Color(0.35f, 0.35f, 0.35f) }; themeColors.diffStar = new DiffStarColors { gradientStart = new Color(0.2f, 0.2f, 0.2f), gradientEnd = new Color(0.7f, 0.7f, 0.7f) }; themeColors.pointer = new PointerColors { background = new Color(0.92f, 0.92f, 0.92f), outline = new Color(0.12f, 0.12f, 0.12f), shadow = new Color(0f, 0f, 0f) }; themeColors.background = new BackgroundColors { waves = new Color(0f, 0f, 0f, 0.9f), waves2 = new Color(0.2f, 0.2f, 0.2f, 0.9f), dots = new Color(0f, 0f, 0f, 1f), dots2 = new Color(0f, 0f, 0f, 1f), diamond = new Color(0f, 0f, 0f, 0.6f), shape = new Color(0f, 0f, 0f, 0.75f), background = new Color(0.12f, 0.12f, 0.12f, 0.1f) }; themeColors.title = new TitleColors { songName = new Color(1f, 1f, 1f), titleBar = new Color(0.2f, 0.2f, 0.2f), title = new Color(1f, 1f, 1f), titleShadow = new Color(0.2f, 0.2f, 0.2f) }; colors = themeColors; } public static void SetDayTheme() { //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_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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: 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_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: 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_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_0584: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_05b8: Unknown result type (might be due to invalid IL or missing references) //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05dd: Unknown result type (might be due to invalid IL or missing references) //IL_05e2: Unknown result type (might be due to invalid IL or missing references) //IL_0602: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Unknown result type (might be due to invalid IL or missing references) //IL_0636: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_066f: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_0689: Unknown result type (might be due to invalid IL or missing references) //IL_069e: Unknown result type (might be due to invalid IL or missing references) //IL_06a3: Unknown result type (might be due to invalid IL or missing references) //IL_06b8: Unknown result type (might be due to invalid IL or missing references) //IL_06bd: Unknown result type (might be due to invalid IL or missing references) //IL_06dd: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //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_0711: Unknown result type (might be due to invalid IL or missing references) //IL_0716: Unknown result type (might be due to invalid IL or missing references) //IL_072b: Unknown result type (might be due to invalid IL or missing references) //IL_0730: Unknown result type (might be due to invalid IL or missing references) //IL_0750: Unknown result type (might be due to invalid IL or missing references) //IL_0755: Unknown result type (might be due to invalid IL or missing references) //IL_076a: Unknown result type (might be due to invalid IL or missing references) //IL_076f: Unknown result type (might be due to invalid IL or missing references) //IL_078f: Unknown result type (might be due to invalid IL or missing references) //IL_0794: Unknown result type (might be due to invalid IL or missing references) //IL_07a9: Unknown result type (might be due to invalid IL or missing references) //IL_07ae: Unknown result type (might be due to invalid IL or missing references) //IL_07b4: Unknown result type (might be due to invalid IL or missing references) //IL_07b9: Unknown result type (might be due to invalid IL or missing references) //IL_07de: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_0802: Unknown result type (might be due to invalid IL or missing references) //IL_081c: Unknown result type (might be due to invalid IL or missing references) //IL_0821: Unknown result type (might be due to invalid IL or missing references) //IL_083b: Unknown result type (might be due to invalid IL or missing references) //IL_0840: Unknown result type (might be due to invalid IL or missing references) //IL_085a: Unknown result type (might be due to invalid IL or missing references) //IL_085f: Unknown result type (might be due to invalid IL or missing references) //IL_0879: Unknown result type (might be due to invalid IL or missing references) //IL_087e: Unknown result type (might be due to invalid IL or missing references) //IL_0898: Unknown result type (might be due to invalid IL or missing references) //IL_089d: Unknown result type (might be due to invalid IL or missing references) //IL_08bd: Unknown result type (might be due to invalid IL or missing references) //IL_08c2: Unknown result type (might be due to invalid IL or missing references) //IL_08dc: Unknown result type (might be due to invalid IL or missing references) //IL_08e1: Unknown result type (might be due to invalid IL or missing references) //IL_08f6: Unknown result type (might be due to invalid IL or missing references) //IL_08fb: Unknown result type (might be due to invalid IL or missing references) //IL_0910: Unknown result type (might be due to invalid IL or missing references) //IL_0915: Unknown result type (might be due to invalid IL or missing references) ThemeColors themeColors = new ThemeColors(); LeaderboardColors obj = new LeaderboardColors { panelBody = new Color(0f, 0f, 0f), scoresBody = new Color(0.9f, 0.9f, 0.9f, 0.9f), rowEntry = new Color(0.75f, 0.75f, 0.75f), yourRowEntry = new Color(1f, 1f, 1f, 0.65f), headerText = new Color(0f, 0f, 0f), text = new Color(0f, 0f, 0f), textOutline = new Color(1f, 1f, 1f), slider = new SliderColors { background = new Color(0.85f, 0.85f, 0.85f), fill = new Color(0f, 0f, 0f), handle = new Color(0f, 0f, 0f) } }; ColorBlock tabs = default(ColorBlock); ((ColorBlock)(ref tabs)).normalColor = new Color(0f, 0f, 0f); ((ColorBlock)(ref tabs)).pressedColor = new Color(1f, 1f, 0f); ((ColorBlock)(ref tabs)).highlightedColor = new Color(0.25f, 0.25f, 0.25f); ((ColorBlock)(ref tabs)).colorMultiplier = 1f; ((ColorBlock)(ref tabs)).fadeDuration = 0.2f; obj.tabs = tabs; themeColors.leaderboard = obj; themeColors.notification = new NotificationColors { border = new Color(0.8f, 0.8f, 0.8f, 0.75f), background = new Color(1f, 1f, 1f, 0.95f), defaultText = new Color(0f, 0f, 0f), textOutline = new Color(1f, 1f, 1f), warningText = new Color(0.6f, 0.6f, 0f), errorText = new Color(0.6f, 0f, 0f) }; ReplayButtonColors obj2 = new ReplayButtonColors { text = new Color(0f, 0f, 0f) }; tabs = default(ColorBlock); ((ColorBlock)(ref tabs)).normalColor = new Color(1f, 1f, 1f); ((ColorBlock)(ref tabs)).highlightedColor = new Color(0.8f, 0.8f, 0.8f); ((ColorBlock)(ref tabs)).pressedColor = new Color(0.9f, 0.9f, 0.9f); ((ColorBlock)(ref tabs)).colorMultiplier = 1f; ((ColorBlock)(ref tabs)).fadeDuration = 0.2f; obj2.colors = tabs; themeColors.replayButton = obj2; themeColors.capsules = new CapsulesColors { year = new Color(1f, 1f, 1f), tempo = new Color(0.8f, 0.8f, 0.8f, 0.75f), genre = new Color(0.88f, 0.88f, 0.88f), composer = new Color(0.88f, 0.88f, 0.88f), description = new Color(1f, 1f, 1f), yearShadow = Color.black, genreShadow = Color.black, composerShadow = Color.black, descriptionShadow = Color.black }; themeColors.randomButton = new RandomButtonColors { background = new Color(1f, 1f, 1f), backgroundOver = new Color(0.8f, 0.8f, 0.8f), outline = new Color(0.15f, 0.15f, 0.15f), outlineOver = new Color(0.25f, 0.25f, 0.25f), text = new Color(0.08f, 0.08f, 0.08f), textOver = new Color(0.2f, 0.2f, 0.2f) }; themeColors.backButton = new PlayBackButtonColors { background = new Color(1f, 1f, 1f), backgroundOver = new Color(0.9f, 0.9f, 0.9f), outline = new Color(0.15f, 0.15f, 0.15f), outlineOver = new Color(0.25f, 0.25f, 0.25f), text = new Color(0.08f, 0.08f, 0.08f), textOver = new Color(0.2f, 0.2f, 0.2f), shadow = Color.black, shadowOver = new Color(0.95f, 0.95f, 0.95f) }; themeColors.playButton = new PlayBackButtonColors { background = new Color(1f, 1f, 1f), backgroundOver = new Color(0.9f, 0.9f, 0.9f), outline = new Color(0.15f, 0.15f, 0.15f), outlineOver = new Color(0.25f, 0.25f, 0.25f), text = new Color(0.08f, 0.08f, 0.08f), textOver = new Color(0.2f, 0.2f, 0.2f), shadow = Color.black, shadowOver = new Color(0.95f, 0.95f, 0.95f) }; themeColors.songButton = new SongButtonColors { background = new Color(1f, 1f, 1f), outline = new Color(0.8f, 0.8f, 0.8f), outlineOver = new Color(0.35f, 0.35f, 0.35f), selectedText = new Color(0f, 0f, 0f), shadow = new Color(0.05f, 0.05f, 0.05f), textOver = new Color(0.08f, 0.08f, 0.08f), text = new Color(0.35f, 0.35f, 0.35f), square = new Color(0.35f, 0.35f, 0.35f) }; themeColors.scrollSpeedSlider = new ScrollSpeedSliderColors { background = new Color(0.85f, 0.85f, 0.85f), text = new Color(1f, 1f, 1f), handle = new Color(0f, 0f, 0f), fill = new Color(0f, 0f, 0f) }; themeColors.diffStar = new DiffStarColors { gradientStart = new Color(0.8f, 0.8f, 0.8f), gradientEnd = new Color(0.3f, 0.3f, 0.3f) }; themeColors.pointer = new PointerColors { background = new Color(0.88f, 0.88f, 0.88f), outline = new Color(0.08f, 0.08f, 0.08f), shadow = Color.black }; themeColors.background = new BackgroundColors { waves = new Color(0f, 0f, 0f, 0.9f), waves2 = new Color(0.6f, 0.6f, 0.6f, 0.9f), dots = new Color(0.9f, 0.9f, 0.9f, 1f), dots2 = new Color(0.9f, 0.9f, 0.9f, 1f), diamond = new Color(0.9f, 0.9f, 0.9f, 0.6f), shape = new Color(0.9f, 0.9f, 0.9f, 0.45f), background = new Color(0.77f, 0.77f, 0.77f, 0.1f) }; themeColors.title = new TitleColors { songName = new Color(0f, 0f, 0f), titleBar = new Color(0.9f, 0.9f, 0.9f, 0.75f), title = new Color(0f, 0f, 0f), titleShadow = new Color(0.9f, 0.9f, 0.9f) }; colors = themeColors; } public static void SetCustomTheme(string themeFileName) { if (File.Exists(Paths.BepInExRootPath + "/Themes/" + themeFileName + ".json")) { string text = File.ReadAllText(Paths.BepInExRootPath + "/Themes/" + themeFileName + ".json"); try { SerializableClass.JsonThemeDeserializer themeConfig = JsonConvert.DeserializeObject(text); LoadTheme(themeConfig); return; } catch (Exception ex) { Plugin.LogError(ex.ToString()); Plugin.LogError("Corrupted theme: " + themeFileName); Plugin.LogError("Loading default theme..."); SetDefaultTheme(); return; } } Plugin.LogError("Missing theme: " + themeFileName); SetDefaultTheme(); } public static void LoadTheme(SerializableClass.JsonThemeDeserializer themeConfig) { //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) colors = new ThemeColors(); colors.InitializeEmpty(); ColorUtility.TryParseHtmlString(themeConfig.theme.leaderboard.panelBody, ref colors.leaderboard.panelBody); ColorUtility.TryParseHtmlString(themeConfig.theme.leaderboard.scoresBody, ref colors.leaderboard.scoresBody); ColorUtility.TryParseHtmlString(themeConfig.theme.leaderboard.rowEntry, ref colors.leaderboard.rowEntry); ColorUtility.TryParseHtmlString(themeConfig.theme.leaderboard.yourRowEntry, ref colors.leaderboard.yourRowEntry); ColorUtility.TryParseHtmlString(themeConfig.theme.scrollSpeedSlider.background, ref colors.scrollSpeedSlider.background); ColorUtility.TryParseHtmlString(themeConfig.theme.scrollSpeedSlider.text, ref colors.scrollSpeedSlider.text); ColorUtility.TryParseHtmlString(themeConfig.theme.scrollSpeedSlider.handle, ref colors.scrollSpeedSlider.handle); ColorUtility.TryParseHtmlString(themeConfig.theme.scrollSpeedSlider.fill, ref colors.scrollSpeedSlider.fill); ColorUtility.TryParseHtmlString(themeConfig.theme.leaderboard.slider.background, ref colors.leaderboard.slider.background); ColorUtility.TryParseHtmlString(themeConfig.theme.leaderboard.slider.fill, ref colors.leaderboard.slider.fill); ColorUtility.TryParseHtmlString(themeConfig.theme.leaderboard.slider.handle, ref colors.leaderboard.slider.handle); ColorUtility.TryParseHtmlString(themeConfig.theme.leaderboard.headerText, ref colors.leaderboard.headerText); ColorUtility.TryParseHtmlString(themeConfig.theme.leaderboard.text, ref colors.leaderboard.text); ColorUtility.TryParseHtmlString(themeConfig.theme.leaderboard.textOutline, ref colors.leaderboard.textOutline); Color normalColor = default(Color); ColorUtility.TryParseHtmlString(themeConfig.theme.leaderboard.tabs.normal, ref normalColor); Color pressedColor = default(Color); ColorUtility.TryParseHtmlString(themeConfig.theme.leaderboard.tabs.pressed, ref pressedColor); Color highlightedColor = default(Color); ColorUtility.TryParseHtmlString(themeConfig.theme.leaderboard.tabs.highlighted, ref highlightedColor); LeaderboardColors leaderboard = colors.leaderboard; ColorBlock tabs = default(ColorBlock); ((ColorBlock)(ref tabs)).normalColor = normalColor; ((ColorBlock)(ref tabs)).pressedColor = pressedColor; ((ColorBlock)(ref tabs)).highlightedColor = highlightedColor; ((ColorBlock)(ref tabs)).colorMultiplier = 1f; ((ColorBlock)(ref tabs)).fadeDuration = 0.1f; leaderboard.tabs = tabs; ColorUtility.TryParseHtmlString(themeConfig.theme.notification.border, ref colors.notification.border); ColorUtility.TryParseHtmlString(themeConfig.theme.notification.background, ref colors.notification.background); ColorUtility.TryParseHtmlString(themeConfig.theme.notification.defaultText, ref colors.notification.defaultText); ColorUtility.TryParseHtmlString(themeConfig.theme.notification.warningText, ref colors.notification.warningText); ColorUtility.TryParseHtmlString(themeConfig.theme.notification.errorText, ref colors.notification.errorText); ColorUtility.TryParseHtmlString(themeConfig.theme.notification.textOutline, ref colors.notification.textOutline); ColorUtility.TryParseHtmlString(themeConfig.theme.replayButton.text, ref colors.replayButton.text); ColorUtility.TryParseHtmlString(themeConfig.theme.replayButton.normal, ref normalColor); ColorUtility.TryParseHtmlString(themeConfig.theme.replayButton.pressed, ref pressedColor); ColorUtility.TryParseHtmlString(themeConfig.theme.replayButton.highlighted, ref highlightedColor); ReplayButtonColors replayButton = colors.replayButton; tabs = default(ColorBlock); ((ColorBlock)(ref tabs)).normalColor = normalColor; ((ColorBlock)(ref tabs)).pressedColor = pressedColor; ((ColorBlock)(ref tabs)).highlightedColor = highlightedColor; ((ColorBlock)(ref tabs)).colorMultiplier = 1f; ((ColorBlock)(ref tabs)).fadeDuration = 0.1f; replayButton.colors = tabs; ColorUtility.TryParseHtmlString(themeConfig.theme.capsules.year, ref colors.capsules.year); ColorUtility.TryParseHtmlString(themeConfig.theme.capsules.yearShadow, ref colors.capsules.yearShadow); ColorUtility.TryParseHtmlString(themeConfig.theme.capsules.composer, ref colors.capsules.composer); ColorUtility.TryParseHtmlString(themeConfig.theme.capsules.composerShadow, ref colors.capsules.composerShadow); ColorUtility.TryParseHtmlString(themeConfig.theme.capsules.genre, ref colors.capsules.genre); ColorUtility.TryParseHtmlString(themeConfig.theme.capsules.genreShadow, ref colors.capsules.genreShadow); ColorUtility.TryParseHtmlString(themeConfig.theme.capsules.description, ref colors.capsules.description); ColorUtility.TryParseHtmlString(themeConfig.theme.capsules.descriptionShadow, ref colors.capsules.descriptionShadow); ColorUtility.TryParseHtmlString(themeConfig.theme.capsules.tempo, ref colors.capsules.tempo); ColorUtility.TryParseHtmlString(themeConfig.theme.randomButton.background, ref colors.randomButton.background); ColorUtility.TryParseHtmlString(themeConfig.theme.randomButton.backgroundOver, ref colors.randomButton.backgroundOver); ColorUtility.TryParseHtmlString(themeConfig.theme.randomButton.outline, ref colors.randomButton.outline); ColorUtility.TryParseHtmlString(themeConfig.theme.randomButton.outlineOver, ref colors.randomButton.outlineOver); ColorUtility.TryParseHtmlString(themeConfig.theme.randomButton.text, ref colors.randomButton.text); ColorUtility.TryParseHtmlString(themeConfig.theme.randomButton.textOver, ref colors.randomButton.textOver); ColorUtility.TryParseHtmlString(themeConfig.theme.backButton.background, ref colors.backButton.background); ColorUtility.TryParseHtmlString(themeConfig.theme.backButton.backgroundOver, ref colors.backButton.backgroundOver); ColorUtility.TryParseHtmlString(themeConfig.theme.backButton.outline, ref colors.backButton.outline); ColorUtility.TryParseHtmlString(themeConfig.theme.backButton.outlineOver, ref colors.backButton.outlineOver); ColorUtility.TryParseHtmlString(themeConfig.theme.backButton.text, ref colors.backButton.text); ColorUtility.TryParseHtmlString(themeConfig.theme.backButton.textOver, ref colors.backButton.textOver); ColorUtility.TryParseHtmlString(themeConfig.theme.backButton.shadow, ref colors.backButton.shadow); ColorUtility.TryParseHtmlString(themeConfig.theme.backButton.shadowOver, ref colors.backButton.shadowOver); ColorUtility.TryParseHtmlString(themeConfig.theme.playButton.background, ref colors.playButton.background); ColorUtility.TryParseHtmlString(themeConfig.theme.playButton.backgroundOver, ref colors.playButton.backgroundOver); ColorUtility.TryParseHtmlString(themeConfig.theme.playButton.outline, ref colors.playButton.outline); ColorUtility.TryParseHtmlString(themeConfig.theme.playButton.outlineOver, ref colors.playButton.outlineOver); ColorUtility.TryParseHtmlString(themeConfig.theme.playButton.text, ref colors.playButton.text); ColorUtility.TryParseHtmlString(themeConfig.theme.playButton.textOver, ref colors.playButton.textOver); ColorUtility.TryParseHtmlString(themeConfig.theme.playButton.shadow, ref colors.playButton.shadow); ColorUtility.TryParseHtmlString(themeConfig.theme.playButton.shadowOver, ref colors.playButton.shadowOver); ColorUtility.TryParseHtmlString(themeConfig.theme.songButton.background, ref colors.songButton.background); ColorUtility.TryParseHtmlString(themeConfig.theme.songButton.outline, ref colors.songButton.outline); ColorUtility.TryParseHtmlString(themeConfig.theme.songButton.outlineOver, ref colors.songButton.outlineOver); ColorUtility.TryParseHtmlString(themeConfig.theme.songButton.shadow, ref colors.songButton.shadow); ColorUtility.TryParseHtmlString(themeConfig.theme.songButton.text, ref colors.songButton.text); ColorUtility.TryParseHtmlString(themeConfig.theme.songButton.textOver, ref colors.songButton.textOver); ColorUtility.TryParseHtmlString(themeConfig.theme.songButton.square, ref colors.songButton.square); ColorUtility.TryParseHtmlString(themeConfig.theme.diffStar.gradientStart, ref colors.diffStar.gradientStart); ColorUtility.TryParseHtmlString(themeConfig.theme.diffStar.gradientEnd, ref colors.diffStar.gradientEnd); ColorUtility.TryParseHtmlString(themeConfig.theme.pointer.background, ref colors.pointer.background); ColorUtility.TryParseHtmlString(themeConfig.theme.pointer.shadow, ref colors.pointer.shadow); ColorUtility.TryParseHtmlString(themeConfig.theme.pointer.outline, ref colors.pointer.outline); ColorUtility.TryParseHtmlString(themeConfig.theme.background.waves, ref colors.background.waves); ColorUtility.TryParseHtmlString(themeConfig.theme.background.waves2, ref colors.background.waves2); ColorUtility.TryParseHtmlString(themeConfig.theme.background.dots, ref colors.background.dots); ColorUtility.TryParseHtmlString(themeConfig.theme.background.dots2, ref colors.background.dots2); ColorUtility.TryParseHtmlString(themeConfig.theme.background.shape, ref colors.background.shape); ColorUtility.TryParseHtmlString(themeConfig.theme.background.diamond, ref colors.background.diamond); ColorUtility.TryParseHtmlString(themeConfig.theme.background.background, ref colors.background.background); ColorUtility.TryParseHtmlString(themeConfig.theme.title.songName, ref colors.title.songName); ColorUtility.TryParseHtmlString(themeConfig.theme.title.titleBar, ref colors.title.titleBar); ColorUtility.TryParseHtmlString(themeConfig.theme.title.title, ref colors.title.title); ColorUtility.TryParseHtmlString(themeConfig.theme.title.titleShadow, ref colors.title.titleShadow); } public static void SetRandomTheme() { //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_0036: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_005d: 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_006e: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_00a2: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0214: 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_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0258: 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_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04e2: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_0509: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05ad: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: 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_05e5: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_0602: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Unknown result type (might be due to invalid IL or missing references) //IL_061e: Unknown result type (might be due to invalid IL or missing references) //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Unknown result type (might be due to invalid IL or missing references) //IL_0651: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) Random rdm = new Random(DateTime.Now.Millisecond); ThemeColors themeColors = new ThemeColors(); LeaderboardColors obj = new LeaderboardColors { panelBody = GetRandomColor(rdm, 1f), scoresBody = GetRandomColor(rdm, 1f), rowEntry = GetRandomColor(rdm, 1f), yourRowEntry = GetRandomColor(rdm, 0.35f), headerText = GetRandomColor(rdm, 1f), text = GetRandomColor(rdm, 1f), textOutline = GetRandomColor(rdm, 0.75f), slider = new SliderColors { background = GetRandomColor(rdm, 1f), fill = GetRandomColor(rdm, 1f), handle = GetRandomColor(rdm, 1f) } }; ColorBlock tabs = default(ColorBlock); ((ColorBlock)(ref tabs)).normalColor = GetRandomColor(rdm, 1f); ((ColorBlock)(ref tabs)).pressedColor = GetRandomColor(rdm, 1f); ((ColorBlock)(ref tabs)).highlightedColor = GetRandomColor(rdm, 1f); ((ColorBlock)(ref tabs)).colorMultiplier = 1f; ((ColorBlock)(ref tabs)).fadeDuration = 0.2f; obj.tabs = tabs; themeColors.leaderboard = obj; themeColors.notification = new NotificationColors { border = GetRandomColor(rdm, 0.75f), background = GetRandomColor(rdm, 0.84f), defaultText = GetRandomColor(rdm, 1f), textOutline = GetRandomColor(rdm, 0.84f), warningText = GetRandomColor(rdm, 1f), errorText = GetRandomColor(rdm, 1f) }; ReplayButtonColors obj2 = new ReplayButtonColors { text = GetRandomColor(rdm, 1f) }; tabs = default(ColorBlock); ((ColorBlock)(ref tabs)).normalColor = GetRandomColor(rdm, 1f); ((ColorBlock)(ref tabs)).highlightedColor = GetRandomColor(rdm, 1f); ((ColorBlock)(ref tabs)).pressedColor = GetRandomColor(rdm, 1f); obj2.colors = tabs; themeColors.replayButton = obj2; themeColors.capsules = new CapsulesColors { year = GetRandomColor(rdm, 1f), tempo = GetRandomColor(rdm, 1f), genre = GetRandomColor(rdm, 1f), composer = GetRandomColor(rdm, 1f), description = GetRandomColor(rdm, 1f), yearShadow = GetRandomColor(rdm, 1f), genreShadow = GetRandomColor(rdm, 1f), composerShadow = GetRandomColor(rdm, 1f), descriptionShadow = GetRandomColor(rdm, 1f) }; themeColors.randomButton = new RandomButtonColors { background = GetRandomColor(rdm, 1f), backgroundOver = GetRandomColor(rdm, 1f), outline = GetRandomColor(rdm, 1f), outlineOver = GetRandomColor(rdm, 1f), text = GetRandomColor(rdm, 1f), textOver = GetRandomColor(rdm, 1f) }; themeColors.backButton = new PlayBackButtonColors { background = GetRandomColor(rdm, 1f), backgroundOver = GetRandomColor(rdm, 1f), outline = GetRandomColor(rdm, 1f), outlineOver = GetRandomColor(rdm, 1f), text = GetRandomColor(rdm, 1f), textOver = GetRandomColor(rdm, 1f), shadow = GetRandomColor(rdm, 1f), shadowOver = GetRandomColor(rdm, 1f) }; themeColors.playButton = new PlayBackButtonColors { background = GetRandomColor(rdm, 1f), backgroundOver = GetRandomColor(rdm, 1f), outline = GetRandomColor(rdm, 1f), outlineOver = GetRandomColor(rdm, 1f), text = GetRandomColor(rdm, 1f), textOver = GetRandomColor(rdm, 1f), shadow = GetRandomColor(rdm, 1f), shadowOver = GetRandomColor(rdm, 1f) }; themeColors.songButton = new SongButtonColors { background = GetRandomColor(rdm, 1f), outline = GetRandomColor(rdm, 1f), outlineOver = GetRandomColor(rdm, 1f), shadow = GetRandomColor(rdm, 1f), textOver = GetRandomColor(rdm, 1f), text = GetRandomColor(rdm, 1f), selectedText = GetRandomColor(rdm, 1f), square = GetRandomColor(rdm, 1f) }; themeColors.scrollSpeedSlider = new ScrollSpeedSliderColors { background = GetRandomColor(rdm, 1f), text = GetRandomColor(rdm, 1f), handle = GetRandomColor(rdm, 1f), fill = GetRandomColor(rdm, 1f) }; themeColors.diffStar = new DiffStarColors { gradientStart = GetRandomColor(rdm, 1f), gradientEnd = GetRandomColor(rdm, 1f) }; themeColors.pointer = new PointerColors { background = GetRandomColor(rdm, 1f), shadow = GetRandomColor(rdm, 1f), outline = GetRandomColor(rdm, 1f) }; themeColors.background = new BackgroundColors { waves = GetRandomColor(rdm, 0.5f), waves2 = GetRandomColor(rdm, 0.5f), dots = GetRandomColor(rdm, 0.5f), dots2 = GetRandomColor(rdm, 0.5f), shape = GetRandomColor(rdm, 0.5f), diamond = GetRandomColor(rdm, 0.5f), background = GetRandomColor(rdm, 0.5f) }; themeColors.title = new TitleColors { songName = GetRandomColor(rdm, 1f), title = GetRandomColor(rdm, 1f), titleBar = GetRandomColor(rdm, 1f), titleShadow = GetRandomColor(rdm, 1f) }; colors = themeColors; } private static Color GetRandomColor(Random rdm, float alpha) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) return new Color((float)rdm.NextDouble(), (float)rdm.NextDouble(), (float)rdm.NextDouble(), alpha); } } public static class ThemeManager { public static Action OnThemeRefreshEvents; private const string CONFIG_FIELD = "Themes"; private const string DEFAULT_THEME = "Default"; public static Text songyear; public static Text songgenre; public static Text songcomposer; public static Text songtempo; public static Text songduration; public static Text songdesctext; private static string _currentTheme; private static bool _isInitialized; private static AudioSource _btnClickSfx; public static void SetTheme(string themeName) { _currentTheme = themeName; Theme.isDefault = false; switch (themeName) { case "Day": Theme.SetDayTheme(); break; case "Night": Theme.SetNightTheme(); break; case "Random": Theme.SetRandomTheme(); break; case "Default": Theme.SetDefaultTheme(); break; default: Theme.SetCustomTheme(themeName); break; } GameObjectFactory.UpdatePrefabTheme(); } public static void Config_SettingChanged(object sender, SettingChangedEventArgs e) { if (!(_currentTheme == Plugin.Instance.ThemeName.Value)) { _currentTheme = Plugin.Instance.ThemeName.Value; RefreshTheme(); } } public static void RefreshTheme() { SetTheme(_currentTheme); OnThemeRefreshEvents?.Invoke(); TootTallyNotifManager.DisplayNotif("Theme Reloaded!"); } [HarmonyPatch(typeof(HomeController), "Start")] [HarmonyPrefix] public static void Initialize() { if (!_isInitialized) { SetTheme(Plugin.Instance.ThemeName.Value); _isInitialized = true; } } [HarmonyPatch(typeof(LevelSelectController), "Start")] [HarmonyPostfix] public static void ChangeThemeOnLevelSelectControllerStartPostFix(LevelSelectController __instance) { //IL_10e4: Unknown result type (might be due to invalid IL or missing references) //IL_10fd: Unknown result type (might be due to invalid IL or missing references) //IL_1116: Unknown result type (might be due to invalid IL or missing references) //IL_112f: Unknown result type (might be due to invalid IL or missing references) //IL_1148: Unknown result type (might be due to invalid IL or missing references) //IL_1161: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_0b97: Unknown result type (might be due to invalid IL or missing references) //IL_0bca: Unknown result type (might be due to invalid IL or missing references) //IL_0bfd: Unknown result type (might be due to invalid IL or missing references) //IL_0c38: Unknown result type (might be due to invalid IL or missing references) //IL_0c44: Unknown result type (might be due to invalid IL or missing references) //IL_0ca9: Unknown result type (might be due to invalid IL or missing references) //IL_0d29: Unknown result type (might be due to invalid IL or missing references) //IL_0d50: Unknown result type (might be due to invalid IL or missing references) //IL_0d89: Unknown result type (might be due to invalid IL or missing references) //IL_0d90: Expected O, but got Unknown //IL_0d93: Unknown result type (might be due to invalid IL or missing references) //IL_0dbe: Unknown result type (might be due to invalid IL or missing references) //IL_0dc5: Expected O, but got Unknown //IL_0dc8: Unknown result type (might be due to invalid IL or missing references) //IL_0e46: Unknown result type (might be due to invalid IL or missing references) //IL_0e7c: Unknown result type (might be due to invalid IL or missing references) //IL_0e97: Unknown result type (might be due to invalid IL or missing references) //IL_0ecd: Unknown result type (might be due to invalid IL or missing references) //IL_0ee8: Unknown result type (might be due to invalid IL or missing references) //IL_0f35: Unknown result type (might be due to invalid IL or missing references) //IL_0f68: Unknown result type (might be due to invalid IL or missing references) //IL_0f9b: Unknown result type (might be due to invalid IL or missing references) //IL_0fce: Unknown result type (might be due to invalid IL or missing references) //IL_102e: Unknown result type (might be due to invalid IL or missing references) //IL_1051: Unknown result type (might be due to invalid IL or missing references) //IL_1074: Unknown result type (might be due to invalid IL or missing references) //IL_10af: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0157: 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_047f: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Expected O, but got Unknown //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_081e: Expected O, but got Unknown //IL_09f3: Unknown result type (might be due to invalid IL or missing references) //IL_09fa: Expected O, but got Unknown //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05ad: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Unknown result type (might be due to invalid IL or missing references) //IL_05dd: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Unknown result type (might be due to invalid IL or missing references) //IL_0636: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Unknown result type (might be due to invalid IL or missing references) //IL_064a: Unknown result type (might be due to invalid IL or missing references) //IL_0675: Unknown result type (might be due to invalid IL or missing references) //IL_06bc: Unknown result type (might be due to invalid IL or missing references) //IL_071f: Unknown result type (might be due to invalid IL or missing references) //IL_0731: Unknown result type (might be due to invalid IL or missing references) //IL_0740: Unknown result type (might be due to invalid IL or missing references) //IL_0745: Unknown result type (might be due to invalid IL or missing references) //IL_0770: Unknown result type (might be due to invalid IL or missing references) //IL_0881: Unknown result type (might be due to invalid IL or missing references) //IL_08c1: Unknown result type (might be due to invalid IL or missing references) //IL_090f: Unknown result type (might be due to invalid IL or missing references) //IL_094f: Unknown result type (might be due to invalid IL or missing references) //IL_0a5d: Unknown result type (might be due to invalid IL or missing references) //IL_0a9d: Unknown result type (might be due to invalid IL or missing references) //IL_0af7: Unknown result type (might be due to invalid IL or missing references) //IL_0b37: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) if (Theme.isDefault) { return; } _btnClickSfx = __instance.hoversfx; try { GameObject[] btns = __instance.btns; foreach (GameObject val in btns) { ((Graphic)((Component)val.transform.Find("BG/ScoreText")).gameObject.GetComponent()).color = Theme.colors.leaderboard.text; } } catch (Exception ex) { Plugin.LogError("ScoreText theme couldn't be applied:" + ex.Message); } try { GameObject val2 = Object.Instantiate(((Component)__instance.btnbgs[0]).gameObject); Object.DestroyImmediate((Object)(object)((Component)val2.transform.Find("heart-circ")).gameObject); Object.DestroyImmediate((Object)(object)((Component)val2.transform.Find("ScoreText")).gameObject); Object.DestroyImmediate((Object)(object)((Component)val2.transform.Find("score-zone")).gameObject); for (int j = 0; j < 7; j++) { Image val3 = __instance.btnbgs[j]; val3.sprite = AssetManager.GetSprite("SongButtonBackground.png"); ((Graphic)((Component)((Component)val3).transform.parent.GetChild(2)).GetComponent()).color = ((j == 0) ? Theme.colors.songButton.textOver : Theme.colors.songButton.text); GameObject val4 = Object.Instantiate(val2, ((Component)val3).gameObject.transform.parent); ((Object)val4).name = "Shadow"; OverwriteGameObjectSpriteAndColor(val4, "SongButtonShadow.png", Theme.colors.songButton.shadow); GameObject val5 = Object.Instantiate(val2, ((Component)val3).gameObject.transform); ((Object)val5).name = "Outline"; OverwriteGameObjectSpriteAndColor(val5, "SongButtonOutline.png", (j == 0) ? Theme.colors.songButton.outlineOver : Theme.colors.songButton.outline); ((Graphic)((Component)((Component)val3).transform.Find("score-zone")).GetComponent()).color = Theme.colors.songButton.square; ((Graphic)val3).color = Theme.colors.songButton.background; } for (int k = 7; k < __instance.btnbgs.Length; k++) { ((Graphic)__instance.btnbgs[k]).color = Theme.colors.songButton.background; } Object.DestroyImmediate((Object)(object)val2); } catch (Exception ex2) { Plugin.LogError("SongButton theme couldn't be applied:" + ex2.Message); } try { ((Graphic)__instance.songtitlebar.GetComponent()).color = Theme.colors.title.titleBar; ((Graphic)__instance.scenetitle.GetComponent()).color = Theme.colors.title.titleShadow; ((Graphic)__instance.longsongtitle).color = Theme.colors.title.songName; ((Graphic)__instance.longsongtitle_dropshadow).color = Theme.colors.title.titleShadow; ((Shadow)((Component)__instance.longsongtitle).GetComponent()).effectColor = Theme.colors.title.outline; } catch (Exception ex3) { Plugin.LogError("Song Title theme couldn't be applied:" + ex3.Message); } try { GameObject gameObject = ((Component)__instance.btnspanel.transform.Find("RightLines")).gameObject; Image component = ((Component)gameObject.transform.Find("Red (1)")).GetComponent(); ((Graphic)component).color = Theme.colors.leaderboard.scoresBody; for (int l = 1; l < 8; l++) { Image component2 = ((Component)gameObject.transform.Find("yellows/Yellow" + l)).GetComponent(); ((Graphic)component2).color = Theme.colors.leaderboard.scoresBody; } Image component3 = ((Component)gameObject.transform.Find("White")).GetComponent(); ((Graphic)component3).color = Theme.colors.songButton.outline; } catch (Exception ex4) { Plugin.LogError("Lines theme couldn't be applied:" + ex4.Message); } try { GameObject gameObject2 = GameObject.Find("MainCanvas/FullScreenPanel/capsules").gameObject; GameObject val6 = Object.Instantiate(gameObject2); foreach (Transform item in val6.transform) { Transform val7 = item; Object.Destroy((Object)(object)((Component)val7).gameObject); } RectTransform component4 = val6.GetComponent(); ((Transform)component4).localScale = Vector3.one; component4.anchoredPosition = Vector2.zero; GameObject val8 = Object.Instantiate(val6, gameObject2.transform); OverwriteGameObjectSpriteAndColor(val8, "YearCapsule.png", Theme.colors.capsules.yearShadow); RectTransform component5 = val8.GetComponent(); component5.anchoredPosition += new Vector2(5f, -3f); GameObject val9 = Object.Instantiate(val6, gameObject2.transform); OverwriteGameObjectSpriteAndColor(val9, "YearCapsule.png", Theme.colors.capsules.year); songyear = Object.Instantiate(__instance.songyear, val9.transform); GameObject val10 = Object.Instantiate(val6, gameObject2.transform); OverwriteGameObjectSpriteAndColor(val10, "GenreCapsule.png", Theme.colors.capsules.genreShadow); RectTransform component6 = val10.GetComponent(); component6.anchoredPosition += new Vector2(5f, -3f); GameObject val11 = Object.Instantiate(val6, gameObject2.transform); OverwriteGameObjectSpriteAndColor(val11, "GenreCapsule.png", Theme.colors.capsules.genre); songgenre = Object.Instantiate(__instance.songgenre, val11.transform); GameObject val12 = Object.Instantiate(val6, gameObject2.transform); OverwriteGameObjectSpriteAndColor(val12, "ComposerCapsule.png", Theme.colors.capsules.composerShadow); RectTransform component7 = val12.GetComponent(); component7.anchoredPosition += new Vector2(5f, -3f); GameObject val13 = Object.Instantiate(val6, gameObject2.transform); OverwriteGameObjectSpriteAndColor(val13, "ComposerCapsule.png", Theme.colors.capsules.composer); songcomposer = Object.Instantiate(__instance.songcomposer, val13.transform); GameObject val14 = Object.Instantiate(val6, gameObject2.transform); OverwriteGameObjectSpriteAndColor(val14, "BPMTimeCapsule.png", Theme.colors.capsules.tempo); songtempo = Object.Instantiate(__instance.songtempo, val14.transform); songduration = Object.Instantiate(__instance.songduration, val14.transform); GameObject val15 = Object.Instantiate(val6, gameObject2.transform); OverwriteGameObjectSpriteAndColor(val15, "DescCapsule.png", Theme.colors.capsules.descriptionShadow); RectTransform component8 = val15.GetComponent(); component8.anchoredPosition += new Vector2(5f, -3f); GameObject val16 = Object.Instantiate(val6, gameObject2.transform); OverwriteGameObjectSpriteAndColor(val16, "DescCapsule.png", Theme.colors.capsules.description); songdesctext = Object.Instantiate(__instance.songdesctext, val16.transform); Object.DestroyImmediate((Object)(object)gameObject2.GetComponent()); Object.DestroyImmediate((Object)(object)val6); } catch (Exception ex5) { Plugin.LogError("Capsules theme couldn't be applied:" + ex5.Message); } try { GameObject gameObject3 = ((Component)__instance.playbtnobj.transform.Find("play-bg")).gameObject; GameObject val17 = Object.Instantiate(gameObject3, ((Component)__instance.playbtn).transform); foreach (Transform item2 in val17.transform) { Transform val18 = item2; ((Component)val18).gameObject.SetActive(false); } GameObject val19 = Object.Instantiate(val17, ((Component)__instance.playbtn).transform); ((Object)val19).name = "playBackground"; OverwriteGameObjectSpriteAndColor(val19, "PlayBackground.png", Theme.colors.playButton.background); GameObject val20 = Object.Instantiate(val17, ((Component)__instance.playbtn).transform); ((Object)val20).name = "playOutline"; OverwriteGameObjectSpriteAndColor(val20, "PlayOutline.png", Theme.colors.playButton.outline); Text component9 = ((Component)Object.Instantiate(((Component)__instance.playbtn).transform.GetChild(3), ((Component)__instance.playbtn).transform).GetChild(0)).GetComponent(); ((Graphic)component9).color = Theme.colors.playButton.text; GameObject val21 = Object.Instantiate(val17, ((Component)__instance.playbtn).transform); ((Object)val21).name = "playShadow"; OverwriteGameObjectSpriteAndColor(val21, "PlayShadow.png", Theme.colors.playButton.shadow); gameObject3.SetActive(false); val17.SetActive(false); } catch (Exception ex6) { Plugin.LogError("Play button theme couldn't be applied:" + ex6.Message); } try { GameObject gameObject4 = ((Component)((Component)__instance.backbutton).transform.Find("button-full")).gameObject; ((Object)gameObject4).name = "BackButton"; GameObject val22 = Object.Instantiate(((Component)gameObject4.transform.GetChild(0)).gameObject, ((Component)__instance.backbutton).transform); foreach (Transform item3 in val22.transform) { Transform val23 = item3; ((Component)val23).gameObject.SetActive(false); } GameObject val24 = Object.Instantiate(val22, ((Component)__instance.backbutton).transform); ((Object)val24).name = "backBackground"; OverwriteGameObjectSpriteAndColor(val24, "BackBackground.png", Theme.colors.backButton.background); GameObject val25 = Object.Instantiate(val22, ((Component)__instance.backbutton).transform); ((Object)val25).name = "backOutline"; OverwriteGameObjectSpriteAndColor(val25, "BackOutline.png", Theme.colors.backButton.outline); Text component10 = ((Component)Object.Instantiate(((Component)__instance.backbutton).transform.GetChild(0).GetChild(2), ((Component)__instance.backbutton).transform)).GetComponent(); ((Object)component10).name = "backText"; ((Graphic)component10).color = Theme.colors.backButton.text; GameObject val26 = Object.Instantiate(val22, ((Component)__instance.backbutton).transform); ((Object)val26).name = "backShadow"; OverwriteGameObjectSpriteAndColor(val26, "BackShadow.png", Theme.colors.backButton.shadow); gameObject4.SetActive(false); val22.SetActive(false); } catch (Exception ex7) { Plugin.LogError("Back button theme couldn't be applied:" + ex7.Message); } try { ((Graphic)((Component)__instance.btnrandom.transform.Find("Text")).GetComponent()).color = Theme.colors.randomButton.text; ((Graphic)((Component)__instance.btnrandom.transform.Find("icon")).GetComponent()).color = Theme.colors.randomButton.text; ((Graphic)((Component)__instance.btnrandom.transform.Find("btn-shadow")).GetComponent()).color = Theme.colors.randomButton.shadow; GameObject val27 = Object.Instantiate(((Component)__instance.btnrandom.transform.Find("btn")).gameObject); RectTransform component11 = val27.GetComponent(); component11.anchoredPosition = Vector2.zero; ((Transform)component11).localScale = Vector3.one; ((Component)__instance.btnrandom.transform.Find("btn")).gameObject.SetActive(false); GameObject val28 = Object.Instantiate(val27, __instance.btnrandom.transform); ((Object)val28).name = "RandomBackground"; OverwriteGameObjectSpriteAndColor(val28, "RandomBackground.png", Theme.colors.randomButton.background); __instance.btnrandom.transform.Find("Text").SetParent(val28.transform); __instance.btnrandom.transform.Find("icon").SetParent(val28.transform); GameObject val29 = Object.Instantiate(val27, __instance.btnrandom.transform); val29.GetComponent().anchoredPosition = new Vector2(0f, -1f); ((Object)val29).name = "RandomOutline"; OverwriteGameObjectSpriteAndColor(val29, "RandomOutline.png", Theme.colors.randomButton.outline); Object.DestroyImmediate((Object)(object)__instance.btnrandom.GetComponent()); val27.SetActive(false); EventTrigger val30 = __instance.btnrandom.AddComponent(); Entry val31 = new Entry(); val31.eventID = (EventTriggerType)0; ((UnityEvent)(object)val31.callback).AddListener((UnityAction)delegate { OnPointerEnterRandomEvent(__instance); }); val30.triggers.Add(val31); Entry val32 = new Entry(); val32.eventID = (EventTriggerType)1; ((UnityEvent)(object)val32.callback).AddListener((UnityAction)delegate { OnPointerLeaveRandomEvent(__instance); }); val30.triggers.Add(val32); } catch (Exception ex8) { Plugin.LogError("Random button theme couldn't be applied:" + ex8.Message); } try { GameObject val33 = Object.Instantiate(((Component)__instance.pointerarrow).gameObject); OverwriteGameObjectSpriteAndColor(((Component)__instance.pointerarrow).gameObject, "pointerBG.png", Theme.colors.pointer.background); GameObject val34 = Object.Instantiate(val33, ((Component)__instance.pointerarrow).transform); ((Object)val34).name = "Shadow"; val34.GetComponent().anchoredPosition = Vector2.zero; OverwriteGameObjectSpriteAndColor(val34, "pointerShadow.png", Theme.colors.pointer.shadow); GameObject val35 = Object.Instantiate(val33, ((Component)__instance.pointerarrow).transform); ((Object)val35).name = "Outline"; val35.GetComponent().anchoredPosition = Vector2.zero; OverwriteGameObjectSpriteAndColor(val35, "pointerOutline.png", Theme.colors.pointer.outline); Object.DestroyImmediate((Object)(object)val33); } catch (Exception ex9) { Plugin.LogError("Pointer arrow theme couldn't be applied:" + ex9.Message); } try { ((Transform)__instance.bgdots.GetComponent()).eulerAngles = new Vector3(0f, 0f, 165.5f); ((Graphic)((Component)__instance.bgdots.transform.Find("Image")).GetComponent()).color = Theme.colors.background.dots; ((Graphic)((Component)__instance.bgdots.transform.Find("Image (1)")).GetComponent()).color = Theme.colors.background.dots; ((Graphic)((Component)__instance.bgdots2.transform.Find("Image")).GetComponent()).color = Theme.colors.background.dots2; GameObject val36 = Object.Instantiate(((Component)__instance.bgdots.transform.Find("Image")).gameObject, ((Component)__instance.bgdots.transform.Find("Image")).transform); val36.GetComponent().anchoredPosition = new Vector2(0f, -1010f); GameObject.Find("bgcamera").GetComponent().backgroundColor = Theme.colors.background.background; ((Graphic)GameObject.Find("BG Shape").GetComponent()).color = Theme.colors.background.shape; GameObject gameObject5 = GameObject.Find("MainCanvas").gameObject; ((Graphic)((Component)gameObject5.transform.Find("FullScreenPanel/bgdots_diamond")).GetComponent()).color = Theme.colors.background.diamond; } catch (Exception ex10) { Plugin.LogError("Background theme couldn't be applied:" + ex10.Message); } ((Graphic)songyear).color = Theme.colors.leaderboard.text; ((Graphic)songgenre).color = Theme.colors.leaderboard.text; ((Graphic)songduration).color = Theme.colors.leaderboard.text; ((Graphic)songcomposer).color = Theme.colors.leaderboard.text; ((Graphic)songtempo).color = Theme.colors.leaderboard.text; ((Graphic)songdesctext).color = Theme.colors.leaderboard.text; OnAdvanceSongsPostFix(__instance); } [HarmonyPatch(typeof(LevelSelectController), "hoverBtn")] [HarmonyPostfix] public static void OnHoverBtnPostfix(LevelSelectController __instance, int btnnum) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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) if (!Theme.isDefault) { if (btnnum >= 7) { ((Graphic)((Component)__instance.btnbgs[btnnum]).GetComponent()).color = Theme.colors.songButton.outline; return; } ((Graphic)((Component)__instance.btnbgs[btnnum]).GetComponent()).color = Theme.colors.songButton.background; ((Graphic)((Component)((Component)__instance.btnbgs[btnnum]).transform.Find("Outline")).GetComponent()).color = Theme.colors.songButton.outlineOver; ((Graphic)((Component)((Component)__instance.btnbgs[btnnum]).transform.parent.GetChild(2)).GetComponent()).color = Theme.colors.songButton.textOver; } } [HarmonyPatch(typeof(LevelSelectController), "unHoverBtn")] [HarmonyPostfix] public static void OnUnHoverBtnPostfix(LevelSelectController __instance, int btnnum) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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) if (!Theme.isDefault) { if (btnnum >= 7) { ((Graphic)((Component)__instance.btnbgs[btnnum]).GetComponent()).color = Theme.colors.songButton.background; return; } ((Graphic)((Component)__instance.btnbgs[btnnum]).GetComponent()).color = Theme.colors.songButton.background; ((Graphic)((Component)((Component)__instance.btnbgs[btnnum]).transform.Find("Outline")).GetComponent()).color = Theme.colors.songButton.outline; ((Graphic)((Component)((Component)__instance.btnbgs[btnnum]).transform.parent.GetChild(2)).GetComponent()).color = Theme.colors.songButton.text; } } [HarmonyPatch(typeof(LevelSelectController), "hoverPlay")] [HarmonyPrefix] public static bool OnHoverPlayBypassIfThemeNotDefault(LevelSelectController __instance) { //IL_003e: 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) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) if (Theme.isDefault) { return true; } _btnClickSfx.Play(); __instance.playhovering = true; ((Graphic)((Component)__instance.playbtnobj.transform.Find("playBackground")).GetComponent()).color = Theme.colors.playButton.backgroundOver; ((Graphic)((Component)__instance.playbtnobj.transform.Find("playOutline")).GetComponent()).color = Theme.colors.playButton.outlineOver; ((Graphic)((Component)__instance.playbtnobj.transform.Find("txt-play/txt-play-front")).GetComponent()).color = Theme.colors.playButton.textOver; ((Graphic)((Component)__instance.playbtnobj.transform.Find("playShadow")).GetComponent()).color = Theme.colors.playButton.shadowOver; return false; } [HarmonyPatch(typeof(LevelSelectController), "unHoverPlay")] [HarmonyPrefix] public static bool OnUnHoverPlayBypassIfThemeNotDefault(LevelSelectController __instance) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_00be: Unknown result type (might be due to invalid IL or missing references) if (Theme.isDefault) { return true; } __instance.playhovering = false; ((Graphic)((Component)__instance.playbtnobj.transform.Find("playBackground")).GetComponent()).color = Theme.colors.playButton.background; ((Graphic)((Component)__instance.playbtnobj.transform.Find("playOutline")).GetComponent()).color = Theme.colors.playButton.outline; ((Graphic)((Component)__instance.playbtnobj.transform.Find("txt-play/txt-play-front")).GetComponent()).color = Theme.colors.playButton.text; ((Graphic)((Component)__instance.playbtnobj.transform.Find("playShadow")).GetComponent()).color = Theme.colors.playButton.shadow; return false; } [HarmonyPatch(typeof(BackButtonController), "onHover")] [HarmonyPrefix] public static bool OnHoverBackBypassIfThemeNotDefault(BackButtonController __instance, bool hovering) { //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0193: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) if (Theme.isDefault || ((Object)((Component)__instance).gameObject).name == "BackButtonNew") { return true; } __instance.txt_back = ((Component)((Component)__instance).gameObject.transform.Find("backText")).GetComponent(); if (hovering) { _btnClickSfx.Play(); ((Graphic)((Component)((Component)__instance).gameObject.transform.Find("backBackground")).GetComponent()).color = Theme.colors.backButton.backgroundOver; ((Graphic)((Component)((Component)__instance).gameObject.transform.Find("backOutline")).GetComponent()).color = Theme.colors.backButton.outlineOver; ((Graphic)__instance.txt_back).color = Theme.colors.backButton.textOver; ((Graphic)((Component)((Component)__instance).gameObject.transform.Find("backShadow")).GetComponent()).color = Theme.colors.backButton.shadowOver; } else { ((Graphic)((Component)((Component)__instance).gameObject.transform.Find("backBackground")).GetComponent()).color = Theme.colors.backButton.background; ((Graphic)((Component)((Component)__instance).gameObject.transform.Find("backOutline")).GetComponent()).color = Theme.colors.backButton.outline; ((Graphic)__instance.txt_back).color = Theme.colors.backButton.text; ((Graphic)((Component)((Component)__instance).gameObject.transform.Find("backShadow")).GetComponent()).color = Theme.colors.backButton.shadow; } return false; } public static void OnPointerEnterRandomEvent(LevelSelectController __instance) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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) __instance.hoversfx.Play(); ((Graphic)((Component)__instance.btnrandom.transform.Find("RandomBackground")).GetComponent()).color = Theme.colors.randomButton.backgroundOver; ((Graphic)((Component)__instance.btnrandom.transform.Find("RandomOutline")).GetComponent()).color = Theme.colors.randomButton.outlineOver; ((Graphic)((Component)__instance.btnrandom.transform.Find("RandomBackground/icon")).GetComponent()).color = Theme.colors.randomButton.textOver; ((Graphic)((Component)__instance.btnrandom.transform.Find("RandomBackground/Text")).GetComponent()).color = Theme.colors.randomButton.textOver; ((Graphic)((Component)__instance.btnrandom.transform.Find("btn-shadow")).GetComponent()).color = Theme.colors.randomButton.shadowOver; } public static void OnPointerLeaveRandomEvent(LevelSelectController __instance) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) ((Graphic)((Component)__instance.btnrandom.transform.Find("RandomBackground")).GetComponent()).color = Theme.colors.randomButton.background; ((Graphic)((Component)__instance.btnrandom.transform.Find("RandomOutline")).GetComponent()).color = Theme.colors.randomButton.outline; ((Graphic)((Component)__instance.btnrandom.transform.Find("RandomBackground/icon")).GetComponent()).color = Theme.colors.randomButton.text; ((Graphic)((Component)__instance.btnrandom.transform.Find("RandomBackground/Text")).GetComponent()).color = Theme.colors.randomButton.text; ((Graphic)((Component)__instance.btnrandom.transform.Find("btn-shadow")).GetComponent()).color = Theme.colors.randomButton.shadow; } [HarmonyPatch(typeof(LevelSelectController), "advanceSongs")] [HarmonyPostfix] public static void OnAdvanceSongsPostFix(LevelSelectController __instance) { //IL_004d: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < (Theme.isDefault ? __instance.alltrackslist[__instance.songindex].difficulty : 10); i++) { if (!Theme.isDefault) { ((Graphic)__instance.diffstars[i]).color = Color.Lerp(Theme.colors.diffStar.gradientStart, Theme.colors.diffStar.gradientEnd, (float)i / 9f); } else { ((Graphic)__instance.diffstars[i]).color = Color.white; } } if (!Theme.isDefault && !((Object)(object)songyear == (Object)null)) { songyear.text = __instance.songyear.text; songgenre.text = __instance.songgenre.text; songduration.text = __instance.songduration.text; songcomposer.text = __instance.songcomposer.text; songtempo.text = __instance.songtempo.text; songdesctext.text = __instance.songdesctext.text; } } [HarmonyPatch(typeof(LevelSelectController), "sortTracks")] [HarmonyPostfix] public static void OnSortTracksPostFix(LevelSelectController __instance) { OnAdvanceSongsPostFix(__instance); } [HarmonyPatch(typeof(WaveController), "Start")] [HarmonyPostfix] public static void WaveControllerFuckeryOverwrite(WaveController __instance) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (!Theme.isDefault) { SpriteRenderer[] wavesprites = __instance.wavesprites; foreach (SpriteRenderer val in wavesprites) { val.color = ((((Object)((Component)__instance).gameObject).name == "BGWave") ? Theme.colors.background.waves : Theme.colors.background.waves2); } } } public static void OverwriteGameObjectSpriteAndColor(GameObject gameObject, string spriteName, Color spriteColor) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) Image component = gameObject.GetComponent(); component.useSpriteMesh = true; component.sprite = AssetManager.GetSprite(spriteName); ((Graphic)component).color = spriteColor; } } public static class PluginInfo { public const string PLUGIN_GUID = "TootTallyCore"; public const string PLUGIN_NAME = "TootTallyCore"; public const string PLUGIN_VERSION = "1.3.10"; } } namespace TootTallyCore.Utils.TootTallyNotifs { public class TootTallyNotif : MonoBehaviour { private TMP_Text _textHolder; private string _text; private Color _textColor; private RectTransform _rectTransform; private Vector2 _endPosition; private float _lifespan; private CanvasGroup _canvasGroup; private SecondDegreeDynamicsAnimation _secondOrderDynamic; private bool _isDiposed; public string GetText => _text; public void SetText(string text) { _text = text; if ((Object)(object)_textHolder != (Object)null) { _textHolder.text = text; } } public void SetTextSize(int size) { _textHolder.fontSize = size; } public void SetTextAlign(TextAlignmentOptions textAnchor) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) _textHolder.alignment = textAnchor; } public void SetTextColor(Color color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) _textColor = color; } public void Initialize(float lifespan, Vector2 endPosition) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) _isDiposed = false; _rectTransform = ((Component)this).gameObject.GetComponent(); _secondOrderDynamic = new SecondDegreeDynamicsAnimation(1.4f, 0.85f, 0.75f); SetTransitionToNewPosition(endPosition); _textHolder = ((Component)((Component)this).gameObject.transform.Find("NotifText")).gameObject.GetComponent(); ((Component)_textHolder).GetComponent().sizeDelta = _rectTransform.sizeDelta - Vector2.one * 20f; RectTransform component = ((Component)_textHolder).GetComponent(); component.anchoredPosition += new Vector2(1f, -1f) * 10f; _textHolder.text = _text; ((Graphic)_textHolder).color = _textColor; _canvasGroup = ((Component)this).gameObject.AddComponent(); _lifespan = lifespan; } public void Initialize(float lifespan, Vector2 endPosition, Vector2 textRectSize) { //IL_0033: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_00ac: Unknown result type (might be due to invalid IL or missing references) _isDiposed = false; _rectTransform = ((Component)this).gameObject.GetComponent(); _secondOrderDynamic = new SecondDegreeDynamicsAnimation(1.4f, 0.85f, 0.75f); SetTransitionToNewPosition(endPosition); _textHolder = ((Component)((Component)this).gameObject.transform.Find("NotifText")).gameObject.GetComponent(); ((Component)_textHolder).GetComponent().sizeDelta = textRectSize; ((Component)_textHolder).GetComponent().anchoredPosition = new Vector2(0.5f, 0f) * textRectSize; _textHolder.text = _text; ((Graphic)_textHolder).color = _textColor; _canvasGroup = ((Component)this).gameObject.AddComponent(); _lifespan = lifespan; ((Component)this).gameObject.SetActive(true); } public void Initialize(float lifespan, Vector2 endPosition, Vector2 textRectSize, Vector2 textPosition) { //IL_0033: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) _isDiposed = false; _rectTransform = ((Component)this).gameObject.GetComponent(); _secondOrderDynamic = new SecondDegreeDynamicsAnimation(1.4f, 0.85f, 0.75f); SetTransitionToNewPosition(endPosition); _textHolder = ((Component)((Component)this).gameObject.transform.Find("NotifText")).gameObject.GetComponent(); ((Component)_textHolder).GetComponent().sizeDelta = textRectSize; ((Component)_textHolder).GetComponent().anchoredPosition = textPosition; _textHolder.text = _text; ((Graphic)_textHolder).color = _textColor; _canvasGroup = ((Component)this).gameObject.AddComponent(); _lifespan = lifespan; ((Component)this).gameObject.SetActive(true); } public void SetTransitionConstants(float f, float z, float r) { _secondOrderDynamic.SetConstants(f, z, r); } public void SetTransitionToNewPosition(Vector2 endPosition) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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) _secondOrderDynamic.SetStartVector(Vector2.op_Implicit(_rectTransform.anchoredPosition)); _endPosition = endPosition; } public void Update() { //IL_0017: 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_0036: 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_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) if (!_isDiposed) { if (_secondOrderDynamic != null && _rectTransform.anchoredPosition != _endPosition) { _rectTransform.anchoredPosition = Vector2.op_Implicit(_secondOrderDynamic.GetNewVector(Vector2.op_Implicit(_endPosition), Time.deltaTime)); } _lifespan -= Time.deltaTime; if (_lifespan / 1.75f <= 1f) { _canvasGroup.alpha = EasingHelper.EaseIn(_lifespan / 1.25f); } if (_lifespan < 0f) { Dispose(); } } } public void Dispose() { if (!_isDiposed) { _isDiposed = true; TootTallyNotifManager.QueueToRemovedFromList(this); } } } public class TootTallyNotifManager : MonoBehaviour { private class TootTallyNotifData { public string message { get; set; } public Color textColor { get; set; } public float lifespan { get; set; } public TootTallyNotifData(string message, Color textColor, float lifespan) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) this.message = message; this.textColor = textColor; this.lifespan = lifespan; } } private static List _activeNotificationList; private static List _toRemoveNotificationList; private static ConcurrentQueue _pendingNotifications; private static GameObject _notifCanvas; private static bool IsInitialized; private void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (!IsInitialized) { _notifCanvas = new GameObject("NotifCanvas"); Canvas val = _notifCanvas.AddComponent(); val.renderMode = (RenderMode)0; val.overrideSorting = true; val.sortingOrder = 1; CanvasScaler val2 = _notifCanvas.AddComponent(); val2.referenceResolution = new Vector2(1920f, 1080f); val2.uiScaleMode = (ScaleMode)1; Object.DontDestroyOnLoad((Object)(object)_notifCanvas); _pendingNotifications = new ConcurrentQueue(); _activeNotificationList = new List(); _toRemoveNotificationList = new List(); IsInitialized = true; } } private static void DisplayNotif(string message, Color textColor, float lifespan) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (IsInitialized && Plugin.Instance.ShouldShowNotifs.Value) { _pendingNotifications.Enqueue(new TootTallyNotifData(message, textColor, lifespan)); } } private static TootTallyNotif DisplayNotif(string message, Color textColor) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!IsInitialized || !Plugin.Instance.ShouldShowNotifs.Value) { return null; } TootTallyNotif tootTallyNotif = GameObjectFactory.CreateNotif(_notifCanvas.transform, "Notification", message, textColor); tootTallyNotif.Initialize(float.MaxValue, new Vector2(695f, -400f)); ((Component)tootTallyNotif).gameObject.SetActive(true); _activeNotificationList.Add(tootTallyNotif); OnNotifCountChangeSetNewPosition(); return tootTallyNotif; } public static TootTallyNotif ManualNotif(string message, Color textColor) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return DisplayNotif(message, textColor); } public static void DisplayNotif(string message, float lifespan = 6f) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) DisplayNotif(message, Theme.colors.notification.defaultText, lifespan); } public static void DisplayWarning(string message, float lifespan = 6f) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) DisplayNotif(message, Theme.colors.notification.warningText, lifespan); } public static void DisplayError(string message, float lifespan = 6f) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) DisplayNotif(message, Theme.colors.notification.errorText, lifespan); } public static void DisplayCustom(string message, Color textColor, float lifespan = 6f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) DisplayNotif(message, textColor, lifespan); } private static void OnNotifCountChangeSetNewPosition() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) int num = 0; for (int num2 = _activeNotificationList.Count - 1; num2 >= 0; num2--) { _activeNotificationList[num2].SetTransitionToNewPosition(new Vector2(695f, (float)(-400 + 215 * num))); num++; } } private void Update() { //IL_0040: 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) if (!IsInitialized) { return; } TootTallyNotifData result; while (_pendingNotifications != null && _pendingNotifications.Count > 0 && _pendingNotifications.TryDequeue(out result)) { TootTallyNotif tootTallyNotif = GameObjectFactory.CreateNotif(_notifCanvas.transform, "Notification", result.message, result.textColor); tootTallyNotif.Initialize(result.lifespan, new Vector2(695f, -400f)); ((Component)tootTallyNotif).gameObject.SetActive(true); _activeNotificationList.Add(tootTallyNotif); OnNotifCountChangeSetNewPosition(); } _activeNotificationList?.ForEach(delegate(TootTallyNotif notif) { notif.Update(); }); if (_toRemoveNotificationList == null || _toRemoveNotificationList.Count <= 0) { return; } foreach (TootTallyNotif toRemoveNotification in _toRemoveNotificationList) { _activeNotificationList.Remove(toRemoveNotification); Object.Destroy((Object)(object)((Component)toRemoveNotification).gameObject); } OnNotifCountChangeSetNewPosition(); _toRemoveNotificationList.Clear(); } public static void QueueToRemovedFromList(TootTallyNotif notif) { _toRemoveNotificationList.Add(notif); } } } namespace TootTallyCore.Utils.TootTallyModules { public interface ITootTallyModule { string Name { get; set; } bool IsConfigInitialized { get; set; } ConfigEntry ModuleConfigEnabled { get; set; } void LoadModule(); void UnloadModule(); } public static class TootTallyModuleManager { private static List _tootTallyModuleList; public static void AddModule(ITootTallyModule module) { if (_tootTallyModuleList == null) { _tootTallyModuleList = new List(); } _tootTallyModuleList.Add(module); if (!module.IsConfigInitialized) { module.ModuleConfigEnabled.SettingChanged += delegate { ModuleConfigEnabled_SettingChanged(module); }; module.IsConfigInitialized = true; } } public static void LoadModules() { _tootTallyModuleList?.ForEach(delegate(ITootTallyModule m) { try { if (m.ModuleConfigEnabled.Value) { m.LoadModule(); } } catch (Exception ex) { Plugin.LogError("Module " + m.Name + " couldn't be loaded."); Plugin.LogException(ex); } }); } private static void ModuleConfigEnabled_SettingChanged(ITootTallyModule module) { try { if (module.ModuleConfigEnabled.Value) { module.LoadModule(); TootTallyNotifManager.DisplayNotif("Module " + module.Name + " Enabled."); } else { module.UnloadModule(); TootTallyNotifManager.DisplayNotif("Module " + module.Name + " Disabled."); } } catch (Exception ex) { Plugin.LogError("Module " + module.Name + " couldn't be un/loaded."); Plugin.LogException(ex); } } } } namespace TootTallyCore.Utils.TootTallyGlobals { public static class TootTallyGlobalVariables { public static float gameSpeedMultiplier = 1f; public static bool wasReplaying = false; public static bool usedAutotoot = false; public static bool isReplaying = false; public static bool isOldReplay = false; public static bool isSpectating = false; public static bool isPracticing = false; public static bool isTournamentHosting = false; public static bool isPlayingMultiplayer = false; public static bool allowSubmit = true; } public static class TootTallyPatches { private static float _releaseThreshold; private static double _songTime; private static float _songLength; private static bool _startSongTime; private static bool IsGCEnabled => (int)GarbageCollector.GCMode == 1; [HarmonyPatch(typeof(GameController), "buildNotes")] [HarmonyPrefix] public static void FixAudioLatency(GameController __instance) { if (GlobalVariables.practicemode == 1f && !GlobalVariables.turbomode) { float num = ((TootTallyGlobalVariables.gameSpeedMultiplier != 1f) ? ((float)GlobalVariables.localsettings.latencyadjust * 0.001f * TootTallyGlobalVariables.gameSpeedMultiplier) : (((float)GlobalVariables.localsettings.latencyadjust + Plugin.Instance.OffsetAtDefaultSpeed.Value) * 0.001f)); Plugin.LogInfo($"Fixed audio latency from: {__instance.latency_offset} to {num}"); __instance.latency_offset = num; } } [HarmonyPatch(typeof(HomeController), "doFastScreenShake")] [HarmonyPrefix] private static bool RemoveTheGodDamnShake() { return false; } [HarmonyPatch(typeof(GameController), "Start")] [HarmonyPrefix] public static void GameControllerPrefixPatch(GameController __instance) { _releaseThreshold = __instance.release_threshold; if (GlobalVariables.turbomode) { TootTallyGlobalVariables.gameSpeedMultiplier = 2f; } else if (GlobalVariables.practicemode != 1f) { TootTallyGlobalVariables.gameSpeedMultiplier = GlobalVariables.practicemode; } } [HarmonyPatch(typeof(GameController), "Start")] [HarmonyPostfix] public static void GameControllerPostfixPatch(GameController __instance) { if (__instance.freeplay) { TootTallyGlobalVariables.gameSpeedMultiplier = (__instance.smooth_scrolling_move_mult = 1f); } } [HarmonyPatch(typeof(BGController), "setUpBGControllerRefsDelayed")] [HarmonyPostfix] public static void OnSetUpBGControllerRefsDelayedPostFix(BGController __instance) { VideoPlayer val = null; try { GameObject gameObject = GameObject.Find("BGCameraObj").gameObject; val = gameObject.GetComponentInChildren(); } catch (Exception ex) { Plugin.LogWarning(ex.ToString()); Plugin.LogWarning("Couldn't find VideoPlayer in background"); } if ((Object)(object)val != (Object)null) { val.playbackSpeed = TootTallyGlobalVariables.gameSpeedMultiplier; } if (TootTallyGlobalVariables.gameSpeedMultiplier != 1f) { OnGameControllerReadySetGameSpeed(__instance.gamecontroller, TootTallyGlobalVariables.gameSpeedMultiplier); Plugin.LogInfo("GameSpeed set to " + TootTallyGlobalVariables.gameSpeedMultiplier); SetGCTotalTrackTimeString(__instance.gamecontroller); } } [HarmonyPatch(typeof(GameController), "fixAudioMixerStuff")] [HarmonyPrefix] public static bool OnFixAudioMixerStuffPostFix(GameController __instance) { if (!Plugin.Instance.ChangePitch.Value) { Plugin.LogInfo("Changed audmix to pitchshifted mixer"); __instance.musictrack.outputAudioMixerGroup = __instance.audmix_bgmus_pitchshifted; __instance.musictrack.volume = GlobalVariables.localsettings.maxvolume_music * ((TootTallyGlobalVariables.gameSpeedMultiplier == 1f) ? 0.75f : 1f); __instance.audmix.SetFloat("pitchShifterMult", 1f / TootTallyGlobalVariables.gameSpeedMultiplier); __instance.audmix.SetFloat("mastervol", Mathf.Log10(GlobalVariables.localsettings.maxvolume) * 40f); __instance.audmix.SetFloat("trombvol", Mathf.Log10(GlobalVariables.localsettings.maxvolume_tromb) * 60f + 12f); __instance.audmix.SetFloat("airhornvol", (GlobalVariables.localsettings.maxvolume_airhorn - 1f) * 80f); return false; } return true; } [HarmonyPatch(typeof(GameController), "startDance")] [HarmonyPostfix] public static void OnGameControllerStartDanceFixSpeedBackup(GameController __instance) { if (__instance.musictrack.pitch != TootTallyGlobalVariables.gameSpeedMultiplier) { OnGameControllerReadySetGameSpeed(__instance, TootTallyGlobalVariables.gameSpeedMultiplier); Plugin.LogInfo("BACKUP: GameSpeed set to " + TootTallyGlobalVariables.gameSpeedMultiplier); SetGCTotalTrackTimeString(__instance); } } public static void SetCurrentSongTime(float time) { if (!(time < 0f) && !(time > _songLength)) { _songTime = time; } } [HarmonyPatch(typeof(GameController), "Update")] [HarmonyPostfix] public static void OnGameControllerUpdateFixPitchAndBreathing(GameController __instance) { if (_startSongTime && !__instance.paused && !__instance.quitting && !__instance.retrying && !__instance.freeplay && !TootTallyGlobalVariables.isTournamentHosting) { _songTime += Time.deltaTime * TootTallyGlobalVariables.gameSpeedMultiplier; if (!__instance.level_finished && !__instance.musictrack.isPlaying && _songTime >= (double)_songLength) { Plugin.LogInfo("Toottally forced level_finished to prevent softlock."); __instance.levelendtime = 0.001f; __instance.musictrack.time = 0.01f; __instance.level_finished = true; __instance.curtainc.closeCurtain(true); if (__instance.totalscore < 0) { __instance.totalscore = 0; } GlobalVariables.gameplay_scoretotal = __instance.totalscore; if (GlobalVariables.localsettings.acc_autotoot) { __instance.maxlevelscore = Mathf.FloorToInt((float)__instance.maxlevelscore * 0.5f); } GlobalVariables.gameplay_scoreperc = __instance.totalscore / __instance.maxlevelscore; GlobalVariables.gameplay_notescores = new int[5] { __instance.scores_F, __instance.scores_D, __instance.scores_C, __instance.scores_B, __instance.scores_A }; } } float num = 0f; if (!__instance.noteplaying && __instance.breathcounter >= 0f) { num = (__instance.outofbreath ? (Time.deltaTime * (1f - TootTallyGlobalVariables.gameSpeedMultiplier) * 0.29f) : (Time.deltaTime * (1f - TootTallyGlobalVariables.gameSpeedMultiplier) * 8.5f)); } __instance.breathcounter += num; if (__instance.breathcounter >= 1f) { __instance.breathcounter = 0.99f; } if (__instance.outofbreath && __instance.breathcounter < 0f) { __instance.breathcounter = 0.01f; } if (__instance.noteplaying && Plugin.Instance.ChangePitch.Value) { AudioSource currentnotesound = __instance.currentnotesound; currentnotesound.pitch *= TootTallyGlobalVariables.gameSpeedMultiplier; } } [HarmonyPatch(typeof(GameController), "Start")] [HarmonyPostfix] private static void OnGameControllerStartSetupTimer(GameController __instance) { _startSongTime = false; if (!((Object)(object)__instance == (Object)null) && !__instance.freeplay && !((Object)(object)__instance.musictrack == (Object)null) && !((Object)(object)__instance.musictrack.clip == (Object)null)) { _songLength = __instance.musictrack.clip.length; _songTime = 0.0; } } [HarmonyPatch(typeof(GameController), "playsong")] [HarmonyPostfix] public static void OnGameControllerStartSongStartSongTime(GameController __instance) { if (!__instance.freeplay && !TootTallyGlobalVariables.isSpectating) { Plugin.LogInfo("Starting song time."); _songLength = __instance.musictrack.clip.length; _startSongTime = true; } } [HarmonyPatch(typeof(GameController), "updateTimeCounter")] [HarmonyPostfix] public static void OnUpdateTimeCounterSetTimeElapsedString(float elapsedtime, GameController __instance) { if (!__instance.freeplay) { elapsedtime /= TootTallyGlobalVariables.gameSpeedMultiplier; float num = Mathf.Floor(elapsedtime * (1f / 60f)); int num2 = (int)elapsedtime - (int)num * 60; string text = num2.ToString(); if (num2 < 10) { text = "0" + text; } __instance.timeelapsed_shad.text = $"{num}:{text} / {__instance.totaltracktimestring}"; __instance.timeelapsed.text = $"{num}:{text} / {__instance.totaltracktimestring}"; } } [HarmonyPatch(typeof(GameController), "Start")] [HarmonyPostfix] public static void OnGameControllerStartSetTitleWithSpeed(GameController __instance) { if (TootTallyGlobalVariables.gameSpeedMultiplier != 1f && !__instance.freeplay) { string text = $" [{TootTallyGlobalVariables.gameSpeedMultiplier:0.00}x]"; Text songtitle = __instance.songtitle; Text songtitleshadow = __instance.songtitleshadow; string text2 = (songtitleshadow.text += text); songtitle.text = text2; } } private static void OnGameControllerReadySetGameSpeed(GameController __instance, float speed) { __instance.smooth_scrolling_move_mult = speed; __instance.musictrack.pitch = speed; __instance.breathmultiplier = speed; __instance.release_threshold = _releaseThreshold * speed; } public static void SetGCTotalTrackTimeString(GameController __instance) { if (!__instance.freeplay) { float num = __instance.levelendtime / TootTallyGlobalVariables.gameSpeedMultiplier; float num2 = Mathf.Floor(num / 60f); int num3 = (int)num - (int)num2 * 60; string text = num3.ToString(); if (num3 < 10) { text = "0" + text; } __instance.totaltracktimestring = $"{num2}:{text}"; } } [HarmonyPatch(typeof(GameController), "Start")] [HarmonyPostfix] private static void DisableGarbageCollector(GameController __instance) { if (!Plugin.Instance.RunGCWhilePlaying.Value && IsGCEnabled) { GarbageCollector.GCMode = (Mode)0; } } [HarmonyPatch(typeof(PauseCanvasController), "showPausePanel")] [HarmonyPostfix] private static void EnableGarbageCollectorOnPause() { if (!Plugin.Instance.RunGCWhilePlaying.Value && !IsGCEnabled) { GarbageCollector.GCMode = (Mode)1; } } [HarmonyPatch(typeof(GameController), "resumeTrack")] [HarmonyPostfix] private static void DisableGarbageCollectorOnResumeTrack() { if (!Plugin.Instance.RunGCWhilePlaying.Value && IsGCEnabled) { GarbageCollector.GCMode = (Mode)0; } } [HarmonyPatch(typeof(LevelSelectController), "Start")] [HarmonyPostfix] private static void EnableGarbageCollectorOnLevelSelectEnter() { if (!Plugin.Instance.RunGCWhilePlaying.Value && !IsGCEnabled) { GarbageCollector.GCMode = (Mode)1; } } [HarmonyPatch(typeof(PlaytestAnims), "Start")] [HarmonyPostfix] private static void EnableGarbageCollectorOnMultiplayerEnter() { if (!Plugin.Instance.RunGCWhilePlaying.Value && !IsGCEnabled) { GarbageCollector.GCMode = (Mode)1; } } } } namespace TootTallyCore.Utils.Steam { public class SteamAuthTicketHandler { private Callback _callback; private Dictionary _activeRequests; public SteamAuthTicketHandler() { _callback = Callback.Create((DispatchDelegate)OnSteamAuthTicketResponse); _activeRequests = new Dictionary(); } private void OnSteamAuthTicketResponse(GetTicketForWebApiResponse_t pCallback) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 //IL_0048: 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_0025: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (_activeRequests.Remove(pCallback.m_hAuthTicket, out var value)) { if ((int)pCallback.m_eResult != 1) { value.OnFailure(new TicketRequestException($"Unable to get Steam auth ticket (code {pCallback.m_eResult})", pCallback.m_eResult)); return; } Span bytes = new Span(pCallback.m_rgubTicket, 0, pCallback.m_cubTicket); string ticket = HexConverter.ToHexString(bytes); value.OnSuccess(ticket); } } public TicketRequest RequestTicket() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (!SteamManager.Initialized) { throw new InvalidOperationException("Can't request ticket as Steam hasn't been initialized!"); } HAuthTicket authTicketForWebApi = SteamUser.GetAuthTicketForWebApi("TootTally"); return _activeRequests[authTicketForWebApi] = new TicketRequest(); } } public class TicketRequest : CustomYieldInstruction { public string Result { get; private set; } public Exception Exception { get; private set; } public override bool keepWaiting { get { if (Result == null) { return Exception == null; } return false; } } internal TicketRequest() { } internal void OnSuccess(string ticket) { Result = ticket; } internal void OnFailure(Exception exn) { Exception = exn; } } public class TicketRequestException : Exception { public EResult Code { get; } internal TicketRequestException(string message, EResult code) : base(message) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Code = code; } } } namespace TootTallyCore.Utils.SoundEffects { public static class SoundEffectsManager { private static AudioSource _soundPlayer; private static AudioClip _btnHover; private static AudioClip _btnClick; public static void Initialize(HomeController __instance) { _soundPlayer = Object.Instantiate(__instance.sfxhoverobj); ((Object)_soundPlayer).name = "TootTallySoundPlayer"; _soundPlayer.volume = 0.5f; _btnHover = __instance.allsfx[2]; _btnClick = __instance.allsfx[4]; Object.DontDestroyOnLoad((Object)(object)_soundPlayer); } public static void PlayerBtnHover() { if (!((Object)(object)_btnHover == (Object)null)) { _soundPlayer.clip = _btnHover; _soundPlayer.Play(); } } public static void PlayerBtnClick() { if (!((Object)(object)_btnClick == (Object)null)) { _soundPlayer.clip = _btnClick; _soundPlayer.Play(); } } } } namespace TootTallyCore.Utils.Helpers { public static class EasingHelper { public static float Lerp(float firstFloat, float secondFloat, float by) { return firstFloat + (secondFloat - firstFloat) * by; } public static Vector2 Lerp(Vector2 firstVector, Vector2 secondVector, float by) { //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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) return new Vector2(Lerp(firstVector.x, secondVector.x, by), Lerp(firstVector.y, secondVector.y, by)); } public static float EaseIn(float by) { return by * by; } public static float EaseOut(float by) { return 1f - EaseIn(1f - by); } public static float EaseInAndOut(float by) { if ((double)by < 0.5) { return EaseIn(by * 2f) / 2f; } return 1f - EaseIn((1f - by) * 2f) / 2f; } } public static class FileHelper { public class FileData { public long size; public string extension; } public static readonly string FILE_PATH_TOOTTALLY_APPDATA = Path.Combine(Application.persistentDataPath, "TootTally"); private static readonly string[] SizeSuffixes = new string[9] { "b", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" }; private const string _DOWNLOAD_MIRROR_LINK = "https://sgp1.digitaloceanspaces.com/toottally/chartmirrors/"; private const string _DISCORD_DOWNLOAD_HEADER = "https://cdn.discordapp.com/"; private const string _GOOGLEDRIVE_LINK_HEADER = "https://drive.google.com/file/d/"; private const string _GOOGLEDRIVE_DOWNLOAD_HEADER = "https://drive.google.com/uc?export=download&id="; private const string _PIXELDRAIN_DOWNLOAD_HEADER = "https://pixeldrain.com/u/"; private const string _PIXELDRAIN_DIRECT_DOWNLOAD_HEADER = "https://pixeldrain.com/api/file/"; private const string _TROMBONEDB_DIRECT_DOWNLOAD_HEADER = "https://db.trombone.fyi/"; public static T LoadFromTootTallyAppData(string fileName) { string text = Path.Combine(FILE_PATH_TOOTTALLY_APPDATA, fileName); if (!File.Exists(text)) { Plugin.LogError("File " + text + " doesnt exist."); return default(T); } try { return JsonConvert.DeserializeObject(File.ReadAllText(text)); } catch (Exception ex) { Plugin.LogError("Couldn't deserialize object: " + ex.Message + " - " + ex.StackTrace); } return default(T); } public static void SaveToTootTallyAppData(string fileName, T obj, bool saveToBackupIfExists = false) { string text = Path.Combine(FILE_PATH_TOOTTALLY_APPDATA, fileName); try { string contents = JsonConvert.SerializeObject((object)obj); if (File.Exists(text) && saveToBackupIfExists) { if (File.Exists(text + ".old")) { File.Delete(text + ".old"); } File.Move(text, text + ".old"); } File.WriteAllText(text, contents); } catch (Exception ex) { Plugin.LogError("Couldn't serialize object: " + ex.Message + " - " + ex.StackTrace); } } public static void TryMigrateFolder(string sourceFolderPath, string targetFolderPath, bool renameToOldIfAlreadyExists) { TryMigrateFolder(sourceFolderPath, targetFolderPath); } public static void TryMigrateFolder(string sourceFolderPath, string targetFolderPath) { if (!Directory.Exists(sourceFolderPath)) { return; } string[] directories = Directory.GetDirectories(sourceFolderPath); string[] files = Directory.GetFiles(sourceFolderPath); if (!Directory.Exists(targetFolderPath)) { Directory.CreateDirectory(targetFolderPath); } string[] array = directories; foreach (string text in array) { string text2 = Path.Combine(targetFolderPath, Path.GetFileNameWithoutExtension(text)); if (!Directory.Exists(text2)) { Plugin.LogInfo("Move new folder " + text2); Directory.Move(text, text2); } } string[] array2 = files; foreach (string text3 in array2) { string text4 = Path.Combine(targetFolderPath, Path.GetFileName(text3)); if (!File.Exists(text4)) { Plugin.LogInfo("Moving file " + text4); File.Move(text3, text4); } } Plugin.LogInfo("Deleting source folder " + sourceFolderPath); Directory.Delete(sourceFolderPath, recursive: true); } public static void WriteJsonToFile(string dirName, string fileName, string jsonString) { try { Plugin.LogDebug("Creating MemoryStream Buffer for replay creation."); using MemoryStream memoryStream = new MemoryStream(); Plugin.LogDebug("Creating ZipArchive for replay creation."); using (ZipArchive zipArchive = new ZipArchive(memoryStream, ZipArchiveMode.Create, leaveOpen: true, Encoding.UTF8)) { ZipArchiveEntry zipArchiveEntry = zipArchive.CreateEntry(fileName); Plugin.LogDebug("Writing Zipped replay to MemoryStream Buffer."); using Stream stream = zipArchiveEntry.Open(); using StreamWriter streamWriter = new StreamWriter(stream); streamWriter.Write(jsonString); } Plugin.LogDebug("Writing MemoryStream to File."); using FileStream destination = new FileStream(dirName + fileName, FileMode.CreateNew); memoryStream.Seek(0L, SeekOrigin.Begin); memoryStream.CopyTo(destination); } catch (Exception ex) { Plugin.LogError(ex.Message); } } public static string ReadJsonFromFile(string dirName, string fileName) { try { string result; using (MemoryStream memoryStream = new MemoryStream()) { using (FileStream fileStream = new FileStream(dirName + fileName, FileMode.Open)) { fileStream.CopyTo(memoryStream); } using ZipArchive zipArchive = new ZipArchive(memoryStream, ZipArchiveMode.Read, leaveOpen: true); ZipArchiveEntry entry = zipArchive.GetEntry(zipArchive.Entries[0].Name); using Stream stream = entry.Open(); using StreamReader streamReader = new StreamReader(stream); result = streamReader.ReadToEnd(); } return result; } catch (Exception ex) { Plugin.LogError(ex.Message); return null; } } public static void WriteBytesToFile(string dirName, string fileName, byte[] bytes) { if (!File.Exists(dirName + fileName)) { File.Create(dirName + fileName).Close(); File.WriteAllBytes(dirName + fileName, bytes); } } public static void ExtractZipToDirectory(string source, string destination) { if (File.Exists(source)) { ZipFile.ExtractToDirectory(source, destination, overwriteFiles: true); } } public static void DeleteFile(string dirName, string fileName) { if (File.Exists(dirName + fileName)) { File.Delete(dirName + fileName); } } public static string SizeSuffix(long value, int decimalPlaces = 1) { if (decimalPlaces < 0) { throw new ArgumentOutOfRangeException("decimalPlaces"); } if (value < 0) { return "-" + SizeSuffix(-value, decimalPlaces); } if (value == 0L) { return string.Format("{0:n" + decimalPlaces + "} b", 0); } int num = (int)Math.Log(value, 1024.0); decimal num2 = (decimal)value / (decimal)(1L << num * 10); if (Math.Round(num2, decimalPlaces) >= 1000m) { num++; num2 /= 1024m; } return string.Format("{0:n" + decimalPlaces + "} {1}", num2, SizeSuffixes[num]); } public static string GetDownloadLinkFromSongData(SerializableClass.SongDataFromDB song) { if (song.mirror != null && Path.GetExtension(song.mirror).Contains(".zip")) { return song.mirror; } if (song.download != null && song.download != "") { if (song.download.Contains("https://cdn.discordapp.com/") && Path.GetExtension(song.download).Contains(".zip")) { return song.download; } if (song.download.Contains("https://drive.google.com/file/d/")) { return GetGoogleDriveDownloadLink(song.download); } if (song.download.Contains("https://pixeldrain.com/u/")) { return song.download.Replace("https://pixeldrain.com/u/", "https://pixeldrain.com/api/file/"); } if (song.download.Contains("https://pixeldrain.com/api/file/")) { return song.download; } if (song.download.Contains("https://db.trombone.fyi/")) { return song.download; } } return null; } private static string GetGoogleDriveDownloadLink(string downloadString) { return "https://drive.google.com/uc?export=download&id=" + downloadString.Replace("https://drive.google.com/file/d/", "").Split(new char[1] { '/' })[0]; } } public class HexConverter { private static readonly uint[] Lookup32 = CreateLookup32(); private static uint[] CreateLookup32() { uint[] array = new uint[256]; for (int i = 0; i < 256; i++) { string text = i.ToString("X2"); array[i] = text[0] + ((uint)text[1] << 16); } return array; } public static string ToHexString(Span bytes) { uint[] lookup = Lookup32; char[] array = new char[bytes.Length * 2]; for (int i = 0; i < bytes.Length; i++) { uint num = lookup[bytes[i]]; array[2 * i] = (char)num; array[2 * i + 1] = (char)(num >> 16); } return new string(array); } } public class ReloadManager { private readonly Plugin _plugin; private ReloadOperation ActiveOperation { get; set; } public bool IsCurrentlyReloading => ActiveOperation != null; public ReloadManager(Plugin plugin) { _plugin = plugin; } public void ReloadAll([CanBeNull] IProgressCallbacks callbacks) { if (IsCurrentlyReloading) { return; } ActiveOperation = new ReloadOperation(callbacks); ((MonoBehaviour)_plugin).StartCoroutine((IEnumerator)TrackReloader.ReloadAll((Action)ActiveOperation.OnProgress).ForEach((Action>)delegate(FSharpResult result) { ActiveOperation = null; if (result.IsError) { callbacks?.OnError(result.ErrorValue); } else { callbacks?.OnComplete(); } })); } public void Update() { ActiveOperation?.Update(); } } public class ReloadOperation { private readonly IProgressCallbacks _callbacks; private volatile Progress _lastProgress; public ReloadOperation(IProgressCallbacks callbacks) { _callbacks = callbacks; } internal void OnProgress(Progress progress) { _lastProgress = progress; } internal void Update() { if (_lastProgress != null) { _callbacks?.OnProgressUpdate(_lastProgress); } } } public interface IProgressCallbacks { void OnProgressUpdate(Progress progress); void OnComplete(); void OnError(Exception exn); } public class ProgressCallbacks : IProgressCallbacks { public Action onProgress; public Action onComplete; public Action onError; public void OnProgressUpdate(Progress progress) { onProgress?.Invoke(progress); } public void OnComplete() { onComplete?.Invoke(); } public void OnError(Exception exn) { onError?.Invoke(exn); } } public static class SongDataHelper { public class DecimalJsonConverter : JsonConverter { public override bool CanRead => false; public override void WriteJson(JsonWriter writer, float value, JsonSerializer serializer) { if ((double)value == Math.Truncate(value)) { writer.WriteRawValue(((int)value).ToString()); } else { writer.WriteRawValue(((double)value).ToString(CultureInfo.InvariantCulture)); } } public override float ReadJson(JsonReader reader, Type objectType, float existingValue, bool hasExistingValue, JsonSerializer serializer) { throw new NotImplementedException(); } } public static string CalcSHA256Hash(byte[] data) { using SHA256 sHA = SHA256.Create(); StringBuilder stringBuilder = new StringBuilder(); byte[] array = sHA.ComputeHash(data); byte[] array2 = array; foreach (byte b in array2) { stringBuilder.Append(b.ToString("x2")); } return stringBuilder.ToString(); } public static string CalcFileHash(string fileLocation) { if (!File.Exists(fileLocation) || new FileInfo(fileLocation).Length > 2000000) { return ""; } return CalcSHA256Hash(Encoding.UTF8.GetBytes(File.ReadAllText(fileLocation))); } public static string GetSongFilePath(TromboneTrack track) { CustomTrack val = (CustomTrack)(object)((track is CustomTrack) ? track : null); if (val != null) { return Path.Combine(val.folderPath, Globals.defaultChartName); } return Application.streamingAssetsPath + "/trackassets/" + track.trackref + "/trackdata.tmb"; } public static string GetChoosenSongHash(string trackref) { TromboneTrack track = TrackLookup.lookup(trackref); return GetSongHash(track); } public static string GetSongHash(TromboneTrack track) { if (track is CustomTrack) { return CalcFileHash(GetSongFilePath(track)); } if (track is BaseGameTrack) { return track.trackref; } Plugin.LogInfo($"TrackType {((object)track).GetType()} is unknown."); return null; } public static string GenerateBaseTmb(TromboneTrack track) { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown SingleTrackData val = TrackLookup.toTrackData(track); string songFilePath = GetSongFilePath(track); SerializableClass.TMBData tMBData = new SerializableClass.TMBData { name = val.trackname_long, shortName = val.trackname_short, trackRef = val.trackref, author = val.artist, genre = val.genre, description = val.desc, difficulty = val.difficulty }; int.TryParse(new string(val.year.Where(char.IsDigit).ToArray()), out tMBData.year); using (FileStream serializationStream = File.Open(songFilePath, FileMode.Open)) { BinaryFormatter binaryFormatter = new BinaryFormatter(); SavedLevel val2 = (SavedLevel)binaryFormatter.Deserialize(serializationStream); List levelData = new List(); val2.savedleveldata.ForEach(delegate(float[] arr) { List list = new List(); foreach (float item in arr) { list.Add(item); } levelData.Add(list.ToArray()); }); tMBData.savednotespacing = val2.savednotespacing; tMBData.endpoint = val2.endpoint; tMBData.timesig = val2.timesig; tMBData.tempo = val2.tempo; tMBData.notes = levelData; } return JsonConvert.SerializeObject((object)tMBData, (JsonConverter[])(object)new JsonConverter[1] { (JsonConverter)new DecimalJsonConverter() }); } } public static class TootTallyUtils { public static string FormatFromSeconds(float totalSeconds) { totalSeconds = (uint)totalSeconds; float num = totalSeconds % 60f; float num2 = totalSeconds / 60f; float num3 = num2 % 60f; float num4 = num2 / 60f; string text = ""; if (num4 > 0f) { text = $"{num4}:"; } return text + $"{num3}:{num:D2}"; } } } namespace TootTallyCore.Utils.Assets { public static class AssetBundleManager { private static Dictionary _prefabDict; private static bool _isInitialized; private static GameObject _defaultGameObject => GameObjectFactory.CreateImageHolder(null, Vector2.zero, new Vector2(64f, 64f), AssetManager.GetSprite("icon.png"), "DefaultGameObject"); public static void LoadAssets(string filePath) { if (_prefabDict == null) { _prefabDict = new Dictionary(); } if (File.Exists(filePath)) { ((MonoBehaviour)Plugin.Instance).StartCoroutine((IEnumerator)LoadAssetBundle(filePath, OnAssetBundleLoaded)); } } public static IEnumerator LoadAssetBundle(string filePath, Action callback) { AssetBundleCreateRequest request = AssetBundle.LoadFromFileAsync(filePath); yield return request; if (request == null) { Plugin.LogError("AssetBundle " + filePath + " failed to load."); } else { callback(request.assetBundle); } } public static void OnAssetBundleLoaded(AssetBundle assetBundle) { if ((Object)(object)assetBundle == (Object)null) { Plugin.LogError("AssetBundle was null"); return; } assetBundle.GetAllAssetNames().ToList().ForEach(delegate(string name) { _prefabDict.Add(Path.GetFileNameWithoutExtension(name), assetBundle.LoadAsset(name)); }); _isInitialized = true; } public static GameObject GetPrefab(string name) { if (!_isInitialized || _prefabDict == null) { return _defaultGameObject; } if (!_prefabDict.ContainsKey(name)) { Plugin.LogError("Couldn't find asset bundle " + name); return _defaultGameObject; } return _prefabDict[name]; } public static void Dispose() { _prefabDict.Clear(); _prefabDict = null; } } public static class AssetManager { public const string DEFAULT_TEXTURE_NAME = "icon.png"; public static Dictionary textureDictionary; public static void LoadAssets(string directory) { if (textureDictionary == null) { textureDictionary = new Dictionary(); } if (!Directory.Exists(directory)) { return; } foreach (string item in from f in Directory.GetFiles(directory) where Path.GetExtension(f) == ".png" select f) { string assetName = Path.GetFileName(item); if (textureDictionary.ContainsKey(assetName)) { continue; } ((MonoBehaviour)Plugin.Instance).StartCoroutine((IEnumerator)TootTallyAPIService.TryLoadingTextureLocal(item, delegate(Texture2D texture) { if ((Object)(object)texture != (Object)null && !textureDictionary.ContainsKey(assetName)) { textureDictionary.Add(assetName, texture); } })); } } public static void LoadSingleAsset(string assetPath, string assetName, Action callback = null) { if (textureDictionary.ContainsKey(assetName)) { callback?.Invoke(GetSprite(assetName)); return; } ((MonoBehaviour)Plugin.Instance).StartCoroutine((IEnumerator)TootTallyAPIService.TryLoadingTextureLocal(assetPath, delegate(Texture2D texture) { if ((Object)(object)texture != (Object)null && !textureDictionary.ContainsKey(assetName)) { textureDictionary.Add(assetName, texture); callback?.Invoke(GetSprite(assetName)); } })); } public static void GetProfilePictureByID(int userID, Action callback) { if (!textureDictionary.ContainsKey(userID.ToString())) { ((MonoBehaviour)Plugin.Instance).StartCoroutine((IEnumerator)TootTallyAPIService.LoadPFPFromServer(userID, delegate(Texture2D texture) { if (!textureDictionary.ContainsKey(userID.ToString())) { textureDictionary.Add(userID.ToString(), texture ?? textureDictionary["icon.png"]); } callback(GetSprite(userID.ToString())); })); } else { callback(GetSprite(userID.ToString())); } } public static Texture2D GetTexture(string assetKey) { try { return textureDictionary[assetKey]; } catch (Exception ex) { Plugin.LogError("Key " + assetKey + " not found."); Plugin.LogException(ex); return textureDictionary["icon.png"]; } } public static Sprite GetSprite(string assetKey) { //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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) try { Texture2D val = textureDictionary[assetKey]; return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), Vector2.zero, 300f); } catch (Exception ex) { Plugin.LogError("Key " + assetKey + " not found."); Plugin.LogException(ex); Texture2D val2 = textureDictionary["icon.png"]; return Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), Vector2.zero, 300f); } } } } namespace TootTallyCore.Graphics { public class BubblePopupHandler : MonoBehaviour { private Camera _camera; private GameObject _bubble; private EventTrigger _parentTrigger; private TootTallyAnimation _positionAnimation; private TootTallyAnimation _scaleAnimation; private bool _useWorldPosition; private bool _isActive; public void Initialize(GameObject bubble, Camera camera, bool useWorldPosition = true) { _camera = camera; Initialize(bubble, useWorldPosition); } public void Initialize(GameObject bubble, bool useWorldPosition = true) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) _bubble = bubble; _bubble.transform.SetParent(((Component)this).transform); _bubble.transform.position = ((Component)this).transform.position; _useWorldPosition = useWorldPosition; } public void Initialize(Transform uiHolder, GameObject bubble, bool useWorldPosition = true) { //IL_0029: 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_0069: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) _bubble = bubble; _bubble.transform.SetParent(uiHolder); _bubble.transform.position = ((Component)this).transform.position; _useWorldPosition = useWorldPosition; if (!((Component)((Component)this).transform).TryGetComponent(ref _parentTrigger)) { _parentTrigger = ((Component)((Component)this).transform).gameObject.AddComponent(); } Entry val = new Entry(); val.eventID = (EventTriggerType)0; ((UnityEvent)(object)val.callback).AddListener((UnityAction)delegate { OnPointerEnter(); }); Entry val2 = new Entry(); val2.eventID = (EventTriggerType)1; ((UnityEvent)(object)val2.callback).AddListener((UnityAction)delegate { OnPointerExit(); }); _parentTrigger.triggers.Add(val); _parentTrigger.triggers.Add(val2); } public void Awake() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_parentTrigger != (Object)null)) { GameObject gameObject = ((Component)((Component)this).transform).gameObject; if (!gameObject.TryGetComponent(ref _parentTrigger)) { _parentTrigger = gameObject.gameObject.AddComponent(); } Entry val = new Entry(); val.eventID = (EventTriggerType)0; ((UnityEvent)(object)val.callback).AddListener((UnityAction)delegate { OnPointerEnter(); }); Entry val2 = new Entry(); val2.eventID = (EventTriggerType)1; ((UnityEvent)(object)val2.callback).AddListener((UnityAction)delegate { OnPointerExit(); }); _parentTrigger.triggers.Add(val); _parentTrigger.triggers.Add(val2); } } public void Update() { //IL_0018: 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_0058: 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_0040: Unknown result type (might be due to invalid IL or missing references) if (_isActive) { Camera val = _camera ?? Camera.main; Vector3 mousePosition = Input.mousePosition; mousePosition.z = 10f; if (_useWorldPosition) { _positionAnimation?.SetTargetVector(val.ScreenToWorldPoint(mousePosition)); } else { _positionAnimation?.SetTargetVector(mousePosition); } } if (Input.GetMouseButtonDown(0) && _isActive) { OnPointerExit(); } } private void OnPointerEnter() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_bubble == (Object)null)) { _isActive = true; _positionAnimation?.Dispose(); _scaleAnimation?.Dispose(); _bubble.transform.position = ((Component)this).transform.position; _bubble.transform.localScale = Vector2.op_Implicit(Vector2.zero); _bubble.SetActive(true); _bubble.transform.SetAsLastSibling(); _positionAnimation = TootTallyAnimationManager.AddNewTransformPositionAnimation(_bubble, _useWorldPosition ? Camera.main.ScreenToWorldPoint(Input.mousePosition) : Input.mousePosition, 999f, GetSecondDegreeAnimation()); _scaleAnimation = TootTallyAnimationManager.AddNewTransformScaleAnimation(_bubble, Vector3.one, 0.8f, GetSecondDegreeAnimation()); } } private void OnPointerExit() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_bubble == (Object)null)) { _isActive = false; _positionAnimation?.Dispose(); _positionAnimation = null; _scaleAnimation?.Dispose(); _scaleAnimation = TootTallyAnimationManager.AddNewTransformScaleAnimation(_bubble, Vector2.zero, 0.8f, GetSecondDegreeAnimationExit(), delegate { _bubble.SetActive(false); }); } } public SecondDegreeDynamicsAnimation GetSecondDegreeAnimation() { return new SecondDegreeDynamicsAnimation(2.5f, 0.85f, 1f); } public SecondDegreeDynamicsAnimation GetSecondDegreeAnimationExit() { return new SecondDegreeDynamicsAnimation(2.65f, 1f, 1f); } } public class CustomButton : MonoBehaviour { public Button button; public Text textHolder; public void ConstructNewButton(Button button, Text textHolder) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) this.button = button; this.textHolder = textHolder; textHolder.supportRichText = true; ((MaskableGraphic)textHolder).maskable = true; LocalizeStringEvent val = default(LocalizeStringEvent); if (((Component)textHolder).TryGetComponent(ref val)) { Object.DestroyImmediate((Object)(object)val); } ((Object)this).name = ((Object)this).name; RemoveAllOnClickActions(); EventTrigger val2 = ((Component)button).gameObject.AddComponent(); Entry val3 = new Entry(); val3.eventID = (EventTriggerType)0; ((UnityEvent)(object)val3.callback).AddListener((UnityAction)delegate { SoundEffectsManager.PlayerBtnHover(); }); val2.triggers.Add(val3); } public void RemoveAllOnClickActions() { ((UnityEventBase)button.onClick).RemoveAllListeners(); } } public static class GameObjectFactory { public enum TextFont { Comfortaa, Multicolore } private static CustomButton _buttonPrefab; private static TextMeshProUGUI _multicoloreTextPrefab; private static TextMeshProUGUI _comfortaaTextPrefab; private static GameObject _bubblePrefab; private static Slider _verticalSliderPrefab; private static Slider _sliderPrefab; private static Slider _settingsPanelVolumeSlider; private static TootTallyNotif _tootTallyNotifPrefab; private static GameObject _settingsGraphics; private static GameObject _creditPanel; private static TMP_InputField _inputFieldPrefab; private static GameObject _overlayPanelPrefab; private static bool _isHomeControllerInitialized; private static bool _isLevelSelectControllerInitialized; public static TMP_Text GetComfortaaFont => (TMP_Text)(object)_comfortaaTextPrefab; public static GameObject GetOverlayPanelPrefab => _overlayPanelPrefab; [HarmonyPatch(typeof(HomeController), "Start")] [HarmonyPostfix] private static void YoinkSettingsGraphicsHomeController(HomeController __instance) { SoundEffectsManager.Initialize(__instance); _settingsGraphics = ((Component)__instance.fullsettingspanel.transform.Find("Settings")).gameObject; _settingsPanelVolumeSlider = Object.Instantiate(__instance.set_sld_volume_tromb); ((Component)_settingsPanelVolumeSlider).gameObject.SetActive(false); Object.DontDestroyOnLoad((Object)(object)_settingsPanelVolumeSlider); _creditPanel = ((Component)__instance.ext_credits_go.transform.parent).gameObject; OnHomeControllerInitialize(__instance); } [HarmonyPatch(typeof(LevelSelectController), "Start")] [HarmonyPostfix] private static void YoinkGraphicsLevelSelectController(LevelSelectController __instance) { OnLevelSelectControllerInitialize(__instance); } public static void OnHomeControllerInitialize(HomeController homeController) { if (!_isHomeControllerInitialized) { SetTextPrefabs(); SetInputFieldPrefab(); SetNotificationPrefab(); SetBubblePrefab(); SetCustomButtonPrefab(); SetOverlayPanelPrefab(); _isHomeControllerInitialized = true; UpdatePrefabTheme(); } } public static void OnLevelSelectControllerInitialize(LevelSelectController levelSelectController) { if (!_isLevelSelectControllerInitialized) { Plugin.LogDebug("Generating Slider prefab..."); SetSliderPrefab(); Plugin.LogDebug("Generating VerticalSlider prefab..."); SetVerticalSliderPrefab(); _isLevelSelectControllerInitialized = true; UpdatePrefabTheme(); } } public static void UpdatePrefabTheme() { //IL_0028: 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_002e: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_012d: 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_0163: 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_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0211: 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_023f: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) if (_isHomeControllerInitialized) { try { Image component = ((Component)_tootTallyNotifPrefab).GetComponent(); Color color = (((Graphic)_bubblePrefab.GetComponent()).color = Theme.colors.notification.border); ((Graphic)component).color = color; Image component2 = ((Component)((Component)_tootTallyNotifPrefab).transform.Find("Window Body")).gameObject.GetComponent(); color = (((Graphic)((Component)_bubblePrefab.transform.Find("Window Body")).gameObject.GetComponent()).color = Theme.colors.notification.background); ((Graphic)component2).color = color; TMP_Text component3 = ((Component)((Component)_tootTallyNotifPrefab).transform.Find("NotifText")).GetComponent(); color = (((Graphic)((Component)_bubblePrefab.transform.Find("Window Body/BubbleText")).GetComponent()).color = Theme.colors.notification.defaultText); ((Graphic)component3).color = color; TMP_Text component4 = ((Component)((Component)_tootTallyNotifPrefab).transform.Find("NotifText")).GetComponent(); Color32 outlineColor = (((Component)_bubblePrefab.transform.Find("Window Body/BubbleText")).GetComponent().outlineColor = Color32.op_Implicit(Theme.colors.notification.textOutline)); component4.outlineColor = outlineColor; ((Graphic)((Component)_overlayPanelPrefab.transform.Find("FSLatencyPanel/LatencyBG")).gameObject.GetComponent()).color = Theme.colors.notification.border; ((Graphic)((Component)_overlayPanelPrefab.transform.Find("FSLatencyPanel/LatencyFG")).gameObject.GetComponent()).color = Theme.colors.notification.background; ColorBlock colors = ((Selectable)_buttonPrefab.button).colors; ((ColorBlock)(ref colors)).normalColor = ((ColorBlock)(ref Theme.colors.replayButton.colors)).normalColor; ((ColorBlock)(ref colors)).highlightedColor = ((ColorBlock)(ref Theme.colors.replayButton.colors)).highlightedColor; ((ColorBlock)(ref colors)).pressedColor = ((ColorBlock)(ref Theme.colors.replayButton.colors)).pressedColor; ((ColorBlock)(ref colors)).selectedColor = ((ColorBlock)(ref Theme.colors.replayButton.colors)).normalColor; ((Selectable)_buttonPrefab.button).colors = colors; ((Graphic)_buttonPrefab.textHolder).color = Theme.colors.replayButton.text; Transform val2 = _overlayPanelPrefab.transform.Find("FSLatencyPanel"); ((Graphic)((Component)val2.Find("LatencyBG")).gameObject.GetComponent()).color = Theme.colors.notification.border; Transform val3 = val2.Find("LatencyFG"); Text component5 = ((Component)val3.Find("title")).gameObject.GetComponent(); Text component6 = ((Component)val3.Find("subtitle")).gameObject.GetComponent(); ((Graphic)component5).color = Theme.colors.notification.defaultText; ((Graphic)component6).color = Theme.colors.notification.defaultText; ((TMP_Text)_multicoloreTextPrefab).fontMaterial.SetColor(ShaderUtilities.ID_OutlineColor, Theme.colors.leaderboard.textOutline); ((Graphic)_multicoloreTextPrefab).color = Theme.colors.leaderboard.text; ((TMP_Text)_comfortaaTextPrefab).fontMaterial.SetColor(ShaderUtilities.ID_OutlineColor, Theme.colors.leaderboard.textOutline); ((Graphic)_comfortaaTextPrefab).color = Theme.colors.leaderboard.text; } catch (Exception ex) { Plugin.LogError("HomeController Theme Couldn't be applied."); Plugin.LogException(ex); } } if (_isLevelSelectControllerInitialized) { try { ((Graphic)((Component)((Component)_sliderPrefab).transform.Find("Fill Area/Fill")).GetComponent()).color = Theme.colors.leaderboard.slider.fill; ((Graphic)((Component)((Component)_sliderPrefab).transform.Find("Background")).GetComponent()).color = Theme.colors.scrollSpeedSlider.background; ((Graphic)((Component)((Component)_sliderPrefab).transform.Find("Handle Slide Area/Handle")).gameObject.GetComponent()).color = Theme.colors.scrollSpeedSlider.handle; ((Graphic)((Component)((Component)_verticalSliderPrefab).transform.Find("Handle")).gameObject.GetComponent()).color = Theme.colors.leaderboard.slider.handle; ((Graphic)((Component)((Component)_verticalSliderPrefab).transform.Find("Fill Area/Fill")).GetComponent()).color = Theme.colors.leaderboard.slider.fill; ((Graphic)((Component)((Component)_verticalSliderPrefab).transform.Find("Background")).GetComponent()).color = Theme.colors.leaderboard.slider.background; } catch (Exception ex2) { Plugin.LogError("LevelSelectController Theme Couldn't be applied."); Plugin.LogException(ex2); } } } private static void SetTextPrefabs() { Stopwatch stopwatch = Stopwatch.StartNew(); List list = (from path in Directory.GetFiles(Path.GetDirectoryName(((BaseUnityPlugin)Plugin.Instance).Info.Location) + "/Fonts") select TMP_FontAsset.CreateFontAsset(new Font(path))).ToList(); Plugin.LogInfo($"Loaded {list.Count} fallback fonts in {stopwatch.Elapsed.TotalSeconds}s"); _multicoloreTextPrefab = CreateTextPrefab("defaultTextPrefab", "SettingsPanel/header-Settings/txt-settingsheader/txt-settingsheader-top", list, wordWrapping: true); _comfortaaTextPrefab = CreateTextPrefab("ComfortaaTextPrefab", "AdvancedInfoPanel/primary-content/intro/copy", list, wordWrapping: false); } private static TextMeshProUGUI CreateTextPrefab(string name, string path, List fallbackFonts, bool wordWrapping) { //IL_00c6: 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_00f7: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = GameObject.Find("MainCanvas").gameObject; GameObject gameObject2 = ((Component)gameObject.transform.Find(path)).gameObject; GameObject val = Object.Instantiate(gameObject2); ((Object)val).name = name; val.SetActive(true); Object.DestroyImmediate((Object)(object)val.GetComponent()); TextMeshProUGUI val2 = val.AddComponent(); ((TMP_Text)val2).fontSize = 22f; ((TMP_Text)val2).text = "defaultText"; ((TMP_Text)val2).font = TMP_FontAsset.CreateFontAsset(gameObject2.GetComponent().font); ((TMP_Text)val2).font.fallbackFontAssetTable = fallbackFonts; ((TMP_Text)val2).fontMaterial.SetFloat(ShaderUtilities.ID_FaceDilate, 0.25f); ((TMP_Text)val2).fontMaterial.EnableKeyword(ShaderUtilities.Keyword_Outline); ((TMP_Text)val2).fontMaterial.SetFloat(ShaderUtilities.ID_OutlineWidth, 0.25f); ((TMP_Text)val2).fontMaterial.SetColor(ShaderUtilities.ID_OutlineColor, Color.black); ((TMP_Text)val2).alignment = (TextAlignmentOptions)514; ((Component)val2).GetComponent().sizeDelta = val.GetComponent().sizeDelta; ((Component)val2).GetComponent().anchoredPosition = Vector2.zero; ((TMP_Text)val2).richText = true; ((TMP_Text)val2).enableWordWrapping = wordWrapping; ((Graphic)val2).material = ((Graphic)gameObject2.GetComponent()).material; Object.DontDestroyOnLoad((Object)(object)val2); return val2; } private static void SetInputFieldPrefab() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0013: 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_006f: 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_0075: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("InputFieldHolder"); RectTransform val2 = val.AddComponent(); val2.anchoredPosition = Vector2.zero; val2.sizeDelta = new Vector2(350f, 50f); GameObject val3 = Object.Instantiate(val, val.transform); GameObject val4 = Object.Instantiate(val3, val.transform); ((Object)val3).name = "Image"; ((Object)val4).name = "Text"; _inputFieldPrefab = val.AddComponent(); Vector2 anchorMax = (val2.anchorMin = Vector2.zero); val2.anchorMax = anchorMax; ((Selectable)_inputFieldPrefab).image = val3.AddComponent(); RectTransform component = val3.GetComponent(); Vector2 val5 = (component.pivot = Vector2.zero); anchorMax = (component.anchorMax = val5); component.anchorMin = anchorMax; component.anchoredPosition = new Vector2(0f, 4f); component.sizeDelta = new Vector2(350f, 2f); RectTransform component2 = val4.GetComponent(); Vector2 val7 = (component2.pivot = Vector2.zero); val5 = (component2.anchorMax = val7); anchorMax = (component2.anchorMin = val5); component2.anchoredPosition = anchorMax; component2.sizeDelta = new Vector2(350f, 50f); _inputFieldPrefab.textComponent = CreateSingleText(val4.transform, "TextLabel", "", Color.white); _inputFieldPrefab.textComponent.rectTransform.pivot = new Vector2(0f, 0.5f); _inputFieldPrefab.textComponent.alignment = (TextAlignmentOptions)513; _inputFieldPrefab.textComponent.margin = new Vector4(5f, 0f, 0f, 0f); _inputFieldPrefab.textComponent.enableWordWrapping = true; _inputFieldPrefab.textViewport = _inputFieldPrefab.textComponent.rectTransform; Object.DontDestroyOnLoad((Object)(object)_inputFieldPrefab); } private static void SetNotificationPrefab() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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) GameObject gameObject = GameObject.Find("MainCanvas").gameObject; GameObject gameObject2 = ((Component)gameObject.transform.Find("SettingsPanel/buffer_panel/window border")).gameObject; GameObject val = Object.Instantiate(gameObject2); ((Object)val).name = "NotificationPrefab"; Object.DestroyImmediate((Object)(object)((Component)val.transform.Find("Window Body/all_settiings")).gameObject); _tootTallyNotifPrefab = val.AddComponent(); RectTransform component = ((Component)_tootTallyNotifPrefab).GetComponent(); component.anchoredPosition = new Vector2(695f, -700f); component.sizeDelta = new Vector2(450f, 200f); ((Graphic)((Component)((Component)_tootTallyNotifPrefab).transform.Find("Window Body")).GetComponent()).color = new Color(0.1f, 0.1f, 0.1f); TMP_Text val2 = (TMP_Text)(object)Object.Instantiate(_multicoloreTextPrefab, ((Component)_tootTallyNotifPrefab).transform); ((Object)val2).name = "NotifText"; ((Component)val2).gameObject.GetComponent().sizeDelta = component.sizeDelta; ((Component)val2).gameObject.SetActive(true); val.SetActive(false); Object.DontDestroyOnLoad((Object)(object)_tootTallyNotifPrefab); } private static void SetBubblePrefab() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = GameObject.Find("MainCanvas").gameObject; GameObject gameObject2 = ((Component)gameObject.transform.Find("SettingsPanel/buffer_panel/window border")).gameObject; _bubblePrefab = Object.Instantiate(gameObject2); ((Object)_bubblePrefab).name = "BubblePrefab"; Transform val = _bubblePrefab.transform.Find("Window Body"); Object.DestroyImmediate((Object)(object)((Component)val.Find("all_settiings")).gameObject); CanvasGroup val2 = _bubblePrefab.AddComponent(); val2.blocksRaycasts = false; RectTransform component = _bubblePrefab.GetComponent(); component.sizeDelta = new Vector2(250f, 100f); component.pivot = new Vector2(1f, 0f); ((Graphic)((Component)val).GetComponent()).color = new Color(0.1f, 0.1f, 0.1f); TextMeshProUGUI val3 = Object.Instantiate(_multicoloreTextPrefab, val); ((Object)val3).name = "BubbleText"; ((MaskableGraphic)val3).maskable = false; ((TMP_Text)val3).enableWordWrapping = true; ((TMP_Text)val3).rectTransform.sizeDelta = component.sizeDelta; ((Component)val3).gameObject.SetActive(true); _bubblePrefab.AddComponent().ignoreLayout = true; _bubblePrefab.SetActive(false); Object.DontDestroyOnLoad((Object)(object)_bubblePrefab); } private static void SetCustomButtonPrefab() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)_settingsGraphics.transform.Find("GRAPHICS/btn_opengraphicspanel")).gameObject; GameObject val = Object.Instantiate(gameObject); Button component = val.GetComponent