using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using OpenRGB.NET; using PluginConfig.API; using PluginConfig.API.Decorators; using PluginConfig.API.Fields; using PluginConfig.API.Functionals; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("UltraRGBLighting")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("UltraRGBLighting")] [assembly: AssemblyTitle("UltraRGBLighting")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace UltraRGBLighting { public enum PermutatorCause { None, RecentKills, RecentDamage, RecentStyle, OnStyleGain, OnRankGain, OnRankLose, OnKill, OnDamage, OnTakeDamage, OnPlayerDeath, OnTrueStop, Always } public enum FadeEnum { Linear, NoFade, SquareRoot, Quadratic, PassIfAboveHalf, PassIfBelowHalf } public class Permutator { public PermutatorCause cause = PermutatorCause.None; public bool scaleWithCauseMagnitude = false; public FadeEnum fadeType = FadeEnum.Linear; public Color propertyColor = Color.white; public colorPropertyEnum property = colorPropertyEnum.None; public float propertyFloat1 = 0f; public float propertyFloat2 = 0f; public float propertyFloat3 = 0f; public float length = 0f; } public class Permutators { [HarmonyPatch(typeof(StyleHUD), "AddPoints")] public class StyleHUDAddPointsPatch { [HarmonyPrefix] private static void Prefix(int points, string pointID, GameObject sourceWeapon = null, EnemyIdentifier eid = null, int count = -1, string prefix = "", string postfix = "") { lastTimeStyleGain = Time.realtimeSinceStartup; styleGainedThisTick.Add(points); recentStyle += points; } } [HarmonyPatch(typeof(StyleHUD), "AscendRank")] public class StyleHUDAscendRankPatch { [HarmonyPrefix] private static void Prefix() { lastTimeRankGain = Time.realtimeSinceStartup; } } [HarmonyPatch(typeof(StyleHUD), "DescendRank")] public class StyleHUDDescendRankPatch { [HarmonyPrefix] private static void Prefix() { lastTimeRankLose = Time.realtimeSinceStartup; } } [HarmonyPatch(typeof(TimeController), "TrueStop")] public class TrueStopPatch { [HarmonyPrefix] private static void Prefix(ref float length) { lastTimeTruestop = Time.realtimeSinceStartup; } } [HarmonyPatch(typeof(EnemyIdentifier))] public class EnemyIdentifierPatch { [HarmonyPatch("DeliverDamage")] private static void Prefix(EnemyIdentifier __instance, out float __state) { __state = __instance.health; } [HarmonyPatch("DeliverDamage")] private static void Postfix(EnemyIdentifier __instance, float __state, float multiplier, GameObject sourceWeapon) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) if (__state <= 0f) { return; } __instance.ForceGetHealth(); float num; if (__instance.health <= 0f) { num = 0f; lastTimeKill = Time.realtimeSinceStartup; EnemyType[] array = new EnemyType[25]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); EnemyType[] source = (EnemyType[])(object)array; if (source.Contains(__instance.enemyType)) { lastKillBig = true; recentKills += 3f; } else { lastKillBig = false; recentKills += 1f; } } else { num = __instance.health; } float num2 = __state - num; if (num2 != 0f && __instance.hitter != "enemy") { lastTimeDamage = Time.realtimeSinceStartup; } if (__instance.hitter != "enemy") { damageDealtThisTick.Add(num2); recentDamage += num2; } } } public static float lastTimeStyleGain = -1f; public static float lastTimeRankGain = -1f; public static float lastTimeRankLose = -1f; public static float lastTimeKill = -1f; public static float lastTimeDamage = -1f; public static float lastTimeOnTakeDamage = -1f; public static float lastTimePlayerDeath = -1f; public static float lastTimeTruestop = -1f; public static List damageDealtThisTick = new List(); public static float lastDamage = -1f; public static float lastOnTakeDamage = -1f; public static bool lastKillBig = false; public static List styleGainedThisTick = new List(); public static float lastStyleGain = -1f; public static float recentKills = 0f; public static float recentDamage = 0f; public static float recentStyle = 0f; private static int hp = 0; private static bool dead = false; public static Permutator[] permutatorArr = new Permutator[15]; public static void actionLogic() { if (hp > MonoSingleton.instance.hp) { lastOnTakeDamage = hp - MonoSingleton.instance.hp; lastTimeOnTakeDamage = Time.realtimeSinceStartup; } hp = MonoSingleton.instance.hp; if (dead != MonoSingleton.instance.dead && MonoSingleton.instance.dead) { lastTimePlayerDeath = Time.realtimeSinceStartup; } dead = MonoSingleton.instance.dead; if (styleGainedThisTick.Count != 0) { float num = 0f; for (int i = 0; i < styleGainedThisTick.Count; i++) { num += styleGainedThisTick[i]; } styleGainedThisTick = new List(); } if (damageDealtThisTick.Count != 0) { float num2 = 0f; for (int j = 0; j < damageDealtThisTick.Count; j++) { num2 += damageDealtThisTick[j]; } lastDamage = num2; damageDealtThisTick = new List(); } recentDamage = recentDamage * (1f - 1f * (Time.deltaTime * (float)Plugin.framesSinceLastRefreshed)) - 0.1f * (Time.deltaTime * (float)Plugin.framesSinceLastRefreshed); recentStyle = recentStyle * (1f - 1f * (Time.deltaTime * (float)Plugin.framesSinceLastRefreshed)) - 5f * (Time.deltaTime * (float)Plugin.framesSinceLastRefreshed); recentKills = recentKills * (1f - 1f * (Time.deltaTime * (float)Plugin.framesSinceLastRefreshed)) - 0.04f * (Time.deltaTime * (float)Plugin.framesSinceLastRefreshed); if (recentDamage < 0f) { recentDamage = 0f; } if (recentStyle < 0f) { recentStyle = 0f; } if (recentKills < 0f) { recentKills = 0f; } } public static Color ApplyPermutators(Color colorIn, int LEDindex) { //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) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_0441: 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_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03be: 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_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: 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_0406: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) Color val = colorIn; for (int i = 0; i < permutatorArr.Length; i++) { Permutator permutator = permutatorArr[i]; PermutatorCause cause = permutator.cause; FadeEnum fadeType = permutator.fadeType; bool scaleWithCauseMagnitude = permutator.scaleWithCauseMagnitude; float length = permutator.length; float value = 0f; float num = 1f; if (cause == PermutatorCause.None) { continue; } switch (cause) { case PermutatorCause.OnStyleGain: if (lastTimeStyleGain < 0f) { continue; } value = Time.realtimeSinceStartup - lastTimeStyleGain; if (scaleWithCauseMagnitude) { num = Convert.ToSingle(Math.Sqrt(lastStyleGain / 5f)); } break; case PermutatorCause.OnRankGain: if (lastTimeRankGain < 0f) { continue; } value = Time.realtimeSinceStartup - lastTimeRankGain; break; case PermutatorCause.OnRankLose: if (lastTimeRankLose < 0f) { continue; } value = Time.realtimeSinceStartup - lastTimeRankLose; break; case PermutatorCause.OnKill: if (lastTimeKill < 0f) { continue; } value = Time.realtimeSinceStartup - lastTimeKill; if (scaleWithCauseMagnitude && lastKillBig) { num = 2f; } break; case PermutatorCause.OnTrueStop: if (lastTimeTruestop < 0f) { continue; } value = Time.realtimeSinceStartup - lastTimeTruestop; break; case PermutatorCause.OnDamage: if (lastTimeDamage < 0f) { continue; } value = Time.realtimeSinceStartup - lastTimeDamage; if (scaleWithCauseMagnitude) { num = Convert.ToSingle(Math.Sqrt(lastDamage)); } break; case PermutatorCause.OnTakeDamage: if (lastTimeOnTakeDamage < 0f) { continue; } value = Time.realtimeSinceStartup - lastTimeOnTakeDamage; if (scaleWithCauseMagnitude) { num = lastOnTakeDamage / 25f; } break; case PermutatorCause.OnPlayerDeath: if (lastTimePlayerDeath < 0f) { continue; } value = Time.realtimeSinceStartup - lastTimePlayerDeath; break; case PermutatorCause.Always: value = 0f; break; case PermutatorCause.RecentKills: { float num4 = recentKills / (4f / length); if (num4 > 1f) { num4 = 1f; } value = length * num * (1f - num4); break; } case PermutatorCause.RecentDamage: { float num3 = recentStyle / (30f / length); if (num3 > 1f) { num3 = 1f; } value = length * num * (1f - num3); break; } case PermutatorCause.RecentStyle: { float num2 = recentStyle / (1000f / length); if (num2 > 1f) { num2 = 1f; } value = length * num * (1f - num2); break; } } value = Math.Abs(value); if (!(value >= length * num)) { float f = 1f - value / (length * num); f = FadeLogic(f, fadeType); val = Plugin.ApplyColorPropertyStep2(val, permutator.property, permutator.propertyColor, permutator.propertyFloat1, permutator.propertyFloat2, permutator.propertyFloat3, LEDindex); val.r = val.r * f + colorIn.r * (1f - f); val.g = val.g * f + colorIn.g * (1f - f); val.b = val.b * f + colorIn.b * (1f - f); } } return val; } public static float FadeLogic(float f, FadeEnum fe) { switch (fe) { case FadeEnum.NoFade: if (f > 0f && f <= 1f) { f = 1f; } break; case FadeEnum.Quadratic: f *= f; break; case FadeEnum.SquareRoot: f = Convert.ToSingle(Math.Sqrt(f)); break; case FadeEnum.PassIfAboveHalf: f = ((!((double)f > 0.5)) ? 0f : 1f); break; case FadeEnum.PassIfBelowHalf: f = ((!((double)f < 0.5)) ? 0f : 1f); break; } return f; } public static Color Colorfy(Color colorIn, Color taintColor, float amt) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0058: Unknown result type (might be due to invalid IL or missing references) float num = taintColor.r * amt + colorIn.r * (1f - amt); float num2 = taintColor.g * amt + colorIn.g * (1f - amt); float num3 = taintColor.b * amt + colorIn.b * (1f - amt); Color result = default(Color); ((Color)(ref result))..ctor(num, num2, num3); return result; } public static Color Brighten(Color colorIn, float amt) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_0056: Unknown result type (might be due to invalid IL or missing references) float r = colorIn.r; float g = colorIn.g; float b = colorIn.b; float num = Math.Max(Math.Max(r, g), b); float num2 = num * amt + 1f * (1f - amt); r /= num2; g /= num2; b /= num2; Color result = default(Color); ((Color)(ref result))..ctor(r, g, b); return result; } } [BepInPlugin("UltraRGBLighting", "UltraRGBLighting", "1.0.0")] public class Plugin : BaseUnityPlugin { private string DefaultParentFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? ""; public static ManualLogSource logger = null; public static Random random = new Random(); public static bool modEnabled = false; public static bool connected = false; public static int currentRankInt = 0; public static float currentRankFloat = 0f; public static styleRankColoringScheme[,] styleRankColorSettings = new styleRankColoringScheme[4, 9]; public static Dictionary deviceColorSettings = new Dictionary(); public static Dictionary> colorsBoard = new Dictionary>(); public static List connectedDevices = new List(); public static OpenRgbClient client; public static float[] lastFlickerTime = new float[4]; public static List[] flickerIntensity = new List[4]; public static float flickerIntensityFixedFrequency = 10f; public static float lastFlickerTimeFixed = 0f; public static List flickerIntensityFixed = new List(); public static int maxLEDCount = 0; public static bool[] connectedSchemes = new bool[4]; public static float nextTimeAttemptAutoconnect = 0f; public static float refreshRate = 60f; public static float lastTimeRefreshed = 0f; public static int framesSinceLastRefreshed = 0; private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown Harmony val = new Harmony("UltraRGBLighting"); val.PatchAll(); for (int i = 0; i < Permutators.permutatorArr.Length; i++) { Permutators.permutatorArr[i] = new Permutator(); } for (int j = 0; j < 4; j++) { for (int k = 0; k < 9; k++) { styleRankColorSettings[j, k] = new styleRankColoringScheme(); } } ModConfig.createConfig(); logger = new ManualLogSource("UltraRGBLighting"); Logger.Sources.Add((ILogSource)(object)logger); logger.LogInfo((object)"UltraRGBLighting started!"); } public static Color AlternateColors(styleRankColoringScheme data) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) Color mainColor = data.mainColor; if (data.alternateColorFreq > 0f) { Color mainColor2 = data.mainColor; Color secondaryColor = data.secondaryColor; float num = Time.realtimeSinceStartup * data.alternateColorFreq * 2f * Convert.ToSingle(Math.PI); float num2 = Convert.ToSingle(Math.Sin(num)) / 2f + 0.5f; mainColor.r = mainColor2.r * (1f - num2) + secondaryColor.r * num2; mainColor.g = mainColor2.g * (1f - num2) + secondaryColor.g * num2; mainColor.b = mainColor2.b * (1f - num2) + secondaryColor.b * num2; } return mainColor; } public static Color PulsateColors(Color color, styleRankColoringScheme data) { //IL_0098: 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_005a: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) if (data.pulsateFrequency > 0f) { float num = Time.realtimeSinceStartup * data.pulsateFrequency * 2f * Convert.ToSingle(Math.PI); float num2 = data.pulsateAmplitude * Convert.ToSingle(Math.Sin(num)) / 2f + 0.5f; color.r *= 1f - num2; color.g *= 1f - num2; color.b *= 1f - num2; } return color; } public static Color FlickerColors(Color color, styleRankColoringScheme data, int settingsIndex, int LEDindex) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_0099: Unknown result type (might be due to invalid IL or missing references) if (data.flickerFrequency > 0f) { float num = flickerIntensity[settingsIndex][LEDindex] * data.flickerAmplitude; color.r = color.r * (1f - num) + data.flickerColor.r * num; color.g = color.g * (1f - num) + data.flickerColor.g * num; color.b = color.b * (1f - num) + data.flickerColor.b * num; } return color; } public static Color HSVToColor(float h, float S, float V) { //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) float num; for (num = h; num < 0f; num += 360f) { } while (num >= 360f) { num -= 360f; } float num4; float num3; float num2; if (V <= 0f) { num4 = (num3 = (num2 = 0f)); } else if (S <= 0f) { num4 = (num3 = (num2 = V)); } else { float num5 = num / 60f; int num6 = (int)Math.Floor(num5); float num7 = num5 - (float)num6; float num8 = V * (1f - S); float num9 = V * (1f - S * num7); float num10 = V * (1f - S * (1f - num7)); switch (num6) { case 0: num4 = V; num3 = num10; num2 = num8; break; case 1: num4 = num9; num3 = V; num2 = num8; break; case 2: num4 = num8; num3 = V; num2 = num10; break; case 3: num4 = num8; num3 = num9; num2 = V; break; case 4: num4 = num10; num3 = num8; num2 = V; break; case 5: num4 = V; num3 = num8; num2 = num9; break; case 6: num4 = V; num3 = num10; num2 = num8; break; case -1: num4 = V; num3 = num8; num2 = num9; break; default: num4 = (num3 = (num2 = V)); break; } } Color result = default(Color); ((Color)(ref result))..ctor(num4, num3, num2); return result; } public static Color InverseColor(Color colorIn) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Color result = default(Color); result.r = 1f - colorIn.r; result.g = 1f - colorIn.g; result.b = 1f - colorIn.b; return result; } public static Color ApplyColorPropertyStep2(Color colorIn, colorPropertyEnum property, Color propertyColor, float f1, float f2, float f3, int LEDindex) { //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) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_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_00a2: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: 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_020a: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: 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_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: 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_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0381: 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_041d: 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_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: 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_0506: 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_0524: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_0591: 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_05af: Unknown result type (might be due to invalid IL or missing references) Color result = colorIn; switch (property) { case colorPropertyEnum.None: return colorIn; case colorPropertyEnum.RainbowWhole: { if (f1 > 1f) { f1 = 1f; } if (f1 < 0f) { f1 = 0f; } Color val = HSVToColor(Convert.ToSingle((double)Time.realtimeSinceStartup * 360.0 * (double)f2), 1f, 1f); result.r = val.r * f1 + colorIn.r * (1f - f1); result.g = val.g * f1 + colorIn.g * (1f - f1); result.b = val.b * f1 + colorIn.b * (1f - f1); break; } case colorPropertyEnum.RainbowFlickerFixed: if (flickerIntensityFixed.Count != 0) { Color val2 = HSVToColor(flickerIntensityFixed[LEDindex] * 360f, 1f, 1f); result.r = val2.r * f1 + colorIn.r * (1f - f1); result.g = val2.g * f1 + colorIn.g * (1f - f1); result.b = val2.b * f1 + colorIn.b * (1f - f1); } break; case colorPropertyEnum.FlickerFixed: if (flickerIntensityFixed.Count != 0) { float num3 = flickerIntensityFixed[LEDindex] * f1; result.r = colorIn.r * (1f - num3) + propertyColor.r * num3; result.g = colorIn.g * (1f - num3) + propertyColor.g * num3; result.b = colorIn.b * (1f - num3) + propertyColor.b * num3; } break; case colorPropertyEnum.InverseColors: result = InverseColor(colorIn); break; case colorPropertyEnum.Brighten: result = Permutators.Brighten(colorIn, f1); break; case colorPropertyEnum.CheckerboardInverseColor: { int num5 = 1; if (f2 > 0f) { num5 = (int)Math.Round(Time.realtimeSinceStartup * f2) % 2; } if (LEDindex % 2 == num5) { result = InverseColor(colorIn); } break; } case colorPropertyEnum.CheckerboardColor: { int num4 = 1; if (f1 > 1f) { f1 = 1f; } if (f2 > 0f) { num4 = (int)Math.Round(Time.realtimeSinceStartup * f2) % 2; } if (LEDindex % 2 == num4) { if (f3 > 0f) { f1 *= 0.5f + 0.5f * Convert.ToSingle(Math.Sin((double)(Time.realtimeSinceStartup * 2f) * Math.PI * (double)f3)); } result.r = colorIn.r * (1f - f1) + propertyColor.r * f1; result.g = colorIn.g * (1f - f1) + propertyColor.g * f1; result.b = colorIn.b * (1f - f1) + propertyColor.b * f1; } break; } case colorPropertyEnum.Colorfy: if (f1 > 1f) { f1 = 1f; } result = Permutators.Colorfy(colorIn, propertyColor, f1); break; case colorPropertyEnum.SnakeColor: { int num2 = (int)Math.Round(f3); for (int j = 0; j < num2; j++) { if ((int)Math.Round(Time.realtimeSinceStartup * f2) % maxLEDCount == LEDindex - j) { result.r = colorIn.r * (1f - f1) + propertyColor.r * f1; result.g = colorIn.g * (1f - f1) + propertyColor.g * f1; result.b = colorIn.b * (1f - f1) + propertyColor.b * f1; } } break; } case colorPropertyEnum.DoubleSnakeColor: { int num = (int)Math.Round(f3); for (int i = 0; i < num; i++) { if ((int)Math.Round(Time.realtimeSinceStartup * f2) % maxLEDCount == LEDindex - i) { result.r = colorIn.r * (1f - f1) + propertyColor.r * f1; result.g = colorIn.g * (1f - f1) + propertyColor.g * f1; result.b = colorIn.b * (1f - f1) + propertyColor.b * f1; } if (((int)(0.0 - Math.Round(Time.realtimeSinceStartup * f2)) % maxLEDCount + maxLEDCount) % maxLEDCount == LEDindex - i) { result.r = colorIn.r * (1f - f1) + propertyColor.r * f1; result.g = colorIn.g * (1f - f1) + propertyColor.g * f1; result.b = colorIn.b * (1f - f1) + propertyColor.b * f1; } } break; } } return result; } public static Color ApplyColorPropertyStep1(Color colorIn, styleRankColoringScheme data, int settingsIndex, int LEDindex, int propertyNum) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) colorPropertyEnum property = colorPropertyEnum.None; float f = 0f; float f2 = 0f; float f3 = 0f; Color propertyColor = Color.black; switch (propertyNum) { case 1: property = data.property1; f = data.property1Float1; f2 = data.property1Float2; f3 = data.property1Float3; propertyColor = data.property1Color; break; case 2: property = data.property2; f = data.property2Float1; f2 = data.property2Float2; f3 = data.property2Float3; propertyColor = data.property2Color; break; case 3: property = data.property3; f = data.property3Float1; f2 = data.property3Float2; f3 = data.property3Float3; propertyColor = data.property3Color; break; } return ApplyColorPropertyStep2(colorIn, property, propertyColor, f, f2, f3, LEDindex); } public static Color getColorByRank(int i, int settingsIndex, int LEDindex) { //IL_0001: 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_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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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) Color white = Color.white; styleRankColoringScheme data = styleRankColorSettings[settingsIndex, i + 1]; white = AlternateColors(data); white = FlickerColors(white, data, settingsIndex, LEDindex); white = PulsateColors(white, data); white = ApplyColorPropertyStep1(white, data, settingsIndex, LEDindex, 1); white = ApplyColorPropertyStep1(white, data, settingsIndex, LEDindex, 2); return ApplyColorPropertyStep1(white, data, settingsIndex, LEDindex, 3); } public static Color getCurrentColor(int settingsIndex, int LEDindex) { //IL_0001: 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_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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0062: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) Color colorIn = Color.white; if (ModConfig.gradientizeRankColors) { int i = (int)Math.Floor(currentRankFloat); int i2 = (int)Math.Ceiling(currentRankFloat); float num = currentRankFloat - (float)currentRankInt; Color colorByRank = getColorByRank(i, settingsIndex, LEDindex); Color colorByRank2 = getColorByRank(i2, settingsIndex, LEDindex); colorIn.r = colorByRank.r * (1f - num) + colorByRank2.r * num; colorIn.g = colorByRank.g * (1f - num) + colorByRank2.g * num; colorIn.b = colorByRank.b * (1f - num) + colorByRank2.b * num; } else { colorIn = getColorByRank(currentRankInt, settingsIndex, LEDindex); } return Permutators.ApplyPermutators(colorIn, LEDindex); } public static int getSettingsByDeviceIndex(int deviceIndex) { if (deviceColorSettings.ContainsKey(deviceIndex)) { if (deviceColorSettings[deviceIndex].scheme == styleRankColoringSchemeEnum.Scheme1) { return 0; } if (deviceColorSettings[deviceIndex].scheme == styleRankColoringSchemeEnum.Scheme2) { return 1; } if (deviceColorSettings[deviceIndex].scheme == styleRankColoringSchemeEnum.Scheme3) { return 2; } if (deviceColorSettings[deviceIndex].scheme == styleRankColoringSchemeEnum.Scheme4) { return 3; } if (deviceColorSettings[deviceIndex].scheme == styleRankColoringSchemeEnum.Default) { return (int)(ModConfig.defaultColoring - 2); } if (deviceColorSettings[deviceIndex].scheme == styleRankColoringSchemeEnum.None) { return -1; } } return -2; } public static void flickerIntensityLogic() { float realtimeSinceStartup = Time.realtimeSinceStartup; for (int i = 0; i < 4; i++) { if (!connectedSchemes[i]) { continue; } float flickerFrequency = styleRankColorSettings[i, currentRankInt + 1].flickerFrequency; float num = 1f / flickerFrequency; if (realtimeSinceStartup > lastFlickerTime[i] + num) { for (int j = 0; j < maxLEDCount; j++) { flickerIntensity[i][j] = Convert.ToSingle(random.NextDouble()); lastFlickerTime[i] = Time.realtimeSinceStartup; } } } float num2 = flickerIntensityFixedFrequency; float num3 = 1f / num2; if (realtimeSinceStartup > lastFlickerTimeFixed + num3) { for (int k = 0; k < maxLEDCount; k++) { flickerIntensityFixed[k] = Convert.ToSingle(random.NextDouble()); lastFlickerTimeFixed = Time.realtimeSinceStartup; } } } public static void mainLogic() { //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018c: 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_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) if (!modEnabled || (Object)(object)MonoSingleton.Instance == (Object)null) { return; } framesSinceLastRefreshed++; if (!(lastTimeRefreshed + 1f / refreshRate < Time.realtimeSinceStartup)) { return; } lastTimeRefreshed = Time.realtimeSinceStartup; connectedSchemes[0] = false; connectedSchemes[1] = false; connectedSchemes[2] = false; connectedSchemes[3] = false; for (int i = 0; i < connectedDevices.Count; i++) { if (getSettingsByDeviceIndex(i) > 0) { connectedSchemes[getSettingsByDeviceIndex(i)] = true; } } Permutators.actionLogic(); currentRankInt = MonoSingleton.Instance.rankIndex; currentRankFloat = (float)currentRankInt + MonoSingleton.Instance.currentMeter / (float)MonoSingleton.Instance.currentRank.maxMeter; if (currentRankFloat < 0f) { currentRankFloat = -1f; currentRankInt = -1; } if (connected) { flickerIntensityLogic(); foreach (Device connectedDevice in connectedDevices) { int index = connectedDevice.Index; for (int j = 0; j < colorsBoard[index].Count; j++) { int settingsByDeviceIndex = getSettingsByDeviceIndex(index); if (settingsByDeviceIndex >= 0) { Color currentColor = getCurrentColor(settingsByDeviceIndex, j); byte b = (byte)(int)(currentColor.r * 255f); byte b2 = (byte)(int)(currentColor.g * 255f); byte b3 = (byte)(int)(currentColor.b * 255f); colorsBoard[index][j] = new Color(b, b2, b3); } } Color[] array = (Color[])(object)new Color[colorsBoard[index].Count]; for (int k = 0; k < array.Length; k++) { array[k] = colorsBoard[index][k]; } client.UpdateLeds(index, (ReadOnlySpan)array); } } else if (ModConfig.autoConnect && Time.realtimeSinceStartup > nextTimeAttemptAutoconnect) { nextTimeAttemptAutoconnect = Time.realtimeSinceStartup + 15f; try { ModConfig.connectToOpenRGB(); } catch (Exception ex) { logger.LogInfo((object)"Could not automatically connect to OpenRGB for some reason... printing stack trace\n"); logger.LogInfo((object)ex.ToString()); } } framesSinceLastRefreshed = 0; } private void Update() { mainLogic(); } } public class styleRankColoringScheme { public Color mainColor; public Color secondaryColor; public float alternateColorFreq = 0f; public float pulsateAmplitude = 0f; public float pulsateFrequency = 0f; public float flickerAmplitude = 0f; public Color flickerColor = Color.black; public float flickerFrequency = 0f; public colorPropertyEnum property1 = colorPropertyEnum.None; public Color property1Color = Color.black; public float property1Float1 = 0f; public float property1Float2 = 0f; public float property1Float3 = 0f; public colorPropertyEnum property2 = colorPropertyEnum.None; public Color property2Color = Color.black; public float property2Float1 = 0f; public float property2Float2 = 0f; public float property2Float3 = 0f; public colorPropertyEnum property3 = colorPropertyEnum.None; public Color property3Color = Color.black; public float property3Float1 = 0f; public float property3Float2 = 0f; public float property3Float3 = 0f; } public enum styleRankColoringSchemeEnum { None, Default, Scheme1, Scheme2, Scheme3, Scheme4 } public enum forcedStyleRankColoringSchemeEnum { None, Scheme1, Scheme2, Scheme3, Scheme4 } public enum colorPropertyEnum { None, RainbowWhole, RainbowFlickerFixed, FlickerFixed, InverseColors, Brighten, CheckerboardInverseColor, CheckerboardColor, Colorfy, SnakeColor, DoubleSnakeColor } public class deviceColoringScheme { public styleRankColoringSchemeEnum scheme = styleRankColoringSchemeEnum.None; } public class ModConfig { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static BoolValueChangeEventDelegate <>9__7_1; public static BoolValueChangeEventDelegate <>9__7_2; public static FloatValueChangeEventDelegate <>9__7_3; public static FloatValueChangeEventDelegate <>9__7_4; public static EnumValueChangeEventDelegate <>9__18_0; internal void b__7_1(BoolValueChangeEvent e) { autoConnect = e.value; } internal void b__7_2(BoolValueChangeEvent e) { gradientizeRankColors = e.value; } internal void b__7_3(FloatValueChangeEvent e) { Plugin.flickerIntensityFixedFrequency = e.value; } internal void b__7_4(FloatValueChangeEvent e) { Plugin.refreshRate = e.value; } internal void b__18_0(EnumValueChangeEvent e) { defaultColoring = convertForcedToNormalStyleRankEnum(e.value); } } private static string DefaultParentFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? ""; public static bool gradientizeRankColors = false; public static ConfigPanel connectedDevicesPanel; public static ButtonField connectButton; public static bool autoConnect = false; public static string[] styleNames = new string[9] { "No Rank", "Destructive", "Chaotic", "Brutal", "Anarchic", "Supreme", "SSadistic", "SSShitstorm", "ULTRAKILL" }; public static Color[] styleColors = (Color[])(object)new Color[9] { Color.grey, Color.blue, Color.green, Color.yellow, Color.magenta, Color.red, Color.red, Color.red, Color.white }; public static Dictionary deviceConfigPanels = new Dictionary(); public static Dictionary deviceConfigHeaders = new Dictionary(); public static ConfigDivision enableRestDevicesDivision; public static styleRankColoringSchemeEnum defaultColoring = styleRankColoringSchemeEnum.None; public static styleRankColoringSchemeEnum convertForcedToNormalStyleRankEnum(forcedStyleRankColoringSchemeEnum data) { return data switch { forcedStyleRankColoringSchemeEnum.None => styleRankColoringSchemeEnum.None, forcedStyleRankColoringSchemeEnum.Scheme1 => styleRankColoringSchemeEnum.Scheme1, forcedStyleRankColoringSchemeEnum.Scheme2 => styleRankColoringSchemeEnum.Scheme2, forcedStyleRankColoringSchemeEnum.Scheme3 => styleRankColoringSchemeEnum.Scheme3, forcedStyleRankColoringSchemeEnum.Scheme4 => styleRankColoringSchemeEnum.Scheme4, _ => styleRankColoringSchemeEnum.None, }; } public static void connectToOpenRGB() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_00f8: Unknown result type (might be due to invalid IL or missing references) OpenRgbClient val = null; if (!Plugin.connected || Plugin.client == null) { val = (Plugin.client = new OpenRgbClient("127.0.0.1", 6742, "OpenRGB.NET", true, 1000, 4u)); try { val.Connect(); } catch (Exception) { Plugin.logger.LogInfo((object)"could not connect to OpenRGB"); } Plugin.logger.LogInfo((object)"Connected to OpenRGB"); } else { val = Plugin.client; } Plugin[] plugins = val.GetPlugins(); Device[] allControllerData = val.GetAllControllerData(); string[] profiles = val.GetProfiles(); Plugin.logger.LogInfo((object)"Found devices:"); Device[] array = allControllerData; foreach (Device val2 in array) { Plugin.connectedDevices.Add(val2); Plugin.logger.LogInfo((object)val2.Name); List list = new List(val2.Leds.Length); for (int j = 0; j < val2.Leds.Length; j++) { list.Add(new Color(byte.MaxValue, byte.MaxValue, byte.MaxValue)); } Plugin.colorsBoard[val2.Index] = list; if (Plugin.maxLEDCount < val2.Leds.Length) { Plugin.maxLEDCount = val2.Leds.Length; } } Plugin.flickerIntensity[0] = new List(); Plugin.flickerIntensity[1] = new List(); Plugin.flickerIntensity[2] = new List(); Plugin.flickerIntensity[3] = new List(); Plugin.flickerIntensityFixed = new List(); for (int k = 0; k < Plugin.maxLEDCount; k++) { Plugin.flickerIntensity[0].Add(0f); Plugin.flickerIntensity[1].Add(0f); Plugin.flickerIntensity[2].Add(0f); Plugin.flickerIntensity[3].Add(0f); Plugin.flickerIntensityFixed.Add(0f); } Plugin.connected = true; refillConnectedDevicePanels(); } public static void createConfig() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Expected O, but got Unknown //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Expected O, but got Unknown //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Expected O, but got Unknown //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Expected O, but got Unknown //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Expected O, but got Unknown //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Expected O, but got Unknown //IL_02a6: 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_02b1: Expected O, but got Unknown PluginConfigurator val = PluginConfigurator.Create("UltraRGBLighting", "UltraRGBLighting"); val.SetIconWithURL(Path.Combine(DefaultParentFolder, "icon.png") ?? ""); connectButton = new ButtonField(val.rootPanel, "Connect", "button.connectButton"); connectButton.onClick += new OnClick(connectToOpenRGB); BoolField val2 = new BoolField(val.rootPanel, "Mod Enabled", "modEnabled", true); ConfigDivision division = new ConfigDivision(val.rootPanel, "division"); val2.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e) { Plugin.modEnabled = e.value; ((ConfigField)division).interactable = e.value; }; Plugin.modEnabled = val2.value; ((ConfigField)division).interactable = val2.value; BoolField val3 = new BoolField((ConfigPanel)(object)division, "Attempt Autoconnect Periodically", "autoconnectfield", false); object obj = <>c.<>9__7_1; if (obj == null) { BoolValueChangeEventDelegate val4 = delegate(BoolValueChangeEvent e) { autoConnect = e.value; }; <>c.<>9__7_1 = val4; obj = (object)val4; } val3.onValueChange += (BoolValueChangeEventDelegate)obj; autoConnect = val3.value; BoolField val5 = new BoolField((ConfigPanel)(object)division, "Gradientize Colors between Ranks", "stylerankcolorsgradientize", false); object obj2 = <>c.<>9__7_2; if (obj2 == null) { BoolValueChangeEventDelegate val6 = delegate(BoolValueChangeEvent e) { gradientizeRankColors = e.value; }; <>c.<>9__7_2 = val6; obj2 = (object)val6; } val5.onValueChange += (BoolValueChangeEventDelegate)obj2; gradientizeRankColors = val5.value; FloatField val7 = new FloatField((ConfigPanel)(object)division, "Fixed Flicker Frequency", "fixedflickerfrequency", 0f, 0f, 1000f); object obj3 = <>c.<>9__7_3; if (obj3 == null) { FloatValueChangeEventDelegate val8 = delegate(FloatValueChangeEvent e) { Plugin.flickerIntensityFixedFrequency = e.value; }; <>c.<>9__7_3 = val8; obj3 = (object)val8; } val7.onValueChange += (FloatValueChangeEventDelegate)obj3; Plugin.flickerIntensityFixedFrequency = val7.value; connectedDevicesPanel = new ConfigPanel((ConfigPanel)(object)division, "Connected Devices Settings", "connectedDevicesPanel"); fillConnectedDevicesPanel(connectedDevicesPanel); ConfigPanel rootPanel = new ConfigPanel((ConfigPanel)(object)division, "Style Rank Settings", "styleranksettingsPanel"); for (int i = 0; i < 4; i++) { createEntireStyleColoringPanel(rootPanel, i); } ConfigPanel val9 = new ConfigPanel((ConfigPanel)(object)division, "Permutator Settings", "permutatorsettingsPanel"); new ConfigHeader(val9, "Permutators are handled sequentially in order", 15); for (int j = 0; j < 15; j++) { createPermutatorPanel(val9, j); } new ConfigHeader((ConfigPanel)(object)division, "Increase refresh rate for more responsiveness on RGB device, decrease to reduce load on game.", 18); FloatField val10 = new FloatField((ConfigPanel)(object)division, "Refresh rate (Hz)", "refreshRate", 50f, 0.1f, 1000f); object obj4 = <>c.<>9__7_4; if (obj4 == null) { FloatValueChangeEventDelegate val11 = delegate(FloatValueChangeEvent e) { Plugin.refreshRate = e.value; }; <>c.<>9__7_4 = val11; obj4 = (object)val11; } val10.onValueChange += (FloatValueChangeEventDelegate)obj4; Plugin.refreshRate = val10.value; } public static void changePermutatorPanel(PermutatorCause pc, colorPropertyEnum property, BoolField boolField, FloatField lengthField, FloatField ff1, FloatField ff2, FloatField ff3, ColorField colorField) { changePropertyFieldNames(property, ff1, ff2, ff3, colorField); switch (pc) { case PermutatorCause.None: ((ConfigField)boolField).interactable = false; ((ConfigField)boolField).displayName = "N/A"; ((ConfigField)lengthField).displayName = "Effect Duration"; break; case PermutatorCause.RecentDamage: ((ConfigField)boolField).interactable = false; ((ConfigField)boolField).displayName = "N/A"; ((ConfigField)lengthField).displayName = "Damage Sensitivity"; break; case PermutatorCause.RecentKills: ((ConfigField)boolField).interactable = false; ((ConfigField)boolField).displayName = "N/A"; ((ConfigField)lengthField).displayName = "Kill Sensitivity"; break; case PermutatorCause.RecentStyle: ((ConfigField)boolField).interactable = false; ((ConfigField)boolField).displayName = "N/A"; ((ConfigField)lengthField).displayName = "Style Sensitivity"; break; case PermutatorCause.OnDamage: ((ConfigField)boolField).interactable = true; ((ConfigField)boolField).displayName = "Scale Time With Damage"; ((ConfigField)lengthField).displayName = "Effect Duration"; break; case PermutatorCause.OnKill: ((ConfigField)boolField).interactable = true; ((ConfigField)boolField).displayName = "Scale Time With Kill Size"; ((ConfigField)lengthField).displayName = "Effect Duration"; break; case PermutatorCause.OnPlayerDeath: ((ConfigField)boolField).interactable = false; ((ConfigField)boolField).displayName = "N/A"; ((ConfigField)lengthField).displayName = "Effect Duration"; break; case PermutatorCause.OnRankGain: ((ConfigField)boolField).interactable = false; ((ConfigField)boolField).displayName = "N/A"; ((ConfigField)lengthField).displayName = "Effect Duration"; break; case PermutatorCause.OnRankLose: ((ConfigField)boolField).interactable = false; ((ConfigField)boolField).displayName = "N/A"; ((ConfigField)lengthField).displayName = "Effect Duration"; break; case PermutatorCause.OnStyleGain: ((ConfigField)boolField).interactable = true; ((ConfigField)boolField).displayName = "Scale With Style Gained"; ((ConfigField)lengthField).displayName = "Effect Duration"; break; case PermutatorCause.OnTakeDamage: ((ConfigField)boolField).interactable = true; ((ConfigField)boolField).displayName = "Scale With Damage Taken"; ((ConfigField)lengthField).displayName = "Effect Duration"; break; case PermutatorCause.OnTrueStop: ((ConfigField)boolField).interactable = false; ((ConfigField)boolField).displayName = "N/A"; ((ConfigField)lengthField).displayName = "Effect Duration"; break; case PermutatorCause.Always: ((ConfigField)boolField).interactable = false; ((ConfigField)boolField).displayName = "N/A"; ((ConfigField)lengthField).displayName = "Effect Duration"; break; } } public static void createPermutatorPanel(ConfigPanel rootPanel, int i) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Expected O, but got Unknown //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Expected O, but got Unknown //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Expected O, but got Unknown //IL_01f7: 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_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Expected O, but got Unknown //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Expected O, but got Unknown //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Expected O, but got Unknown //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Expected O, but got Unknown //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Expected O, but got Unknown //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Expected O, but got Unknown ConfigPanel val = new ConfigPanel(rootPanel, "Permutator " + (i + 1), "permutatorPanel" + i); EnumField causeField = new EnumField(val, "Permutator Cause", "permutatorCause" + i, PermutatorCause.None); BoolField scaleWithCauseField = new BoolField(val, "Scale With Cause Magnitude", "permutatorscalecause" + i, false); scaleWithCauseField.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e) { Permutators.permutatorArr[i].scaleWithCauseMagnitude = e.value; }; Permutators.permutatorArr[i].scaleWithCauseMagnitude = scaleWithCauseField.value; EnumField effectField = new EnumField(val, "Permutator Effect", "permutatorEffect" + i, colorPropertyEnum.None); EnumField val2 = new EnumField(val, "Permutator Fade Type", "permutatorfade" + i, FadeEnum.Linear); val2.onValueChange += delegate(EnumValueChangeEvent e) { Permutators.permutatorArr[i].fadeType = e.value; }; Permutators.permutatorArr[i].fadeType = val2.value; FloatField lengthField = new FloatField(val, "Effect Duration", "permutatorEffectduration" + i, 0f, 0f, 100f); lengthField.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Permutators.permutatorArr[i].length = e.value; }; Permutators.permutatorArr[i].length = lengthField.value; ColorField colorField = new ColorField(val, "Effect Color (if applicable)", "permutatorEffectColor" + i, Color.white); colorField.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) Permutators.permutatorArr[i].propertyColor = e.value; }; Permutators.permutatorArr[i].propertyColor = colorField.value; FloatField propertyValue1Field = new FloatField(val, "Value 1", "permutatorfloat1" + i, 0f, 0f, 1000f); propertyValue1Field.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Permutators.permutatorArr[i].propertyFloat1 = e.value; }; Permutators.permutatorArr[i].propertyFloat1 = propertyValue1Field.value; FloatField propertyValue2Field = new FloatField(val, "Value 2", "permutatorfloat2" + i, 0f, 0f, 1000f); propertyValue2Field.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Permutators.permutatorArr[i].propertyFloat2 = e.value; }; Permutators.permutatorArr[i].propertyFloat2 = propertyValue2Field.value; FloatField propertyValue3Field = new FloatField(val, "Value 3", "permutatorfloat3" + i, 0f, 0f, 1000f); propertyValue3Field.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Permutators.permutatorArr[i].propertyFloat3 = e.value; }; Permutators.permutatorArr[i].propertyFloat3 = propertyValue3Field.value; causeField.onValueChange += delegate(EnumValueChangeEvent e) { Permutators.permutatorArr[i].cause = e.value; changePermutatorPanel(e.value, effectField.value, scaleWithCauseField, lengthField, propertyValue1Field, propertyValue2Field, propertyValue3Field, colorField); }; Permutators.permutatorArr[i].cause = causeField.value; effectField.onValueChange += delegate(EnumValueChangeEvent e) { Permutators.permutatorArr[i].property = e.value; changePermutatorPanel(causeField.value, e.value, scaleWithCauseField, lengthField, propertyValue1Field, propertyValue2Field, propertyValue3Field, colorField); }; Permutators.permutatorArr[i].property = effectField.value; changePermutatorPanel(causeField.value, effectField.value, scaleWithCauseField, lengthField, propertyValue1Field, propertyValue2Field, propertyValue3Field, colorField); } public static void createEntireStyleColoringPanel(ConfigPanel rootPanel, int i) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown ConfigPanel rootPanel2 = new ConfigPanel(rootPanel, "Style Rank Colors Config " + (i + 1), "configPanelX" + i); for (int j = 0; j < 9; j++) { createStyleRankColoringSchemePanel(rootPanel2, i, j); } } public static void changePropertyFieldNames(colorPropertyEnum property, FloatField ff1, FloatField ff2, FloatField ff3, ColorField colorField) { ((ConfigField)ff3).displayName = "N/A"; ((ConfigField)ff3).interactable = false; switch (property) { case colorPropertyEnum.None: ((ConfigField)ff1).displayName = "N/A"; ((ConfigField)ff2).displayName = "N/A"; ((ConfigField)ff1).interactable = false; ((ConfigField)ff2).interactable = false; ((ConfigField)colorField).interactable = false; break; case colorPropertyEnum.RainbowWhole: ((ConfigField)ff1).displayName = "Intensity"; ((ConfigField)ff2).displayName = "Frequency"; ((ConfigField)ff1).interactable = true; ((ConfigField)ff2).interactable = true; ((ConfigField)colorField).interactable = false; break; case colorPropertyEnum.RainbowFlickerFixed: ((ConfigField)ff1).displayName = "Intensity Of Flicker"; ((ConfigField)ff2).displayName = "Frequency Of Fixed Flicker"; ((ConfigField)ff1).interactable = true; ((ConfigField)ff2).interactable = false; ((ConfigField)colorField).interactable = false; break; case colorPropertyEnum.FlickerFixed: ((ConfigField)ff1).displayName = "Intensity Of Flicker"; ((ConfigField)ff2).displayName = "Frequency Of Fixed Flicker"; ((ConfigField)ff1).interactable = true; ((ConfigField)ff2).interactable = false; ((ConfigField)colorField).interactable = true; break; case colorPropertyEnum.InverseColors: ((ConfigField)ff1).displayName = "N/A"; ((ConfigField)ff2).displayName = "N/A"; ((ConfigField)ff1).interactable = false; ((ConfigField)ff2).interactable = false; ((ConfigField)colorField).interactable = false; break; case colorPropertyEnum.Brighten: ((ConfigField)ff1).displayName = "Intensity"; ((ConfigField)ff2).displayName = "N/A"; ((ConfigField)ff1).interactable = true; ((ConfigField)ff2).interactable = false; ((ConfigField)colorField).interactable = false; break; case colorPropertyEnum.CheckerboardInverseColor: ((ConfigField)ff1).displayName = "N/A"; ((ConfigField)ff2).displayName = "Frequency of Swapping"; ((ConfigField)ff1).interactable = false; ((ConfigField)ff2).interactable = true; ((ConfigField)colorField).interactable = false; break; case colorPropertyEnum.CheckerboardColor: ((ConfigField)ff1).displayName = "Color Intensity"; ((ConfigField)ff2).displayName = "Frequency of Swapping"; ((ConfigField)ff3).displayName = "Frequency of Pulsating"; ((ConfigField)ff1).interactable = true; ((ConfigField)ff2).interactable = true; ((ConfigField)ff3).interactable = true; ((ConfigField)colorField).interactable = true; break; case colorPropertyEnum.Colorfy: ((ConfigField)ff1).displayName = "Color Intensity"; ((ConfigField)ff2).displayName = "N/A"; ((ConfigField)ff1).interactable = true; ((ConfigField)ff2).interactable = false; ((ConfigField)colorField).interactable = true; break; case colorPropertyEnum.SnakeColor: ((ConfigField)ff1).displayName = "Color Intensity"; ((ConfigField)ff2).displayName = "Speed"; ((ConfigField)ff3).displayName = "Length (rounded)"; ((ConfigField)ff1).interactable = true; ((ConfigField)ff2).interactable = true; ((ConfigField)ff3).interactable = true; ((ConfigField)colorField).interactable = true; break; case colorPropertyEnum.DoubleSnakeColor: ((ConfigField)ff1).displayName = "Color Intensity"; ((ConfigField)ff2).displayName = "Speed"; ((ConfigField)ff3).displayName = "Length (rounded)"; ((ConfigField)ff1).interactable = true; ((ConfigField)ff2).interactable = true; ((ConfigField)ff3).interactable = true; ((ConfigField)colorField).interactable = true; break; } } public static void createStyleRankColoringSchemePanel(ConfigPanel rootPanel, int index, int j) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0083: 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_008e: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_0106: Expected O, but got Unknown //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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_017b: Expected O, but got Unknown //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Expected O, but got Unknown //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Expected O, but got Unknown //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Expected O, but got Unknown //IL_0253: 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_025f: Expected O, but got Unknown //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Expected O, but got Unknown //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_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Expected O, but got Unknown //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Expected O, but got Unknown //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Expected O, but got Unknown //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Expected O, but got Unknown //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Expected O, but got Unknown //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Expected O, but got Unknown //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Expected O, but got Unknown //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Expected O, but got Unknown //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_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Expected O, but got Unknown //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Expected O, but got Unknown //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Expected O, but got Unknown //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Expected O, but got Unknown //IL_0603: Unknown result type (might be due to invalid IL or missing references) //IL_060d: Expected O, but got Unknown //IL_061a: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Expected O, but got Unknown //IL_06ae: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0718: Unknown result type (might be due to invalid IL or missing references) //IL_0722: Expected O, but got Unknown //IL_072f: Unknown result type (might be due to invalid IL or missing references) //IL_0739: Expected O, but got Unknown //IL_0756: Unknown result type (might be due to invalid IL or missing references) //IL_075b: 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_07a5: Expected O, but got Unknown //IL_07b2: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Expected O, but got Unknown //IL_081e: Unknown result type (might be due to invalid IL or missing references) //IL_0828: Expected O, but got Unknown //IL_0835: Unknown result type (might be due to invalid IL or missing references) //IL_083f: Expected O, but got Unknown //IL_08a1: Unknown result type (might be due to invalid IL or missing references) //IL_08ab: Expected O, but got Unknown //IL_08b8: Unknown result type (might be due to invalid IL or missing references) //IL_08c2: Expected O, but got Unknown //IL_094c: Unknown result type (might be due to invalid IL or missing references) //IL_09b1: Unknown result type (might be due to invalid IL or missing references) //IL_09b6: Unknown result type (might be due to invalid IL or missing references) //IL_09c0: Expected O, but got Unknown //IL_09cd: Unknown result type (might be due to invalid IL or missing references) //IL_09d7: Expected O, but got Unknown //IL_09f4: Unknown result type (might be due to invalid IL or missing references) //IL_09f9: Unknown result type (might be due to invalid IL or missing references) //IL_0a39: Unknown result type (might be due to invalid IL or missing references) //IL_0a43: Expected O, but got Unknown //IL_0a50: Unknown result type (might be due to invalid IL or missing references) //IL_0a5a: Expected O, but got Unknown //IL_0abc: Unknown result type (might be due to invalid IL or missing references) //IL_0ac6: Expected O, but got Unknown //IL_0ad3: Unknown result type (might be due to invalid IL or missing references) //IL_0add: Expected O, but got Unknown //IL_0b3f: Unknown result type (might be due to invalid IL or missing references) //IL_0b49: Expected O, but got Unknown //IL_0b56: Unknown result type (might be due to invalid IL or missing references) //IL_0b60: Expected O, but got Unknown ConfigPanel val = new ConfigPanel(rootPanel, styleNames[j], "stylerankpanel" + j + " " + index); ColorField val2 = new ColorField(val, "Main Color", "stylerankMainColor" + j + " " + index, styleColors[j]); val2.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e) { //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) Plugin.styleRankColorSettings[index, j].mainColor = e.value; }; Plugin.styleRankColorSettings[index, j].mainColor = val2.value; new ConfigHeader(val, "Alternate Color only used if Color Alternate Frequency > 0", 12); ColorField val3 = new ColorField(val, "Alternate Color", "stylerankAltColor" + j + " " + index, Color.cyan); val3.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e) { //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) Plugin.styleRankColorSettings[index, j].secondaryColor = e.value; }; Plugin.styleRankColorSettings[index, j].secondaryColor = val3.value; FloatField val4 = new FloatField(val, "Color Alternate Frequency", "colorAlternateFrequency" + j + " " + index, 0f, 0f, 1000f); val4.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].alternateColorFreq = e.value; }; Plugin.styleRankColorSettings[index, j].alternateColorFreq = val4.value; FloatField val5 = new FloatField(val, "Flicker Frequency", "flickerFrequency" + j + " " + index, 0f, 0f, 1000f); val5.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].flickerFrequency = e.value; }; Plugin.styleRankColorSettings[index, j].flickerFrequency = val5.value; ColorField val6 = new ColorField(val, "Flicker Color", "flickerColor" + j + " " + index, Color.black); val6.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e) { //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) Plugin.styleRankColorSettings[index, j].flickerColor = e.value; }; Plugin.styleRankColorSettings[index, j].flickerColor = val6.value; FloatField val7 = new FloatField(val, "Flicker Intensity", "flickerIntensity" + j + " " + index, 0f, 0f, 1f); val7.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].flickerAmplitude = e.value; }; Plugin.styleRankColorSettings[index, j].flickerAmplitude = val7.value; FloatField val8 = new FloatField(val, "Pulsate Frequency", "pulsateFrequency" + j + " " + index, 0f, 0f, 1000f); val8.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].pulsateFrequency = e.value; }; Plugin.styleRankColorSettings[index, j].pulsateFrequency = val8.value; FloatField val9 = new FloatField(val, "Pulsate Intensity", "pulsateIntensity" + j + " " + index, 0f, 0f, 1f); val9.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].pulsateAmplitude = e.value; }; Plugin.styleRankColorSettings[index, j].pulsateAmplitude = val9.value; new ConfigHeader(val, "Additional Properties", 24); new ConfigHeader(val, "Property 1", 15); EnumField val10 = new EnumField(val, "Property 1", "property1" + j + " " + index, colorPropertyEnum.None); ColorField filter1ColorField = new ColorField(val, "Property 1 Color", "property1color" + j + " " + index, Color.black); filter1ColorField.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e) { //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) Plugin.styleRankColorSettings[index, j].property1Color = e.value; }; Plugin.styleRankColorSettings[index, j].property1Color = filter1ColorField.value; FloatField additionalFilter1Float1Field = new FloatField(val, "Property 1 Value 1", "property1float1" + j + " " + index, 0f, 0f, 1000f); additionalFilter1Float1Field.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].property1Float1 = e.value; }; Plugin.styleRankColorSettings[index, j].property1Float1 = additionalFilter1Float1Field.value; FloatField additionalFilter1Float2Field = new FloatField(val, "Property 1 Value 2", "property1float2" + j + " " + index, 0f, 0f, 1000f); additionalFilter1Float2Field.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].property1Float2 = e.value; }; Plugin.styleRankColorSettings[index, j].property1Float2 = additionalFilter1Float2Field.value; FloatField additionalFilter1Float3Field = new FloatField(val, "Property 1 Value 3", "property1float3" + j + " " + index, 0f, 0f, 1000f); additionalFilter1Float3Field.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].property1Float3 = e.value; }; Plugin.styleRankColorSettings[index, j].property1Float3 = additionalFilter1Float3Field.value; val10.onValueChange += delegate(EnumValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].property1 = e.value; changePropertyFieldNames(e.value, additionalFilter1Float1Field, additionalFilter1Float2Field, additionalFilter1Float3Field, filter1ColorField); }; Plugin.styleRankColorSettings[index, j].property1 = val10.value; changePropertyFieldNames(val10.value, additionalFilter1Float1Field, additionalFilter1Float2Field, additionalFilter1Float3Field, filter1ColorField); new ConfigHeader(val, "Property 2", 15); EnumField val11 = new EnumField(val, "Property 2", "property2" + j + " " + index, colorPropertyEnum.None); ColorField filter2ColorField = new ColorField(val, "Property 2 Color", "property2color" + j + " " + index, Color.black); filter2ColorField.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e) { //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) Plugin.styleRankColorSettings[index, j].property2Color = e.value; }; Plugin.styleRankColorSettings[index, j].property2Color = filter2ColorField.value; FloatField additionalFilter2Float1Field = new FloatField(val, "Property 2 Value 1", "property2float1" + j + " " + index, 0f, 0f, 1000f); additionalFilter2Float1Field.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].property2Float1 = e.value; }; Plugin.styleRankColorSettings[index, j].property2Float1 = additionalFilter2Float1Field.value; FloatField additionalFilter2Float2Field = new FloatField(val, "Property 2 Value 2", "property2float2" + j + " " + index, 0f, 0f, 1000f); additionalFilter2Float2Field.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].property2Float2 = e.value; }; Plugin.styleRankColorSettings[index, j].property2Float2 = additionalFilter2Float2Field.value; FloatField additionalFilter2Float3Field = new FloatField(val, "Property 2 Value 3", "property2float3" + j + " " + index, 0f, 0f, 1000f); additionalFilter2Float3Field.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].property2Float3 = e.value; }; Plugin.styleRankColorSettings[index, j].property2Float3 = additionalFilter2Float3Field.value; val11.onValueChange += delegate(EnumValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].property2 = e.value; changePropertyFieldNames(e.value, additionalFilter2Float1Field, additionalFilter2Float2Field, additionalFilter2Float3Field, filter2ColorField); }; Plugin.styleRankColorSettings[index, j].property2 = val11.value; changePropertyFieldNames(val11.value, additionalFilter2Float1Field, additionalFilter2Float2Field, additionalFilter2Float3Field, filter2ColorField); new ConfigHeader(val, "Property 3", 15); EnumField val12 = new EnumField(val, "Property 3", "property3" + j + " " + index, colorPropertyEnum.None); ColorField filter3ColorField = new ColorField(val, "Property 3 Color", "property3color" + j + " " + index, Color.black); filter3ColorField.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e) { //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) Plugin.styleRankColorSettings[index, j].property3Color = e.value; }; Plugin.styleRankColorSettings[index, j].property3Color = filter3ColorField.value; FloatField additionalFilter3Float1Field = new FloatField(val, "Property 3 Value 1", "property3float1" + j + " " + index, 0f, 0f, 1000f); additionalFilter3Float1Field.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].property3Float1 = e.value; }; Plugin.styleRankColorSettings[index, j].property3Float1 = additionalFilter3Float1Field.value; FloatField additionalFilter3Float2Field = new FloatField(val, "Property 3 Value 2", "property3float2" + j + " " + index, 0f, 0f, 1000f); additionalFilter3Float2Field.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].property3Float2 = e.value; }; Plugin.styleRankColorSettings[index, j].property3Float2 = additionalFilter3Float2Field.value; FloatField additionalFilter3Float3Field = new FloatField(val, "Property 3 Value 3", "property3float3" + j + " " + index, 0f, 0f, 1000f); additionalFilter3Float3Field.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].property3Float3 = e.value; }; Plugin.styleRankColorSettings[index, j].property3Float3 = additionalFilter3Float3Field.value; val12.onValueChange += delegate(EnumValueChangeEvent e) { Plugin.styleRankColorSettings[index, j].property3 = e.value; changePropertyFieldNames(e.value, additionalFilter3Float1Field, additionalFilter3Float2Field, additionalFilter3Float3Field, filter3ColorField); }; Plugin.styleRankColorSettings[index, j].property3 = val12.value; changePropertyFieldNames(val12.value, additionalFilter3Float1Field, additionalFilter3Float2Field, additionalFilter3Float3Field, filter3ColorField); } public static void fillConnectedDevicesPanel(ConfigPanel rootPanel) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown EnumField val = new EnumField(rootPanel, "Default Color Scheme", "defaultColorSchemeField", forcedStyleRankColoringSchemeEnum.Scheme1); val.onValueChange += delegate(EnumValueChangeEvent e) { defaultColoring = convertForcedToNormalStyleRankEnum(e.value); }; defaultColoring = convertForcedToNormalStyleRankEnum(val.value); enableRestDevicesDivision = new ConfigDivision(rootPanel, "enableRestDevicesDivision"); foreach (Device connectedDevice in Plugin.connectedDevices) { int index = connectedDevice.Index; ConfigHeader value = new ConfigHeader((ConfigPanel)(object)enableRestDevicesDivision, connectedDevice.Name, 18); ConfigPanel val2 = new ConfigPanel((ConfigPanel)(object)enableRestDevicesDivision, "Device " + index + " Settings", "devicepanel" + index); createConnectedDevicePanel(val2, index); deviceConfigPanels[index] = val2; deviceConfigHeaders[index] = value; } } public static void checkForDeviceColorSettingsOfIExists(int i) { if (!Plugin.deviceColorSettings.ContainsKey(i)) { Plugin.deviceColorSettings[i] = new deviceColoringScheme(); } } public static void createConnectedDevicePanel(ConfigPanel rootPanel, int index) { checkForDeviceColorSettingsOfIExists(index); EnumField val = new EnumField(rootPanel, "Device Color Scheme", "deviceColorSchemeField" + index, styleRankColoringSchemeEnum.Default); val.onValueChange += delegate(EnumValueChangeEvent e) { checkForDeviceColorSettingsOfIExists(index); Plugin.deviceColorSettings[index].scheme = e.value; }; Plugin.deviceColorSettings[index].scheme = val.value; } public static void refillConnectedDevicePanels() { //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Expected O, but got Unknown foreach (int key in deviceConfigHeaders.Keys) { ConfigHeader val = deviceConfigHeaders[key]; val.text = "Device not connected"; for (int i = 0; i < Plugin.connectedDevices.Count; i++) { if (key == Plugin.connectedDevices[i].Index) { val.text = Plugin.connectedDevices[i].Name; } } } foreach (ConfigPanel value2 in deviceConfigPanels.Values) { ((ConfigField)value2).interactable = false; } foreach (Device connectedDevice in Plugin.connectedDevices) { if (deviceConfigPanels.ContainsKey(connectedDevice.Index)) { ((ConfigField)deviceConfigPanels[connectedDevice.Index]).interactable = true; continue; } Plugin.logger.LogInfo((object)((object)connectedDevice).ToString()); ConfigHeader value = new ConfigHeader((ConfigPanel)(object)enableRestDevicesDivision, connectedDevice.Name, 18); ConfigPanel val2 = new ConfigPanel((ConfigPanel)(object)enableRestDevicesDivision, "Device " + connectedDevice.Index + " Settings", "devicepanel" + connectedDevice.Index); createConnectedDevicePanel(val2, connectedDevice.Index); deviceConfigPanels[connectedDevice.Index] = val2; deviceConfigHeaders[connectedDevice.Index] = value; } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "UltraRGBLighting"; public const string PLUGIN_NAME = "UltraRGBLighting"; public const string PLUGIN_VERSION = "1.0.0"; } }