Decompiled source of CustomClanHelper v1.2.0

plugins/CustomClanHelper.Plugin.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 System.Text;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CustomClanHelper.Plugin.Code;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using ShinyShoe;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("CustomClanHelper.Plugin")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyInformationalVersion("1.2.0+592f1ab15e3b9bc42b7ce966a9c280ca483904f3")]
[assembly: AssemblyProduct("CustomClanHelper.Plugin")]
[assembly: AssemblyTitle("CustomClanHelper.Plugin")]
[assembly: AssemblyVersion("1.2.0.0")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 CustomClanHelper.Plugin
{
	[BepInPlugin("CustomClanHelper.Plugin", "CustomClanHelper.Plugin", "1.2.0")]
	public class Plugin : BaseUnityPlugin
	{
		private class ConfigDescriptionBuilder
		{
			public string English { get; set; } = "";


			public string French { get; set; } = "";


			public string German { get; set; } = "";


			public string Russian { get; set; } = "";


			public string Portuguese { get; set; } = "";


			public string Chinese { get; set; } = "";


			public string Spanish { get; set; } = "";


			public string ChineseTraditional { get; set; } = "";


			public string Korean { get; set; } = "";


			public string Japanese { get; set; } = "";


			public override string ToString()
			{
				StringBuilder stringBuilder = new StringBuilder();
				if (!string.IsNullOrEmpty(English))
				{
					stringBuilder.AppendLine(English);
				}
				if (!string.IsNullOrEmpty(French))
				{
					stringBuilder.AppendLine(French);
				}
				if (!string.IsNullOrEmpty(German))
				{
					stringBuilder.AppendLine(German);
				}
				if (!string.IsNullOrEmpty(Russian))
				{
					stringBuilder.AppendLine(Russian);
				}
				if (!string.IsNullOrEmpty(Portuguese))
				{
					stringBuilder.AppendLine(Portuguese);
				}
				if (!string.IsNullOrEmpty(Chinese))
				{
					stringBuilder.AppendLine(Chinese);
				}
				if (!string.IsNullOrEmpty(Spanish))
				{
					stringBuilder.AppendLine(Spanish);
				}
				if (!string.IsNullOrEmpty(ChineseTraditional))
				{
					stringBuilder.AppendLine(ChineseTraditional);
				}
				if (!string.IsNullOrEmpty(Korean))
				{
					stringBuilder.AppendLine(Korean);
				}
				if (!string.IsNullOrEmpty(Japanese))
				{
					stringBuilder.AppendLine(Japanese);
				}
				return stringBuilder.ToString().TrimEnd();
			}
		}

		internal static ManualLogSource Logger = new ManualLogSource("CustomClanHelper.Plugin");

		public void Awake()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"Plugin CustomClanHelper.Plugin is loaded!");
			new Harmony("CustomClanHelper.Plugin").PatchAll();
			UpdateSettings();
			((BaseUnityPlugin)this).Config.SettingChanged += OnAnySettingChanged;
		}

		private void UpdateSettings()
		{
			Logger.LogInfo((object)"Settings Updated");
		}

		private void OnAnySettingChanged(object sender, SettingChangedEventArgs e)
		{
			Logger.LogInfo((object)"A Setting Changed");
			UpdateSettings();
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "CustomClanHelper.Plugin";

		public const string PLUGIN_NAME = "CustomClanHelper.Plugin";

		public const string PLUGIN_VERSION = "1.2.0";
	}
}
namespace CustomClanHelper.Plugin.patches
{
	[HarmonyPatch(typeof(StandardChecklistPage), "Initialize")]
	internal class StandardChecklistPatch
	{
		public static readonly FieldInfo ClassDataField = AccessTools.Field(typeof(ClanChecklistSection), "classData");

		public static void Postfix(List<ClanChecklistSection> ___clanChecklistSections)
		{
			foreach (ClanChecklistSection ___clanChecklistSection in ___clanChecklistSections)
			{
				object? value = ClassDataField.GetValue(___clanChecklistSection);
				ClassData val = (ClassData)((value is ClassData) ? value : null);
				if ((Object)(object)val != (Object)null && val.IsModdedClan())
				{
					((Component)___clanChecklistSection).gameObject.SetActive(false);
				}
			}
		}
	}
}
namespace CustomClanHelper.Plugin.Patches
{
	[HarmonyPatch(typeof(CompendiumSectionChecklist), "InitializeImpl")]
	internal class CompendiumSectionChecklist_AddChecklistPage_Patch
	{
		public static void Prefix(List<ChecklistPage> ___checklistPages, CompendiumSectionChecklist __instance)
		{
			if (___checklistPages.Count == 2)
			{
				ChecklistPage item = ModdedChecklistPage.Create(0, ___checklistPages[0], ((Component)__instance).transform).Item1;
				___checklistPages.Add(item);
			}
		}
	}
	[HarmonyPatch(typeof(CompendiumSectionChecklist), "ApplyChanges")]
	public class LogbookPagePatches
	{
		private static readonly MethodInfo SetPage = AccessTools.Method(typeof(CompendiumSectionChecklist), "SetPage", new Type[1] { typeof(ChecklistPage) }, (Type[])null);

		public static bool Prefix(CompendiumSectionChecklist __instance, ref IReadOnlyList<ChecklistChangeData> ___changeDatas, List<ChecklistPage> ___checklistPages, CovenantRankMeter ___covenantRankMeter, List<ChecklistWinStreakUI> ___winstreakUIs)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Invalid comparison between Unknown and I4
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Invalid comparison between Unknown and I4
			foreach (ChecklistChangeData change in ___changeDatas)
			{
				if ((int)change.feature == 1)
				{
					___covenantRankMeter.SetChangeData(change);
				}
				else if ((int)change.feature == 6)
				{
					___winstreakUIs.ForEach(delegate(ChecklistWinStreakUI ui)
					{
						ui.SetChangeData(change);
					});
				}
			}
			ChecklistPage val = ___checklistPages[0];
			foreach (ChecklistPage ___checklistPage in ___checklistPages)
			{
				___checklistPage.ApplyChanges(___changeDatas);
				if (___checklistPage.HasChanges)
				{
					val = ___checklistPage;
				}
			}
			SetPage.Invoke(__instance, new object[1] { val });
			___changeDatas = Array.Empty<ChecklistChangeData>();
			return false;
		}
	}
	[HarmonyPatch(typeof(CompendiumSectionChecklist), "AnimateChangesCoroutine")]
	public class LogbookPagePatches2
	{
		[CompilerGenerated]
		private sealed class <Replacement>d__4 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public SaveManager saveManager;

			public CompendiumSectionChecklist ui;

			public List<ChecklistPage> checklistPages;

			public List<ChecklistWinStreakUI> winstreakUIs;

			public CovenantRankMeter covenantRankMeter;

			private ChecklistChangeAnimationTiming <timing>5__2;

			private Action<Vector3> <onApplied>5__3;

			private List<ChecklistWinStreakUI>.Enumerator <>7__wrap3;

			private int <i>5__5;

			private ChecklistPage <page>5__6;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <Replacement>d__4(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				int num = <>1__state;
				if (num == -3 || num == 1)
				{
					try
					{
					}
					finally
					{
						<>m__Finally1();
					}
				}
				<timing>5__2 = null;
				<onApplied>5__3 = null;
				<>7__wrap3 = default(List<ChecklistWinStreakUI>.Enumerator);
				<page>5__6 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				try
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
					{
						<>1__state = -1;
						if ((Object)(object)saveManager == (Object)null)
						{
							return false;
						}
						<timing>5__2 = saveManager.GetBalanceData().GetChecklistAnimationTimingData();
						<onApplied>5__3 = MakePrivateDelegate<Action<Vector3>>(ui, HandleChangeApplied);
						int num2 = FindFirstChangedPageIndex(checklistPages);
						if (num2 >= 0)
						{
							ChecklistPage val = checklistPages[num2];
							SetPage.Invoke(ui, new object[1] { val });
							((CompendiumSection)ui).TurnPage(num2);
							((PaginatedCompendiumSection)ui).PageCountChangedSignal.Dispatch();
						}
						if (!IEnumerableUtility.IsNullOrEmpty<ChecklistWinStreakUI>(winstreakUIs))
						{
							<>7__wrap3 = winstreakUIs.GetEnumerator();
							<>1__state = -3;
							goto IL_0128;
						}
						goto IL_0147;
					}
					case 1:
						<>1__state = -3;
						goto IL_0128;
					case 2:
						<>1__state = -1;
						<i>5__5 = 0;
						goto IL_0260;
					case 3:
						<>1__state = -1;
						<>2__current = <page>5__6.AnimateChangesCoroutine(<timing>5__2, <onApplied>5__3);
						<>1__state = 4;
						return true;
					case 4:
						{
							<>1__state = -1;
							<page>5__6 = null;
							goto IL_024e;
						}
						IL_0260:
						if (<i>5__5 < checklistPages.Count)
						{
							<page>5__6 = checklistPages[<i>5__5];
							if (!((Object)(object)<page>5__6 == (Object)null) && <page>5__6.HasChanges)
							{
								int num = <i>5__5;
								IEnumerator enumerator = (IEnumerator)TurnPageIfNeededCoroutine.Invoke(ui, new object[3] { <page>5__6, <timing>5__2, num });
								<>2__current = enumerator;
								<>1__state = 3;
								return true;
							}
							goto IL_024e;
						}
						return false;
						IL_0128:
						if (<>7__wrap3.MoveNext())
						{
							ChecklistWinStreakUI current = <>7__wrap3.Current;
							<>2__current = current.AnimateChangeCoroutine(<timing>5__2, <onApplied>5__3);
							<>1__state = 1;
							return true;
						}
						<>m__Finally1();
						<>7__wrap3 = default(List<ChecklistWinStreakUI>.Enumerator);
						goto IL_0147;
						IL_0147:
						<>2__current = covenantRankMeter.AnimateChangeCoroutine(<timing>5__2, <onApplied>5__3);
						<>1__state = 2;
						return true;
						IL_024e:
						<i>5__5++;
						goto IL_0260;
					}
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			private void <>m__Finally1()
			{
				<>1__state = -1;
				((IDisposable)<>7__wrap3).Dispose();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public static readonly MethodInfo SetPage = AccessTools.Method(typeof(CompendiumSectionChecklist), "SetPage", new Type[1] { typeof(ChecklistPage) }, (Type[])null);

		public static readonly MethodInfo TurnPageIfNeededCoroutine = AccessTools.Method(typeof(CompendiumSectionChecklist), "TurnPageIfNeededCoroutine", new Type[3]
		{
			typeof(ChecklistPage),
			typeof(ChecklistChangeAnimationTiming),
			typeof(int)
		}, (Type[])null);

		public static readonly MethodInfo HandleChangeApplied = AccessTools.Method(typeof(CompendiumSectionChecklist), "HandleChangeApplied", new Type[1] { typeof(Vector3) }, (Type[])null);

		private static bool Prefix(CompendiumSectionChecklist __instance, ref IEnumerator __result, SaveManager ___saveManager, ref int ___sfxIndex, List<ChecklistPage> ___checklistPages, List<ChecklistWinStreakUI> ___winstreakUIs, CovenantRankMeter ___covenantRankMeter)
		{
			___sfxIndex = 0;
			__result = Replacement(__instance, ___saveManager, ___checklistPages, ___winstreakUIs, ___covenantRankMeter);
			return false;
		}

		[IteratorStateMachine(typeof(<Replacement>d__4))]
		private static IEnumerator Replacement(CompendiumSectionChecklist ui, SaveManager saveManager, List<ChecklistPage> checklistPages, List<ChecklistWinStreakUI> winstreakUIs, CovenantRankMeter covenantRankMeter)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <Replacement>d__4(0)
			{
				ui = ui,
				saveManager = saveManager,
				checklistPages = checklistPages,
				winstreakUIs = winstreakUIs,
				covenantRankMeter = covenantRankMeter
			};
		}

		private static int FindFirstChangedPageIndex(List<ChecklistPage> pages)
		{
			for (int i = 0; i < pages.Count; i++)
			{
				if ((Object)(object)pages[i] != (Object)null && pages[i].HasChanges)
				{
					return i;
				}
			}
			return -1;
		}

		private static TDelegate MakePrivateDelegate<TDelegate>(object instance, MethodInfo method) where TDelegate : Delegate
		{
			return (TDelegate)Delegate.CreateDelegate(typeof(TDelegate), instance, method);
		}
	}
}
namespace CustomClanHelper.Plugin.Code
{
	public static class ClassDataExtensions
	{
		internal static readonly HashSet<string> VANILLA_CLANS = new HashSet<string>
		{
			"0df83271-5359-48df-9365-e73b7b2d0130", "fd119fcf-c2cf-469e-8a5a-e9b0f265560d", "4fe56363-b1d9-46b7-9a09-bd2df1a5329f", "9317cf9a-04ec-49da-be29-0e4ed61eb8ba", "fda62ada-520e-42f3-aa88-e4a78549c4a2", "46ae87db-d92e-4fcb-a3bc-67c723d7bebd", "9d1f0ee1-3e81-4b65-8438-aecd6db91929", "5be08e27-c1e6-4b9d-b506-e4781e111dc8", "9aaf1009-3fbe-4ac5-9f99-a3a702ff7f27", "c595c344-d323-4cf1-9ad6-41edc2aebbd0",
			"3c98c8eb-fc7c-4b35-925e-6b5ab0f69896", "ab9c9f6f-2543-4ca5-b7e5-e2eb125445b8"
		};

		public static bool IsModdedClan(this ClassData clan)
		{
			return !VANILLA_CLANS.Contains(((GameData)clan).GetID());
		}

		public static bool IsVanillaClan(this ClassData clan)
		{
			return VANILLA_CLANS.Contains(((GameData)clan).GetID());
		}
	}
	public sealed class ModdedChecklistPage : ChecklistPage
	{
		[CompilerGenerated]
		private sealed class <AnimateChangesCoroutine>d__6 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ModdedChecklistPage <>4__this;

			public ChecklistChangeAnimationTiming timing;

			public Action<Vector3> handleChangeApplied;

			private List<ClanChecklistSection>.Enumerator <>7__wrap1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <AnimateChangesCoroutine>d__6(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				int num = <>1__state;
				if (num == -3 || num == 1)
				{
					try
					{
					}
					finally
					{
						<>m__Finally1();
					}
				}
				<>7__wrap1 = default(List<ClanChecklistSection>.Enumerator);
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				try
				{
					int num = <>1__state;
					ModdedChecklistPage moddedChecklistPage = <>4__this;
					switch (num)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						if (IEnumerableUtility.IsNullOrEmpty<ClanChecklistSection>(moddedChecklistPage.clanChecklistSections))
						{
							return false;
						}
						<>7__wrap1 = moddedChecklistPage.clanChecklistSections.GetEnumerator();
						<>1__state = -3;
						break;
					case 1:
						<>1__state = -3;
						break;
					}
					if (<>7__wrap1.MoveNext())
					{
						ClanChecklistSection current = <>7__wrap1.Current;
						<>2__current = current.AnimateChangeCoroutine(timing, handleChangeApplied);
						<>1__state = 1;
						return true;
					}
					<>m__Finally1();
					<>7__wrap1 = default(List<ClanChecklistSection>.Enumerator);
					return false;
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			private void <>m__Finally1()
			{
				<>1__state = -1;
				((IDisposable)<>7__wrap1).Dispose();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public LayoutGroup? clanSectionsLayoutAllClans;

		private List<ClanChecklistSection>? clanChecklistSections;

		private int page;

		internal static (ChecklistPage, GameObject) Create(int page, ChecklistPage vanillaPage, Transform parent)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Expected O, but got Unknown
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject
			{
				name = $"Modded checklist page {page}"
			};
			ModdedChecklistPage moddedChecklistPage = val.AddComponent<ModdedChecklistPage>();
			moddedChecklistPage.page = page;
			RectTransform obj = val.AddComponent<RectTransform>();
			((Transform)obj).SetParent(parent);
			obj.anchorMin = Vector2.zero;
			obj.anchorMax = Vector2.one;
			obj.offsetMin = new Vector2(400f, 0f);
			obj.offsetMax = Vector2.zero;
			obj.sizeDelta = new Vector2(-400f, 0f);
			GameObject val2 = new GameObject
			{
				name = "Layout"
			};
			val2.SetActive(true);
			val2.transform.localPosition = new Vector3(0f, 45f, 0f);
			GridLayoutGroup val3 = val2.AddComponent<GridLayoutGroup>();
			val3.startCorner = (Corner)0;
			val3.startAxis = (Axis)0;
			val3.cellSize = new Vector2(710f, 157f);
			val3.spacing = new Vector2(20f, 14f);
			val3.constraint = (Constraint)0;
			val3.constraintCount = 2;
			((LayoutGroup)val3).childAlignment = (TextAnchor)0;
			RectTransform component = val2.GetComponent<RectTransform>();
			((Transform)component).SetParent(val.transform);
			component.anchorMin = new Vector2(0.5f, 0.5f);
			component.anchorMax = new Vector2(0.5f, 0.5f);
			component.offsetMin = new Vector2(-720f, -378f);
			component.offsetMax = new Vector2(720f, 468f);
			component.sizeDelta = new Vector2(1440f, 846f);
			moddedChecklistPage.clanSectionsLayoutAllClans = (LayoutGroup?)(object)val3;
			new GameObject();
			Transform obj2 = ((Component)vanillaPage).transform.Find("All launch clans layout/Clan checklist section all clans");
			GameObject val4 = ((obj2 != null) ? ((Component)obj2).gameObject : null);
			if ((Object)(object)val4 == (Object)null)
			{
				Plugin.Logger.LogError((object)"Failed to find ChecklistPage item to copy");
			}
			else
			{
				GameObject obj3 = Object.Instantiate<GameObject>(val4);
				((Object)obj3).name = "Clan checklist section";
				obj3.SetActive(true);
				obj3.GetComponent<ClanChecklistSection>();
				((Transform)obj3.GetComponent<RectTransform>()).SetParent(val2.transform);
			}
			return ((ChecklistPage)(object)moddedChecklistPage, val);
		}

		public override void Initialize(SaveManager saveManager)
		{
			List<ClassData> list = new List<ClassData>();
			foreach (ClassData classData in saveManager.GetBalanceData().GetClassDatas())
			{
				if (classData.IsModdedClan())
				{
					list.Add(classData);
				}
			}
			if (!IEnumerableUtility.IsNullOrEmpty<ClassData>(list))
			{
				((Component)clanSectionsLayoutAllClans).gameObject.SetActive(true);
				clanChecklistSections = GameObjectUtil.PopulateViewList<ClassData, ClanChecklistSection, SaveManager>((Component)(object)clanSectionsLayoutAllClans, (IReadOnlyList<ClassData>)list, saveManager, (SelectablesCollection)null);
				{
					foreach (ClanChecklistSection clanChecklistSection in clanChecklistSections)
					{
						clanChecklistSection.ReparentCrewVictoryItems();
					}
					return;
				}
			}
			((Component)clanSectionsLayoutAllClans).gameObject.SetActive(false);
		}

		public override bool ApplyChanges(IReadOnlyList<ChecklistChangeData> changeDatas)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			((ChecklistPage)this).HasChanges = false;
			foreach (ChecklistChangeData changeData in changeDatas)
			{
				if ((int)changeData.feature == 5 && changeData.mainClassId == null && (int)changeData.dlc == 0)
				{
					((ChecklistPage)this).HasChanges = true;
				}
			}
			foreach (ClanChecklistSection clanChecklistSection in clanChecklistSections)
			{
				((ChecklistPage)this).HasChanges = ((ChecklistPage)this).HasChanges | clanChecklistSection.SetChangeData(changeDatas);
			}
			return ((ChecklistPage)this).HasChanges;
		}

		[IteratorStateMachine(typeof(<AnimateChangesCoroutine>d__6))]
		public override IEnumerator AnimateChangesCoroutine(ChecklistChangeAnimationTiming timing, Action<Vector3> handleChangeApplied)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <AnimateChangesCoroutine>d__6(0)
			{
				<>4__this = this,
				timing = timing,
				handleChangeApplied = handleChangeApplied
			};
		}

		public override IGameUIComponent? GetDefaultGameUISelectable()
		{
			ClanChecklistSection valueOrDefault = IEnumerableUtility.GetValueOrDefault<ClanChecklistSection>(clanChecklistSections, 0);
			if (valueOrDefault == null)
			{
				return null;
			}
			return valueOrDefault.GetDefaultGameUISelectable();
		}
	}
}