Decompiled source of SoundSampler v1.0.0

plugins/SoundSampler/SoundSampler.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EquinoxsModUtils;
using FMOD.Studio;
using FMODUnity;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("SoundSampler")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SoundSampler")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("644eb60b-4eeb-423c-9f29-bcfd9ef40257")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SoundSampler;

[BepInPlugin("com.equinox.SoundSampler", "SoundSampler", "1.0.0")]
public class SoundSamplerPlugin : BaseUnityPlugin
{
	private const string MyGUID = "com.equinox.SoundSampler";

	private const string PluginName = "SoundSampler";

	private const string VersionString = "1.0.0";

	private static readonly Harmony Harmony = new Harmony("com.equinox.SoundSampler");

	public static ManualLogSource Log = new ManualLogSource("SoundSampler");

	private bool showGUI = false;

	private string searchTerm = "";

	private Vector2 scrollPos = Vector2.zero;

	private List<string> events = new List<string>
	{
		"event:/Silence", "event:/SFX/Machine SFX/Placeholders/Beacon Placeholder", "event:/SFX/Environmental SFX/Water Heavier Flow", "event:/SFX/Environmental SFX/Waterfall - Massive", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Run_Rock", "event:/SFX/Player Movement SFX/Player_Jump_Land_Dirt", "event:/SFX/UI SFX/Building UI SFX/Build Click", "event:/SFX/Player Movement SFX/Player_Run_Rock", "event:/SFX/Machine SFX/Monorail/Monorail Package Travelling", "event:/SFX/Machine SFX/Driller Mining Ore",
		"event:/SFX/Machine SFX/Assembler/Assembler Arm Retract", "event:/SFX/UI SFX/Main Menu_Go Back", "event:/SFX/UI SFX/Pause Menu Confirm", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Jump_Land_Rock", "event:/SFX/Player Movement SFX/Player_Jump_Land_Rock", "event:/SFX/Environmental SFX/Door Opening", "event:/SFX/Environmental SFX/Upgrade Module", "event:/SFX/Tool SFX/Multiplayer Tools/Multiplayer Pickaxe_Impact_Rock", "event:/SFX/Tool SFX/Put Away Tool", "event:/SFX/UI SFX/Laser Tag UI/Asteroid UI/Asteroid Wave Start",
		"event:/SFX/Tool SFX/MOLE/MOLE Rock Destroy", "event:/SFX/Tool SFX/Pickaxe/Pickaxe_Impact_Metal", "event:/SFX/Machine SFX/Power Loss", "event:/SFX/Environmental SFX/Generator Hum", "event:/SFX/Tool SFX/Explosive Trigger Explosion", "event:/SFX/Environmental SFX/Asteroids/Asteroid close to nexus", "event:/SFX/Tool SFX/Laser Tool/Laser Tool Fire - Locked", "event:/SFX/UI SFX/Building UI SFX/Erase Mode - Enter", "event:/SFX/Tool SFX/Laser Tool/Laser Tool Water Impact", "event:/SFX/UI SFX/Crafting UI/Cancel Clear Crafting Queue",
		"event:/SFX/UI SFX/Main Menu_Navigate Tick Fast", "event:/SFX/Player Movement SFX/Player_Walk_Water", "event:/SFX/Tool SFX/Laser Tool/Laser Tool Cooldown", "event:/SFX/UI SFX/Error", "event:/SFX/UI SFX/Building UI SFX/Build Small 2", "event:/SFX/Tool SFX/Pickaxe/Pickaxe_Impact_Ore", "event:/SFX/Player Movement SFX/Player_Walk_Metal", "event:/SFX/Tool SFX/Laser Tool/Laser Tool Player Impact", "event:/SFX/Tool SFX/Pickaxe/Pickaxe_Swing Woosh", "event:/SFX/UI SFX/Crafting UI/Hit Clear Crafting Queue",
		"event:/SFX/Machine SFX/Blast Smelter/Blast Smelter Passive Glow", "event:/SFX/UI SFX/Inspect Machine", "event:/SFX/UI SFX/Main Menu_Start Game", "event:/SFX/Environmental SFX/Asteroids/Asteroid Destroyed", "event:/SFX/Environmental SFX/Light Hum", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Run_Leafy", "event:/SFX/UI SFX/Tab Change Tick", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Run_Water", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Jump_Takeoff_Metal", "event:/SFX/UI SFX/Player Leave Laser Tag",
		"event:/SFX/Tool SFX/Multiplayer Tools/Multiplayer MOLE/Multiplayer MOLE Rock Destroy", "event:/SFX/UI SFX/Multiplayer Join", "event:/SFX/Player Movement SFX/Player_Walk_Rock", "event:/SFX/UI SFX/Main Menu_Navigate Tick Slow", "event:/SFX/Tool SFX/Pickaxe/Pickaxe_Impact_Leafy", "event:/SFX/Tool SFX/Laser Tool/Laser Tool Generic Impact", "event:/SFX/Player Movement SFX/Player_Jump_Land_Metal", "event:/SFX/UI SFX/Production Terminal Radio Light On", "event:/SFX/Environmental SFX/Asteroids/Spaceship Rocket Fire", "event:/SFX/UI SFX/Pause Menu Open",
		"event:/SFX/Environmental SFX/Asteroids/Asteroid Spawned", "event:/SFX/UI SFX/Exit Inspect Machine", "event:/SFX/Machine SFX/Placeholders/Teleporter Placeholder", "event:/SFX/Tool SFX/MOLE/MOLE Tool", "event:/SFX/Machine SFX/Monorail/Monorail Depot Recieving Packages", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Jump_Land_Leafy", "event:/SFX/Tool SFX/Multiplayer Tools/Multiplayer Pickaxe_Impact_Dirt", "event:/SFX/Environmental SFX/Asteroids/Asteroid Moving", "event:/SFX/Machine SFX/Driller Active", "event:/SFX/Tool SFX/Pickaxe/Pickaxe_Impact_Water",
		"event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Jump_Land_Water", "event:/SFX/Tool SFX/Multiplayer Tools/Multiplayer Pickaxe_Impact_Ore", "event:/SFX/UI SFX/Building UI SFX/Erase Mode - Idle", "event:/SFX/Environmental SFX/Kindlevine Idle Sound", "event:/SFX/UI SFX/Building UI SFX/Erase Object", "event:/SFX/UI SFX/Building UI SFX/Exit Build Mode", "event:/SFX/Player Movement SFX/Player_Jump_Land_Leafy", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Walk_Water", "event:/SFX/UI SFX/Building UI SFX/Rotate Building On Grid", "event:/SFX/Tool SFX/Laser Tool/Laser Tool Unlocked",
		"event:/SFX/Machine SFX/Nexus/Nexus Refilled", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Jump_Takeoff_Rock", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Jump_Takeoff_Water", "event:/SFX/UI SFX/Quests and Unlocks/Research Unlock Completed", "event:/SFX/Machine SFX/Thresher Active", "event:/SFX/Machine SFX/Chest_Open", "event:/SFX/Player Movement SFX/Player_Jump_Takeoff_Rock", "event:/SFX/Tool SFX/Scanner Complete", "event:/SFX/UI SFX/Building UI SFX/Erase Click", "event:/SFX/UI SFX/Building UI SFX/Build Error",
		"event:/SFX/Machine SFX/Nexus/Nexus Inactive Idle", "event:/SFX/Player Movement SFX/Player_Jump_Takeoff_Water", "event:/SFX/Tool SFX/Pickaxe/Pickaxe_Rubber", "event:/SFX/UI SFX/Crafting UI/Craft", "event:/SFX/Machine SFX/Blast Smelter/Blast Smelter Explosion", "event:/SFX/Tool SFX/MOLE/MOLE BH", "event:/SFX/UI SFX/Main Menu_Click Option", "event:/SFX/Tool SFX/Multiplayer Tools/Multiplayer Pickaxe_Swing Woosh", "event:/SFX/Tool SFX/Multiplayer Tools/Multiplayer MOLE/Multiplayer MOLE BH", "event:/SFX/UI SFX/Tech Tree/Tech Tree Node Deactivated",
		"event:/SFX/UI SFX/Building UI SFX/Erase Mode - Exit", "event:/SFX/Machine SFX/Assembler/Assembler Lasers", "event:/SFX/UI SFX/Pause Menu Load Save", "event:/SFX/Environmental SFX/Waterfall - Rapids", "event:/SFX/Tool SFX/Scanner_Progress", "event:/SFX/UI SFX/Building UI SFX/Enter Build Mode", "event:/SFX/UI SFX/Building UI SFX/Secondary Build Click", "event:/SFX/UI SFX/Quests and Unlocks/Quest System_Complete Quest", "event:/SFX/UI SFX/Take One Resource", "event:/SFX/Tool SFX/Multiplayer Tools/Multiplayer Pick Up Plants",
		"event:/SFX/Tool SFX/Laser Tool/Laser Tool Equip", "event:/SFX/Environmental SFX/Pedstal Hum", "event:/SFX/Tool SFX/Multiplayer Tools/Multiplayer MOLE/Multiplayer MOLE Tool", "event:/SFX/Machine SFX/Nexus/Nexus Active Idle", "event:/SFX/Machine SFX/Smelter Active", "event:/SFX/UI SFX/Tech Tree/Tech Tree Node Activated", "event:/SFX/Environmental SFX/River Ambience", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Jump_Takeoff_Leafy", "event:/SFX/Machine SFX/Blast Drill/Blast Drill - Chisels Sliding Back Into Place", "event:/SFX/Environmental SFX/Water Trickle",
		"event:/SFX/Tool SFX/Laser Tool/Laser Tool Ping Impact", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Walk_Dirt", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Jump_Land_Dirt", "event:/SFX/UI SFX/Tech Tree/Tech Tree Node Build Up", "event:/SFX/UI SFX/Set Hotbar Entry", "event:/SFX/UI SFX/Production Terminal Radio Light Off", "event:/SFX/UI SFX/Building UI SFX/Build Mode Idle", "event:/SFX/Tool SFX/Laser Tool/Laser Tool Mode Toggle", "event:/SFX/UI SFX/Menu Focus Change", "event:/SFX/Machine SFX/Voltage Stepper",
		"event:/SFX/Machine SFX/Monorail/Monorail Depot Unloading Packages", "event:/SFX/UI SFX/Transfer Item", "event:/SFX/Machine SFX/Blast Drill/Blast Drill - Chisels locking into place", "event:/SFX/Player Movement SFX/Player Laser Sounds/Player Combat - Locked", "event:/SFX/Machine SFX/Production Terminal Ambience", "event:/SFX/Machine SFX/Monorail/Monorail Depot Loading Packages", "event:/SFX/Player Movement SFX/Player_Walk_Dirt", "event:/SFX/Environmental SFX/Cave Sounds_Ambient", "event:/SFX/Machine SFX/Machine Open", "event:/SFX/Machine SFX/Conveyor Belt Idle",
		"event:/SFX/Environmental SFX/Waterfall - Infinite Drop Top", "event:/SFX/Machine SFX/Monorail/Monorail Depot Sending Packages", "event:/SFX/UI SFX/Cursor Tick Slow", "event:/SFX/Machine SFX/Assembler/Assembler Active", "event:/SFX/UI SFX/Player Join Laser Tag", "event:/SFX/Machine SFX/Machine Close", "event:/SFX/Tool SFX/Multiplayer Tools/Multiplayer Pickaxe_Impact_Leafy", "event:/SFX/UI SFX/Game Loaded", "event:/SFX/Player Movement SFX/Facility_Footsteps", "event:/SFX/UI SFX/Quests and Unlocks/Quest System_Reward Popup",
		"event:/SFX/UI SFX/Tech Tree/Select Research", "event:/SFX/Environmental SFX/Waterfall - Infinite Drop", "event:/SFX/UI SFX/Laser Tag UI/Asteroid UI/Asteroid Wave Countdown", "event:/SFX/UI SFX/Crafting UI/Complete Intermediate Crafting Queue Item", "event:/SFX/Machine SFX/Inserter_Arm Rotate", "event:/SFX/Machine SFX/Planter Active", "event:/SFX/Player Movement SFX/Player_Run_Leafy", "event:/SFX/UI SFX/Quests and Unlocks/Quest System_New Quest", "event:/SFX/Tool SFX/Laser Tool/Laser Tool Fire - Ping", "event:/SFX/Player Movement SFX/Player_Jump_Land_Water",
		"event:/SFX/Tool SFX/Multiplayer Tools/Multiplayer Pickaxe_Impact_Water", "event:/SFX/Environmental SFX/Waterfall Medium", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Walk_Metal", "event:/SFX/Tool SFX/Explosive Idle", "event:/SFX/Tool SFX/Pickaxe/Pickaxe_Rock_Break", "event:/SFX/Tool SFX/Multiplayer Tools/Multiplayer Pickaxe_Impact_Metal", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Jump_Takeoff_Dirt", "event:/SFX/Environmental SFX/Asteroids/Spaceship Spawned", "event:/SFX/Tool SFX/Laser Tool/Laser Tool Asteroid Impact", "event:/SFX/UI SFX/Crafting UI/Complete Final Crafting Queue Item",
		"event:/SFX/UI SFX/Quests and Unlocks/Research Unlock Acquired", "event:/SFX/UI SFX/Pause Menu Go Back", "event:/SFX/Machine SFX/Assembler/Assembler Press", "event:/SFX/Player Movement SFX/Player_Jump_Takeoff_Metal", "event:/SFX/UI SFX/Pause Menu Close", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Walk_Leafy", "event:/SFX/Tool SFX/Pickaxe/Pickaxe_Impact_Rock", "event:/SFX/UI SFX/Crafting UI/Confirm Clear Crafting Queue", "event:/SFX/UI SFX/Quests and Unlocks/Quest System_Quest Pip Appear", "event:/SFX/UI SFX/Navigate Hotbar Tick",
		"event:/SFX/Machine SFX/Power Generator", "event:/SFX/Machine SFX/HVC", "event:/SFX/UI SFX/Building UI SFX/Build Small", "event:/SFX/Tool SFX/Multiplayer Tools/Multiplayer Pickaxe_Rock_Break", "event:/SFX/Machine SFX/Chest_Close", "event:/SFX/UI SFX/Take All Resources", "event:/SFX/Environmental SFX/Production Terminal World Sound", "event:/SFX/Tool SFX/MOLE/MOLE Rock Destroy Backup", "event:/SFX/UI SFX/Filter Change Tick", "event:/SFX/Player Movement SFX/Player_Run_Metal",
		"event:/SFX/UI SFX/Production Terminal Repair Completed", "event:/SFX/Tool SFX/Scanner_Active", "event:/SFX/UI SFX/Building UI SFX/Build Large", "event:/SFX/Machine SFX/Accumulator", "event:/SFX/Player Movement SFX/Player_Jump_Takeoff_Leafy", "event:/SFX/Machine SFX/Placeholders/Water Wheel Placeholder", "event:/SFX/UI SFX/Multiplayer Leave", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Run_Metal", "event:/SFX/Machine SFX/Research Core Idle", "event:/SFX/Machine SFX/Assembler/Assembler Arm Extend",
		"event:/SFX/Tool SFX/Laser Tool/Laser Tool Fire - Cooldown", "event:/SFX/UI SFX/Cursor Tick Fast", "event:/SFX/Machine SFX/Blast Drill/Blast Drill - Explosion and Punch", "event:/SFX/Machine SFX/Light Stick Idle", "event:/SFX/Tool SFX/Take Out Tool", "event:/SFX/Environmental SFX/Warehouse Activation", "event:/SFX/Player Movement SFX/Player Laser Sounds/Player Combat - You've Been Hit", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Jump_Land_Metal", "event:/SFX/Tool SFX/Laser Tool/Laser Tool Fire - Combat", "event:/SFX/Player Movement SFX/Player_Run_Dirt",
		"event:/SFX/UI SFX/Building UI SFX/Build Go Back", "event:/SFX/Tool SFX/Pick Up Plants", "event:/SFX/Player Movement SFX/Multiplayer Movement/Multiplayer Player_Walk_Rock", "event:/SFX/Tool SFX/Laser Tool/Laser Tool Successful Hit", "event:/SFX/Tool SFX/Pickaxe/Pickaxe_Impact_Dirt", "event:/SFX/Tool SFX/MOLE/MOLE Rock Collect", "event:/SFX/Player Movement SFX/Player_Jump_Takeoff_Dirt", "event:/SFX/Player Movement SFX/Player_Run_Water", "event:/SFX/Machine SFX/Inserter_Arm Extend", "event:/VO/VO Radio Noise"
	};

	private EventInstance audioPlayer;

	private Texture2D background;

	private Texture2D backgroundHighlight;

	private string lastClickedEvent;

	private ConfigEntry<KeyboardShortcut> showSoundsShortcut;

	private void Awake()
	{
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Expected O, but got Unknown
		((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: SoundSampler, VersionString: 1.0.0 is loading...");
		Harmony.PatchAll();
		showSoundsShortcut = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("General", "Show Sounds GUI", new KeyboardShortcut((KeyCode)293, Array.Empty<KeyCode>()), new ConfigDescription("The key to press to toggle the sounds GUI.", (AcceptableValueBase)null, Array.Empty<object>()));
		background = ModUtils.LoadTexture2DFromFile("SoundSampler.Border240x40.png", false, (Assembly)null);
		backgroundHighlight = ModUtils.LoadTexture2DFromFile("SoundSampler.BorderHover240x40.png", false, (Assembly)null);
		((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: SoundSampler, VersionString: 1.0.0 is loaded.");
		Log = ((BaseUnityPlugin)this).Logger;
	}

	private void Update()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		KeyboardShortcut value = showSoundsShortcut.Value;
		if (((KeyboardShortcut)(ref value)).IsDown() && ModUtils.hasGameLoaded)
		{
			showGUI = !showGUI;
			if (!showGUI)
			{
				ModUtils.FreeCursor(false);
			}
		}
	}

	private void OnGUI()
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Expected O, but got Unknown
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Expected O, but got Unknown
		//IL_0160: Unknown result type (might be due to invalid IL or missing references)
		//IL_0165: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Expected O, but got Unknown
		//IL_017e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_018f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_020a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0210: Unknown result type (might be due to invalid IL or missing references)
		//IL_021b: Unknown result type (might be due to invalid IL or missing references)
		//IL_022d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0233: Unknown result type (might be due to invalid IL or missing references)
		//IL_023e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0250: Unknown result type (might be due to invalid IL or missing references)
		//IL_0256: Unknown result type (might be due to invalid IL or missing references)
		//IL_0261: Unknown result type (might be due to invalid IL or missing references)
		//IL_0273: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Unknown result type (might be due to invalid IL or missing references)
		//IL_0297: Expected O, but got Unknown
		//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_035b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0361: Unknown result type (might be due to invalid IL or missing references)
		//IL_037d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0384: Unknown result type (might be due to invalid IL or missing references)
		//IL_0389: Unknown result type (might be due to invalid IL or missing references)
		//IL_030a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0314: Unknown result type (might be due to invalid IL or missing references)
		//IL_0319: Unknown result type (might be due to invalid IL or missing references)
		//IL_0321: Unknown result type (might be due to invalid IL or missing references)
		//IL_0327: Unknown result type (might be due to invalid IL or missing references)
		//IL_0332: Unknown result type (might be due to invalid IL or missing references)
		//IL_0344: Expected O, but got Unknown
		//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
		if (!showGUI)
		{
			return;
		}
		ModUtils.FreeCursor(true);
		float num = Screen.width - 600;
		GUIStyle val = new GUIStyle
		{
			alignment = (TextAnchor)3,
			padding = new RectOffset(10, 0, 0, 0)
		};
		val.normal.textColor = Color.yellow;
		val.normal.background = background;
		val.hover.textColor = Color.yellow;
		val.hover.background = background;
		val.focused.textColor = Color.yellow;
		val.focused.background = background;
		val.active.textColor = Color.yellow;
		val.active.background = background;
		val.onNormal.textColor = Color.yellow;
		val.onNormal.background = background;
		val.onHover.textColor = Color.yellow;
		val.onHover.background = background;
		val.onFocused.textColor = Color.yellow;
		val.onFocused.background = background;
		val.onActive.textColor = Color.yellow;
		val.onActive.background = background;
		GUIStyle val2 = val;
		GUIStyle val3 = new GUIStyle
		{
			alignment = (TextAnchor)3,
			padding = new RectOffset(10, 0, 0, 0)
		};
		val3.normal.textColor = Color.black;
		val3.normal.background = backgroundHighlight;
		val3.hover.textColor = Color.black;
		val3.hover.background = backgroundHighlight;
		val3.focused.textColor = Color.black;
		val3.focused.background = backgroundHighlight;
		val3.active.textColor = Color.black;
		val3.active.background = backgroundHighlight;
		val3.onNormal.textColor = Color.black;
		val3.onNormal.background = backgroundHighlight;
		val3.onHover.textColor = Color.black;
		val3.onHover.background = backgroundHighlight;
		val3.onFocused.textColor = Color.black;
		val3.onFocused.background = backgroundHighlight;
		val3.onActive.textColor = Color.black;
		val3.onActive.background = backgroundHighlight;
		GUIStyle val4 = val3;
		searchTerm = GUI.TextField(new Rect(num, 0f, 600f, 40f), searchTerm, val2);
		List<string> list = events.Where((string audio) => audio.ToLower().Contains(searchTerm.ToLower())).ToList();
		list.Sort();
		if (string.IsNullOrEmpty(searchTerm))
		{
			Rect val5 = new Rect(num + 10f, 0f, 580f, 40f);
			GUIStyle val6 = new GUIStyle
			{
				alignment = (TextAnchor)4
			};
			val6.normal.textColor = Color.gray;
			val6.normal.background = null;
			GUI.Label(val5, "Search...", val6);
		}
		scrollPos = GUI.BeginScrollView(new Rect(num, 50f, 600f, (float)(Screen.height - 50)), scrollPos, new Rect(num, 50f, 600f, (float)((list.Count + 1) * 50)), false, false);
		for (int i = 0; i < list.Count; i++)
		{
			float num2 = 50 * (i + 1);
			GUIStyle val7 = ((list[i] == lastClickedEvent) ? val4 : val2);
			if (GUI.Button(new Rect(num, num2, 600f, 40f), list[i], val7))
			{
				PlayAudio(list[i]);
				GUIUtility.systemCopyBuffer = list[i];
				lastClickedEvent = list[i];
			}
		}
		GUI.EndScrollView();
	}

	private void PlayAudio(string eventName)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		((EventInstance)(ref audioPlayer)).stop((STOP_MODE)1);
		audioPlayer = RuntimeManager.CreateInstance(eventName);
		((EventInstance)(ref audioPlayer)).setParameterByName("Volume", 0.2f, false);
		((EventInstance)(ref audioPlayer)).start();
	}
}