Decompiled source of TextDisplayMod v2.0.1

Mods/TextDisplayMod.dll

Decompiled 2 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using MelonLoader;
using MelonLoader.Preferences;
using Microsoft.CodeAnalysis;
using TextDisplayMod;
using UIFramework;
using UIFramework.UiExtensions;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Core), "Text Display Mod", "1.0.0", "NexyDev", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 255, 105, 191)]
[assembly: MelonAuthorColor(255, 168, 221, 255)]
[assembly: MelonAdditionalDependencies(new string[] { "UIFramework" })]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("TextDisplayMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+11188b05f55f735a86df5b75dfca3f19ffe48487")]
[assembly: AssemblyProduct("TextDisplayMod")]
[assembly: AssemblyTitle("TextDisplayMod")]
[assembly: NeutralResourcesLanguage("en-US")]
[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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace TextDisplayMod
{
	public static class BuildInfo
	{
		public const string Name = "Text Display Mod";

		public const string Author = "NexyDev";

		public const string Version = "1.0.0";

		public const string Description = "A mod that displays text on the computer screen, helpful for watermarks.";
	}
	public class Core : MelonMod
	{
		private List<DropdownItem> itemList = new List<DropdownItem>();

		public DynamicDropdownDescriptor DropdownDescriptor;

		public MelonPreferences_Entry<bool> IsTextVisible;

		public MelonPreferences_Entry<string> Text;

		public MelonPreferences_Entry<string> Alignment;

		public MelonPreferences_Entry<int> Size;

		public MelonPreferences_Entry<int> X;

		public MelonPreferences_Entry<int> Y;

		public MelonPreferences_Entry<int> TextRectScaleX;

		public MelonPreferences_Entry<int> TextRectScaleY;

		public MelonPreferences_Category TextCategory;

		public MelonPreferences_Category DimensionsPositions;

		public static Core Instance;

		public static ModelMod Me;

		public override void OnInitializeMelon()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Expected O, but got Unknown
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Expected O, but got Unknown
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Expected O, but got Unknown
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Expected O, but got Unknown
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Expected O, but got Unknown
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Expected O, but got Unknown
			MelonLogger.Msg("\u001b[38;2;255;105;191m[TextDisplayMod] \u001b[0mMod loaded.");
			DropdownDescriptor = new DynamicDropdownDescriptor(itemList);
			DropdownDescriptor.AddDropdownItem(new DropdownItem("Upper-Right", (object)"0"));
			DropdownDescriptor.AddDropdownItem(new DropdownItem("Upper-Center", (object)"1"));
			DropdownDescriptor.AddDropdownItem(new DropdownItem("Upper-Left", (object)"2"));
			DropdownDescriptor.AddDropdownItem(new DropdownItem("Middle-Right", (object)"3"));
			DropdownDescriptor.AddDropdownItem(new DropdownItem("Middle-Center", (object)"4"));
			DropdownDescriptor.AddDropdownItem(new DropdownItem("Middle-Left", (object)"5"));
			DropdownDescriptor.AddDropdownItem(new DropdownItem("Lower-Right", (object)"6"));
			DropdownDescriptor.AddDropdownItem(new DropdownItem("Lower-Center", (object)"7"));
			DropdownDescriptor.AddDropdownItem(new DropdownItem("Upper-Left", (object)"8"));
			TextCategory = MelonPreferences.CreateCategory("Text Display Mod", "Settings");
			IsTextVisible = TextCategory.CreateEntry<bool>("ShowText", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			Text = TextCategory.CreateEntry<string>("Text Displayed", "Text Shown", "", (string)null, false, false, (ValueValidator)null, (string)null);
			Alignment = TextCategory.CreateEntry<string>("DropdownTest", "0", "Dropdown Text", (string)null, false, false, (ValueValidator)(object)DropdownDescriptor);
			Size = TextCategory.CreateEntry<int>("Size", 75, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			DimensionsPositions = MelonPreferences.CreateCategory("Text Display Mod", "Dimensions and Positions");
			X = DimensionsPositions.CreateEntry<int>("X Position", -100, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			Y = DimensionsPositions.CreateEntry<int>("Y Position", 100, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			TextRectScaleX = DimensionsPositions.CreateEntry<int>("X Text rect scale (Not recommended to change)", 1920, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			TextRectScaleY = DimensionsPositions.CreateEntry<int>("Y Text rect scale (Not recommended to change)", 1080, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			Instance = this;
			UI.RegisterMelon((MelonBase)(object)this, (MelonPreferences_Category[])(object)new MelonPreferences_Category[1] { TextCategory });
			MelonLogger.Msg("\u001b[38;2;255;105;191m[TextDisplayMod] \u001b[0mF9 UI Generated");
		}

		public override void OnGUI()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			if (IsTextVisible.Value)
			{
				GUIStyle val = new GUIStyle(GUI.skin.label);
				val = new GUIStyle(GUI.skin.label)
				{
					richText = true,
					fontSize = Size.Value
				};
				val.normal.textColor = Color.white;
				if (Alignment.Value == "0")
				{
					val.alignment = (TextAnchor)2;
				}
				else if (Alignment.Value == "1")
				{
					val.alignment = (TextAnchor)1;
				}
				else if (Alignment.Value == "2")
				{
					val.alignment = (TextAnchor)0;
				}
				else if (Alignment.Value == "3")
				{
					val.alignment = (TextAnchor)5;
				}
				else if (Alignment.Value == "4")
				{
					val.alignment = (TextAnchor)4;
				}
				else if (Alignment.Value == "5")
				{
					val.alignment = (TextAnchor)3;
				}
				else if (Alignment.Value == "6")
				{
					val.alignment = (TextAnchor)8;
				}
				else if (Alignment.Value == "7")
				{
					val.alignment = (TextAnchor)7;
				}
				else if (Alignment.Value == "8")
				{
					val.alignment = (TextAnchor)8;
				}
				GUI.Label(new Rect((float)X.Value, (float)Y.Value, (float)TextRectScaleX.Value, (float)TextRectScaleY.Value), Text.Value, val);
			}
		}
	}
}