using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Microsoft.CodeAnalysis;
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
{
[BepInPlugin("UltraRGBLighting", "UltraRGBLighting", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
public static int currentRankInt = -1;
public static float currentRankFloat = -1f;
public float pollingTime = 0.5f;
private string DefaultParentFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "";
private string path;
private float timeElapsed = 0f;
public void openRootFolder()
{
Application.OpenURL(DefaultParentFolder);
}
private void Awake()
{
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Expected O, but got Unknown
//IL_006d: 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_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Expected O, but got Unknown
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Expected O, but got Unknown
path = Path.Combine(DefaultParentFolder, "output.txt") ?? "";
PluginConfigurator val = PluginConfigurator.Create("UltraRGBLighting", "UltraRGBLighting");
val.SetIconWithURL(Path.Combine(DefaultParentFolder, "icon.png") ?? "");
ConfigHeader val2 = new ConfigHeader(val.rootPanel, "You must open UltraRGBLighting.jar (provided in the mod directory) and OpenRGB (must be downloaded from their site) for this mod to do anything. UltraRGBLighting.jar provides configuration options. Consult the readme if confused.", 24);
val2.textSize = 14;
val2.textColor = Color.red;
ButtonField val3 = new ButtonField(val.rootPanel, "Open Mod Folder", "button.openfolder");
val3.onClick += new OnClick(openRootFolder);
ConfigHeader val4 = new ConfigHeader(val.rootPanel, "Polling rate refers to the amount of times a second that the style rank is recorded. High polling rates have a negative performance impact, and at a certain point start having a negative effect. A value around 40 is strongly reccomended.", 24);
val4.textSize = 12;
FloatField val5 = new FloatField(val.rootPanel, "Polling Rate (Hz)", "pollingRate", 40f, 0.001f, 1000f);
val5.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent e)
{
pollingTime = 1f / e.value;
};
pollingTime = 1f / val5.value;
Debug.Log((object)"UltraRGBLighting.dll Loaded");
}
private void Update()
{
timeElapsed += Time.deltaTime;
if (!((Object)(object)MonoSingleton<StyleHUD>.Instance == (Object)null))
{
currentRankInt = MonoSingleton<StyleHUD>.Instance.rankIndex;
currentRankFloat = (float)currentRankInt + MonoSingleton<StyleHUD>.Instance.currentMeter / (float)MonoSingleton<StyleHUD>.Instance.currentRank.maxMeter;
if (currentRankFloat < 0f)
{
currentRankFloat = -1f;
}
if (timeElapsed > pollingTime)
{
File.WriteAllText(path, currentRankFloat + "\n" + pollingTime * 1000f);
timeElapsed = 0f;
}
}
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "UltraRGBLighting";
public const string PLUGIN_NAME = "UltraRGBLighting";
public const string PLUGIN_VERSION = "1.0.0";
}
}