Decompiled source of LucysTools v0.7.0

GDWeave/mods/LucysTools/LucysTools.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using GDWeave;
using GDWeave.Godot;
using GDWeave.Godot.Variants;
using GDWeave.Modding;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyCompany("LucysTools")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+fc710e05667c046bf1f56e63b05b8a2fe43eb546")]
[assembly: AssemblyProduct("LucysTools")]
[assembly: AssemblyTitle("LucysTools")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace LucysTools;

public class Mod : IMod, global::System.IDisposable
{
	public static IModInterface ModInterface;

	public Mod(IModInterface modInterface)
	{
		modInterface.Logger.Information("Lucy was here :3");
		ModInterface = modInterface;
		modInterface.RegisterScriptMod((IScriptMod)(object)new LucysChatChanges());
		modInterface.RegisterScriptMod((IScriptMod)(object)new LucyServerBrowserChanges());
		modInterface.RegisterScriptMod((IScriptMod)(object)new LucyMainMenuChanges());
	}

	public void Dispose()
	{
	}
}
[RequiredMember]
public record CodeChange
{
	[CompilerGenerated]
	protected virtual global::System.Type EqualityContract
	{
		[CompilerGenerated]
		get
		{
			return typeof(CodeChange);
		}
	}

	[RequiredMember]
	public string name;

	[RequiredMember]
	public Func<Token, bool>[] multitoken_prefix;

	[RequiredMember]
	public Token[] code_to_add;

	[CompilerGenerated]
	public override string ToString()
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Expected O, but got Unknown
		StringBuilder val = new StringBuilder();
		val.Append("CodeChange");
		val.Append(" { ");
		if (PrintMembers(val))
		{
			val.Append(' ');
		}
		val.Append('}');
		return ((object)val).ToString();
	}

	[CompilerGenerated]
	protected virtual bool PrintMembers(StringBuilder builder)
	{
		RuntimeHelpers.EnsureSufficientExecutionStack();
		builder.Append("name = ");
		builder.Append((object)name);
		builder.Append(", multitoken_prefix = ");
		builder.Append((object)multitoken_prefix);
		builder.Append(", code_to_add = ");
		builder.Append((object)code_to_add);
		return true;
	}

	[CompilerGenerated]
	public virtual bool Equals(CodeChange? other)
	{
		if ((object)this != other)
		{
			if ((object)other != null && EqualityContract == other.EqualityContract && EqualityComparer<string>.Default.Equals(name, other.name) && EqualityComparer<Func<Token, bool>[]>.Default.Equals(multitoken_prefix, other.multitoken_prefix))
			{
				return EqualityComparer<Token[]>.Default.Equals(code_to_add, other.code_to_add);
			}
			return false;
		}
		return true;
	}

	[CompilerGenerated]
	[SetsRequiredMembers]
	protected CodeChange(CodeChange original)
	{
		name = original.name;
		multitoken_prefix = original.multitoken_prefix;
		code_to_add = original.code_to_add;
	}

	[Obsolete("Constructors of types with required members are not supported in this version of your compiler.", true)]
	[CompilerFeatureRequired("RequiredMembers")]
	public CodeChange()
	{
	}
}
public class LucyServerBrowserChanges : IScriptMod
{
	[CompilerGenerated]
	private sealed class <GDWeave-Modding-IScriptMod-Modify>d__2 : global::System.Collections.Generic.IEnumerable<Token>, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerator<Token>, global::System.Collections.IEnumerator, global::System.IDisposable
	{
		private int <>1__state;

		private Token <>2__current;

		private int <>l__initialThreadId;

		public LucyServerBrowserChanges <>4__this;

		private global::System.Collections.Generic.IEnumerable<Token> tokens;

		public global::System.Collections.Generic.IEnumerable<Token> <>3__tokens;

		private List<ValueTuple<CodeChange, MultiTokenWaiter>> <pending_changes>5__2;

		private global::System.Collections.Generic.IEnumerator<Token> <>7__wrap2;

		private Token <token>5__4;

		private Enumerator<ValueTuple<CodeChange, MultiTokenWaiter>> <>7__wrap4;

		private CodeChange <change>5__6;

		private Token[] <>7__wrap6;

		private int <>7__wrap7;

		Token global::System.Collections.Generic.IEnumerator<Token>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object global::System.Collections.IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <GDWeave-Modding-IScriptMod-Modify>d__2(int <>1__state)
		{
			this.<>1__state = <>1__state;
			<>l__initialThreadId = Environment.CurrentManagedThreadId;
		}

		[DebuggerHidden]
		void global::System.IDisposable.Dispose()
		{
			int num = <>1__state;
			if ((uint)(num - -4) > 1u && (uint)(num - 1) > 2u)
			{
				return;
			}
			try
			{
				if (num != -4 && (uint)(num - 1) > 1u)
				{
					return;
				}
				try
				{
				}
				finally
				{
					<>m__Finally2();
				}
			}
			finally
			{
				<>m__Finally1();
			}
		}

		private bool MoveNext()
		{
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				int num = <>1__state;
				LucyServerBrowserChanges lucyServerBrowserChanges = <>4__this;
				bool flag;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<pending_changes>5__2 = Enumerable.ToList<ValueTuple<CodeChange, MultiTokenWaiter>>(Enumerable.Select<CodeChange, ValueTuple<CodeChange, MultiTokenWaiter>>((global::System.Collections.Generic.IEnumerable<CodeChange>)lucyServerBrowserChanges.changes, (Func<CodeChange, ValueTuple<CodeChange, MultiTokenWaiter>>)((CodeChange c) => new ValueTuple<CodeChange, MultiTokenWaiter>(c, new MultiTokenWaiter(c.multitoken_prefix, false, false)))));
					<>7__wrap2 = tokens.GetEnumerator();
					<>1__state = -3;
					goto IL_01ef;
				case 1:
					<>1__state = -4;
					<>7__wrap6 = <change>5__6.code_to_add;
					<>7__wrap7 = 0;
					goto IL_0182;
				case 2:
					<>1__state = -4;
					<>7__wrap7++;
					goto IL_0182;
				case 3:
					{
						<>1__state = -3;
						goto IL_01e8;
					}
					IL_0182:
					if (<>7__wrap7 < <>7__wrap6.Length)
					{
						Token val = <>7__wrap6[<>7__wrap7];
						<>2__current = val;
						<>1__state = 2;
						return true;
					}
					<>7__wrap6 = null;
					flag = true;
					goto IL_01b4;
					IL_01ef:
					if (((global::System.Collections.IEnumerator)<>7__wrap2).MoveNext())
					{
						<token>5__4 = <>7__wrap2.Current;
						flag = false;
						<>7__wrap4 = <pending_changes>5__2.GetEnumerator();
						<>1__state = -4;
						while (<>7__wrap4.MoveNext())
						{
							ValueTuple<CodeChange, MultiTokenWaiter> current = <>7__wrap4.Current;
							<change>5__6 = current.Item1;
							if (current.Item2.Check(<token>5__4))
							{
								Mod.ModInterface.Logger.Information("Adding Lucy server button mod " + <change>5__6.name);
								<>2__current = <token>5__4;
								<>1__state = 1;
								return true;
							}
							<change>5__6 = null;
						}
						goto IL_01b4;
					}
					<>m__Finally1();
					<>7__wrap2 = null;
					return false;
					IL_01b4:
					<>m__Finally2();
					<>7__wrap4 = default(Enumerator<ValueTuple<CodeChange, MultiTokenWaiter>>);
					if (!flag)
					{
						<>2__current = <token>5__4;
						<>1__state = 3;
						return true;
					}
					goto IL_01e8;
					IL_01e8:
					<token>5__4 = null;
					goto IL_01ef;
				}
			}
			catch
			{
				//try-fault
				((global::System.IDisposable)this).Dispose();
				throw;
			}
		}

		bool global::System.Collections.IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		private void <>m__Finally1()
		{
			<>1__state = -1;
			if (<>7__wrap2 != null)
			{
				((global::System.IDisposable)<>7__wrap2).Dispose();
			}
		}

		private void <>m__Finally2()
		{
			<>1__state = -3;
			((global::System.IDisposable)<>7__wrap4).Dispose();
		}

		[DebuggerHidden]
		void global::System.Collections.IEnumerator.Reset()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new NotSupportedException();
		}

		[DebuggerHidden]
		global::System.Collections.Generic.IEnumerator<Token> global::System.Collections.Generic.IEnumerable<Token>.GetEnumerator()
		{
			<GDWeave-Modding-IScriptMod-Modify>d__2 <GDWeave-Modding-IScriptMod-Modify>d__;
			if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
			{
				<>1__state = 0;
				<GDWeave-Modding-IScriptMod-Modify>d__ = this;
			}
			else
			{
				<GDWeave-Modding-IScriptMod-Modify>d__ = new <GDWeave-Modding-IScriptMod-Modify>d__2(0)
				{
					<>4__this = <>4__this
				};
			}
			<GDWeave-Modding-IScriptMod-Modify>d__.tokens = <>3__tokens;
			return <GDWeave-Modding-IScriptMod-Modify>d__;
		}

		[DebuggerHidden]
		global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator()
		{
			return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable<Token>)this).GetEnumerator();
		}
	}

	private CodeChange[] changes = new CodeChange[2]
	{
		new CodeChange
		{
			name = "server button arg",
			multitoken_prefix = new Func<Token, bool>[6]
			{
				(Token t) => (int)t.Type == 82,
				delegate(Token t)
				{
					IdentifierToken val7 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val7 != null && val7.Name == "age_limit";
				},
				(Token t) => (int)t.Type == 82,
				delegate(Token t)
				{
					IdentifierToken val6 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val6 != null && val6.Name == "dated";
				},
				(Token t) => (int)t.Type == 82,
				delegate(Token t)
				{
					IdentifierToken val5 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val5 != null && val5.Name == "banned";
				}
			},
			code_to_add = (Token[])(object)new Token[4]
			{
				new Token((TokenType)82, (uint?)null),
				(Token)new IdentifierToken("lucy_display"),
				new Token((TokenType)23, (uint?)null),
				(Token)new ConstantToken((Variant)new StringVariant(""))
			}
		},
		new CodeChange
		{
			name = "server button load",
			multitoken_prefix = new Func<Token, bool>[9]
			{
				delegate(Token t)
				{
					IdentifierToken val4 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val4 != null && val4.Name == "display_name";
				},
				(Token t) => (int)t.Type == 84,
				delegate(Token t)
				{
					IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val3 != null && val3.Name == "replace";
				},
				(Token t) => (int)t.Type == 80,
				delegate(Token t)
				{
					ConstantToken val = (ConstantToken)(object)((t is ConstantToken) ? t : null);
					if (val != null)
					{
						Variant value = val.Value;
						StringVariant val2 = (StringVariant)(object)((value is StringVariant) ? value : null);
						if (val2 != null)
						{
							return val2.Value == "]";
						}
					}
					return false;
				},
				(Token t) => (int)t.Type == 82,
				(Token t) => t is ConstantToken,
				(Token t) => (int)t.Type == 81,
				(Token t) => (int)t.Type == 89
			},
			code_to_add = (Token[])(object)new Token[9]
			{
				new Token((TokenType)38, (uint?)null),
				(Token)new IdentifierToken("lucy_display"),
				new Token((TokenType)8, (uint?)null),
				(Token)new ConstantToken((Variant)new StringVariant("")),
				new Token((TokenType)86, (uint?)null),
				(Token)new IdentifierToken("display_name"),
				new Token((TokenType)23, (uint?)null),
				(Token)new IdentifierToken("lucy_display"),
				new Token((TokenType)89, (uint?)1u)
			}
		}
	};

	bool IScriptMod.ShouldRun(string path)
	{
		return path == "res://Scenes/Menus/Main Menu/ServerButton/server_button.gdc";
	}

	[IteratorStateMachine(typeof(<GDWeave-Modding-IScriptMod-Modify>d__2))]
	global::System.Collections.Generic.IEnumerable<Token> IScriptMod.Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		List<ValueTuple<CodeChange, MultiTokenWaiter>> pending_changes = Enumerable.ToList<ValueTuple<CodeChange, MultiTokenWaiter>>(Enumerable.Select<CodeChange, ValueTuple<CodeChange, MultiTokenWaiter>>((global::System.Collections.Generic.IEnumerable<CodeChange>)changes, (Func<CodeChange, ValueTuple<CodeChange, MultiTokenWaiter>>)((CodeChange c) => new ValueTuple<CodeChange, MultiTokenWaiter>(c, new MultiTokenWaiter(c.multitoken_prefix, false, false)))));
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token token = enumerator.Current;
				bool flag = false;
				Enumerator<ValueTuple<CodeChange, MultiTokenWaiter>> enumerator2 = pending_changes.GetEnumerator();
				try
				{
					while (enumerator2.MoveNext())
					{
						ValueTuple<CodeChange, MultiTokenWaiter> current = enumerator2.Current;
						CodeChange change = current.Item1;
						if (current.Item2.Check(token))
						{
							Mod.ModInterface.Logger.Information("Adding Lucy server button mod " + change.name);
							yield return token;
							Token[] code_to_add = change.code_to_add;
							for (int i = 0; i < code_to_add.Length; i++)
							{
								yield return code_to_add[i];
							}
							flag = true;
							break;
						}
					}
				}
				finally
				{
					((global::System.IDisposable)enumerator2).Dispose();
				}
				if (!flag)
				{
					yield return token;
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}
public class LucyMainMenuChanges : IScriptMod
{
	[CompilerGenerated]
	private sealed class <GDWeave-Modding-IScriptMod-Modify>d__2 : global::System.Collections.Generic.IEnumerable<Token>, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerator<Token>, global::System.Collections.IEnumerator, global::System.IDisposable
	{
		private int <>1__state;

		private Token <>2__current;

		private int <>l__initialThreadId;

		public LucyMainMenuChanges <>4__this;

		private global::System.Collections.Generic.IEnumerable<Token> tokens;

		public global::System.Collections.Generic.IEnumerable<Token> <>3__tokens;

		private List<ValueTuple<CodeChange, MultiTokenWaiter>> <pending_changes>5__2;

		private global::System.Collections.Generic.IEnumerator<Token> <>7__wrap2;

		private Token <token>5__4;

		private Enumerator<ValueTuple<CodeChange, MultiTokenWaiter>> <>7__wrap4;

		private CodeChange <change>5__6;

		private Token[] <>7__wrap6;

		private int <>7__wrap7;

		Token global::System.Collections.Generic.IEnumerator<Token>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object global::System.Collections.IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <GDWeave-Modding-IScriptMod-Modify>d__2(int <>1__state)
		{
			this.<>1__state = <>1__state;
			<>l__initialThreadId = Environment.CurrentManagedThreadId;
		}

		[DebuggerHidden]
		void global::System.IDisposable.Dispose()
		{
			int num = <>1__state;
			if ((uint)(num - -4) > 1u && (uint)(num - 1) > 2u)
			{
				return;
			}
			try
			{
				if (num != -4 && (uint)(num - 1) > 1u)
				{
					return;
				}
				try
				{
				}
				finally
				{
					<>m__Finally2();
				}
			}
			finally
			{
				<>m__Finally1();
			}
		}

		private bool MoveNext()
		{
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				int num = <>1__state;
				LucyMainMenuChanges lucyMainMenuChanges = <>4__this;
				bool flag;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<pending_changes>5__2 = Enumerable.ToList<ValueTuple<CodeChange, MultiTokenWaiter>>(Enumerable.Select<CodeChange, ValueTuple<CodeChange, MultiTokenWaiter>>((global::System.Collections.Generic.IEnumerable<CodeChange>)lucyMainMenuChanges.changes, (Func<CodeChange, ValueTuple<CodeChange, MultiTokenWaiter>>)((CodeChange c) => new ValueTuple<CodeChange, MultiTokenWaiter>(c, new MultiTokenWaiter(c.multitoken_prefix, false, false)))));
					<>7__wrap2 = tokens.GetEnumerator();
					<>1__state = -3;
					goto IL_01ef;
				case 1:
					<>1__state = -4;
					<>7__wrap6 = <change>5__6.code_to_add;
					<>7__wrap7 = 0;
					goto IL_0182;
				case 2:
					<>1__state = -4;
					<>7__wrap7++;
					goto IL_0182;
				case 3:
					{
						<>1__state = -3;
						goto IL_01e8;
					}
					IL_0182:
					if (<>7__wrap7 < <>7__wrap6.Length)
					{
						Token val = <>7__wrap6[<>7__wrap7];
						<>2__current = val;
						<>1__state = 2;
						return true;
					}
					<>7__wrap6 = null;
					flag = true;
					goto IL_01b4;
					IL_01ef:
					if (((global::System.Collections.IEnumerator)<>7__wrap2).MoveNext())
					{
						<token>5__4 = <>7__wrap2.Current;
						flag = false;
						<>7__wrap4 = <pending_changes>5__2.GetEnumerator();
						<>1__state = -4;
						while (<>7__wrap4.MoveNext())
						{
							ValueTuple<CodeChange, MultiTokenWaiter> current = <>7__wrap4.Current;
							<change>5__6 = current.Item1;
							if (current.Item2.Check(<token>5__4))
							{
								Mod.ModInterface.Logger.Information("Adding Lucy server button mod " + <change>5__6.name);
								<>2__current = <token>5__4;
								<>1__state = 1;
								return true;
							}
							<change>5__6 = null;
						}
						goto IL_01b4;
					}
					<>m__Finally1();
					<>7__wrap2 = null;
					return false;
					IL_01b4:
					<>m__Finally2();
					<>7__wrap4 = default(Enumerator<ValueTuple<CodeChange, MultiTokenWaiter>>);
					if (!flag)
					{
						<>2__current = <token>5__4;
						<>1__state = 3;
						return true;
					}
					goto IL_01e8;
					IL_01e8:
					<token>5__4 = null;
					goto IL_01ef;
				}
			}
			catch
			{
				//try-fault
				((global::System.IDisposable)this).Dispose();
				throw;
			}
		}

		bool global::System.Collections.IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		private void <>m__Finally1()
		{
			<>1__state = -1;
			if (<>7__wrap2 != null)
			{
				((global::System.IDisposable)<>7__wrap2).Dispose();
			}
		}

		private void <>m__Finally2()
		{
			<>1__state = -3;
			((global::System.IDisposable)<>7__wrap4).Dispose();
		}

		[DebuggerHidden]
		void global::System.Collections.IEnumerator.Reset()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new NotSupportedException();
		}

		[DebuggerHidden]
		global::System.Collections.Generic.IEnumerator<Token> global::System.Collections.Generic.IEnumerable<Token>.GetEnumerator()
		{
			<GDWeave-Modding-IScriptMod-Modify>d__2 <GDWeave-Modding-IScriptMod-Modify>d__;
			if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
			{
				<>1__state = 0;
				<GDWeave-Modding-IScriptMod-Modify>d__ = this;
			}
			else
			{
				<GDWeave-Modding-IScriptMod-Modify>d__ = new <GDWeave-Modding-IScriptMod-Modify>d__2(0)
				{
					<>4__this = <>4__this
				};
			}
			<GDWeave-Modding-IScriptMod-Modify>d__.tokens = <>3__tokens;
			return <GDWeave-Modding-IScriptMod-Modify>d__;
		}

		[DebuggerHidden]
		global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator()
		{
			return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable<Token>)this).GetEnumerator();
		}
	}

	private CodeChange[] changes = new CodeChange[2]
	{
		new CodeChange
		{
			name = "server button lucy_display get",
			multitoken_prefix = new Func<Token, bool>[10]
			{
				(Token t) => (int)t.Type == 38,
				(Token t) => (int)t.Type == 87,
				delegate(Token t)
				{
					ConstantToken val7 = (ConstantToken)(object)((t is ConstantToken) ? t : null);
					if (val7 != null)
					{
						Variant value = val7.Value;
						StringVariant val8 = (StringVariant)(object)((value is StringVariant) ? value : null);
						if (val8 != null)
						{
							return val8.Value == "%hidenames";
						}
					}
					return false;
				},
				(Token t) => (int)t.Type == 84,
				delegate(Token t)
				{
					IdentifierToken val6 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val6 != null && val6.Name == "pressed";
				},
				(Token t) => (int)t.Type == 86,
				delegate(Token t)
				{
					IdentifierToken val5 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val5 != null && val5.Name == "lobby_custom_name";
				},
				(Token t) => (int)t.Type == 23,
				(Token t) => (int)t.Type == 2,
				(Token t) => (int)t.Type == 89
			},
			code_to_add = (Token[])(object)new Token[24]
			{
				new Token((TokenType)59, (uint?)null),
				(Token)new IdentifierToken("lucy_display"),
				new Token((TokenType)23, (uint?)null),
				(Token)new ConstantToken((Variant)new StringVariant("")),
				new Token((TokenType)89, (uint?)2u),
				new Token((TokenType)38, (uint?)null),
				new Token((TokenType)15, (uint?)null),
				new Token((TokenType)87, (uint?)null),
				(Token)new ConstantToken((Variant)new StringVariant("%hidenames")),
				new Token((TokenType)84, (uint?)null),
				(Token)new IdentifierToken("pressed"),
				new Token((TokenType)86, (uint?)null),
				new Token((TokenType)89, (uint?)3u),
				(Token)new IdentifierToken("lucy_display"),
				new Token((TokenType)23, (uint?)null),
				(Token)new IdentifierToken("Steam"),
				new Token((TokenType)84, (uint?)null),
				(Token)new IdentifierToken("getLobbyData"),
				new Token((TokenType)80, (uint?)null),
				(Token)new IdentifierToken("lobby"),
				new Token((TokenType)82, (uint?)null),
				(Token)new ConstantToken((Variant)new StringVariant("bbcode_lobby_name")),
				new Token((TokenType)81, (uint?)null),
				new Token((TokenType)89, (uint?)2u)
			}
		},
		new CodeChange
		{
			name = "server button lucy_display arg",
			multitoken_prefix = new Func<Token, bool>[7]
			{
				delegate(Token t)
				{
					IdentifierToken val4 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val4 != null && val4.Name == "lobby_cap";
				},
				(Token t) => (int)t.Type == 82,
				delegate(Token t)
				{
					IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val3 != null && val3.Name == "lobby_age";
				},
				(Token t) => (int)t.Type == 82,
				delegate(Token t)
				{
					IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val2 != null && val2.Name == "dated";
				},
				(Token t) => (int)t.Type == 82,
				delegate(Token t)
				{
					IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val != null && val.Name == "banned";
				}
			},
			code_to_add = (Token[])(object)new Token[2]
			{
				new Token((TokenType)82, (uint?)null),
				(Token)new IdentifierToken("lucy_display")
			}
		}
	};

	bool IScriptMod.ShouldRun(string path)
	{
		return path == "res://Scenes/Menus/Main Menu/main_menu.gdc";
	}

	[IteratorStateMachine(typeof(<GDWeave-Modding-IScriptMod-Modify>d__2))]
	global::System.Collections.Generic.IEnumerable<Token> IScriptMod.Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		List<ValueTuple<CodeChange, MultiTokenWaiter>> pending_changes = Enumerable.ToList<ValueTuple<CodeChange, MultiTokenWaiter>>(Enumerable.Select<CodeChange, ValueTuple<CodeChange, MultiTokenWaiter>>((global::System.Collections.Generic.IEnumerable<CodeChange>)changes, (Func<CodeChange, ValueTuple<CodeChange, MultiTokenWaiter>>)((CodeChange c) => new ValueTuple<CodeChange, MultiTokenWaiter>(c, new MultiTokenWaiter(c.multitoken_prefix, false, false)))));
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token token = enumerator.Current;
				bool flag = false;
				Enumerator<ValueTuple<CodeChange, MultiTokenWaiter>> enumerator2 = pending_changes.GetEnumerator();
				try
				{
					while (enumerator2.MoveNext())
					{
						ValueTuple<CodeChange, MultiTokenWaiter> current = enumerator2.Current;
						CodeChange change = current.Item1;
						if (current.Item2.Check(token))
						{
							Mod.ModInterface.Logger.Information("Adding Lucy server button mod " + change.name);
							yield return token;
							Token[] code_to_add = change.code_to_add;
							for (int i = 0; i < code_to_add.Length; i++)
							{
								yield return code_to_add[i];
							}
							flag = true;
							break;
						}
					}
				}
				finally
				{
					((global::System.IDisposable)enumerator2).Dispose();
				}
				if (!flag)
				{
					yield return token;
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}
public class LucysChatChanges : IScriptMod
{
	[CompilerGenerated]
	private sealed class <GDWeave-Modding-IScriptMod-Modify>d__2 : global::System.Collections.Generic.IEnumerable<Token>, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerator<Token>, global::System.Collections.IEnumerator, global::System.IDisposable
	{
		private int <>1__state;

		private Token <>2__current;

		private int <>l__initialThreadId;

		public LucysChatChanges <>4__this;

		private global::System.Collections.Generic.IEnumerable<Token> tokens;

		public global::System.Collections.Generic.IEnumerable<Token> <>3__tokens;

		private List<ValueTuple<CodeChange, MultiTokenWaiter>> <pending_changes>5__2;

		private global::System.Collections.Generic.IEnumerator<Token> <>7__wrap2;

		private Token <token>5__4;

		private Enumerator<ValueTuple<CodeChange, MultiTokenWaiter>> <>7__wrap4;

		private CodeChange <change>5__6;

		private Token[] <>7__wrap6;

		private int <>7__wrap7;

		Token global::System.Collections.Generic.IEnumerator<Token>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object global::System.Collections.IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <GDWeave-Modding-IScriptMod-Modify>d__2(int <>1__state)
		{
			this.<>1__state = <>1__state;
			<>l__initialThreadId = Environment.CurrentManagedThreadId;
		}

		[DebuggerHidden]
		void global::System.IDisposable.Dispose()
		{
			int num = <>1__state;
			if ((uint)(num - -4) > 1u && (uint)(num - 1) > 2u)
			{
				return;
			}
			try
			{
				if (num != -4 && (uint)(num - 1) > 1u)
				{
					return;
				}
				try
				{
				}
				finally
				{
					<>m__Finally2();
				}
			}
			finally
			{
				<>m__Finally1();
			}
		}

		private bool MoveNext()
		{
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				int num = <>1__state;
				LucysChatChanges lucysChatChanges = <>4__this;
				bool flag;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<pending_changes>5__2 = Enumerable.ToList<ValueTuple<CodeChange, MultiTokenWaiter>>(Enumerable.Select<CodeChange, ValueTuple<CodeChange, MultiTokenWaiter>>((global::System.Collections.Generic.IEnumerable<CodeChange>)lucysChatChanges.changes, (Func<CodeChange, ValueTuple<CodeChange, MultiTokenWaiter>>)((CodeChange c) => new ValueTuple<CodeChange, MultiTokenWaiter>(c, new MultiTokenWaiter(c.multitoken_prefix, false, false)))));
					<>7__wrap2 = tokens.GetEnumerator();
					<>1__state = -3;
					goto IL_01ef;
				case 1:
					<>1__state = -4;
					<>7__wrap6 = <change>5__6.code_to_add;
					<>7__wrap7 = 0;
					goto IL_0182;
				case 2:
					<>1__state = -4;
					<>7__wrap7++;
					goto IL_0182;
				case 3:
					{
						<>1__state = -3;
						goto IL_01e8;
					}
					IL_0182:
					if (<>7__wrap7 < <>7__wrap6.Length)
					{
						Token val = <>7__wrap6[<>7__wrap7];
						<>2__current = val;
						<>1__state = 2;
						return true;
					}
					<>7__wrap6 = null;
					flag = true;
					goto IL_01b4;
					IL_01ef:
					if (((global::System.Collections.IEnumerator)<>7__wrap2).MoveNext())
					{
						<token>5__4 = <>7__wrap2.Current;
						flag = false;
						<>7__wrap4 = <pending_changes>5__2.GetEnumerator();
						<>1__state = -4;
						while (<>7__wrap4.MoveNext())
						{
							ValueTuple<CodeChange, MultiTokenWaiter> current = <>7__wrap4.Current;
							<change>5__6 = current.Item1;
							if (current.Item2.Check(<token>5__4))
							{
								Mod.ModInterface.Logger.Information("Adding Lucy Chat mod " + <change>5__6.name);
								<>2__current = <token>5__4;
								<>1__state = 1;
								return true;
							}
							<change>5__6 = null;
						}
						goto IL_01b4;
					}
					<>m__Finally1();
					<>7__wrap2 = null;
					return false;
					IL_01b4:
					<>m__Finally2();
					<>7__wrap4 = default(Enumerator<ValueTuple<CodeChange, MultiTokenWaiter>>);
					if (!flag)
					{
						<>2__current = <token>5__4;
						<>1__state = 3;
						return true;
					}
					goto IL_01e8;
					IL_01e8:
					<token>5__4 = null;
					goto IL_01ef;
				}
			}
			catch
			{
				//try-fault
				((global::System.IDisposable)this).Dispose();
				throw;
			}
		}

		bool global::System.Collections.IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		private void <>m__Finally1()
		{
			<>1__state = -1;
			if (<>7__wrap2 != null)
			{
				((global::System.IDisposable)<>7__wrap2).Dispose();
			}
		}

		private void <>m__Finally2()
		{
			<>1__state = -3;
			((global::System.IDisposable)<>7__wrap4).Dispose();
		}

		[DebuggerHidden]
		void global::System.Collections.IEnumerator.Reset()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new NotSupportedException();
		}

		[DebuggerHidden]
		global::System.Collections.Generic.IEnumerator<Token> global::System.Collections.Generic.IEnumerable<Token>.GetEnumerator()
		{
			<GDWeave-Modding-IScriptMod-Modify>d__2 <GDWeave-Modding-IScriptMod-Modify>d__;
			if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
			{
				<>1__state = 0;
				<GDWeave-Modding-IScriptMod-Modify>d__ = this;
			}
			else
			{
				<GDWeave-Modding-IScriptMod-Modify>d__ = new <GDWeave-Modding-IScriptMod-Modify>d__2(0)
				{
					<>4__this = <>4__this
				};
			}
			<GDWeave-Modding-IScriptMod-Modify>d__.tokens = <>3__tokens;
			return <GDWeave-Modding-IScriptMod-Modify>d__;
		}

		[DebuggerHidden]
		global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator()
		{
			return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable<Token>)this).GetEnumerator();
		}
	}

	private CodeChange[] changes = new CodeChange[1]
	{
		new CodeChange
		{
			name = "chat process intercept",
			multitoken_prefix = new Func<Token, bool>[7]
			{
				delegate(Token t)
				{
					IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val2 != null && val2.Name == "color";
				},
				(Token t) => (int)t.Type == 84,
				delegate(Token t)
				{
					IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val != null && val.Name == "to_html";
				},
				(Token t) => (int)t.Type == 80,
				(Token t) => (int)t.Type == 81,
				(Token t) => (int)t.Type == 89,
				(Token t) => (int)t.Type == 89
			},
			code_to_add = (Token[])(object)new Token[16]
			{
				new Token((TokenType)87, (uint?)null),
				(Token)new ConstantToken((Variant)new StringVariant("/root/LucyLucysTools")),
				new Token((TokenType)84, (uint?)null),
				(Token)new IdentifierToken("process_message"),
				new Token((TokenType)80, (uint?)null),
				(Token)new IdentifierToken("text"),
				new Token((TokenType)82, (uint?)null),
				(Token)new IdentifierToken("chat_local"),
				new Token((TokenType)82, (uint?)null),
				(Token)new IdentifierToken("player"),
				new Token((TokenType)82, (uint?)null),
				new Token((TokenType)3, (uint?)null),
				new Token((TokenType)81, (uint?)null),
				new Token((TokenType)89, (uint?)1u),
				new Token((TokenType)46, (uint?)null),
				new Token((TokenType)89, (uint?)1u)
			}
		}
	};

	bool IScriptMod.ShouldRun(string path)
	{
		return path == "res://Scenes/HUD/playerhud.gdc";
	}

	[IteratorStateMachine(typeof(<GDWeave-Modding-IScriptMod-Modify>d__2))]
	global::System.Collections.Generic.IEnumerable<Token> IScriptMod.Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		List<ValueTuple<CodeChange, MultiTokenWaiter>> pending_changes = Enumerable.ToList<ValueTuple<CodeChange, MultiTokenWaiter>>(Enumerable.Select<CodeChange, ValueTuple<CodeChange, MultiTokenWaiter>>((global::System.Collections.Generic.IEnumerable<CodeChange>)changes, (Func<CodeChange, ValueTuple<CodeChange, MultiTokenWaiter>>)((CodeChange c) => new ValueTuple<CodeChange, MultiTokenWaiter>(c, new MultiTokenWaiter(c.multitoken_prefix, false, false)))));
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token token = enumerator.Current;
				bool flag = false;
				Enumerator<ValueTuple<CodeChange, MultiTokenWaiter>> enumerator2 = pending_changes.GetEnumerator();
				try
				{
					while (enumerator2.MoveNext())
					{
						ValueTuple<CodeChange, MultiTokenWaiter> current = enumerator2.Current;
						CodeChange change = current.Item1;
						if (current.Item2.Check(token))
						{
							Mod.ModInterface.Logger.Information("Adding Lucy Chat mod " + change.name);
							yield return token;
							Token[] code_to_add = change.code_to_add;
							for (int i = 0; i < code_to_add.Length; i++)
							{
								yield return code_to_add[i];
							}
							flag = true;
							break;
						}
					}
				}
				finally
				{
					((global::System.IDisposable)enumerator2).Dispose();
				}
				if (!flag)
				{
					yield return token;
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}