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 BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Fields;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SmallerStyleBonuses")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SmallerStyleBonuses")]
[assembly: AssemblyTitle("SmallerStyleBonuses")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[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 SmallerStyleBonuses
{
public static class PluginInfo
{
public const string PLUGIN_GUID = "com.blaixenu.stylebonusresizer";
public const string PLUGIN_NAME = "Style Bonus Resizer";
public const string PLUGIN_VERSION = "1.0.0";
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.blaixenu.stylebonusresizer", "Style Bonus Resizer", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static PostFloatSliderValueChangeEvent <>9__8_0;
internal void <Awake>b__8_0(float _, Tuple<float, float> _)
{
Behaviour.UpdateSize();
}
}
internal static PluginConfigurator? config;
internal static FloatSliderField SizeMult;
internal static ManualLogSource Logger { get; private set; }
public static string ModDir => Path.GetDirectoryName(typeof(Plugin).Assembly.Location);
private void Awake()
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Expected O, but got Unknown
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Expected O, but got Unknown
Logger = ((BaseUnityPlugin)this).Logger;
Logger.LogInfo((object)"Plugin com.blaixenu.stylebonusresizer is loaded!");
((Object)((Component)this).gameObject).hideFlags = (HideFlags)4;
new Harmony("com.blaixenu.stylebonusresizer").PatchAll();
config = PluginConfigurator.Create("Style Bonus Resizer", "com.blaixenu.stylebonusresizer");
config.SetIconWithURL("file://" + Path.Combine(ModDir, "icon.png"));
SizeMult = new FloatSliderField(config.rootPanel, "Size Multiplier", "sizeMult", new Tuple<float, float>(0.1f, 5f), 0.8f);
FloatSliderField sizeMult = SizeMult;
object obj = <>c.<>9__8_0;
if (obj == null)
{
PostFloatSliderValueChangeEvent val = delegate
{
Behaviour.UpdateSize();
};
<>c.<>9__8_0 = val;
obj = (object)val;
}
sizeMult.postValueChangeEvent += (PostFloatSliderValueChangeEvent)obj;
}
}
[HarmonyPatch]
public static class Behaviour
{
private static float initialSize;
private static float SizeMult => Plugin.SizeMult.value;
[HarmonyPostfix]
[HarmonyPatch(typeof(StyleHUD), "Start")]
public static void DoYourThing(StyleHUD __instance)
{
initialSize = __instance.styleInfo.fontSize;
UpdateSize();
}
public static void UpdateSize()
{
StyleHUD val = default(StyleHUD);
if (MonoSingleton<StyleHUD>.TryGetInstance(ref val))
{
val.styleInfo.fontSize = initialSize * SizeMult;
}
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}