Decompiled source of TextScalerMod v1.0.0

plugins/Mickynuts/TextScalerMod.dll

Decompiled 2 weeks ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("TextScalerMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("TextScalerMod")]
[assembly: AssemblyTitle("TextScalerMod")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("com.Mickynuts.textscaler", "Text Scaler Mod", "1.0.0")]
public class TextScaler : BaseUnityPlugin
{
	private ConfigEntry<int> fontSize;

	private void Awake()
	{
		fontSize = ((BaseUnityPlugin)this).Config.Bind<int>("TextScaler", "FontSize", 14, "Taille de la police à appliquer à tous les textes du jeu.");
		((BaseUnityPlugin)this).Logger.LogInfo((object)$"[TextScaler] Chargé avec fontSize={fontSize.Value}");
	}

	private void Update()
	{
		Text[] array = Object.FindObjectsOfType<Text>();
		foreach (Text val in array)
		{
			if ((Object)(object)val != (Object)null && val.fontSize != fontSize.Value && fontSize.Value > 0)
			{
				val.fontSize = fontSize.Value;
			}
		}
	}
}