Decompiled source of DECTalk v1.0.3

GDWeave/mods/DECTalkMod/DECTalkMod.dll

Decompiled 2 weeks 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 DECTalkMod.Patches;
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("DECTalkMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0+0a28bd4e5f7d949f15fdadcdbe91bf9716f3cd27")]
[assembly: AssemblyProduct("DECTalkMod")]
[assembly: AssemblyTitle("DECTalkMod")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace DECTalkMod
{
	public class Config
	{
	}
	public class Mod : IMod, global::System.IDisposable
	{
		public static Config Config;

		public static IModInterface Interface;

		public static void LogInformation(object msg)
		{
			Interface.Logger.Information(": DECTalkMod: " + msg);
		}

		public Mod(IModInterface modInterface)
		{
			Interface = modInterface;
			Config = modInterface.ReadConfig<Config>();
			LogInformation("Haaii!");
			Interface.RegisterScriptMod((IScriptMod)(object)new ModPatcher());
			Interface.RegisterScriptMod((IScriptMod)(object)new PlayerHUDPatcher());
			Interface.RegisterScriptMod((IScriptMod)(object)new PlayerLabelPatcher());
			Interface.RegisterScriptMod((IScriptMod)(object)new SoundManagerPatcher());
		}

		public void Dispose()
		{
		}
	}
}
namespace DECTalkMod.Patches
{
	public class ModPatcher : 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 string path;

			public string <>3__path;

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

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

			public ModPatcher <>4__this;

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

			private Token <token>5__2;

			private StringVariant <str>5__3;

			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)
				{
					return;
				}
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}

			private bool MoveNext()
			{
				try
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<>s__1 = tokens.GetEnumerator();
						<>1__state = -3;
						break;
					case 1:
						<>1__state = -3;
						<str>5__3 = null;
						<token>5__2 = null;
						break;
					}
					if (((global::System.Collections.IEnumerator)<>s__1).MoveNext())
					{
						<token>5__2 = <>s__1.Current;
						Token obj = <token>5__2;
						ConstantToken val = (ConstantToken)(object)((obj is ConstantToken) ? obj : null);
						if (val != null)
						{
							Variant value = val.Value;
							<str>5__3 = (StringVariant)(object)((value is StringVariant) ? value : null);
							if (<str>5__3 != null && <str>5__3.Value == "%LIBDECTALKPATH%")
							{
								<str>5__3.Value = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "libGodotDecTalk.dll");
							}
						}
						<>2__current = <token>5__2;
						<>1__state = 1;
						return true;
					}
					<>m__Finally1();
					<>s__1 = 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 (<>s__1 != null)
				{
					((global::System.IDisposable)<>s__1).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)
					{
						<>4__this = <>4__this
					};
				}
				<Modify>d__.path = <>3__path;
				<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/deltaneverused.dectalk/main.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
			{
				StringVariant str = default(StringVariant);
				while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
				{
					Token token = enumerator.Current;
					ConstantToken val = (ConstantToken)(object)((token is ConstantToken) ? token : null);
					int num;
					if (val != null)
					{
						Variant value = val.Value;
						str = (StringVariant)(object)((value is StringVariant) ? value : null);
						if (str != null)
						{
							num = ((str.Value == "%LIBDECTALKPATH%") ? 1 : 0);
							goto IL_009d;
						}
					}
					num = 0;
					goto IL_009d;
					IL_009d:
					if (num != 0)
					{
						str.Value = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "libGodotDecTalk.dll");
					}
					yield return token;
					str = null;
				}
			}
			finally
			{
				((global::System.IDisposable)enumerator)?.Dispose();
			}
		}
	}
	public class PlayerHUDPatcher : 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 string path;

			public string <>3__path;

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

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

			public PlayerHUDPatcher <>4__this;

			private MultiTokenWaiter <speechWaiter>5__1;

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

			private Token <token>5__3;

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

			private Token <t>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 ((uint)(num - -4) > 1u && (uint)(num - 1) > 2u)
				{
					return;
				}
				try
				{
					if (num != -4 && num != 2)
					{
						return;
					}
					try
					{
					}
					finally
					{
						<>m__Finally2();
					}
				}
				finally
				{
					<>m__Finally1();
				}
			}

			private bool MoveNext()
			{
				//IL_0136: Unknown result type (might be due to invalid IL or missing references)
				//IL_0140: Expected O, but got Unknown
				try
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<speechWaiter>5__1 = new MultiTokenWaiter(new Func<Token, bool>[7]
						{
							(Token t) => (int)t.Type == 48,
							delegate(Token t)
							{
								IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
								return val2 != null && val2.Name == "_send_message";
							},
							(Token t) => (int)t.Type == 80,
							delegate(Token t)
							{
								IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
								return val != null && val.Name == "text";
							},
							(Token t) => (int)t.Type == 81,
							(Token t) => (int)t.Type == 86,
							(Token t) => (int)t.Type == 89
						}, false, false);
						<>s__2 = tokens.GetEnumerator();
						<>1__state = -3;
						break;
					case 1:
						<>1__state = -3;
						<>s__4 = ScriptTokenizer.Tokenize("\ntext = text.replace(\"[\", \"{\")\ntext = text.replace(\"]\", \"}\")\n", 1u).GetEnumerator();
						<>1__state = -4;
						goto IL_0207;
					case 2:
						<>1__state = -4;
						<t>5__5 = null;
						goto IL_0207;
					case 3:
						{
							<>1__state = -3;
							goto IL_0246;
						}
						IL_0207:
						if (((global::System.Collections.IEnumerator)<>s__4).MoveNext())
						{
							<t>5__5 = <>s__4.Current;
							<>2__current = <t>5__5;
							<>1__state = 2;
							return true;
						}
						<>m__Finally2();
						<>s__4 = null;
						goto IL_0246;
						IL_0246:
						<token>5__3 = null;
						break;
					}
					if (((global::System.Collections.IEnumerator)<>s__2).MoveNext())
					{
						<token>5__3 = <>s__2.Current;
						if (<speechWaiter>5__1.Check(<token>5__3))
						{
							<>2__current = <token>5__3;
							<>1__state = 1;
							return true;
						}
						<>2__current = <token>5__3;
						<>1__state = 3;
						return true;
					}
					<>m__Finally1();
					<>s__2 = 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 (<>s__2 != null)
				{
					((global::System.IDisposable)<>s__2).Dispose();
				}
			}

			private void <>m__Finally2()
			{
				<>1__state = -3;
				if (<>s__4 != null)
				{
					((global::System.IDisposable)<>s__4).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)
					{
						<>4__this = <>4__this
					};
				}
				<Modify>d__.path = <>3__path;
				<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/playerhud.gdc";
		}

		[IteratorStateMachine(typeof(<Modify>d__1))]
		public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
		{
			MultiTokenWaiter speechWaiter = new MultiTokenWaiter(new Func<Token, bool>[7]
			{
				(Token t) => (int)t.Type == 48,
				delegate(Token t)
				{
					IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val2 != null && val2.Name == "_send_message";
				},
				(Token t) => (int)t.Type == 80,
				delegate(Token t)
				{
					IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val != null && val.Name == "text";
				},
				(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 (speechWaiter.Check(token))
					{
						yield return token;
						global::System.Collections.Generic.IEnumerator<Token> enumerator2 = ScriptTokenizer.Tokenize("\ntext = text.replace(\"[\", \"{\")\ntext = text.replace(\"]\", \"}\")\n", 1u).GetEnumerator();
						try
						{
							while (((global::System.Collections.IEnumerator)enumerator2).MoveNext())
							{
								yield return enumerator2.Current;
							}
						}
						finally
						{
							((global::System.IDisposable)enumerator2)?.Dispose();
						}
					}
					else
					{
						yield return token;
					}
				}
			}
			finally
			{
				((global::System.IDisposable)enumerator)?.Dispose();
			}
		}
	}
	public class PlayerLabelPatcher : 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 string path;

			public string <>3__path;

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

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

			public PlayerLabelPatcher <>4__this;

			private MultiTokenWaiter <speechWaiter>5__1;

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

			private Token <token>5__3;

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

			private Token <t>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 ((uint)(num - -4) > 1u && (uint)(num - 1) > 2u)
				{
					return;
				}
				try
				{
					if (num != -4 && num != 2)
					{
						return;
					}
					try
					{
					}
					finally
					{
						<>m__Finally2();
					}
				}
				finally
				{
					<>m__Finally1();
				}
			}

			private bool MoveNext()
			{
				//IL_0136: Unknown result type (might be due to invalid IL or missing references)
				//IL_0140: Expected O, but got Unknown
				try
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<speechWaiter>5__1 = new MultiTokenWaiter(new Func<Token, bool>[7]
						{
							delegate(Token t)
							{
								IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
								return val3 != null && val3.Name == "SwearFilter";
							},
							(Token t) => (int)t.Type == 84,
							delegate(Token t)
							{
								IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
								return val2 != null && val2.Name == "_filter_string";
							},
							(Token t) => (int)t.Type == 80,
							delegate(Token t)
							{
								IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
								return val != null && val.Name == "text";
							},
							(Token t) => (int)t.Type == 81,
							(Token t) => (int)t.Type == 89
						}, false, false);
						<>s__2 = tokens.GetEnumerator();
						<>1__state = -3;
						break;
					case 1:
						<>1__state = -3;
						<>s__4 = ScriptTokenizer.Tokenize("\nvar voice = get_node(\"/root/deltaneveruseddectalk\").speak(text)\n\nget_parent().get_parent().add_child(voice)\nvoice.transform.origin.x = 0\nvoice.transform.origin.y = 0\nvoice.transform.origin.z = 0\nvoice.pitch_scale = 1\nvoice.play()\n", 1u).GetEnumerator();
						<>1__state = -4;
						goto IL_0207;
					case 2:
						<>1__state = -4;
						<t>5__5 = null;
						goto IL_0207;
					case 3:
						{
							<>1__state = -3;
							goto IL_0246;
						}
						IL_0207:
						if (((global::System.Collections.IEnumerator)<>s__4).MoveNext())
						{
							<t>5__5 = <>s__4.Current;
							<>2__current = <t>5__5;
							<>1__state = 2;
							return true;
						}
						<>m__Finally2();
						<>s__4 = null;
						goto IL_0246;
						IL_0246:
						<token>5__3 = null;
						break;
					}
					if (((global::System.Collections.IEnumerator)<>s__2).MoveNext())
					{
						<token>5__3 = <>s__2.Current;
						if (<speechWaiter>5__1.Check(<token>5__3))
						{
							<>2__current = <token>5__3;
							<>1__state = 1;
							return true;
						}
						<>2__current = <token>5__3;
						<>1__state = 3;
						return true;
					}
					<>m__Finally1();
					<>s__2 = 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 (<>s__2 != null)
				{
					((global::System.IDisposable)<>s__2).Dispose();
				}
			}

			private void <>m__Finally2()
			{
				<>1__state = -3;
				if (<>s__4 != null)
				{
					((global::System.IDisposable)<>s__4).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)
					{
						<>4__this = <>4__this
					};
				}
				<Modify>d__.path = <>3__path;
				<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/Entities/Player/player_label.gdc";
		}

		[IteratorStateMachine(typeof(<Modify>d__1))]
		public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
		{
			MultiTokenWaiter speechWaiter = new MultiTokenWaiter(new Func<Token, bool>[7]
			{
				delegate(Token t)
				{
					IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val3 != null && val3.Name == "SwearFilter";
				},
				(Token t) => (int)t.Type == 84,
				delegate(Token t)
				{
					IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val2 != null && val2.Name == "_filter_string";
				},
				(Token t) => (int)t.Type == 80,
				delegate(Token t)
				{
					IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val != null && val.Name == "text";
				},
				(Token t) => (int)t.Type == 81,
				(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 (speechWaiter.Check(token))
					{
						yield return token;
						global::System.Collections.Generic.IEnumerator<Token> enumerator2 = ScriptTokenizer.Tokenize("\nvar voice = get_node(\"/root/deltaneveruseddectalk\").speak(text)\n\nget_parent().get_parent().add_child(voice)\nvoice.transform.origin.x = 0\nvoice.transform.origin.y = 0\nvoice.transform.origin.z = 0\nvoice.pitch_scale = 1\nvoice.play()\n", 1u).GetEnumerator();
						try
						{
							while (((global::System.Collections.IEnumerator)enumerator2).MoveNext())
							{
								yield return enumerator2.Current;
							}
						}
						finally
						{
							((global::System.IDisposable)enumerator2)?.Dispose();
						}
					}
					else
					{
						yield return token;
					}
				}
			}
			finally
			{
				((global::System.IDisposable)enumerator)?.Dispose();
			}
		}
	}
	public class SoundManagerPatcher : 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 string path;

			public string <>3__path;

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

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

			public SoundManagerPatcher <>4__this;

			private MultiTokenWaiter <voiceWaiter>5__1;

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

			private Token <token>5__3;

			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) > 3u)
				{
					return;
				}
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}

			private bool MoveNext()
			{
				//IL_0249: Unknown result type (might be due to invalid IL or missing references)
				//IL_0253: Expected O, but got Unknown
				//IL_0272: Unknown result type (might be due to invalid IL or missing references)
				//IL_027c: Expected O, but got Unknown
				//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d4: Expected O, but got Unknown
				try
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<voiceWaiter>5__1 = new MultiTokenWaiter(new Func<Token, bool>[11]
						{
							(Token t) => (int)t.Type == 48,
							delegate(Token t)
							{
								IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
								return val != null && val.Name == "_construct_voice";
							},
							(Token t) => (int)t.Type == 80,
							(Token t) => t is IdentifierToken,
							(Token t) => (int)t.Type == 82,
							(Token t) => t is IdentifierToken,
							(Token t) => (int)t.Type == 82,
							(Token t) => t is IdentifierToken,
							(Token t) => (int)t.Type == 81,
							(Token t) => (int)t.Type == 86,
							(Token t) => (int)t.Type == 89
						}, false, false);
						<>s__2 = tokens.GetEnumerator();
						<>1__state = -3;
						break;
					case 1:
						<>1__state = -3;
						<>2__current = new Token((TokenType)46, (uint?)null);
						<>1__state = 2;
						return true;
					case 2:
						<>1__state = -3;
						<>2__current = new Token((TokenType)89, (uint?)1u);
						<>1__state = 3;
						return true;
					case 3:
						<>1__state = -3;
						goto IL_02b3;
					case 4:
						{
							<>1__state = -3;
							goto IL_02b3;
						}
						IL_02b3:
						<token>5__3 = null;
						break;
					}
					if (((global::System.Collections.IEnumerator)<>s__2).MoveNext())
					{
						<token>5__3 = <>s__2.Current;
						if (<voiceWaiter>5__1.Check(<token>5__3))
						{
							<>2__current = <token>5__3;
							<>1__state = 1;
							return true;
						}
						<>2__current = <token>5__3;
						<>1__state = 4;
						return true;
					}
					<>m__Finally1();
					<>s__2 = 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 (<>s__2 != null)
				{
					((global::System.IDisposable)<>s__2).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)
					{
						<>4__this = <>4__this
					};
				}
				<Modify>d__.path = <>3__path;
				<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/Entities/Player/sound_manager.gdc";
		}

		[IteratorStateMachine(typeof(<Modify>d__1))]
		public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
		{
			MultiTokenWaiter voiceWaiter = new MultiTokenWaiter(new Func<Token, bool>[11]
			{
				(Token t) => (int)t.Type == 48,
				delegate(Token t)
				{
					IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val != null && val.Name == "_construct_voice";
				},
				(Token t) => (int)t.Type == 80,
				(Token t) => t is IdentifierToken,
				(Token t) => (int)t.Type == 82,
				(Token t) => t is IdentifierToken,
				(Token t) => (int)t.Type == 82,
				(Token t) => t is IdentifierToken,
				(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 (voiceWaiter.Check(token))
					{
						yield return token;
						yield return new Token((TokenType)46, (uint?)null);
						yield return new Token((TokenType)89, (uint?)1u);
					}
					else
					{
						yield return token;
					}
				}
			}
			finally
			{
				((global::System.IDisposable)enumerator)?.Dispose();
			}
		}
	}
}