Decompiled source of ChordSwitcher v2.0.1

GDWeave/mods/ChordSwitcher/ChordSwitcher.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
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("ChordSwitcher")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d427ad11ce99393c25c72c5da3caa4d15deeb342")]
[assembly: AssemblyProduct("ChordSwitcher")]
[assembly: AssemblyTitle("ChordSwitcher")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace ChordSwitcher;

internal class FretButtonMod : 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 FretButtonMod <>4__this;

		private MultiTokenWaiter <setMarker>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_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Expected O, but got Unknown
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<setMarker>5__1 = new MultiTokenWaiter(new Func<Token, bool>[4]
					{
						(Token t) => (int)t.Type == 48,
						delegate(Token t)
						{
							IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val3 != null && val3.Name == "_set_marker";
						},
						delegate(Token t)
						{
							IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val2 != null && val2.Name == "_s";
						},
						delegate(Token t)
						{
							IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val != null && val.Name == "_f";
						}
					}, false, true);
					<>s__2 = tokens.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("_c");
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -3;
					goto IL_01bf;
				case 4:
					{
						<>1__state = -3;
						goto IL_01bf;
					}
					IL_01bf:
					<token>5__3 = null;
					break;
				}
				if (((global::System.Collections.IEnumerator)<>s__2).MoveNext())
				{
					<token>5__3 = <>s__2.Current;
					if (<setMarker>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/Minigames/Guitar/fret_button.gdc";
	}

	[IteratorStateMachine(typeof(<Modify>d__1))]
	public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		MultiTokenWaiter setMarker = new MultiTokenWaiter(new Func<Token, bool>[4]
		{
			(Token t) => (int)t.Type == 48,
			delegate(Token t)
			{
				IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val3 != null && val3.Name == "_set_marker";
			},
			delegate(Token t)
			{
				IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val2 != null && val2.Name == "_s";
			},
			delegate(Token t)
			{
				IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val != null && val.Name == "_f";
			}
		}, false, true);
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token token = enumerator.Current;
				if (setMarker.Check(token))
				{
					yield return token;
					yield return new Token((TokenType)82, (uint?)null);
					yield return (Token)new IdentifierToken("_c");
				}
				else
				{
					yield return token;
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}
internal class GuitarMod : 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 GuitarMod <>4__this;

		private MultiTokenWaiter <topOfFile>5__1;

		private MultiTokenWaiter <signalFretUpdate>5__2;

		private MultiTokenWaiter <bottomOfReady>5__3;

		private MultiTokenWaiter <selectShapeLoop>5__4;

		private MultiTokenWaiter <selectFretArgs>5__5;

		private MultiTokenWaiter <emitSignal>5__6;

		private MultiTokenWaiter <postEmitSignal>5__7;

		private int <skip>5__8;

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

		private Token <token>5__10;

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

		private bool MoveNext()
		{
			//IL_0708: Unknown result type (might be due to invalid IL or missing references)
			//IL_0712: Expected O, but got Unknown
			//IL_0735: Unknown result type (might be due to invalid IL or missing references)
			//IL_073f: Expected O, but got Unknown
			//IL_075b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0765: Expected O, but got Unknown
			//IL_0788: Unknown result type (might be due to invalid IL or missing references)
			//IL_0792: Expected O, but got Unknown
			//IL_07ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b8: Expected O, but got Unknown
			//IL_07db: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e5: Expected O, but got Unknown
			//IL_0801: Unknown result type (might be due to invalid IL or missing references)
			//IL_080b: Expected O, but got Unknown
			//IL_0806: Unknown result type (might be due to invalid IL or missing references)
			//IL_0810: Expected O, but got Unknown
			//IL_0833: Unknown result type (might be due to invalid IL or missing references)
			//IL_083d: Expected O, but got Unknown
			//IL_0861: Unknown result type (might be due to invalid IL or missing references)
			//IL_086b: Expected O, but got Unknown
			//IL_08d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08da: Expected O, but got Unknown
			//IL_08f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0901: Expected O, but got Unknown
			//IL_0969: Unknown result type (might be due to invalid IL or missing references)
			//IL_0973: Expected O, but got Unknown
			//IL_0990: Unknown result type (might be due to invalid IL or missing references)
			//IL_099a: Expected O, but got Unknown
			//IL_09be: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c8: Expected O, but got Unknown
			//IL_09e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09eb: Expected O, but got Unknown
			//IL_09e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f0: Expected O, but got Unknown
			//IL_0a58: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a62: Expected O, but got Unknown
			//IL_0a86: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a90: Expected O, but got Unknown
			//IL_0aad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab7: Expected O, but got Unknown
			//IL_0adb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae5: Expected O, but got Unknown
			//IL_0b08: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b12: Expected O, but got Unknown
			//IL_0b36: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b40: Expected O, but got Unknown
			//IL_0b60: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b6a: Expected O, but got Unknown
			//IL_0bd2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bdc: Expected O, but got Unknown
			//IL_0bf5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bff: Expected O, but got Unknown
			//IL_0bfa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c04: Expected O, but got Unknown
			//IL_0c6d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c77: Expected O, but got Unknown
			//IL_0c9b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca5: Expected O, but got Unknown
			//IL_0cc2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ccc: Expected O, but got Unknown
			//IL_0cc7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd1: Expected O, but got Unknown
			//IL_0cf5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cff: Expected O, but got Unknown
			//IL_0d1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d26: Expected O, but got Unknown
			//IL_0d4a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d54: Expected O, but got Unknown
			//IL_0d71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d7b: Expected O, but got Unknown
			//IL_0d9f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0da9: Expected O, but got Unknown
			//IL_0dc6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dd0: Expected O, but got Unknown
			//IL_0df4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dfe: Expected O, but got Unknown
			//IL_0e22: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e2c: Expected O, but got Unknown
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Expected O, but got Unknown
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Expected O, but got Unknown
			//IL_0a31: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3b: Expected O, but got Unknown
			//IL_0c46: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c50: Expected O, but got Unknown
			//IL_038d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0397: 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_056d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0577: Expected O, but got Unknown
			//IL_05c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ce: Expected O, but got Unknown
			//IL_065f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0669: Expected O, but got Unknown
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<topOfFile>5__1 = new MultiTokenWaiter(new Func<Token, bool>[2]
					{
						(Token t) => (int)t.Type == 89,
						(Token t) => (int)t.Type == 89
					}, false, true);
					<signalFretUpdate>5__2 = new MultiTokenWaiter(new Func<Token, bool>[4]
					{
						(Token t) => (int)t.Type == 66,
						delegate(Token t)
						{
							IdentifierToken val19 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val19 != null && val19.Name == "_fret_update";
						},
						delegate(Token t)
						{
							IdentifierToken val18 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val18 != null && val18.Name == "string";
						},
						delegate(Token t)
						{
							IdentifierToken val17 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val17 != null && val17.Name == "fret";
						}
					}, false, true);
					<bottomOfReady>5__3 = new MultiTokenWaiter(new Func<Token, bool>[7]
					{
						(Token t) => (int)t.Type == 48,
						delegate(Token t)
						{
							IdentifierToken val16 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val16 != null && val16.Name == "_ready";
						},
						(Token t) => (int)t.Type == 86,
						(Token t) => (int)t.Type == 89,
						delegate(Token t)
						{
							IdentifierToken val15 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val15 != null && val15.Name == "AnimationPlayer";
						},
						delegate(Token t)
						{
							IdentifierToken val14 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val14 != null && val14.Name == "play";
						},
						(Token t) => (int)t.Type == 89
					}, false, true);
					<selectShapeLoop>5__4 = new MultiTokenWaiter(new Func<Token, bool>[7]
					{
						(Token t) => (int)t.Type == 48,
						delegate(Token t)
						{
							IdentifierToken val13 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val13 != null && val13.Name == "_setup_guitar";
						},
						delegate(Token t)
						{
							IdentifierToken val12 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val12 != null && val12.Name == "_select_shape";
						},
						delegate(Token t)
						{
							IdentifierToken val11 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val11 != null && val11.Name == "_setup_guitar";
						},
						delegate(Token t)
						{
							IdentifierToken val10 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val10 != null && val10.Name == "_select_shape";
						},
						(Token t) => (int)t.Type == 2,
						(Token t) => (int)t.Type == 2
					}, false, true);
					<selectFretArgs>5__5 = new MultiTokenWaiter(new Func<Token, bool>[6]
					{
						(Token t) => (int)t.Type == 48,
						delegate(Token t)
						{
							IdentifierToken val9 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val9 != null && val9.Name == "_select_fret";
						},
						delegate(Token t)
						{
							IdentifierToken val8 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val8 != null && val8.Name == "string";
						},
						delegate(Token t)
						{
							IdentifierToken val7 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val7 != null && val7.Name == "fret";
						},
						delegate(Token t)
						{
							IdentifierToken val6 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val6 != null && val6.Name == "ignore_overwrite";
						},
						(Token t) => (int)t.Type == 2
					}, false, true);
					<emitSignal>5__6 = new MultiTokenWaiter(new Func<Token, bool>[2]
					{
						delegate(Token t)
						{
							IdentifierToken val5 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val5 != null && val5.Name == "ignore_overwrite";
						},
						delegate(Token t)
						{
							IdentifierToken val4 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val4 != null && val4.Name == "emit_signal";
						}
					}, false, true);
					<postEmitSignal>5__7 = new MultiTokenWaiter(new Func<Token, bool>[4]
					{
						delegate(Token t)
						{
							IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val3 != null && val3.Name == "emit_signal";
						},
						delegate(Token t)
						{
							IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val2 != null && val2.Name == "saved_shapes";
						},
						delegate(Token t)
						{
							IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val != null && val.Name == "fret";
						},
						(Token t) => (int)t.Type == 89
					}, false, true);
					<skip>5__8 = 0;
					<>s__9 = tokens.GetEnumerator();
					<>1__state = -3;
					goto IL_0e92;
				case 1:
					<>1__state = -3;
					<>2__current = new Token((TokenType)53, (uint?)null);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -3;
					<>2__current = new Token((TokenType)59, (uint?)null);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("chordswitcher_mod");
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -3;
					<>2__current = new Token((TokenType)23, (uint?)null);
					<>1__state = 5;
					return true;
				case 5:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("get_node");
					<>1__state = 6;
					return true;
				case 6:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 7;
					return true;
				case 7:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("/root/ChordSwitcher"));
					<>1__state = 8;
					return true;
				case 8:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 9;
					return true;
				case 9:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)null);
					<>1__state = 10;
					return true;
				case 10:
					<>1__state = -3;
					goto IL_0e8a;
				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("is_chord");
					<>1__state = 13;
					return true;
				case 13:
					<>1__state = -3;
					goto IL_0e8a;
				case 14:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 15;
					return true;
				case 15:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("is_chord");
					<>1__state = 16;
					return true;
				case 16:
					<>1__state = -3;
					<>2__current = new Token((TokenType)23, (uint?)null);
					<>1__state = 17;
					return true;
				case 17:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new BoolVariant(false));
					<>1__state = 18;
					return true;
				case 18:
					<>1__state = -3;
					goto IL_0e8a;
				case 19:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("chordswitcher_mod");
					<>1__state = 20;
					return true;
				case 20:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 21;
					return true;
				case 21:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("_inject");
					<>1__state = 22;
					return true;
				case 22:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 23;
					return true;
				case 23:
					<>1__state = -3;
					<>2__current = new Token((TokenType)3, (uint?)null);
					<>1__state = 24;
					return true;
				case 24:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 25;
					return true;
				case 25:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)1u);
					<>1__state = 26;
					return true;
				case 26:
					<>1__state = -3;
					goto IL_0e8a;
				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 ConstantToken((Variant)new BoolVariant(true));
					<>1__state = 29;
					return true;
				case 29:
					<>1__state = -3;
					goto IL_0e8a;
				case 30:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("emit_signal");
					<>1__state = 31;
					return true;
				case 31:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 32;
					return true;
				case 32:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("_fret_update"));
					<>1__state = 33;
					return true;
				case 33:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 34;
					return true;
				case 34:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("string");
					<>1__state = 35;
					return true;
				case 35:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 36;
					return true;
				case 36:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("fret");
					<>1__state = 37;
					return true;
				case 37:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 38;
					return true;
				case 38:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("is_chord");
					<>1__state = 39;
					return true;
				case 39:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 40;
					return true;
				case 40:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)null);
					<>1__state = 41;
					return true;
				case 41:
					<>1__state = -3;
					goto IL_0e92;
				case 42:
					{
						<>1__state = -3;
						goto IL_0e8a;
					}
					IL_0e92:
					do
					{
						if (((global::System.Collections.IEnumerator)<>s__9).MoveNext())
						{
							<token>5__10 = <>s__9.Current;
							continue;
						}
						<>m__Finally1();
						<>s__9 = null;
						return false;
					}
					while (<skip>5__8-- > 0);
					if (<topOfFile>5__1.Check(<token>5__10))
					{
						<>2__current = <token>5__10;
						<>1__state = 1;
						return true;
					}
					if (<signalFretUpdate>5__2.Check(<token>5__10))
					{
						<>2__current = <token>5__10;
						<>1__state = 11;
						return true;
					}
					if (<selectFretArgs>5__5.Check(<token>5__10))
					{
						<>2__current = <token>5__10;
						<>1__state = 14;
						return true;
					}
					if (<bottomOfReady>5__3.Check(<token>5__10))
					{
						<>2__current = new Token((TokenType)89, (uint?)1u);
						<>1__state = 19;
						return true;
					}
					if (<selectShapeLoop>5__4.Check(<token>5__10))
					{
						<>2__current = <token>5__10;
						<>1__state = 27;
						return true;
					}
					if (<postEmitSignal>5__7.Check(<token>5__10))
					{
						<>2__current = new Token((TokenType)89, (uint?)1u);
						<>1__state = 30;
						return true;
					}
					if (<emitSignal>5__6.Check(<token>5__10))
					{
						<skip>5__8 = 7;
						goto IL_0e8a;
					}
					<>2__current = <token>5__10;
					<>1__state = 42;
					return true;
					IL_0e8a:
					<token>5__10 = null;
					goto IL_0e92;
				}
			}
			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__9 != null)
			{
				((global::System.IDisposable)<>s__9).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/Minigames/Guitar/guitar_minigame.gdc";
	}

	[IteratorStateMachine(typeof(<Modify>d__1))]
	public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		MultiTokenWaiter topOfFile = new MultiTokenWaiter(new Func<Token, bool>[2]
		{
			(Token t) => (int)t.Type == 89,
			(Token t) => (int)t.Type == 89
		}, false, true);
		MultiTokenWaiter signalFretUpdate = new MultiTokenWaiter(new Func<Token, bool>[4]
		{
			(Token t) => (int)t.Type == 66,
			delegate(Token t)
			{
				IdentifierToken val19 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val19 != null && val19.Name == "_fret_update";
			},
			delegate(Token t)
			{
				IdentifierToken val18 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val18 != null && val18.Name == "string";
			},
			delegate(Token t)
			{
				IdentifierToken val17 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val17 != null && val17.Name == "fret";
			}
		}, false, true);
		MultiTokenWaiter bottomOfReady = new MultiTokenWaiter(new Func<Token, bool>[7]
		{
			(Token t) => (int)t.Type == 48,
			delegate(Token t)
			{
				IdentifierToken val16 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val16 != null && val16.Name == "_ready";
			},
			(Token t) => (int)t.Type == 86,
			(Token t) => (int)t.Type == 89,
			delegate(Token t)
			{
				IdentifierToken val15 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val15 != null && val15.Name == "AnimationPlayer";
			},
			delegate(Token t)
			{
				IdentifierToken val14 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val14 != null && val14.Name == "play";
			},
			(Token t) => (int)t.Type == 89
		}, false, true);
		MultiTokenWaiter selectShapeLoop = new MultiTokenWaiter(new Func<Token, bool>[7]
		{
			(Token t) => (int)t.Type == 48,
			delegate(Token t)
			{
				IdentifierToken val13 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val13 != null && val13.Name == "_setup_guitar";
			},
			delegate(Token t)
			{
				IdentifierToken val12 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val12 != null && val12.Name == "_select_shape";
			},
			delegate(Token t)
			{
				IdentifierToken val11 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val11 != null && val11.Name == "_setup_guitar";
			},
			delegate(Token t)
			{
				IdentifierToken val10 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val10 != null && val10.Name == "_select_shape";
			},
			(Token t) => (int)t.Type == 2,
			(Token t) => (int)t.Type == 2
		}, false, true);
		MultiTokenWaiter selectFretArgs = new MultiTokenWaiter(new Func<Token, bool>[6]
		{
			(Token t) => (int)t.Type == 48,
			delegate(Token t)
			{
				IdentifierToken val9 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val9 != null && val9.Name == "_select_fret";
			},
			delegate(Token t)
			{
				IdentifierToken val8 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val8 != null && val8.Name == "string";
			},
			delegate(Token t)
			{
				IdentifierToken val7 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val7 != null && val7.Name == "fret";
			},
			delegate(Token t)
			{
				IdentifierToken val6 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val6 != null && val6.Name == "ignore_overwrite";
			},
			(Token t) => (int)t.Type == 2
		}, false, true);
		MultiTokenWaiter emitSignal = new MultiTokenWaiter(new Func<Token, bool>[2]
		{
			delegate(Token t)
			{
				IdentifierToken val5 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val5 != null && val5.Name == "ignore_overwrite";
			},
			delegate(Token t)
			{
				IdentifierToken val4 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val4 != null && val4.Name == "emit_signal";
			}
		}, false, true);
		MultiTokenWaiter postEmitSignal = new MultiTokenWaiter(new Func<Token, bool>[4]
		{
			delegate(Token t)
			{
				IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val3 != null && val3.Name == "emit_signal";
			},
			delegate(Token t)
			{
				IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val2 != null && val2.Name == "saved_shapes";
			},
			delegate(Token t)
			{
				IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val != null && val.Name == "fret";
			},
			(Token t) => (int)t.Type == 89
		}, false, true);
		int skip = 0;
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token token = enumerator.Current;
				if (skip-- <= 0)
				{
					if (topOfFile.Check(token))
					{
						yield return token;
						yield return new Token((TokenType)53, (uint?)null);
						yield return new Token((TokenType)59, (uint?)null);
						yield return (Token)new IdentifierToken("chordswitcher_mod");
						yield return new Token((TokenType)23, (uint?)null);
						yield return (Token)new IdentifierToken("get_node");
						yield return new Token((TokenType)80, (uint?)null);
						yield return (Token)new ConstantToken((Variant)new StringVariant("/root/ChordSwitcher"));
						yield return new Token((TokenType)81, (uint?)null);
						yield return new Token((TokenType)89, (uint?)null);
					}
					else if (signalFretUpdate.Check(token))
					{
						yield return token;
						yield return new Token((TokenType)82, (uint?)null);
						yield return (Token)new IdentifierToken("is_chord");
					}
					else if (selectFretArgs.Check(token))
					{
						yield return token;
						yield return new Token((TokenType)82, (uint?)null);
						yield return (Token)new IdentifierToken("is_chord");
						yield return new Token((TokenType)23, (uint?)null);
						yield return (Token)new ConstantToken((Variant)new BoolVariant(false));
					}
					else if (bottomOfReady.Check(token))
					{
						yield return new Token((TokenType)89, (uint?)1u);
						yield return (Token)new IdentifierToken("chordswitcher_mod");
						yield return new Token((TokenType)84, (uint?)null);
						yield return (Token)new IdentifierToken("_inject");
						yield return new Token((TokenType)80, (uint?)null);
						yield return new Token((TokenType)3, (uint?)null);
						yield return new Token((TokenType)81, (uint?)null);
						yield return new Token((TokenType)89, (uint?)1u);
					}
					else if (selectShapeLoop.Check(token))
					{
						yield return token;
						yield return new Token((TokenType)82, (uint?)null);
						yield return (Token)new ConstantToken((Variant)new BoolVariant(true));
					}
					else if (postEmitSignal.Check(token))
					{
						yield return new Token((TokenType)89, (uint?)1u);
						yield return (Token)new IdentifierToken("emit_signal");
						yield return new Token((TokenType)80, (uint?)null);
						yield return (Token)new ConstantToken((Variant)new StringVariant("_fret_update"));
						yield return new Token((TokenType)82, (uint?)null);
						yield return (Token)new IdentifierToken("string");
						yield return new Token((TokenType)82, (uint?)null);
						yield return (Token)new IdentifierToken("fret");
						yield return new Token((TokenType)82, (uint?)null);
						yield return (Token)new IdentifierToken("is_chord");
						yield return new Token((TokenType)81, (uint?)null);
						yield return new Token((TokenType)89, (uint?)null);
					}
					else if (emitSignal.Check(token))
					{
						skip = 7;
					}
					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 FretButtonMod());
		modInterface.RegisterScriptMod((IScriptMod)(object)new GuitarMod());
	}

	public void Dispose()
	{
	}
}