Decompiled source of Customer Search Bar v0.1.0

IL2CPP/Mods/CustomerSearchBar_IL2CPP_0.1.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using CustomerSearcher;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppScheduleOne.Economy;
using Il2CppScheduleOne.PlayerScripts;
using Il2CppScheduleOne.UI;
using Il2CppScheduleOne.UI.Phone;
using Il2CppScheduleOne.UI.Phone.Messages;
using Il2CppScheduleOne.UI.Phone.ProductManagerApp;
using Il2CppSteamworks;
using Il2CppSystem.Collections.Generic;
using MelonLoader;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Core), "CustomerSearchBar_IL2CPP", "0.1", "freddab007", null)]
[assembly: MelonGame("TVGS", "Schedule I")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("CustomerSearcher")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("CustomerSearcher")]
[assembly: AssemblyTitle("CustomerSearcher")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace CustomerSearcher
{
	public class Core : MelonMod
	{
		private Searcher searcher;

		public override void OnInitializeMelon()
		{
			((MelonBase)this).LoggerInstance.Msg("Customer Search Bar IL2CPP v0.1 Initialized.");
		}

		public override void OnSceneWasLoaded(int buildIndex, string sceneName)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			if (buildIndex == 1)
			{
				searcher = null;
				searcher = new Searcher();
				MelonCoroutines.Start(searcher.PlayerSearch(SteamUser.GetSteamID()));
			}
			else if (searcher != null)
			{
				searcher.StopWorking();
			}
		}
	}
	internal class Searcher
	{
		private GameObject currentPlayer;

		private GameObject customerList;

		private GameObject inputfieldPrefab;

		private GameObject inputSearcher;

		private GameplayMenu gameplayMenu;

		private CustomerSelector customerSelector;

		private DealerManagementApp dealerManagementApp;

		private List<Button> customerArray = new List<Button>();

		private List<Button> filters = new List<Button>();

		private InputField searcherInput;

		private bool selectorState = false;

		private bool stopWorking = false;

		public void StopWorking()
		{
			stopWorking = true;
		}

		public IEnumerator PlayerSearch(CSteamID _playerID)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			bool searchingPLayer = true;
			yield return (object)new WaitForSeconds(2f);
			while (searchingPLayer)
			{
				Il2CppArrayBase<Player> players = Object.FindObjectsOfType<Player>();
				if (players != null)
				{
					foreach (Player player in players)
					{
						if (((Object)player).name.Contains(((object)(CSteamID)(ref _playerID)).ToString()))
						{
							currentPlayer = ((Component)player).gameObject;
							MelonCoroutines.Start(CreateSearcher());
							searchingPLayer = false;
						}
					}
				}
				yield return null;
			}
		}

		private void CreateSearcherObject(GameObject _parent)
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: 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_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			inputSearcher = Object.Instantiate<GameObject>(inputfieldPrefab, _parent.transform);
			if ((Object)(object)inputSearcher != (Object)null)
			{
				searcherInput = inputSearcher.GetComponent<InputField>();
				((Graphic)searcherInput.textComponent).color = Color.white;
				searcherInput.contentType = (ContentType)5;
				searcherInput.characterLimit = 0;
				searcherInput.textComponent.resizeTextForBestFit = false;
				((UnityEvent<string>)(object)searcherInput.onValueChange).AddListener(DelegateSupport.ConvertDelegate<UnityAction<string>>((Delegate)new Action<string>(FilterCustomer)));
				searcherInput.text = "";
				((Graphic)searcherInput.textComponent).raycastTarget = false;
				((Component)searcherInput.placeholder).GetComponent<Text>().text = "Filter";
				((Component)searcherInput.placeholder).GetComponent<Text>().resizeTextForBestFit = true;
				((Component)searcherInput).GetComponent<RectTransform>().anchoredPosition = new Vector2(0f, 290f);
				Image component = ((Component)searcherInput).GetComponent<Image>();
				RectTransform component2 = ((Component)component).GetComponent<RectTransform>();
				((Graphic)component).color = Color.grey;
				((Graphic)component).raycastTarget = true;
				Rect rect = component2.rect;
				float num = 0f - (((Rect)(ref rect)).size.x - 350f);
				rect = component2.rect;
				component2.sizeDelta = new Vector2(num, 0f - (((Rect)(ref rect)).size.y - 50f));
				Text textComponent = searcherInput.textComponent;
				((Graphic)textComponent).raycastTarget = false;
				textComponent.resizeTextForBestFit = true;
				ChangeSelector();
			}
		}

		private void ChangeSelector()
		{
			//IL_003d: 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_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			ScrollRect componentInChildren = ((Component)customerSelector).GetComponentInChildren<ScrollRect>();
			if (Object.op_Implicit((Object)(object)componentInChildren))
			{
				Image component = ((Component)((Component)componentInChildren).transform.parent).gameObject.GetComponent<Image>();
				componentInChildren.rectTransform.sizeDelta = new Vector2(componentInChildren.rectTransform.sizeDelta.x, componentInChildren.rectTransform.sizeDelta.y - 50f);
				componentInChildren.rectTransform.anchoredPosition = new Vector2(componentInChildren.rectTransform.anchoredPosition.x, componentInChildren.rectTransform.anchoredPosition.y - 30f);
				((Graphic)component).rectTransform.sizeDelta = new Vector2(((Graphic)component).rectTransform.sizeDelta.x, ((Graphic)component).rectTransform.sizeDelta.y + 100f);
				((Graphic)component).rectTransform.anchoredPosition = new Vector2(((Graphic)component).rectTransform.anchoredPosition.x, ((Graphic)component).rectTransform.anchoredPosition.y - 50f);
			}
		}

		private void FilterCustomer(string _input)
		{
			filters = customerArray;
			foreach (Button filter in filters)
			{
				string[] array = ((Component)filter).GetComponentInChildren<Text>().text.Split(' ');
				if (_input.Count() == 0)
				{
					((Component)filter).gameObject.SetActive(true);
					continue;
				}
				int num = 0;
				int num2 = 0;
				for (int i = 0; i < _input.Count(); i++)
				{
					if (array[0].Count() > i && _input[i] == array[0][i])
					{
						num++;
					}
					if (array[1].Count() > i && _input[i] == array[1][i])
					{
						num2++;
					}
					if (num < i && num2 < i)
					{
						i = _input.Count();
					}
				}
				if (num == _input.Count() || num2 == _input.Count())
				{
					((Component)filter).gameObject.SetActive(true);
				}
				else
				{
					((Component)filter).gameObject.SetActive(false);
				}
			}
		}

		private IEnumerator CreateSearcher()
		{
			bool creatingSearcher = true;
			yield return null;
			while (creatingSearcher)
			{
				customerSelector = currentPlayer.GetComponentInChildren<CustomerSelector>(true);
				dealerManagementApp = currentPlayer.GetComponentInChildren<DealerManagementApp>(true);
				gameplayMenu = currentPlayer.GetComponentInChildren<GameplayMenu>(true);
				if (Object.op_Implicit((Object)(object)customerSelector) && Object.op_Implicit((Object)(object)dealerManagementApp) && Object.op_Implicit((Object)(object)gameplayMenu))
				{
					inputfieldPrefab = ((Component)currentPlayer.GetComponentInChildren<ProductAppDetailPanel>(true)).gameObject;
					if (Object.op_Implicit((Object)(object)inputfieldPrefab))
					{
						customerList = ((Component)((Component)customerSelector).GetComponentInChildren<VerticalLayoutGroup>(true)).gameObject;
						inputfieldPrefab = ((Component)inputfieldPrefab.GetComponentInChildren<InputField>(true)).gameObject;
						if (Object.op_Implicit((Object)(object)customerList))
						{
							MelonCoroutines.Start(ManagingSearcher());
							CreateSearcherObject(((Component)customerSelector).gameObject);
							creatingSearcher = false;
						}
					}
				}
				yield return null;
			}
		}

		private void RefreshCustomerList()
		{
			Il2CppArrayBase<Button> componentsInChildren = customerList.GetComponentsInChildren<Button>(true);
			customerArray.Clear();
			if (dealerManagementApp.dealers == null)
			{
				return;
			}
			foreach (Button item in componentsInChildren)
			{
				((Component)item).gameObject.SetActive(true);
				customerArray.Add(item);
			}
			Enumerator<Dealer> enumerator2 = dealerManagementApp.dealers.GetEnumerator();
			while (enumerator2.MoveNext())
			{
				Dealer current2 = enumerator2.Current;
				Enumerator<Customer> enumerator3 = current2.AssignedCustomers.GetEnumerator();
				while (enumerator3.MoveNext())
				{
					Customer customer = enumerator3.Current;
					IEnumerable<Button> enumerable = ((IEnumerable<Button>)componentsInChildren).Where((Button x) => ((Component)x).GetComponentInChildren<Text>().text.Contains(((Object)customer).name));
					if (enumerable != null && enumerable.Count() > 0)
					{
						Button val = enumerable.First();
						((Component)val).gameObject.SetActive(false);
						customerArray.Remove(val);
					}
				}
			}
		}

		private void RefreshFilter()
		{
			searcherInput.text = "";
			searcherInput.textComponent.text = "";
		}

		private IEnumerator ManagingSearcher()
		{
			while (!stopWorking)
			{
				if (stopWorking)
				{
					MelonCoroutines.Stop((object)ManagingSearcher());
				}
				else
				{
					if (selectorState)
					{
						if (searcherInput.isFocused && Object.op_Implicit((Object)(object)gameplayMenu) && ((Behaviour)gameplayMenu).enabled)
						{
							((Behaviour)gameplayMenu).enabled = false;
						}
						else if (Object.op_Implicit((Object)(object)gameplayMenu) && !searcherInput.isFocused && !((Behaviour)gameplayMenu).enabled)
						{
							((Behaviour)gameplayMenu).enabled = true;
						}
					}
					if (selectorState != ((Component)customerSelector).gameObject.activeSelf)
					{
						selectorState = ((Component)customerSelector).gameObject.activeSelf;
						RefreshCustomerList();
						RefreshFilter();
					}
				}
				yield return null;
			}
		}
	}
}

Mono/Mods/CustomerSearchBar_Mono_0.1.dll

Decompiled a day ago
using System.Collections;
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 CustomerSearcher;
using MelonLoader;
using ScheduleOne.Economy;
using ScheduleOne.PlayerScripts;
using ScheduleOne.UI;
using ScheduleOne.UI.Phone;
using ScheduleOne.UI.Phone.Messages;
using ScheduleOne.UI.Phone.ProductManagerApp;
using Steamworks;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Core), "CustomerSearchBar_Mono", "0.1", "freddab007", null)]
[assembly: MelonGame("TVGS", "Schedule I")]
[assembly: AssemblyTitle("CustomerSearcherMono")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CustomerSearcherMono")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("75c77a81-528c-42de-ad2d-ede21b3eba25")]
[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 CustomerSearcher;

public class Core : MelonMod
{
	private Searcher searcher;

	public override void OnInitializeMelon()
	{
		((MelonBase)this).LoggerInstance.Msg("Customer Search Bar Mono v0.1 Initialized.");
	}

	public override void OnSceneWasLoaded(int buildIndex, string sceneName)
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		if (buildIndex == 1)
		{
			searcher = null;
			searcher = new Searcher();
			MelonCoroutines.Start(searcher.PlayerSearch(SteamUser.GetSteamID()));
		}
		else if (searcher != null)
		{
			searcher.StopWorking();
		}
	}
}
internal class Searcher
{
	private GameObject currentPlayer;

	private GameObject customerList;

	private GameObject inputfieldPrefab;

	private GameObject inputSearcher;

	private GameplayMenu gameplayMenu;

	private CustomerSelector customerSelector;

	private DealerManagementApp dealerManagementApp;

	private Dealer[] dealers;

	private List<Button> customerArray = new List<Button>();

	private List<Button> filters = new List<Button>();

	private InputField searcherInput;

	private bool selectorState = false;

	private bool stopWorking = false;

	public void StopWorking()
	{
		stopWorking = true;
	}

	public IEnumerator PlayerSearch(CSteamID _playerID)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		bool searchingPLayer = true;
		yield return (object)new WaitForSeconds(2f);
		while (searchingPLayer)
		{
			Player[] players = Object.FindObjectsOfType<Player>();
			if (players != null)
			{
				Player[] array = players;
				foreach (Player player in array)
				{
					if (((Object)player).name.Contains(((object)(CSteamID)(ref _playerID)).ToString()))
					{
						currentPlayer = ((Component)player).gameObject;
						MelonCoroutines.Start(CreateSearcher());
						searchingPLayer = false;
					}
				}
			}
			yield return null;
		}
	}

	private void CreateSearcherObject(GameObject _parent)
	{
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_013f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_016f: Unknown result type (might be due to invalid IL or missing references)
		inputSearcher = Object.Instantiate<GameObject>(inputfieldPrefab, _parent.transform);
		if ((Object)(object)inputSearcher != (Object)null)
		{
			searcherInput = inputSearcher.GetComponent<InputField>();
			((Graphic)searcherInput.textComponent).color = Color.white;
			searcherInput.contentType = (ContentType)5;
			searcherInput.characterLimit = 0;
			searcherInput.textComponent.resizeTextForBestFit = false;
			((UnityEvent<string>)(object)searcherInput.onValueChanged).AddListener((UnityAction<string>)FilterCustomer);
			searcherInput.text = "";
			((Graphic)searcherInput.textComponent).raycastTarget = false;
			((Component)searcherInput.placeholder).GetComponent<Text>().text = "Filter";
			((Component)searcherInput.placeholder).GetComponent<Text>().resizeTextForBestFit = true;
			((Component)searcherInput).GetComponent<RectTransform>().anchoredPosition = new Vector2(0f, 290f);
			Image component = ((Component)searcherInput).GetComponent<Image>();
			RectTransform component2 = ((Component)component).GetComponent<RectTransform>();
			((Graphic)component).color = Color.grey;
			((Graphic)component).raycastTarget = true;
			Rect rect = component2.rect;
			float num = 0f - (((Rect)(ref rect)).size.x - 350f);
			rect = component2.rect;
			component2.sizeDelta = new Vector2(num, 0f - (((Rect)(ref rect)).size.y - 50f));
			Text textComponent = searcherInput.textComponent;
			((Graphic)textComponent).raycastTarget = false;
			textComponent.resizeTextForBestFit = true;
			ChangeSelector();
		}
	}

	private void ChangeSelector()
	{
		//IL_003d: 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_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		ScrollRect componentInChildren = ((Component)customerSelector).GetComponentInChildren<ScrollRect>();
		if (Object.op_Implicit((Object)(object)componentInChildren))
		{
			Image component = ((Component)((Component)componentInChildren).transform.parent).gameObject.GetComponent<Image>();
			((Component)componentInChildren).GetComponent<RectTransform>().sizeDelta = new Vector2(((Component)componentInChildren).GetComponent<RectTransform>().sizeDelta.x, ((Component)componentInChildren).GetComponent<RectTransform>().sizeDelta.y - 50f);
			((Component)componentInChildren).GetComponent<RectTransform>().anchoredPosition = new Vector2(((Component)componentInChildren).GetComponent<RectTransform>().anchoredPosition.x, ((Component)componentInChildren).GetComponent<RectTransform>().anchoredPosition.y - 30f);
			((Graphic)component).rectTransform.sizeDelta = new Vector2(((Graphic)component).rectTransform.sizeDelta.x, ((Graphic)component).rectTransform.sizeDelta.y + 100f);
			((Graphic)component).rectTransform.anchoredPosition = new Vector2(((Graphic)component).rectTransform.anchoredPosition.x, ((Graphic)component).rectTransform.anchoredPosition.y - 50f);
		}
	}

	private void FilterCustomer(string _input)
	{
		filters = customerArray;
		foreach (Button filter in filters)
		{
			string[] array = ((Component)filter).GetComponentInChildren<Text>().text.Split(new char[1] { ' ' });
			if (_input.Count() == 0)
			{
				((Component)filter).gameObject.SetActive(true);
				continue;
			}
			int num = 0;
			int num2 = 0;
			for (int i = 0; i < _input.Count(); i++)
			{
				if (array[0].Count() > i && _input[i] == array[0][i])
				{
					num++;
				}
				if (array[1].Count() > i && _input[i] == array[1][i])
				{
					num2++;
				}
				if (num < i && num2 < i)
				{
					i = _input.Count();
				}
			}
			if (num == _input.Count() || num2 == _input.Count())
			{
				((Component)filter).gameObject.SetActive(true);
			}
			else
			{
				((Component)filter).gameObject.SetActive(false);
			}
		}
	}

	private IEnumerator CreateSearcher()
	{
		bool creatingSearcher = true;
		yield return null;
		while (creatingSearcher)
		{
			customerSelector = currentPlayer.GetComponentInChildren<CustomerSelector>(true);
			dealerManagementApp = currentPlayer.GetComponentInChildren<DealerManagementApp>(true);
			gameplayMenu = currentPlayer.GetComponentInChildren<GameplayMenu>(true);
			if (Object.op_Implicit((Object)(object)customerSelector) && Object.op_Implicit((Object)(object)dealerManagementApp) && Object.op_Implicit((Object)(object)gameplayMenu))
			{
				inputfieldPrefab = ((Component)currentPlayer.GetComponentInChildren<ProductAppDetailPanel>(true)).gameObject;
				if (Object.op_Implicit((Object)(object)inputfieldPrefab))
				{
					customerList = ((Component)((Component)customerSelector).GetComponentInChildren<VerticalLayoutGroup>(true)).gameObject;
					inputfieldPrefab = ((Component)inputfieldPrefab.GetComponentInChildren<InputField>(true)).gameObject;
					dealers = (from x in Object.FindObjectsOfType<Dealer>(true)
						where !((Object)x).name.Contains("CartelDealer")
						select x).ToArray();
					if (Object.op_Implicit((Object)(object)customerList) && dealers != null)
					{
						MelonCoroutines.Start(ManagingSearcher());
						CreateSearcherObject(((Component)customerSelector).gameObject);
						creatingSearcher = false;
					}
				}
			}
			yield return null;
		}
	}

	private void RefreshCustomerList()
	{
		Button[] componentsInChildren = customerList.GetComponentsInChildren<Button>(true);
		customerArray.Clear();
		if (dealers == null)
		{
			return;
		}
		Button[] array = componentsInChildren;
		foreach (Button val in array)
		{
			((Component)val).gameObject.SetActive(true);
			customerArray.Add(val);
		}
		Dealer[] array2 = dealers;
		foreach (Dealer val2 in array2)
		{
			foreach (Customer customer in val2.AssignedCustomers)
			{
				IEnumerable<Button> enumerable = componentsInChildren.Where((Button x) => ((Component)x).GetComponentInChildren<Text>().text.Contains(((Object)customer).name));
				if (enumerable != null && enumerable.Count() > 0)
				{
					Button val3 = enumerable.First();
					((Component)val3).gameObject.SetActive(false);
					customerArray.Remove(val3);
				}
			}
		}
	}

	private void RefreshFilter()
	{
		searcherInput.text = "";
		searcherInput.textComponent.text = "";
	}

	private IEnumerator ManagingSearcher()
	{
		while (!stopWorking)
		{
			if (stopWorking)
			{
				MelonCoroutines.Stop((object)ManagingSearcher());
			}
			else
			{
				if (selectorState)
				{
					if (searcherInput.isFocused && Object.op_Implicit((Object)(object)gameplayMenu) && ((Behaviour)gameplayMenu).enabled)
					{
						((Behaviour)gameplayMenu).enabled = false;
					}
					else if (Object.op_Implicit((Object)(object)gameplayMenu) && !searcherInput.isFocused && !((Behaviour)gameplayMenu).enabled)
					{
						((Behaviour)gameplayMenu).enabled = true;
					}
				}
				if (selectorState != ((Component)customerSelector).gameObject.activeSelf)
				{
					selectorState = ((Component)customerSelector).gameObject.activeSelf;
					RefreshCustomerList();
					RefreshFilter();
				}
			}
			yield return null;
		}
	}
}