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 BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.TextCore.LowLevel;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Fffffff")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1+6d5f1df24604bbf136f2dfb240d1ccab3642d5f4")]
[assembly: AssemblyProduct("Fffffff")]
[assembly: AssemblyTitle("Fffffff")]
[assembly: AssemblyVersion("1.0.1.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace Fffffff
{
[BepInPlugin("greycsont.ultrakill.fffffff", "Fffffff", "1.0.1")]
public class Plugin : BaseUnityPlugin
{
internal static List<TMP_FontAsset> fonts = new List<TMP_FontAsset>();
internal static ManualLogSource Logger { get; private set; } = null;
internal static string pluginDir => Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
private void Awake()
{
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Expected O, but got Unknown
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
Logger = ((BaseUnityPlugin)this).Logger;
Logger.LogInfo((object)"Plugin greycsont.ultrakill.fffffff is loaded!");
((Object)((Component)this).gameObject).hideFlags = (HideFlags)4;
int result;
foreach (string item in from f in new string[3] { "*.otf", "*.ttc", "*.ttf" }.SelectMany((string ext) => Directory.GetFiles(pluginDir, "font" + ext))
orderby (!int.TryParse(Path.GetFileNameWithoutExtension(f).Substring("font".Length), out result)) ? int.MaxValue : result
select f)
{
TMP_FontAsset val = TMP_FontAsset.CreateFontAsset(new Font(item), 90, 9, (GlyphRenderMode)4165, 1024, 1024, (AtlasPopulationMode)1, true);
if ((Object)(object)val != (Object)null)
{
fonts.Add(val);
Logger.LogInfo((object)("Loaded font: " + Path.GetFileName(item)));
}
}
new Harmony("greycsont.ultrakill.fffffff").PatchAll();
SceneManager.sceneLoaded += OnSceneLoaded;
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
AddFallbackFont();
}
private void AddFallbackFont()
{
if (fonts.Count == 0)
{
return;
}
foreach (TMP_FontAsset item in Resources.FindObjectsOfTypeAll<TMP_FontAsset>().Except(fonts))
{
TMP_FontAsset val = item;
if (val.fallbackFontAssetTable == null)
{
List<TMP_FontAsset> list = (val.fallbackFontAssetTable = new List<TMP_FontAsset>());
}
foreach (TMP_FontAsset font in fonts)
{
if (!item.fallbackFontAssetTable.Contains(font))
{
item.fallbackFontAssetTable.Add(font);
Logger.LogInfo((object)("Added fallback to " + ((Object)item).name));
}
}
}
}
}
internal static class MyPluginInfo
{
public const string PLUGIN_GUID = "greycsont.ultrakill.fffffff";
public const string PLUGIN_NAME = "Fffffff";
public const string PLUGIN_VERSION = "1.0.1";
}
}