using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppSystem.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("StatusEffectFix")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Vibe O'Drone")]
[assembly: AssemblyProduct("StatusEffectFix")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("6f2c3f2a-9b1e-4b0e-9a2f-2e9f1d3c9a11")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace StatusEffectFix;
[BepInPlugin("seregado.statuseffectfix", "StatusEffectFix", "1.0.0")]
public class Plugin : BasePlugin
{
public const string PluginGuid = "seregado.statuseffectfix";
public const string PluginName = "StatusEffectFix";
public const string PluginVersion = "1.0.0";
internal static ManualLogSource Log;
private Harmony _harmony;
public override void Load()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
Log = ((BasePlugin)this).Log;
_harmony = new Harmony("seregado.statuseffectfix");
_harmony.PatchAll();
ManualLogSource log = Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(10, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("StatusEffectFix");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" v");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.0.0");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" loaded!");
}
log.LogInfo(val);
}
}
[HarmonyPatch(typeof(Player), "Update")]
internal static class StatusEffectFontFix_SyncSubMeshAlpha
{
private static void Postfix()
{
StatusController instance = StatusController.Instance;
List<StateElementController> val = ((instance != null) ? instance.spawnedControllers : null);
if (val == null)
{
return;
}
Enumerator<StateElementController> enumerator = val.GetEnumerator();
while (enumerator.MoveNext())
{
StateElementController current = enumerator.Current;
if ((Object)(object)current == (Object)null)
{
continue;
}
foreach (TextMeshProUGUI componentsInChild in ((Component)current).gameObject.GetComponentsInChildren<TextMeshProUGUI>(true))
{
if (((Object)componentsInChild).name != "DetailText")
{
continue;
}
CanvasRenderer canvasRenderer = componentsInChild.canvasRenderer;
if ((Object)(object)canvasRenderer == (Object)null)
{
continue;
}
float alpha = canvasRenderer.GetAlpha();
foreach (TMP_SubMeshUI componentsInChild2 in ((Component)componentsInChild).GetComponentsInChildren<TMP_SubMeshUI>(true))
{
CanvasRenderer canvasRenderer2 = ((Graphic)componentsInChild2).canvasRenderer;
if ((Object)(object)canvasRenderer2 != (Object)null && canvasRenderer2.GetAlpha() != alpha)
{
canvasRenderer2.SetAlpha(alpha);
}
}
}
}
}
}