Decompiled source of Yapper v1.0.0

GDWeave/mods/Yapper/Yapper.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
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("Yapper")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+569d310ba3133e1f73c560d9069c3fcd4e9dda3a")]
[assembly: AssemblyProduct("Yapper")]
[assembly: AssemblyTitle("Yapper")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Yapper;

public class ChatPatch : IScriptMod
{
	[CompilerGenerated]
	private sealed class <Modify>d__1 : 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;

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

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

		private MultiTokenWaiter <waiter>5__2;

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

		private Token <token>5__4;

		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 <Modify>d__1(int <>1__state)
		{
			this.<>1__state = <>1__state;
			<>l__initialThreadId = Environment.CurrentManagedThreadId;
		}

		[DebuggerHidden]
		void global::System.IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || (uint)(num - 1) <= 15u)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
		}

		private bool MoveNext()
		{
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Expected O, but got Unknown
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Expected O, but got Unknown
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Expected O, but got Unknown
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Expected O, but got Unknown
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Expected O, but got Unknown
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Expected O, but got Unknown
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Expected O, but got Unknown
			//IL_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Expected O, but got Unknown
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Expected O, but got Unknown
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Expected O, but got Unknown
			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Expected O, but got Unknown
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b8: Expected O, but got Unknown
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Expected O, but got Unknown
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Expected O, but got Unknown
			//IL_032f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Expected O, but got Unknown
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Expected O, but got Unknown
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<waiter>5__2 = new MultiTokenWaiter(new Func<Token, bool>[2]
					{
						delegate(Token t)
						{
							IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val != null && val.Name == "_update_chat";
						},
						(Token t) => (int)t.Type == 89
					}, false, true);
					<>7__wrap2 = tokens.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					<>2__current = new Token((TokenType)38, (uint?)null);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -3;
					<>2__current = new Token((TokenType)87, (uint?)null);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -3;
					<>2__current = new Token((TokenType)86, (uint?)null);
					<>1__state = 5;
					return true;
				case 5:
					<>1__state = -3;
					<>2__current = new Token((TokenType)87, (uint?)null);
					<>1__state = 6;
					return true;
				case 6:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					<>1__state = 7;
					return true;
				case 7:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 8;
					return true;
				case 8:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("_queue");
					<>1__state = 9;
					return true;
				case 9:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 10;
					return true;
				case 10:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("chat"));
					<>1__state = 11;
					return true;
				case 11:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 12;
					return true;
				case 12:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("text");
					<>1__state = 13;
					return true;
				case 13:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 14;
					return true;
				case 14:
					<>1__state = -3;
					<>2__current = <token>5__4;
					<>1__state = 15;
					return true;
				case 15:
					<>1__state = -3;
					goto IL_038f;
				case 16:
					{
						<>1__state = -3;
						goto IL_038f;
					}
					IL_038f:
					<token>5__4 = null;
					break;
				}
				if (((global::System.Collections.IEnumerator)<>7__wrap2).MoveNext())
				{
					<token>5__4 = <>7__wrap2.Current;
					if (<waiter>5__2.Check(<token>5__4))
					{
						<>2__current = <token>5__4;
						<>1__state = 1;
						return true;
					}
					<>2__current = <token>5__4;
					<>1__state = 16;
					return true;
				}
				<>m__Finally1();
				<>7__wrap2 = null;
				return false;
			}
			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();
			}
		}

		[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()
		{
			<Modify>d__1 <Modify>d__;
			if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
			{
				<>1__state = 0;
				<Modify>d__ = this;
			}
			else
			{
				<Modify>d__ = new <Modify>d__1(0);
			}
			<Modify>d__.tokens = <>3__tokens;
			return <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();
		}
	}

	public bool ShouldRun(string path)
	{
		return path == "res://Scenes/Singletons/SteamNetwork.gdc";
	}

	[IteratorStateMachine(typeof(<Modify>d__1))]
	public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		MultiTokenWaiter waiter = new MultiTokenWaiter(new Func<Token, bool>[2]
		{
			delegate(Token t)
			{
				IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val != null && val.Name == "_update_chat";
			},
			(Token t) => (int)t.Type == 89
		}, false, true);
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token token = enumerator.Current;
				if (waiter.Check(token))
				{
					yield return token;
					yield return new Token((TokenType)38, (uint?)null);
					yield return new Token((TokenType)87, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					yield return new Token((TokenType)86, (uint?)null);
					yield return new Token((TokenType)87, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("_queue");
					yield return new Token((TokenType)80, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("chat"));
					yield return new Token((TokenType)82, (uint?)null);
					yield return (Token)new IdentifierToken("text");
					yield return new Token((TokenType)81, (uint?)null);
					yield return token;
				}
				else
				{
					yield return token;
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}
public class DialoguePatch : IScriptMod
{
	[CompilerGenerated]
	private sealed class <Modify>d__1 : 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;

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

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

		private MultiTokenWaiter <dialogueMatch>5__2;

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

		private Token <token>5__4;

		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 <Modify>d__1(int <>1__state)
		{
			this.<>1__state = <>1__state;
			<>l__initialThreadId = Environment.CurrentManagedThreadId;
		}

		[DebuggerHidden]
		void global::System.IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || (uint)(num - 1) <= 18u)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
		}

		private bool MoveNext()
		{
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Expected O, but got Unknown
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Expected O, but got Unknown
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Expected O, but got Unknown
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Expected O, but got Unknown
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_022f: Expected O, but got Unknown
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Expected O, but got Unknown
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Expected O, but got Unknown
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Expected O, but got Unknown
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Expected O, but got Unknown
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d8: Expected O, but got Unknown
			//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0305: Expected O, but got Unknown
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Expected O, but got Unknown
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_0331: Expected O, but got Unknown
			//IL_0354: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Expected O, but got Unknown
			//IL_037b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0385: Expected O, but got Unknown
			//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b2: Expected O, but got Unknown
			//IL_03cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d9: Expected O, but got Unknown
			//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: Expected O, but got Unknown
			//IL_0429: Unknown result type (might be due to invalid IL or missing references)
			//IL_0433: Expected O, but got Unknown
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Expected O, but got Unknown
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Expected O, but got Unknown
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<dialogueMatch>5__2 = new MultiTokenWaiter(new Func<Token, bool>[5]
					{
						delegate(Token t)
						{
							IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val2 != null && val2.Name == "bank";
						},
						(Token t) => (int)t.Type == 76,
						delegate(Token t)
						{
							IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val != null && val.Name == "i";
						},
						(Token t) => (int)t.Type == 77,
						(Token t) => (int)t.Type == 89
					}, false, false);
					<>7__wrap2 = tokens.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					<>2__current = new Token((TokenType)38, (uint?)null);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -3;
					<>2__current = new Token((TokenType)87, (uint?)null);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -3;
					<>2__current = new Token((TokenType)86, (uint?)null);
					<>1__state = 5;
					return true;
				case 5:
					<>1__state = -3;
					<>2__current = new Token((TokenType)87, (uint?)null);
					<>1__state = 6;
					return true;
				case 6:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					<>1__state = 7;
					return true;
				case 7:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 8;
					return true;
				case 8:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("_queue");
					<>1__state = 9;
					return true;
				case 9:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 10;
					return true;
				case 10:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("dialogue"));
					<>1__state = 11;
					return true;
				case 11:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 12;
					return true;
				case 12:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("bank");
					<>1__state = 13;
					return true;
				case 13:
					<>1__state = -3;
					<>2__current = new Token((TokenType)76, (uint?)null);
					<>1__state = 14;
					return true;
				case 14:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("i");
					<>1__state = 15;
					return true;
				case 15:
					<>1__state = -3;
					<>2__current = new Token((TokenType)77, (uint?)null);
					<>1__state = 16;
					return true;
				case 16:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 17;
					return true;
				case 17:
					<>1__state = -3;
					<>2__current = <token>5__4;
					<>1__state = 18;
					return true;
				case 18:
					<>1__state = -3;
					goto IL_0489;
				case 19:
					{
						<>1__state = -3;
						goto IL_0489;
					}
					IL_0489:
					<token>5__4 = null;
					break;
				}
				if (((global::System.Collections.IEnumerator)<>7__wrap2).MoveNext())
				{
					<token>5__4 = <>7__wrap2.Current;
					if (<dialogueMatch>5__2.Check(<token>5__4))
					{
						<>2__current = new Token((TokenType)89, (uint?)1u);
						<>1__state = 1;
						return true;
					}
					<>2__current = <token>5__4;
					<>1__state = 19;
					return true;
				}
				<>m__Finally1();
				<>7__wrap2 = null;
				return false;
			}
			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();
			}
		}

		[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()
		{
			<Modify>d__1 <Modify>d__;
			if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
			{
				<>1__state = 0;
				<Modify>d__ = this;
			}
			else
			{
				<Modify>d__ = new <Modify>d__1(0);
			}
			<Modify>d__.tokens = <>3__tokens;
			return <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();
		}
	}

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

	[IteratorStateMachine(typeof(<Modify>d__1))]
	public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		MultiTokenWaiter dialogueMatch = new MultiTokenWaiter(new Func<Token, bool>[5]
		{
			delegate(Token t)
			{
				IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val2 != null && val2.Name == "bank";
			},
			(Token t) => (int)t.Type == 76,
			delegate(Token t)
			{
				IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val != null && val.Name == "i";
			},
			(Token t) => (int)t.Type == 77,
			(Token t) => (int)t.Type == 89
		}, false, false);
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token token = enumerator.Current;
				if (dialogueMatch.Check(token))
				{
					yield return new Token((TokenType)89, (uint?)1u);
					yield return new Token((TokenType)38, (uint?)null);
					yield return new Token((TokenType)87, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					yield return new Token((TokenType)86, (uint?)null);
					yield return new Token((TokenType)87, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("_queue");
					yield return new Token((TokenType)80, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("dialogue"));
					yield return new Token((TokenType)82, (uint?)null);
					yield return (Token)new IdentifierToken("bank");
					yield return new Token((TokenType)76, (uint?)null);
					yield return (Token)new IdentifierToken("i");
					yield return new Token((TokenType)77, (uint?)null);
					yield return new Token((TokenType)81, (uint?)null);
					yield return token;
				}
				else
				{
					yield return token;
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}
public class Mod : IMod, global::System.IDisposable
{
	public Mod(IModInterface modInterface)
	{
		modInterface.RegisterScriptMod((IScriptMod)(object)new ResolveAssemblyPath());
		modInterface.RegisterScriptMod((IScriptMod)(object)new TooltipPatch());
		modInterface.RegisterScriptMod((IScriptMod)(object)new DialoguePatch());
		modInterface.RegisterScriptMod((IScriptMod)(object)new ChatPatch());
	}

	public void Dispose()
	{
	}
}
public class ResolveAssemblyPath : IScriptMod
{
	[CompilerGenerated]
	private sealed class <Modify>d__1 : 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;

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

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

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

		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 <Modify>d__1(int <>1__state)
		{
			this.<>1__state = <>1__state;
			<>l__initialThreadId = Environment.CurrentManagedThreadId;
		}

		[DebuggerHidden]
		void global::System.IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || num == 1)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
		}

		private bool MoveNext()
		{
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>7__wrap1 = tokens.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					break;
				}
				if (((global::System.Collections.IEnumerator)<>7__wrap1).MoveNext())
				{
					Token current = <>7__wrap1.Current;
					ConstantToken val = (ConstantToken)(object)((current is ConstantToken) ? current : null);
					if (val != null)
					{
						Variant value = val.Value;
						StringVariant val2 = (StringVariant)(object)((value is StringVariant) ? value : null);
						if (val2 != null && val2.Value == "%LIBGDTTS%")
						{
							val2.Value = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "libgdtts.windows.x86_64.dll");
						}
					}
					<>2__current = current;
					<>1__state = 1;
					return true;
				}
				<>m__Finally1();
				<>7__wrap1 = null;
				return false;
			}
			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__wrap1 != null)
			{
				((global::System.IDisposable)<>7__wrap1).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()
		{
			<Modify>d__1 <Modify>d__;
			if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
			{
				<>1__state = 0;
				<Modify>d__ = this;
			}
			else
			{
				<Modify>d__ = new <Modify>d__1(0);
			}
			<Modify>d__.tokens = <>3__tokens;
			return <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();
		}
	}

	public bool ShouldRun(string path)
	{
		return path == "res://mods/Yapper/scripts/tts.gdc";
	}

	[IteratorStateMachine(typeof(<Modify>d__1))]
	public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token current = enumerator.Current;
				ConstantToken val = (ConstantToken)(object)((current is ConstantToken) ? current : null);
				if (val != null)
				{
					Variant value = val.Value;
					StringVariant val2 = (StringVariant)(object)((value is StringVariant) ? value : null);
					if (val2 != null && val2.Value == "%LIBGDTTS%")
					{
						val2.Value = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "libgdtts.windows.x86_64.dll");
					}
				}
				yield return current;
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}
public class TooltipPatch : IScriptMod
{
	[CompilerGenerated]
	private sealed class <Modify>d__1 : 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;

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

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

		private MultiTokenWaiter <tooltipExitMatch>5__2;

		private MultiTokenWaiter <tooltipEnterMatch>5__3;

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

		private Token <token>5__5;

		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 <Modify>d__1(int <>1__state)
		{
			this.<>1__state = <>1__state;
			<>l__initialThreadId = Environment.CurrentManagedThreadId;
		}

		[DebuggerHidden]
		void global::System.IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || (uint)(num - 1) <= 32u)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
		}

		private bool MoveNext()
		{
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Expected O, but got Unknown
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e8: Expected O, but got Unknown
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_030e: Expected O, but got Unknown
			//IL_0309: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Expected O, but got Unknown
			//IL_0335: Unknown result type (might be due to invalid IL or missing references)
			//IL_033f: Expected O, but got Unknown
			//IL_0361: Unknown result type (might be due to invalid IL or missing references)
			//IL_036b: Expected O, but got Unknown
			//IL_0387: Unknown result type (might be due to invalid IL or missing references)
			//IL_0391: Expected O, but got Unknown
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0396: Expected O, but got Unknown
			//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c2: Expected O, but got Unknown
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e8: Expected O, but got Unknown
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0415: Expected O, but got Unknown
			//IL_0432: Unknown result type (might be due to invalid IL or missing references)
			//IL_043c: Expected O, but got Unknown
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_0441: Expected O, but got Unknown
			//IL_0464: Unknown result type (might be due to invalid IL or missing references)
			//IL_046e: Expected O, but got Unknown
			//IL_048e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0498: Expected O, but got Unknown
			//IL_051c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0526: Expected O, but got Unknown
			//IL_0549: Unknown result type (might be due to invalid IL or missing references)
			//IL_0553: Expected O, but got Unknown
			//IL_0570: Unknown result type (might be due to invalid IL or missing references)
			//IL_057a: Expected O, but got Unknown
			//IL_0575: Unknown result type (might be due to invalid IL or missing references)
			//IL_057f: Expected O, but got Unknown
			//IL_05a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ac: Expected O, but got Unknown
			//IL_05cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d9: Expected O, but got Unknown
			//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0600: Expected O, but got Unknown
			//IL_05fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0605: Expected O, but got Unknown
			//IL_0628: Unknown result type (might be due to invalid IL or missing references)
			//IL_0632: Expected O, but got Unknown
			//IL_064f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0659: Expected O, but got Unknown
			//IL_067c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0686: Expected O, but got Unknown
			//IL_06a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ad: Expected O, but got Unknown
			//IL_06a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b2: Expected O, but got Unknown
			//IL_06d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06df: Expected O, but got Unknown
			//IL_06fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0706: Expected O, but got Unknown
			//IL_0729: Unknown result type (might be due to invalid IL or missing references)
			//IL_0733: Expected O, but got Unknown
			//IL_0750: Unknown result type (might be due to invalid IL or missing references)
			//IL_075a: Expected O, but got Unknown
			//IL_077d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0787: Expected O, but got Unknown
			//IL_07a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b1: Expected O, but got Unknown
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Expected O, but got Unknown
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Expected O, but got Unknown
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<tooltipExitMatch>5__2 = new MultiTokenWaiter(new Func<Token, bool>[6]
					{
						(Token t) => (int)t.Type == 38,
						delegate(Token t)
						{
							IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val3 != null && val3.Name == "hovered_tooltip";
						},
						(Token t) => (int)t.Type == 7,
						delegate(Token t)
						{
							IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val2 != null && val2.Name == "node";
						},
						(Token t) => (int)t.Type == 86,
						(Token t) => (int)t.Type == 89
					}, false, false);
					<tooltipEnterMatch>5__3 = new MultiTokenWaiter(new Func<Token, bool>[5]
					{
						delegate(Token t)
						{
							IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val != null && val.Name == "_update_visible";
						},
						(Token t) => (int)t.Type == 80,
						(Token t) => (int)t.Type == 81,
						(Token t) => (int)t.Type == 86,
						(Token t) => (int)t.Type == 89
					}, false, false);
					<>7__wrap3 = tokens.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					<>2__current = new Token((TokenType)38, (uint?)null);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -3;
					<>2__current = new Token((TokenType)87, (uint?)null);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -3;
					<>2__current = new Token((TokenType)86, (uint?)null);
					<>1__state = 5;
					return true;
				case 5:
					<>1__state = -3;
					<>2__current = new Token((TokenType)87, (uint?)null);
					<>1__state = 6;
					return true;
				case 6:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					<>1__state = 7;
					return true;
				case 7:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 8;
					return true;
				case 8:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("_dequeue");
					<>1__state = 9;
					return true;
				case 9:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 10;
					return true;
				case 10:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("tooltip"));
					<>1__state = 11;
					return true;
				case 11:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 12;
					return true;
				case 12:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)2u);
					<>1__state = 13;
					return true;
				case 13:
					<>1__state = -3;
					<>2__current = <token>5__5;
					<>1__state = 14;
					return true;
				case 14:
					<>1__state = -3;
					goto IL_0807;
				case 15:
					<>1__state = -3;
					<>2__current = new Token((TokenType)38, (uint?)null);
					<>1__state = 16;
					return true;
				case 16:
					<>1__state = -3;
					<>2__current = new Token((TokenType)87, (uint?)null);
					<>1__state = 17;
					return true;
				case 17:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					<>1__state = 18;
					return true;
				case 18:
					<>1__state = -3;
					<>2__current = new Token((TokenType)86, (uint?)null);
					<>1__state = 19;
					return true;
				case 19:
					<>1__state = -3;
					<>2__current = new Token((TokenType)87, (uint?)null);
					<>1__state = 20;
					return true;
				case 20:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					<>1__state = 21;
					return true;
				case 21:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 22;
					return true;
				case 22:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("_queue");
					<>1__state = 23;
					return true;
				case 23:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 24;
					return true;
				case 24:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("tooltip"));
					<>1__state = 25;
					return true;
				case 25:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 26;
					return true;
				case 26:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("current_header");
					<>1__state = 27;
					return true;
				case 27:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 28;
					return true;
				case 28:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("current_body");
					<>1__state = 29;
					return true;
				case 29:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 30;
					return true;
				case 30:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)1u);
					<>1__state = 31;
					return true;
				case 31:
					<>1__state = -3;
					<>2__current = <token>5__5;
					<>1__state = 32;
					return true;
				case 32:
					<>1__state = -3;
					goto IL_0807;
				case 33:
					{
						<>1__state = -3;
						goto IL_0807;
					}
					IL_0807:
					<token>5__5 = null;
					break;
				}
				if (((global::System.Collections.IEnumerator)<>7__wrap3).MoveNext())
				{
					<token>5__5 = <>7__wrap3.Current;
					if (<tooltipExitMatch>5__2.Check(<token>5__5))
					{
						<>2__current = <token>5__5;
						<>1__state = 1;
						return true;
					}
					if (<tooltipEnterMatch>5__3.Check(<token>5__5))
					{
						<>2__current = <token>5__5;
						<>1__state = 15;
						return true;
					}
					<>2__current = <token>5__5;
					<>1__state = 33;
					return true;
				}
				<>m__Finally1();
				<>7__wrap3 = null;
				return false;
			}
			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__wrap3 != null)
			{
				((global::System.IDisposable)<>7__wrap3).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()
		{
			<Modify>d__1 <Modify>d__;
			if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
			{
				<>1__state = 0;
				<Modify>d__ = this;
			}
			else
			{
				<Modify>d__ = new <Modify>d__1(0);
			}
			<Modify>d__.tokens = <>3__tokens;
			return <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();
		}
	}

	public bool ShouldRun(string path)
	{
		return path == "res://Scenes/Singletons/Tooltips/tooltip.gdc";
	}

	[IteratorStateMachine(typeof(<Modify>d__1))]
	public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		MultiTokenWaiter tooltipExitMatch = new MultiTokenWaiter(new Func<Token, bool>[6]
		{
			(Token t) => (int)t.Type == 38,
			delegate(Token t)
			{
				IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val3 != null && val3.Name == "hovered_tooltip";
			},
			(Token t) => (int)t.Type == 7,
			delegate(Token t)
			{
				IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val2 != null && val2.Name == "node";
			},
			(Token t) => (int)t.Type == 86,
			(Token t) => (int)t.Type == 89
		}, false, false);
		MultiTokenWaiter tooltipEnterMatch = new MultiTokenWaiter(new Func<Token, bool>[5]
		{
			delegate(Token t)
			{
				IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val != null && val.Name == "_update_visible";
			},
			(Token t) => (int)t.Type == 80,
			(Token t) => (int)t.Type == 81,
			(Token t) => (int)t.Type == 86,
			(Token t) => (int)t.Type == 89
		}, false, false);
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token token = enumerator.Current;
				if (tooltipExitMatch.Check(token))
				{
					yield return token;
					yield return new Token((TokenType)38, (uint?)null);
					yield return new Token((TokenType)87, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					yield return new Token((TokenType)86, (uint?)null);
					yield return new Token((TokenType)87, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("_dequeue");
					yield return new Token((TokenType)80, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("tooltip"));
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)89, (uint?)2u);
					yield return token;
				}
				else if (tooltipEnterMatch.Check(token))
				{
					yield return token;
					yield return new Token((TokenType)38, (uint?)null);
					yield return new Token((TokenType)87, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					yield return new Token((TokenType)86, (uint?)null);
					yield return new Token((TokenType)87, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("/root/Yapper"));
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("_queue");
					yield return new Token((TokenType)80, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("tooltip"));
					yield return new Token((TokenType)82, (uint?)null);
					yield return (Token)new IdentifierToken("current_header");
					yield return new Token((TokenType)82, (uint?)null);
					yield return (Token)new IdentifierToken("current_body");
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)89, (uint?)1u);
					yield return token;
				}
				else
				{
					yield return token;
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}