Decompiled source of TaskCheat v2.2.0

BepInEx/plugins/cs.HoLMod.TaskCheat.dll

Decompiled 3 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text.RegularExpressions;
using System.Threading;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
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("cs.HoLMod.TaskCheat")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("cs.HoLMod.TaskCheat")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("79682419-f06c-465f-bf65-4c8ceef269eb")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7", FrameworkDisplayName = ".NET Framework 4.7")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace cs.HoLMod.TaskCheat;

public static class AddTaskHandler
{
	public static void AddTasksToCurrent(List<List<string>> selectedTasks)
	{
		if ((Object)(object)TaskCheat.Instance == (Object)null)
		{
			ManualLogSource log = TaskCheat.Log;
			if (log != null)
			{
				log.LogWarning((object)LanguageManager.GetText("TaskCheatInstanceIsNull"));
			}
			return;
		}
		if (string.IsNullOrEmpty(Mainload.SceneID))
		{
			ManualLogSource log2 = TaskCheat.Log;
			if (log2 != null)
			{
				log2.LogWarning((object)LanguageManager.GetText("MainloadSceneIDIsNull"));
			}
			if ((Object)(object)TaskCheat.Instance != (Object)null)
			{
				TaskCheat.Instance.ShowNotification(LanguageManager.GetText("CannotDetermineScene"));
			}
			return;
		}
		string[] array = Mainload.SceneID.Split(new char[1] { '|' });
		string text = array[0];
		switch (text)
		{
		default:
			if (!(text == "F"))
			{
				break;
			}
			goto case "M";
		case "M":
		case "Z":
		case "S":
		case "H":
			try
			{
				List<List<int>> list = Mainload.TaskOrderData_Now;
				if (list == null)
				{
					list = new List<List<int>>();
				}
				int num = 0;
				if (selectedTasks != null && selectedTasks.Count > 0)
				{
					foreach (List<string> selectedTask in selectedTasks)
					{
						List<int> list2 = new List<int>();
						foreach (string item in selectedTask)
						{
							if (int.TryParse(item, out var result))
							{
								list2.Add(result);
							}
						}
						if (list2.Count <= 0)
						{
							continue;
						}
						bool flag = false;
						foreach (List<int> item2 in list)
						{
							if (item2 != null && item2.Count > 0 && item2[0] == list2[0])
							{
								flag = true;
								break;
							}
						}
						if (!flag)
						{
							list.Add(list2);
							num++;
						}
					}
					Mainload.TaskOrderData_Now = list;
					if ((Object)(object)TaskCheat.Instance != (Object)null && num > 0)
					{
						TaskCheat.Instance.ShowNotification(LanguageManager.GetFormattedText("SuccessfullyAddedTasks", num));
					}
				}
			}
			catch (Exception ex)
			{
				ManualLogSource log3 = TaskCheat.Log;
				if (log3 != null)
				{
					log3.LogError((object)(LanguageManager.GetText("TaskAddError") + ex.Message));
				}
				ManualLogSource log4 = TaskCheat.Log;
				if (log4 != null)
				{
					log4.LogError((object)ex.StackTrace);
				}
				if ((Object)(object)TaskCheat.Instance != (Object)null)
				{
					TaskCheat.Instance.ShowNotification(LanguageManager.GetText("TaskAddFailed"));
				}
			}
			array = null;
			break;
		}
	}
}
public static class TaskClearer
{
	private static List<List<int>> EmptyTaskList = new List<List<int>>();

	public static void AllTaskClear()
	{
		try
		{
			if (Mainload.TaskOrderData_Now != null)
			{
				Mainload.TaskOrderData_Now = new List<List<int>>();
				ManualLogSource log = TaskCheat.Log;
				if (log != null)
				{
					log.LogInfo((object)LanguageManager.GetText("AllTasksCleared"));
				}
			}
			else
			{
				Mainload.TaskOrderData_Now = new List<List<int>>();
				ManualLogSource log2 = TaskCheat.Log;
				if (log2 != null)
				{
					log2.LogInfo((object)LanguageManager.GetText("MainloadTaskOrderDataIsNull"));
				}
			}
		}
		catch (Exception ex)
		{
			ManualLogSource log3 = TaskCheat.Log;
			if (log3 != null)
			{
				log3.LogError((object)(LanguageManager.GetText("TaskClearError") + ex.Message));
			}
		}
	}
}
internal static class LanguageManager
{
	private static bool isChinese;

	private static Dictionary<string, string> textDictionary;

	static LanguageManager()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Invalid comparison between Unknown and I4
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Invalid comparison between Unknown and I4
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Invalid comparison between Unknown and I4
		isChinese = true;
		textDictionary = new Dictionary<string, string>();
		SystemLanguage systemLanguage = Application.systemLanguage;
		isChinese = (int)systemLanguage == 6 || (int)systemLanguage == 40 || (int)systemLanguage == 41;
		InitializeTextDictionary();
	}

	private static void InitializeTextDictionary()
	{
		AddText("任务编辑器", "Task Editor");
		AddText("一键清除", "All Tasks Clear");
		AddText("任务添加", "Add Tasks");
		AddText("重复任务", "Repetitive Tasks");
		AddText("清除所有任务", "Clear All Tasks");
		AddText("选择需要添加的任务", "Select Tasks to Add");
		AddText("选择需要重复的任务", "Select Tasks to Repeat");
		AddText("清除配置文件", "Clear Config File");
		AddText("确认选择", "Confirm Selection");
		AddText("确认添加", "Confirm Addition");
		AddText("关闭", "Close");
		AddText("是", "Yes");
		AddText("否", "No");
		AddText("使用说明:", "Instructions:");
		AddText("1. 请在修改前先保存游戏,以便回档", "1. Save the game before making changes to allow rollback");
		AddText("2. 按F4键显示/隐藏窗口", "2. Press F4 to show/hide the window");
		AddText("3. 切换模式选择:一键清除/任务添加/重复任务", "3. Switch between modes: One-Click Clear/Add Tasks/Repetitive Tasks");
		AddText("Mod作者:AnZhi20", "Mod Author: AnZhi20");
		AddText("Mod版本:", "Mod Version: ");
		AddText("选择要重复添加的任务", "Select Tasks to Repeat");
		AddText("选择要添加的任务", "Select Tasks to Add");
		AddText("确认操作", "Confirm Operation");
		AddText("未找到本存档的配置,可能未生成或已删除。", "No configuration found for this save, it may not have been generated or has been deleted.");
		AddText("是否清除所有配置?", "Do you want to clear all configurations?");
		AddText("任务已清除成功!", "Tasks cleared successfully!");
		AddText("清除失败: ", "Clear failed: ");
		AddText("打开任务选择窗口失败!", "Failed to open task selection window!");
		AddText("打开任务添加窗口失败!", "Failed to open task addition window!");
		AddText("确认任务选择失败!", "Failed to confirm task selection!");
		AddText("确认任务添加失败!", "Failed to confirm task addition!");
		AddText("配置文件已清除成功!", "Configuration file cleared successfully!");
		AddText("配置文件清除失败!", "Failed to clear configuration file!");
		AddText("所有配置已清除成功!", "All configurations cleared successfully!");
		AddText("清除所有配置失败!", "Failed to clear all configurations!");
		AddText("未选择任何任务!", "No tasks selected!");
		AddText("成功选择了 {0} 个任务!", "Successfully selected {0} tasks!");
		AddText("配置格式错误,已清除,请重新配置任务", "Configuration format error, cleared, please reconfigure tasks");
		AddText("未找到匹配的存储标识配置,ToBeAdded保持为空", "No matching storage identifier configuration found, ToBeAdded remains empty");
		AddText("未找到匹配的任务配置,请在任务编辑器中设置", "No matching task configuration found, please set it in the task editor");
		AddText("加载任务配置时出错,请查看日志了解详情", "Error loading task configuration, please check the log for details");
		AddText("已加载 {0} 个重复任务配置", "Loaded {0} repetitive task configurations");
		AddText("无法确定当前场景,任务添加失败!", "Unable to determine current scene, task addition failed!");
		AddText("成功添加了 {0} 个任务!", "Successfully added {0} tasks!");
		AddText("没有添加新任务,可能已全部存在!", "No new tasks added, they may all already exist!");
		AddText("任务添加失败!", "Task addition failed!");
		AddText("无相关配置", "No related configuration");
		AddText("TaskCheatInstanceIsNull", "TaskCheat instance is null");
		AddText("MainloadSceneIDIsNull", "Mainload.SceneID is null");
		AddText("CannotDetermineScene", "Unable to determine current scene, task addition failed!");
		AddText("TaskAddError", "Task addition error: ");
		AddText("AllTasksCleared", "All tasks cleared!");
		AddText("MainloadTaskOrderDataIsNull", "Mainload.TaskOrderData_Now is null");
		AddText("TaskClearError", "Task clear error: ");
		AddText("TaskListIsNull", "Task list is null");
		AddText("CannotConvertStringToInt", "Cannot convert string to integer: {0}");
		AddText("SuccessfullyAddedToBeAddedList", "Successfully added {0} tasks to the to-be-added list");
		AddText("TaskConversionFailed", "{0} tasks conversion failed");
		AddText("AddSelectedTasksError", "Error adding selected tasks: ");
		AddText("ClearedToBeAddedListBeforeRepetitiveAdd", "Cleared to-be-added list before repetitive addition");
		AddText("开始重新从配置文件读取任务", "Starting to read tasks from configuration file again");
		AddText("ReloadedTasksToBeAddedList", "Reloaded {0} tasks to the to-be-added list");
		AddText("NoTasksFoundInConfig", "No tasks found in configuration");
		AddText("ReloadTasksFromConfigError", "Error reloading tasks from configuration: ");
		AddText("SuccessfullyExecutedTaskAdd", "Successfully executed task addition");
		AddText("CannotAddTaskInstanceOrSceneInvalid", "Cannot add task: instance does not exist or scene is invalid");
		AddText("ToBeAddedListEmpty", "To-be-added task list is empty");
		AddText("TaskAddMethodException", "Task addition method exception: ");
		AddText("ClearedToBeAddedListAfterRepetitiveAdd", "Cleared to-be-added list after repetitive addition");
		AddText("存档位置为空,无法加载特定存档的配置文件", "Save location is empty, cannot load configuration file for specific save");
		AddText("读取存档数据后,根据存档位置 {0} 开始查找匹配的配置文件", "After reading save data, start searching for matching configuration file based on save location {0}");
		AddText("当前存储标识: '{0}'", "Current storage identifier: '{0}'");
		AddText("找到与当前存档位置匹配的存储标识,尝试加载配置", "Found storage identifier matching current save location, attempting to load configuration");
		AddText("存储标识存在,但没有找到选中的任务配置", "Storage identifier exists, but no selected task configuration found");
		AddText("配置格式错误,删除存储标识 '{0}' 的配置: {1}", "Configuration format error, deleting configuration for storage identifier '{0}': {1}");
		AddText("配置已成功清除,下次启动将使用默认设置", "Configuration has been successfully cleared, default settings will be used next startup");
		AddText("成功加载匹配的配置文件,添加了 {0} 个任务", "Successfully loaded matching configuration file, added {0} tasks");
		AddText("显示提示信息时出错: {0}", "Error displaying notification: {0}");
		AddText("未知郡县", "Unknown county");
		AddText(",任务奖励:声望+{0}、铜钱+{1}、元宝+{2}", ", Reward: Reputation+{0}, Coins+{1}, Gold+{2}");
	}

	private static void AddText(string chineseText, string englishText)
	{
		textDictionary[chineseText] = englishText;
	}

	public static string GetText(string chineseText)
	{
		if (isChinese)
		{
			return chineseText;
		}
		if (textDictionary.ContainsKey(chineseText))
		{
			return textDictionary[chineseText];
		}
		return chineseText;
	}

	public static string GetFormattedText(string chineseFormat, params object[] args)
	{
		string text = GetText(chineseFormat);
		return string.Format(text, args);
	}

	public static string GetTaskText(List<string> taskTexts)
	{
		if (taskTexts == null || taskTexts.Count == 0)
		{
			return string.Empty;
		}
		int num = ((!isChinese) ? 1 : 0);
		if (num < taskTexts.Count)
		{
			return taskTexts[num];
		}
		return taskTexts[0];
	}
}
public static class PluginInfo
{
	public const string PLUGIN_GUID = "cs.HoLMod.TaskCheat.AnZhi20";

	public const string PLUGIN_NAME = "HoLMod.TaskCheat";

	public const string PLUGIN_VERSION = "2.2.0";
}
[BepInPlugin("cs.HoLMod.TaskCheat.AnZhi20", "HoLMod.TaskCheat", "2.2.0")]
public class TaskCheat : BaseUnityPlugin
{
	private Rect windowRect = new Rect(20f, 20f, 300f, 600f);

	private bool showWindow = false;

	private int windowID = 1000;

	internal static ManualLogSource Log;

	private float scaleFactor = 1f;

	private bool showTaskSelectionWindow = false;

	private Rect taskSelectionWindowRect = new Rect(100f, 100f, 700f, 600f);

	private int taskSelectionWindowID = 2000;

	private Vector2 taskScrollPosition = Vector2.zero;

	private List<bool> taskSelectionStates = new List<bool>();

	private List<List<string>> selectedTasks = new List<List<string>>();

	private bool showAddTaskWindow = false;

	private Rect addTaskWindowRect = new Rect(100f, 100f, 700f, 600f);

	private int addTaskWindowID = 3000;

	private Vector2 addTaskScrollPosition = Vector2.zero;

	private List<bool> addTaskSelectionStates = new List<bool>();

	private bool showConfirmClearAllDialog = false;

	private Rect confirmDialogRect = new Rect(200f, 200f, 300f, 300f);

	private int confirmDialogID = 4000;

	public static TaskCheat Instance { get; private set; }

	public static ConfigEntry<int> TaskCheckInterval { get; private set; }

	private void Awake()
	{
		Instance = this;
		Log = ((BaseUnityPlugin)this).Logger;
		ManualLogSource log = Log;
		if (log != null)
		{
			log.LogInfo((object)"Plugin cs.HoLMod.TaskCheat.AnZhi20 is loaded!");
		}
		TaskCheckInterval = ((BaseUnityPlugin)this).Config.Bind<int>(LanguageManager.GetText("重复任务设置"), LanguageManager.GetText("任务检查间隔(秒)"), 10, LanguageManager.GetText("设置重复任务的检查时间间隔,范围:1-10秒"));
		Harmony.CreateAndPatchAll(typeof(TaskCheat), (string)null);
	}

	public void LoadRepetitiveTaskConfig()
	{
		try
		{
			string storageIdentifier = TaskCheatConfig.GetStorageIdentifier();
			if (string.IsNullOrEmpty(storageIdentifier) || storageIdentifier == "default")
			{
				ManualLogSource log = Log;
				if (log != null)
				{
					log.LogWarning((object)"存储标识无效或为默认值,不加载重复任务配置");
				}
				RepetitiveTaskHandler.ToBeAdded.Clear();
				return;
			}
			List<int> list = TaskCheatConfig.LoadRepetitiveTaskSelection();
			if (list.Count > 0)
			{
				List<List<string>> list2 = new List<List<string>>();
				foreach (int item in list)
				{
					list2.Add(new List<string>
					{
						item.ToString(),
						"0"
					});
				}
				RepetitiveTaskHandler.AddSelectedTasks(list2);
				ManualLogSource log2 = Log;
				if (log2 != null)
				{
					log2.LogInfo((object)LanguageManager.GetFormattedText("已根据配置更新待重复任务列表,共加载{0}个任务", list.Count));
				}
				RepetitiveTaskHandler.TaskAdd();
			}
			else
			{
				ManualLogSource log3 = Log;
				if (log3 != null)
				{
					log3.LogInfo((object)"未加载到重复任务配置,ToBeAdded列表为空");
				}
				RepetitiveTaskHandler.ToBeAdded.Clear();
			}
		}
		catch (Exception ex)
		{
			ManualLogSource log4 = Log;
			if (log4 != null)
			{
				log4.LogError((object)("加载重复任务配置时出错: " + ex.Message));
			}
			ManualLogSource log5 = Log;
			if (log5 != null)
			{
				log5.LogError((object)ex.StackTrace);
			}
		}
	}

	private void Update()
	{
		if (Input.GetKeyDown((KeyCode)285))
		{
			showWindow = !showWindow;
			showTaskSelectionWindow = false;
			showAddTaskWindow = false;
		}
		RepetitiveTaskHandler.RepetitiveTaskAdd();
	}

	private void OnGUI()
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Expected O, but got Unknown
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Expected O, but got Unknown
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Expected O, but got Unknown
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Expected O, but got Unknown
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		if (showWindow)
		{
			windowRect = GUI.Window(windowID, windowRect, new WindowFunction(DrawWindow), "", GUI.skin.window);
		}
		if (showTaskSelectionWindow)
		{
			taskSelectionWindowRect = GUI.Window(taskSelectionWindowID, taskSelectionWindowRect, new WindowFunction(DrawTaskSelectionWindow), "", GUI.skin.window);
		}
		if (showAddTaskWindow)
		{
			addTaskWindowRect = GUI.Window(addTaskWindowID, addTaskWindowRect, new WindowFunction(DrawAddTaskWindow), "", GUI.skin.window);
		}
		if (showConfirmClearAllDialog)
		{
			confirmDialogRect = GUI.Window(confirmDialogID, confirmDialogRect, new WindowFunction(DrawConfirmClearAllDialog), "", GUI.skin.window);
		}
	}

	private void DrawWindow(int windowID)
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Expected O, but got Unknown
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Expected O, but got Unknown
		//IL_00d4: 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_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Expected O, but got Unknown
		//IL_041a: Unknown result type (might be due to invalid IL or missing references)
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.FlexibleSpace();
		GUIStyle val = new GUIStyle(GUI.skin.button)
		{
			fixedWidth = 30f,
			fixedHeight = 30f,
			alignment = (TextAnchor)4
		};
		if (GUILayout.Button(LanguageManager.GetText("关闭"), val, Array.Empty<GUILayoutOption>()))
		{
			showWindow = false;
		}
		GUILayout.EndHorizontal();
		GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
		GUILayout.Space(5f);
		GUIStyle val2 = new GUIStyle(GUI.skin.label)
		{
			fontSize = 16,
			fontStyle = (FontStyle)1,
			alignment = (TextAnchor)4
		};
		GUILayout.Label(LanguageManager.GetText("任务编辑器"), val2, Array.Empty<GUILayoutOption>());
		GUILayout.Space(15f);
		GUIStyle val3 = new GUIStyle(GUI.skin.label)
		{
			fontSize = 14,
			fontStyle = (FontStyle)1
		};
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.Space(20f);
		GUILayout.Label(LanguageManager.GetText("一键清除"), val3, Array.Empty<GUILayoutOption>());
		GUILayout.EndHorizontal();
		GUILayout.Space(5f);
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.Space(40f);
		if (GUILayout.Button(LanguageManager.GetText("清除所有任务"), (GUILayoutOption[])(object)new GUILayoutOption[2]
		{
			GUILayout.Width(200f),
			GUILayout.Height(30f)
		}))
		{
			ClearAllTasks();
		}
		GUILayout.EndHorizontal();
		GUILayout.Space(15f);
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.Space(20f);
		GUILayout.Label(LanguageManager.GetText("任务添加"), val3, Array.Empty<GUILayoutOption>());
		GUILayout.EndHorizontal();
		GUILayout.Space(5f);
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.Space(40f);
		if (GUILayout.Button(LanguageManager.GetText("选择需要添加的任务"), (GUILayoutOption[])(object)new GUILayoutOption[2]
		{
			GUILayout.Width(200f),
			GUILayout.Height(30f)
		}))
		{
			OpenAddTaskWindow();
		}
		GUILayout.EndHorizontal();
		GUILayout.Space(15f);
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.Space(20f);
		GUILayout.Label(LanguageManager.GetText("重复任务"), val3, Array.Empty<GUILayoutOption>());
		GUILayout.EndHorizontal();
		GUILayout.Space(5f);
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.Space(40f);
		if (GUILayout.Button(LanguageManager.GetText("选择需要重复的任务"), (GUILayoutOption[])(object)new GUILayoutOption[2]
		{
			GUILayout.Width(200f),
			GUILayout.Height(30f)
		}))
		{
			OpenTaskSelectionWindow();
		}
		GUILayout.EndHorizontal();
		GUILayout.Space(5f);
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.Space(40f);
		if (GUILayout.Button(LanguageManager.GetText("清除配置文件"), (GUILayoutOption[])(object)new GUILayoutOption[2]
		{
			GUILayout.Width(200f),
			GUILayout.Height(30f)
		}))
		{
			TryClearConfig();
		}
		GUILayout.EndHorizontal();
		GUILayout.EndVertical();
		GUILayout.Space(20f * scaleFactor);
		GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
		GUILayout.Label(LanguageManager.GetText("使用说明:"), GUI.skin.box, Array.Empty<GUILayoutOption>());
		GUILayout.Label(LanguageManager.GetText("1. 请在修改前先保存游戏,以便回档"), Array.Empty<GUILayoutOption>());
		GUILayout.Label(LanguageManager.GetText("2. 按F4键显示/隐藏窗口"), Array.Empty<GUILayoutOption>());
		GUILayout.Label(LanguageManager.GetText("3. 切换模式选择:一键清除/任务添加/重复任务"), Array.Empty<GUILayoutOption>());
		GUILayout.Label("", Array.Empty<GUILayoutOption>());
		GUILayout.Label(LanguageManager.GetText("Mod作者:AnZhi20"), Array.Empty<GUILayoutOption>());
		GUILayout.Label(LanguageManager.GetFormattedText("Mod版本:{0}", "2.2.0"), Array.Empty<GUILayoutOption>());
		GUILayout.EndVertical();
		GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref windowRect)).width, ((Rect)(ref windowRect)).height));
	}

	private void ClearAllTasks()
	{
		try
		{
			TaskClearer.AllTaskClear();
			ManualLogSource log = Log;
			if (log != null)
			{
				log.LogInfo((object)LanguageManager.GetText("所有任务已清除!"));
			}
			ShowNotification(LanguageManager.GetText("任务已清除成功!"));
		}
		catch (Exception ex)
		{
			ManualLogSource log2 = Log;
			if (log2 != null)
			{
				log2.LogError((object)("清除任务时出错: " + ex.Message));
			}
			ShowNotification(LanguageManager.GetText("清除失败: ") + ex.Message);
		}
	}

	public void ShowNotification(string message)
	{
		try
		{
			if (!string.IsNullOrEmpty(message))
			{
				Mainload.Tip_Show.Add(new List<string> { "1", message });
			}
		}
		catch (Exception ex)
		{
			ManualLogSource log = Log;
			if (log != null)
			{
				log.LogError((object)LanguageManager.GetFormattedText("显示提示信息时出错: {0}", ex.Message));
			}
		}
	}

	private void OpenTaskSelectionWindow()
	{
		try
		{
			selectedTasks.Clear();
			taskSelectionStates.Clear();
			if (TaskList.Text_AllTaskOrder != null)
			{
				for (int i = 0; i < TaskList.Text_AllTaskOrder.Count; i++)
				{
					taskSelectionStates.Add(item: false);
				}
				List<int> list = TaskCheatConfig.LoadRepetitiveTaskSelection();
				foreach (int item in list)
				{
					if (item >= 0 && item < taskSelectionStates.Count)
					{
						taskSelectionStates[item] = true;
					}
				}
			}
			showTaskSelectionWindow = true;
		}
		catch (Exception ex)
		{
			ManualLogSource log = Log;
			if (log != null)
			{
				log.LogError((object)("打开任务选择窗口时出错: " + ex.Message));
			}
			ShowNotification(LanguageManager.GetText("打开任务选择窗口失败!"));
		}
	}

	private void DrawTaskSelectionWindow(int windowID)
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Expected O, but got Unknown
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Expected O, but got Unknown
		//IL_00de: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_037f: Unknown result type (might be due to invalid IL or missing references)
		GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.FlexibleSpace();
		GUIStyle val = new GUIStyle(GUI.skin.button)
		{
			fixedWidth = 30f,
			fixedHeight = 30f,
			alignment = (TextAnchor)4
		};
		if (GUILayout.Button(LanguageManager.GetText("关闭"), val, Array.Empty<GUILayoutOption>()))
		{
			showTaskSelectionWindow = false;
		}
		GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.FlexibleSpace();
		GUIStyle val2 = new GUIStyle(GUI.skin.label)
		{
			fontSize = 16,
			fontStyle = (FontStyle)1,
			alignment = (TextAnchor)4
		};
		GUILayout.Label(LanguageManager.GetText("选择要重复添加的任务"), val2, Array.Empty<GUILayoutOption>());
		GUILayout.FlexibleSpace();
		GUILayout.EndHorizontal();
		GUILayout.Space(10f);
		taskScrollPosition = GUILayout.BeginScrollView(taskScrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(400f) });
		if (TaskList.Text_AllTaskOrder != null)
		{
			for (int i = 0; i < TaskList.Text_AllTaskOrder.Count; i++)
			{
				if (i >= taskSelectionStates.Count)
				{
					continue;
				}
				string taskText = LanguageManager.GetTaskText(TaskList.Text_AllTaskOrder[i]);
				string text = taskText.Split(new char[1] { '|' })[0];
				string text2 = text;
				try
				{
					if (TaskList.AllTaskOrderData != null && i < TaskList.AllTaskOrderData.Count)
					{
						List<string> list = TaskList.AllTaskOrderData[i];
						if (list != null && list.Count >= 3)
						{
							string newValue = list[1];
							string text3 = list[0];
							string[] array = list[2].Split(new char[1] { '|' });
							string text4 = ((array.Length != 0) ? array[0] : "0");
							string text5 = ((array.Length > 1) ? array[1] : "0");
							text2 = text.Replace("^", newValue);
							text2 += LanguageManager.GetFormattedText(",任务奖励:声望+{0}、铜钱+{1}、元宝+{2}", text3, text4, text5);
						}
					}
				}
				catch (Exception ex)
				{
					ManualLogSource log = Log;
					if (log != null)
					{
						log.LogError((object)LanguageManager.GetFormattedText("格式化任务显示文本时出错: {0}", ex.Message));
					}
				}
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.FlexibleSpace();
				taskSelectionStates[i] = GUILayout.Toggle(taskSelectionStates[i], text2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(600f) });
				GUILayout.FlexibleSpace();
				GUILayout.EndHorizontal();
				GUILayout.Space(5f);
			}
		}
		GUILayout.EndScrollView();
		GUILayout.Space(20f);
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.FlexibleSpace();
		if (GUILayout.Button(LanguageManager.GetText("确认选择"), (GUILayoutOption[])(object)new GUILayoutOption[2]
		{
			GUILayout.Width(150f),
			GUILayout.Height(30f)
		}))
		{
			ConfirmTaskSelection();
		}
		GUILayout.FlexibleSpace();
		GUILayout.EndHorizontal();
		GUILayout.EndVertical();
		GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref taskSelectionWindowRect)).width, ((Rect)(ref taskSelectionWindowRect)).height));
	}

	private void TryClearConfig()
	{
		try
		{
			string storageIdentifier = TaskCheatConfig.GetStorageIdentifier();
			if (string.IsNullOrEmpty(storageIdentifier))
			{
				ManualLogSource log = Log;
				if (log != null)
				{
					log.LogWarning((object)LanguageManager.GetText("存储标识为空,显示确认清除所有配置对话框"));
				}
				showConfirmClearAllDialog = true;
				return;
			}
			List<int> list = TaskCheatConfig.LoadRepetitiveTaskSelection();
			if (list != null && list.Count > 0)
			{
				if (TaskCheatConfig.ClearConfigByStorageIdentifier(storageIdentifier))
				{
					RepetitiveTaskHandler.ToBeAdded.Clear();
					ManualLogSource log2 = Log;
					if (log2 != null)
					{
						log2.LogInfo((object)LanguageManager.GetText("已清空内存中的待添加任务列表"));
					}
					ShowNotification(LanguageManager.GetText("配置文件已清除成功!"));
				}
				else
				{
					ShowNotification(LanguageManager.GetText("配置文件清除失败!"));
				}
			}
			else
			{
				ManualLogSource log3 = Log;
				if (log3 != null)
				{
					log3.LogWarning((object)LanguageManager.GetText("存储标识无效或对应配置不存在,显示确认清除所有配置对话框"));
				}
				showConfirmClearAllDialog = true;
			}
		}
		catch (Exception ex)
		{
			ManualLogSource log4 = Log;
			if (log4 != null)
			{
				log4.LogError((object)LanguageManager.GetFormattedText("尝试清除配置文件时出错: {0}", ex.Message));
			}
			ManualLogSource log5 = Log;
			if (log5 != null)
			{
				log5.LogError((object)LanguageManager.GetFormattedText("异常堆栈: {0}", ex.StackTrace));
			}
			ShowNotification(LanguageManager.GetFormattedText("操作失败: {0}", ex.Message));
			showConfirmClearAllDialog = true;
		}
	}

	private void DrawConfirmClearAllDialog(int windowID)
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: 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)
		//IL_0040: Expected O, but got Unknown
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: 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_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Expected O, but got Unknown
		//IL_0200: Unknown result type (might be due to invalid IL or missing references)
		GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
		GUILayout.Space(20f);
		GUIStyle val = new GUIStyle(GUI.skin.label)
		{
			fontSize = 14,
			fontStyle = (FontStyle)1,
			alignment = (TextAnchor)4
		};
		GUIStyle val2 = new GUIStyle(GUI.skin.label)
		{
			fontSize = 12,
			alignment = (TextAnchor)4,
			wordWrap = true
		};
		GUILayout.Label(LanguageManager.GetText("确认操作"), val, Array.Empty<GUILayoutOption>());
		GUILayout.Space(10f);
		GUILayout.Label(LanguageManager.GetText("未找到本存档的配置,可能未生成或已删除。"), val2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(40f) });
		GUILayout.Label(LanguageManager.GetText("是否清除所有配置?"), val2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(40f) });
		GUILayout.Space(10f);
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.FlexibleSpace();
		if (GUILayout.Button(LanguageManager.GetText("是"), (GUILayoutOption[])(object)new GUILayoutOption[2]
		{
			GUILayout.Width(80f),
			GUILayout.Height(30f)
		}))
		{
			if (TaskCheatConfig.ClearAllConfig())
			{
				RepetitiveTaskHandler.ToBeAdded.Clear();
				ManualLogSource log = Log;
				if (log != null)
				{
					log.LogInfo((object)LanguageManager.GetText("已清空内存中的待添加任务列表"));
				}
				ShowNotification(LanguageManager.GetText("所有配置已清除成功!"));
			}
			else
			{
				ShowNotification(LanguageManager.GetText("清除所有配置失败!"));
			}
			showConfirmClearAllDialog = false;
		}
		GUILayout.Space(20f);
		if (GUILayout.Button(LanguageManager.GetText("否"), (GUILayoutOption[])(object)new GUILayoutOption[2]
		{
			GUILayout.Width(80f),
			GUILayout.Height(30f)
		}))
		{
			showConfirmClearAllDialog = false;
		}
		GUILayout.FlexibleSpace();
		GUILayout.EndHorizontal();
		GUILayout.EndVertical();
		GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref confirmDialogRect)).width, ((Rect)(ref confirmDialogRect)).height));
	}

	private void ConfirmTaskSelection()
	{
		try
		{
			List<List<string>> list = new List<List<string>>();
			List<int> list2 = new List<int>();
			if (TaskList.Text_AllTaskOrder != null && taskSelectionStates.Count > 0)
			{
				for (int i = 0; i < taskSelectionStates.Count && i < TaskList.Text_AllTaskOrder.Count; i++)
				{
					if (taskSelectionStates[i])
					{
						list.Add(new List<string>
						{
							i.ToString(),
							"0"
						});
						list2.Add(i);
					}
				}
			}
			if (list.Count > 0)
			{
				RepetitiveTaskHandler.AddSelectedTasks(list);
				ShowNotification(LanguageManager.GetFormattedText("成功选择了 {0} 个任务!", list.Count));
			}
			else
			{
				ShowNotification(LanguageManager.GetText("未选择任何任务!"));
			}
			TaskCheatConfig.SaveRepetitiveTaskSelection(list2);
			showTaskSelectionWindow = false;
		}
		catch (Exception ex)
		{
			ManualLogSource log = Log;
			if (log != null)
			{
				log.LogError((object)LanguageManager.GetFormattedText("确认任务选择时出错: {0}", ex.Message));
			}
			ShowNotification(LanguageManager.GetText("确认任务选择失败!"));
		}
	}

	private void OpenAddTaskWindow()
	{
		try
		{
			addTaskSelectionStates.Clear();
			if (TaskList.Text_AllTaskOrder != null)
			{
				for (int i = 0; i < TaskList.Text_AllTaskOrder.Count; i++)
				{
					addTaskSelectionStates.Add(item: false);
				}
			}
			showAddTaskWindow = true;
		}
		catch (Exception ex)
		{
			ManualLogSource log = Log;
			if (log != null)
			{
				log.LogError((object)LanguageManager.GetFormattedText("打开任务添加窗口时出错: {0}", ex.Message));
			}
			ShowNotification(LanguageManager.GetText("打开任务添加窗口失败!"));
		}
	}

	private void DrawAddTaskWindow(int windowID)
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Expected O, but got Unknown
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Expected O, but got Unknown
		//IL_00de: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_038f: Unknown result type (might be due to invalid IL or missing references)
		GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.FlexibleSpace();
		GUIStyle val = new GUIStyle(GUI.skin.button)
		{
			fixedWidth = 30f,
			fixedHeight = 30f,
			alignment = (TextAnchor)4
		};
		if (GUILayout.Button(LanguageManager.GetText("关闭"), val, Array.Empty<GUILayoutOption>()))
		{
			showAddTaskWindow = false;
		}
		GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.FlexibleSpace();
		GUIStyle val2 = new GUIStyle(GUI.skin.label)
		{
			fontSize = 16,
			fontStyle = (FontStyle)1,
			alignment = (TextAnchor)4
		};
		GUILayout.Label(LanguageManager.GetText("选择要添加的任务"), val2, Array.Empty<GUILayoutOption>());
		GUILayout.FlexibleSpace();
		GUILayout.EndHorizontal();
		GUILayout.Space(10f);
		addTaskScrollPosition = GUILayout.BeginScrollView(addTaskScrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(400f) });
		if (TaskList.Text_AllTaskOrder != null)
		{
			for (int i = 0; i < TaskList.Text_AllTaskOrder.Count; i++)
			{
				if (i >= addTaskSelectionStates.Count)
				{
					continue;
				}
				string taskText = LanguageManager.GetTaskText(TaskList.Text_AllTaskOrder[i]);
				string text = taskText.Split(new char[1] { '|' })[0];
				string text2 = text;
				try
				{
					if (TaskList.AllTaskOrderData != null && i < TaskList.AllTaskOrderData.Count)
					{
						List<string> list = TaskList.AllTaskOrderData[i];
						if (list != null && list.Count >= 3)
						{
							string newValue = list[1];
							string text3 = list[0];
							string[] array = list[2].Split(new char[1] { '|' });
							string text4 = ((array.Length != 0) ? array[0] : "0");
							string text5 = ((array.Length > 1) ? array[1] : "0");
							text2 = text.Replace("^", newValue);
							text2 = text2 + ",任务奖励:声望+" + text3 + "、铜钱+" + text4 + "、元宝+" + text5;
						}
					}
				}
				catch (Exception ex)
				{
					ManualLogSource log = Log;
					if (log != null)
					{
						log.LogError((object)LanguageManager.GetFormattedText("格式化任务显示文本时出错: {0}", ex.Message));
					}
				}
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Space(20f);
				addTaskSelectionStates[i] = GUILayout.Toggle(addTaskSelectionStates[i], text2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(600f) });
				GUILayout.EndHorizontal();
				GUILayout.Space(5f);
			}
		}
		GUILayout.EndScrollView();
		GUILayout.Space(20f);
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.FlexibleSpace();
		if (GUILayout.Button(LanguageManager.GetText("确认添加"), (GUILayoutOption[])(object)new GUILayoutOption[2]
		{
			GUILayout.Width(150f),
			GUILayout.Height(30f)
		}))
		{
			ConfirmAddTaskSelection();
		}
		GUILayout.FlexibleSpace();
		GUILayout.EndHorizontal();
		GUILayout.EndVertical();
		GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref addTaskWindowRect)).width, ((Rect)(ref addTaskWindowRect)).height));
	}

	private void ConfirmAddTaskSelection()
	{
		try
		{
			List<List<string>> list = new List<List<string>>();
			if (TaskList.Text_AllTaskOrder != null && addTaskSelectionStates.Count > 0)
			{
				for (int i = 0; i < addTaskSelectionStates.Count && i < TaskList.Text_AllTaskOrder.Count; i++)
				{
					if (addTaskSelectionStates[i])
					{
						list.Add(new List<string>
						{
							i.ToString(),
							"0"
						});
					}
				}
			}
			if (list.Count > 0)
			{
				AddTaskHandler.AddTasksToCurrent(list);
			}
			showAddTaskWindow = false;
		}
		catch (Exception ex)
		{
			ManualLogSource log = Log;
			if (log != null)
			{
				log.LogError((object)LanguageManager.GetFormattedText("确认任务添加时出错: {0}", ex.Message));
			}
			ShowNotification(LanguageManager.GetText("确认任务添加失败!"));
		}
	}
}
[HarmonyPatch(typeof(SaveData))]
[HarmonyPatch("ReadGameData")]
public static class SaveDataReadGameDataPatch
{
	private static void Postfix()
	{
		try
		{
			string cunDangIndex_now = Mainload.CunDangIndex_now;
			if ((Object)(object)TaskCheat.Instance != (Object)null)
			{
				if (string.IsNullOrEmpty(cunDangIndex_now))
				{
					ManualLogSource log = TaskCheat.Log;
					if (log != null)
					{
						log.LogWarning((object)LanguageManager.GetText("存档位置为空,无法加载特定存档的配置文件"));
					}
					return;
				}
				ManualLogSource log2 = TaskCheat.Log;
				if (log2 != null)
				{
					log2.LogInfo((object)LanguageManager.GetFormattedText("读取存档数据后,根据存档位置 {0} 开始查找匹配的配置文件", cunDangIndex_now));
				}
				RepetitiveTaskHandler.ToBeAdded = new List<List<int>>();
				bool flag = false;
				string storageIdentifier = TaskCheatConfig.GetStorageIdentifier();
				ManualLogSource log3 = TaskCheat.Log;
				if (log3 != null)
				{
					log3.LogInfo((object)LanguageManager.GetFormattedText("当前存储标识: '{0}'", storageIdentifier));
				}
				if (!string.IsNullOrEmpty(storageIdentifier) && storageIdentifier != "default" && storageIdentifier.Contains(cunDangIndex_now))
				{
					ManualLogSource log4 = TaskCheat.Log;
					if (log4 != null)
					{
						log4.LogInfo((object)LanguageManager.GetText("找到与当前存档位置匹配的存储标识,尝试加载配置"));
					}
					try
					{
						List<int> list = TaskCheatConfig.LoadRepetitiveTaskSelection();
						if (list.Count > 0)
						{
							List<List<string>> list2 = new List<List<string>>();
							foreach (int item in list)
							{
								list2.Add(new List<string> { item.ToString() });
							}
							RepetitiveTaskHandler.AddSelectedTasks(list2);
							flag = true;
							ManualLogSource log5 = TaskCheat.Log;
							if (log5 != null)
							{
								log5.LogInfo((object)LanguageManager.GetFormattedText("成功加载匹配的配置文件,添加了 {0} 个任务", RepetitiveTaskHandler.ToBeAdded.Count));
							}
							TaskCheat.Instance?.ShowNotification(LanguageManager.GetFormattedText("已加载 {0} 个重复任务配置", RepetitiveTaskHandler.ToBeAdded.Count));
						}
						else
						{
							ManualLogSource log6 = TaskCheat.Log;
							if (log6 != null)
							{
								log6.LogInfo((object)LanguageManager.GetText("存储标识存在,但没有找到选中的任务配置"));
							}
						}
					}
					catch (Exception ex)
					{
						ManualLogSource log7 = TaskCheat.Log;
						if (log7 != null)
						{
							log7.LogError((object)LanguageManager.GetFormattedText("配置格式错误,删除存储标识 '{0}' 的配置: {1}", storageIdentifier, ex.Message));
						}
						ManualLogSource log8 = TaskCheat.Log;
						if (log8 != null)
						{
							log8.LogError((object)ex.StackTrace);
						}
						if (TaskCheatConfig.ClearConfigByStorageIdentifier(storageIdentifier))
						{
							ManualLogSource log9 = TaskCheat.Log;
							if (log9 != null)
							{
								log9.LogInfo((object)LanguageManager.GetText("配置已成功清除,下次启动将使用默认设置"));
							}
							TaskCheat.Instance?.ShowNotification(LanguageManager.GetText("配置格式错误,已清除,请重新配置任务"));
						}
					}
				}
				else if (string.IsNullOrEmpty(storageIdentifier))
				{
					ManualLogSource log10 = TaskCheat.Log;
					if (log10 != null)
					{
						log10.LogWarning((object)LanguageManager.GetText("存储标识为空"));
					}
				}
				else if (storageIdentifier == "default")
				{
					ManualLogSource log11 = TaskCheat.Log;
					if (log11 != null)
					{
						log11.LogWarning((object)LanguageManager.GetText("当前使用默认存储标识,不会加载特定存档的配置"));
					}
				}
				else if (!storageIdentifier.Contains(cunDangIndex_now))
				{
					ManualLogSource log12 = TaskCheat.Log;
					if (log12 != null)
					{
						log12.LogWarning((object)LanguageManager.GetFormattedText("存储标识 '{0}' 不包含当前存档位置 '{1}'", storageIdentifier, cunDangIndex_now));
					}
				}
				if (!flag)
				{
					ManualLogSource log13 = TaskCheat.Log;
					if (log13 != null)
					{
						log13.LogInfo((object)LanguageManager.GetText("未找到匹配的存储标识配置,ToBeAdded保持为空"));
					}
					TaskCheat.Instance?.ShowNotification("未找到匹配的任务配置,请在任务编辑器中设置");
				}
			}
			else
			{
				ManualLogSource log14 = TaskCheat.Log;
				if (log14 != null)
				{
					log14.LogError((object)LanguageManager.GetText("TaskCheat.Instance为null,无法加载配置"));
				}
			}
		}
		catch (Exception ex2)
		{
			ManualLogSource log15 = TaskCheat.Log;
			if (log15 != null)
			{
				log15.LogError((object)LanguageManager.GetFormattedText("在ReadGameData后加载配置时出错: {0}", ex2.Message));
			}
			ManualLogSource log16 = TaskCheat.Log;
			if (log16 != null)
			{
				log16.LogError((object)ex2.StackTrace);
			}
			RepetitiveTaskHandler.ToBeAdded = new List<List<int>>();
			if ((Object)(object)TaskCheat.Instance != (Object)null)
			{
				TaskCheat.Instance?.ShowNotification(LanguageManager.GetText("加载任务配置时出错,请查看日志了解详情"));
			}
		}
	}
}
public static class RepetitiveTaskHandler
{
	public static List<List<int>> ToBeAdded = new List<List<int>>();

	private static DateTime lastAddTime = DateTime.MinValue;

	private static int checkIntervalSeconds = -1;

	public static void AddSelectedTasks(List<List<string>> selectedTasks)
	{
		try
		{
			if (selectedTasks == null)
			{
				ManualLogSource log = TaskCheat.Log;
				if (log != null)
				{
					log.LogWarning((object)LanguageManager.GetText("TaskListIsNull"));
				}
				return;
			}
			ToBeAdded.Clear();
			if (selectedTasks.Count <= 0)
			{
				return;
			}
			int num = 0;
			int num2 = 0;
			foreach (List<string> selectedTask in selectedTasks)
			{
				if (selectedTask == null || selectedTask.Count == 0)
				{
					num2++;
					continue;
				}
				List<int> list = new List<int>();
				bool flag = false;
				foreach (string item in selectedTask)
				{
					if (int.TryParse(item, out var result))
					{
						list.Add(result);
						flag = true;
					}
					else if (!string.IsNullOrEmpty(item))
					{
						ManualLogSource log2 = TaskCheat.Log;
						if (log2 != null)
						{
							log2.LogWarning((object)LanguageManager.GetFormattedText("CannotConvertStringToInt", item));
						}
					}
				}
				if (flag)
				{
					ToBeAdded.Add(list);
					num++;
				}
				else
				{
					num2++;
				}
			}
			if (num > 0)
			{
				ManualLogSource log3 = TaskCheat.Log;
				if (log3 != null)
				{
					log3.LogInfo((object)LanguageManager.GetFormattedText("SuccessfullyAddedToBeAddedList", num));
				}
			}
			if (num2 > 0)
			{
				ManualLogSource log4 = TaskCheat.Log;
				if (log4 != null)
				{
					log4.LogWarning((object)LanguageManager.GetFormattedText("TaskConversionFailed", num2));
				}
			}
		}
		catch (Exception ex)
		{
			ManualLogSource log5 = TaskCheat.Log;
			if (log5 != null)
			{
				log5.LogError((object)(LanguageManager.GetText("AddSelectedTasksError") + ex.Message));
			}
			ManualLogSource log6 = TaskCheat.Log;
			if (log6 != null)
			{
				log6.LogError((object)ex.StackTrace);
			}
		}
	}

	private static DateTime GetCurrentDateTime()
	{
		try
		{
			return DateTime.Now;
		}
		catch
		{
			try
			{
				TimeZoneInfo destinationTimeZone = TimeZoneInfo.FindSystemTimeZoneById("China Standard Time");
				return TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, destinationTimeZone);
			}
			catch
			{
				return DateTime.UtcNow.AddHours(8.0);
			}
		}
	}

	public static void RepetitiveTaskAdd()
	{
		DateTime currentDateTime = GetCurrentDateTime();
		if ((currentDateTime - lastAddTime).TotalSeconds >= (double)checkIntervalSeconds && checkIntervalSeconds > 0)
		{
			if (ToBeAdded != null)
			{
				ToBeAdded.Clear();
				ManualLogSource log = TaskCheat.Log;
				if (log != null)
				{
					log.LogInfo((object)LanguageManager.GetText("ClearedToBeAddedListBeforeRepetitiveAdd"));
				}
			}
			checkIntervalSeconds = TaskCheatConfig.LoadCheckInterval();
			ReloadTaskConfig();
			TaskAdd();
			lastAddTime = currentDateTime;
		}
		else if (checkIntervalSeconds == -1)
		{
			checkIntervalSeconds = TaskCheatConfig.LoadCheckInterval();
			lastAddTime = currentDateTime;
		}
	}

	private static void ReloadTaskConfig()
	{
		try
		{
			if (!((Object)(object)TaskCheat.Instance != (Object)null) || string.IsNullOrEmpty(Mainload.SceneID))
			{
				return;
			}
			string[] array = Mainload.SceneID.Split(new char[1] { '|' });
			if (array.Length != 0)
			{
				string text = array[0];
				switch (text)
				{
				default:
					if (!(text == "F"))
					{
						break;
					}
					goto case "M";
				case "M":
				case "Z":
				case "S":
				case "H":
					try
					{
						ManualLogSource log = TaskCheat.Log;
						if (log != null)
						{
							log.LogInfo((object)LanguageManager.GetText("开始重新从配置文件读取任务"));
						}
						List<int> list = TaskCheatConfig.LoadRepetitiveTaskSelection();
						if (list.Count > 0)
						{
							foreach (int item2 in list)
							{
								List<int> item = new List<int> { item2, 0 };
								ToBeAdded.Add(item);
							}
							ManualLogSource log2 = TaskCheat.Log;
							if (log2 != null)
							{
								log2.LogInfo((object)LanguageManager.GetFormattedText("ReloadedTasksToBeAddedList", ToBeAdded.Count));
							}
						}
						else
						{
							ManualLogSource log3 = TaskCheat.Log;
							if (log3 != null)
							{
								log3.LogInfo((object)LanguageManager.GetText("NoTasksFoundInConfig"));
							}
						}
					}
					catch (Exception ex)
					{
						ManualLogSource log4 = TaskCheat.Log;
						if (log4 != null)
						{
							log4.LogError((object)(LanguageManager.GetText("ReloadTasksFromConfigError") + ex.Message));
						}
						ManualLogSource log5 = TaskCheat.Log;
						if (log5 != null)
						{
							log5.LogError((object)ex.StackTrace);
						}
					}
					break;
				}
				text = null;
			}
			array = null;
		}
		catch (Exception ex2)
		{
			ManualLogSource log6 = TaskCheat.Log;
			if (log6 != null)
			{
				log6.LogError((object)("重新加载任务配置时出错: " + ex2.Message));
			}
			ManualLogSource log7 = TaskCheat.Log;
			if (log7 != null)
			{
				log7.LogError((object)ex2.StackTrace);
			}
		}
	}

	public static void TaskAdd()
	{
		try
		{
			if (ToBeAdded != null && ToBeAdded.Count > 0)
			{
				List<List<string>> list = new List<List<string>>();
				foreach (List<int> item in ToBeAdded)
				{
					List<string> list2 = new List<string>();
					foreach (int item2 in item)
					{
						list2.Add(item2.ToString());
					}
					list.Add(list2);
				}
				string[] array = null;
				string value = null;
				if (!string.IsNullOrEmpty(Mainload.SceneID))
				{
					array = Mainload.SceneID.Split(new char[1] { '|' });
					if (array.Length != 0)
					{
						value = array[0];
					}
				}
				if ((Object)(object)TaskCheat.Instance != (Object)null && !string.IsNullOrEmpty(value))
				{
					AddTaskHandler.AddTasksToCurrent(list);
					ManualLogSource log = TaskCheat.Log;
					if (log != null)
					{
						log.LogInfo((object)LanguageManager.GetText("SuccessfullyExecutedTaskAdd"));
					}
				}
				else
				{
					ManualLogSource log2 = TaskCheat.Log;
					if (log2 != null)
					{
						log2.LogWarning((object)LanguageManager.GetText("CannotAddTaskInstanceOrSceneInvalid"));
					}
				}
			}
			else
			{
				ManualLogSource log3 = TaskCheat.Log;
				if (log3 != null)
				{
					log3.LogInfo((object)LanguageManager.GetText("ToBeAddedListEmpty"));
				}
			}
		}
		catch (Exception ex)
		{
			ManualLogSource log4 = TaskCheat.Log;
			if (log4 != null)
			{
				log4.LogError((object)(LanguageManager.GetText("TaskAddMethodException") + ex.Message));
			}
			ManualLogSource log5 = TaskCheat.Log;
			if (log5 != null)
			{
				log5.LogError((object)ex.StackTrace);
			}
		}
		finally
		{
			if (ToBeAdded != null)
			{
				ToBeAdded.Clear();
				ManualLogSource log6 = TaskCheat.Log;
				if (log6 != null)
				{
					log6.LogInfo((object)LanguageManager.GetText("ClearedToBeAddedListAfterRepetitiveAdd"));
				}
			}
			GC.Collect();
			GC.WaitForPendingFinalizers();
		}
	}
}
public static class TaskCheatConfig
{
	private const int DefaultCheckIntervalSeconds = 10;

	private const int MinCheckIntervalSeconds = 1;

	private const int MaxCheckIntervalSeconds = 10;

	public const string DefaultStorageIdentifier = "default";

	private const string FamilyDataKeyDelimiter = "|";

	private const string ConfigKeyPrefix = "TaskCheat_";

	private const string SelectedTasksKeySuffix = "_SelectedTasks";

	private const string LastTimeRecordKeySuffix = "_LastTimeRecord";

	private const string CheckIntervalKeySuffix = "_CheckInterval";

	private static string[] JunList = new string[12]
	{
		"南郡", "三川郡", "蜀郡", "丹阳郡", "陈留郡", "长沙郡", "会稽郡", "广陵郡", "太原郡", "益州郡",
		"南海郡", "云南郡"
	};

	private static string[][] XianList = new string[12][]
	{
		new string[8] { "临沮", "襄樊", "宜城", "麦城", "华容", "郢亭", "江陵", "夷陵" },
		new string[6] { "平阳", "荥阳", "原武", "阳武", "新郑", "宜阳" },
		new string[6] { "邛崃", "郫县", "什邡", "绵竹", "新都", "成都" },
		new string[6] { "秣陵", "江乘", "江宁", "溧阳", "建邺", "永世" },
		new string[6] { "长垣", "济阳", "成武", "襄邑", "宁陵", "封丘" },
		new string[8] { "零陵", "益阳", "湘县", "袁州", "庐陵", "衡山", "建宁", "桂阳" },
		new string[4] { "曲阿", "松江", "山阴", "余暨" },
		new string[4] { "平安", "射阳", "海陵", "江都" },
		new string[8] { "大陵", "晋阳", "九原", "石城", "阳曲", "魏榆", "孟县", "中都" },
		new string[8] { "连然", "谷昌", "同劳", "昆泽", "滇池", "俞元", "胜休", "南安" },
		new string[6] { "四会", "阳山", "龙川", "揭岭", "罗阳", "善禺" },
		new string[8] { "云平", "叶榆", "永宁", "遂久", "姑复", "蜻陵", "弄栋", "邪龙" }
	};

	private static string GetJunXianNameFromIndex(int junIndex, int xianIndex)
	{
		try
		{
			if (junIndex >= 0 && junIndex < JunList.Length && xianIndex >= 0 && xianIndex < XianList[junIndex].Length)
			{
				return JunList[junIndex] + XianList[junIndex][xianIndex];
			}
			return LanguageManager.GetText("未知郡县");
		}
		catch (Exception ex)
		{
			ManualLogSource log = TaskCheat.Log;
			if (log != null)
			{
				log.LogError((object)(LanguageManager.GetText("获取郡县名称失败: ") + ex.Message));
			}
			return LanguageManager.GetText("未知郡县");
		}
	}

	public static string GetStorageIdentifier()
	{
		try
		{
			if (Mainload.FamilyData != null && Mainload.FamilyData.Count >= 2)
			{
				if (Mainload.FamilyData[0] == null || Mainload.FamilyData[1] == null)
				{
					ManualLogSource log = TaskCheat.Log;
					if (log != null)
					{
						log.LogWarning((object)LanguageManager.GetText("FamilyDataNullOrEmptyWarning"));
					}
					return LanguageManager.GetText("无相关配置");
				}
				string text = Mainload.FamilyData[0].ToString();
				string text2 = Mainload.FamilyData[1].ToString();
				string text3 = Mainload.CunDangIndex_now?.ToString() ?? "未知";
				string text4 = "未知郡县";
				if (!string.IsNullOrEmpty(text) && text.Contains("|"))
				{
					try
					{
						string[] array = text.Split(new char[1] { "|"[0] });
						if (array.Length >= 2 && int.TryParse(array[0], out var result) && int.TryParse(array[1], out var result2))
						{
							text4 = GetJunXianNameFromIndex(result, result2);
						}
					}
					catch (Exception ex)
					{
						ManualLogSource log2 = TaskCheat.Log;
						if (log2 != null)
						{
							log2.LogWarning((object)(LanguageManager.GetText("ParseCountyInfoError") + ex.Message));
						}
					}
				}
				return text4 + text2 + "家(存档位置:" + text3 + ")";
			}
		}
		catch (Exception ex2)
		{
			ManualLogSource log3 = TaskCheat.Log;
			if (log3 != null)
			{
				log3.LogError((object)(LanguageManager.GetText("GetStorageIdentifierError") + ex2.Message));
			}
			ManualLogSource log4 = TaskCheat.Log;
			if (log4 != null)
			{
				log4.LogError((object)ex2.StackTrace);
			}
		}
		return LanguageManager.GetText("无相关配置");
	}

	public static void SaveRepetitiveTaskSelection(List<int> selectedTaskIndices)
	{
		try
		{
			if ((Object)(object)TaskCheat.Instance == (Object)null)
			{
				ManualLogSource log = TaskCheat.Log;
				if (log != null)
				{
					log.LogWarning((object)LanguageManager.GetText("TaskCheatInstanceIsNull"));
				}
				return;
			}
			string storageIdentifier = GetStorageIdentifier();
			string uniqueConfigKey = GetUniqueConfigKey(storageIdentifier, "_SelectedTasks");
			string text = string.Join(",", selectedTaskIndices);
			ConfigEntry<string> val = ((BaseUnityPlugin)TaskCheat.Instance).Config.Bind<string>("重复任务配置", uniqueConfigKey, text, "存储标识 [" + storageIdentifier + "] 的重复任务选择配置");
			val.Value = text;
			((BaseUnityPlugin)TaskCheat.Instance).Config.Save();
			ManualLogSource log2 = TaskCheat.Log;
			if (log2 != null)
			{
				log2.LogInfo((object)LanguageManager.GetFormattedText("SavedRepetitiveTaskSelectionConfig", storageIdentifier));
			}
		}
		catch (Exception ex)
		{
			ManualLogSource log3 = TaskCheat.Log;
			if (log3 != null)
			{
				log3.LogError((object)(LanguageManager.GetText("SaveConfigFailed") + ex.Message));
			}
		}
	}

	private static string GetUniqueConfigKey(string storageIdentifier, string suffix)
	{
		string text = Regex.Replace(storageIdentifier, "[^\\w.-]", "_");
		if (text.Length > 50)
		{
			text = text.Substring(0, 50);
		}
		return "TaskCheat_" + text + suffix;
	}

	public static List<int> LoadRepetitiveTaskSelection()
	{
		try
		{
			if ((Object)(object)TaskCheat.Instance == (Object)null)
			{
				ManualLogSource log = TaskCheat.Log;
				if (log != null)
				{
					log.LogWarning((object)LanguageManager.GetText("TaskCheatInstanceIsNull"));
				}
				return new List<int>();
			}
			string storageIdentifier = GetStorageIdentifier();
			if (storageIdentifier == "无相关配置")
			{
				ManualLogSource log2 = TaskCheat.Log;
				if (log2 != null)
				{
					log2.LogInfo((object)LanguageManager.GetText("StorageIdentifierIsDefaultValue"));
				}
				return new List<int>();
			}
			string uniqueConfigKey = GetUniqueConfigKey(storageIdentifier, "_SelectedTasks");
			ManualLogSource log3 = TaskCheat.Log;
			if (log3 != null)
			{
				log3.LogInfo((object)LanguageManager.GetFormattedText("TryLoadRepetitiveTaskConfig", storageIdentifier, uniqueConfigKey));
			}
			string configValueFromBepInEx = GetConfigValueFromBepInEx("重复任务配置", uniqueConfigKey);
			ManualLogSource log4 = TaskCheat.Log;
			if (log4 != null)
			{
				log4.LogInfo((object)LanguageManager.GetFormattedText("RetrievedConfigValue", configValueFromBepInEx));
			}
			if (!string.IsNullOrEmpty(configValueFromBepInEx))
			{
				int result;
				List<int> list = (from s in configValueFromBepInEx.Split(new char[1] { ',' })
					where int.TryParse(s, out result)
					select s).Select(int.Parse).ToList();
				ManualLogSource log5 = TaskCheat.Log;
				if (log5 != null)
				{
					log5.LogInfo((object)LanguageManager.GetFormattedText("LoadedRepetitiveTaskConfig", list.Count, storageIdentifier));
				}
				return list;
			}
			ManualLogSource log6 = TaskCheat.Log;
			if (log6 != null)
			{
				log6.LogInfo((object)LanguageManager.GetText("NoRepetitiveTaskSelectionConfigFound"));
			}
		}
		catch (Exception ex)
		{
			ManualLogSource log7 = TaskCheat.Log;
			if (log7 != null)
			{
				log7.LogError((object)(LanguageManager.GetText("LoadConfigFailed") + ex.Message));
			}
			ManualLogSource log8 = TaskCheat.Log;
			if (log8 != null)
			{
				log8.LogError((object)ex.StackTrace);
			}
		}
		return new List<int>();
	}

	private static string GetConfigValueFromBepInEx(string section, string key)
	{
		if ((Object)(object)TaskCheat.Instance == (Object)null)
		{
			return string.Empty;
		}
		try
		{
			ConfigEntry<string> val = ((BaseUnityPlugin)TaskCheat.Instance).Config.Bind<string>(section, key, "", (ConfigDescription)null);
			return val.Value;
		}
		catch (Exception ex)
		{
			ManualLogSource log = TaskCheat.Log;
			if (log != null)
			{
				log.LogError((object)(LanguageManager.GetText("GetConfigValueError") + ex.Message));
			}
			return string.Empty;
		}
	}

	public static void SaveCheckInterval(int intervalSeconds)
	{
		try
		{
			int num = ValidateCheckInterval(intervalSeconds);
			if ((Object)(object)TaskCheat.Instance == (Object)null)
			{
				ManualLogSource log = TaskCheat.Log;
				if (log != null)
				{
					log.LogWarning((object)LanguageManager.GetText("TaskCheatInstanceIsNull"));
				}
				return;
			}
			string storageIdentifier = GetStorageIdentifier();
			string uniqueConfigKey = GetUniqueConfigKey(storageIdentifier, "_CheckInterval");
			ConfigEntry<int> val = ((BaseUnityPlugin)TaskCheat.Instance).Config.Bind<int>(LanguageManager.GetText("重复任务设置"), uniqueConfigKey, num, LanguageManager.GetFormattedText("存储标识 [{0}] 的任务检查间隔(秒)", storageIdentifier));
			val.Value = num;
			((BaseUnityPlugin)TaskCheat.Instance).Config.Save();
			ManualLogSource log2 = TaskCheat.Log;
			if (log2 != null)
			{
				log2.LogInfo((object)LanguageManager.GetFormattedText("SavedCheckIntervalConfig", num, storageIdentifier));
			}
		}
		catch (Exception ex)
		{
			ManualLogSource log3 = TaskCheat.Log;
			if (log3 != null)
			{
				log3.LogError((object)(LanguageManager.GetText("SaveCheckIntervalConfigFailed") + ex.Message));
			}
			ManualLogSource log4 = TaskCheat.Log;
			if (log4 != null)
			{
				log4.LogError((object)ex.StackTrace);
			}
		}
	}

	public static int LoadCheckInterval()
	{
		try
		{
			if ((Object)(object)TaskCheat.Instance == (Object)null)
			{
				ManualLogSource log = TaskCheat.Log;
				if (log != null)
				{
					log.LogWarning((object)LanguageManager.GetFormattedText("TaskCheatInstanceIsNullUsingDefaultInterval", 10));
				}
				return 10;
			}
			string storageIdentifier = GetStorageIdentifier();
			string uniqueConfigKey = GetUniqueConfigKey(storageIdentifier, "_CheckInterval");
			ConfigEntry<int> val = ((BaseUnityPlugin)TaskCheat.Instance).Config.Bind<int>(LanguageManager.GetText("重复任务设置"), uniqueConfigKey, 10, LanguageManager.GetFormattedText("存储标识 [{0}] 的任务检查间隔(秒)", storageIdentifier));
			int value = val.Value;
			int num = ValidateCheckInterval(value);
			if (num != value)
			{
				val.Value = num;
				((BaseUnityPlugin)TaskCheat.Instance).Config.Save();
				ManualLogSource log2 = TaskCheat.Log;
				if (log2 != null)
				{
					log2.LogInfo((object)LanguageManager.GetFormattedText("CheckIntervalAdjustedToValidRange", num, storageIdentifier));
				}
			}
			else
			{
				ManualLogSource log3 = TaskCheat.Log;
				if (log3 != null)
				{
					log3.LogInfo((object)LanguageManager.GetFormattedText("LoadedCheckIntervalFromBepInEx", num, storageIdentifier));
				}
			}
			return num;
		}
		catch (Exception ex)
		{
			ManualLogSource log4 = TaskCheat.Log;
			if (log4 != null)
			{
				log4.LogError((object)(LanguageManager.GetText("LoadCheckIntervalFromBepInExFailed") + ex.Message));
			}
			ManualLogSource log5 = TaskCheat.Log;
			if (log5 != null)
			{
				log5.LogError((object)ex.StackTrace);
			}
		}
		return 10;
	}

	private static int ValidateCheckInterval(int intervalSeconds)
	{
		if (intervalSeconds < 1 || intervalSeconds > 10)
		{
			ManualLogSource log = TaskCheat.Log;
			if (log != null)
			{
				log.LogWarning((object)LanguageManager.GetFormattedText("CheckIntervalOutOfValidRange", 1, 10, 10));
			}
			return 10;
		}
		return intervalSeconds;
	}

	public static void SaveLastTimeRecord(int year, int month, int day)
	{
		try
		{
			if ((Object)(object)TaskCheat.Instance == (Object)null)
			{
				ManualLogSource log = TaskCheat.Log;
				if (log != null)
				{
					log.LogWarning((object)LanguageManager.GetText("TaskCheatInstanceIsNull"));
				}
				return;
			}
			string storageIdentifier = GetStorageIdentifier();
			string uniqueConfigKey = GetUniqueConfigKey(storageIdentifier, "_LastTimeRecord");
			string text = $"{year},{month},{day}";
			ConfigEntry<string> val = ((BaseUnityPlugin)TaskCheat.Instance).Config.Bind<string>("时间记录配置", uniqueConfigKey, text, "存储标识 [" + storageIdentifier + "] 的最后记录时间");
			val.Value = text;
			((BaseUnityPlugin)TaskCheat.Instance).Config.Save();
			ManualLogSource log2 = TaskCheat.Log;
			if (log2 != null)
			{
				log2.LogInfo((object)LanguageManager.GetFormattedText("SavedTimeRecordConfig", year, month, day, storageIdentifier));
			}
		}
		catch (Exception ex)
		{
			ManualLogSource log3 = TaskCheat.Log;
			if (log3 != null)
			{
				log3.LogError((object)(LanguageManager.GetText("SaveTimeRecordConfigFailed") + ex.Message));
			}
		}
	}

	public static bool LoadLastTimeRecord(out int year, out int month, out int day)
	{
		year = -1;
		month = -1;
		day = -1;
		try
		{
			if ((Object)(object)TaskCheat.Instance == (Object)null)
			{
				ManualLogSource log = TaskCheat.Log;
				if (log != null)
				{
					log.LogWarning((object)LanguageManager.GetText("TaskCheatInstanceIsNull"));
				}
				return false;
			}
			string storageIdentifier = GetStorageIdentifier();
			string uniqueConfigKey = GetUniqueConfigKey(storageIdentifier, "_LastTimeRecord");
			string configValueFromBepInEx = GetConfigValueFromBepInEx("时间记录配置", uniqueConfigKey);
			if (!string.IsNullOrEmpty(configValueFromBepInEx))
			{
				string[] array = configValueFromBepInEx.Split(new char[1] { ',' });
				if (array.Length == 3 && int.TryParse(array[0], out year) && int.TryParse(array[1], out month) && int.TryParse(array[2], out day))
				{
					ManualLogSource log2 = TaskCheat.Log;
					if (log2 != null)
					{
						log2.LogInfo((object)LanguageManager.GetFormattedText("LoadedTimeRecordConfig", year, month, day, storageIdentifier));
					}
					return true;
				}
			}
			ManualLogSource log3 = TaskCheat.Log;
			if (log3 != null)
			{
				log3.LogInfo((object)LanguageManager.GetText("NoTimeRecordConfigFound"));
			}
		}
		catch (Exception ex)
		{
			ManualLogSource log4 = TaskCheat.Log;
			if (log4 != null)
			{
				log4.LogError((object)(LanguageManager.GetText("LoadTimeRecordConfigFailed") + ex.Message));
			}
		}
		return false;
	}

	public static bool ClearConfigByStorageIdentifier(string storageIdentifier)
	{
		try
		{
			if ((Object)(object)TaskCheat.Instance == (Object)null)
			{
				ManualLogSource log = TaskCheat.Log;
				if (log != null)
				{
					log.LogWarning((object)LanguageManager.GetText("TaskCheatInstanceIsNull"));
				}
				return false;
			}
			string storageIdentifier2 = Regex.Replace(storageIdentifier, "[^\\w.-]", "_");
			string[] array = new string[3] { "重复任务配置", "时间记录配置", "重复任务设置" };
			string[] array2 = new string[3] { "_SelectedTasks", "_LastTimeRecord", "_CheckInterval" };
			string[] array3 = array2;
			foreach (string suffix in array3)
			{
				string uniqueConfigKey = GetUniqueConfigKey(storageIdentifier2, suffix);
				string[] array4 = array;
				foreach (string text in array4)
				{
					try
					{
						ConfigEntry<string> val = ((BaseUnityPlugin)TaskCheat.Instance).Config.Bind<string>(text, uniqueConfigKey, "", (ConfigDescription)null);
						val.Value = "";
					}
					catch
					{
					}
				}
			}
			((BaseUnityPlugin)TaskCheat.Instance).Config.Save();
			ManualLogSource log2 = TaskCheat.Log;
			if (log2 != null)
			{
				log2.LogInfo((object)LanguageManager.GetFormattedText("ClearedConfigByStorageIdentifier", storageIdentifier));
			}
			return true;
		}
		catch (Exception ex)
		{
			ManualLogSource log3 = TaskCheat.Log;
			if (log3 != null)
			{
				log3.LogError((object)(LanguageManager.GetText("ClearConfigError") + ex.Message));
			}
			return false;
		}
	}

	public static bool ClearAllConfig()
	{
		try
		{
			if ((Object)(object)TaskCheat.Instance == (Object)null)
			{
				ManualLogSource log = TaskCheat.Log;
				if (log != null)
				{
					log.LogWarning((object)LanguageManager.GetText("TaskCheatInstanceIsNull"));
				}
				return false;
			}
			if (TaskCheat.TaskCheckInterval != null)
			{
				TaskCheat.TaskCheckInterval.Value = 10;
			}
			string[] array = new string[3] { "重复任务配置", "时间记录配置", "重复任务设置" };
			PropertyInfo property = ((object)((BaseUnityPlugin)TaskCheat.Instance).Config).GetType().GetProperty("ConfigData", BindingFlags.Instance | BindingFlags.NonPublic);
			if (property != null)
			{
				try
				{
					if (property.GetValue(((BaseUnityPlugin)TaskCheat.Instance).Config) is Dictionary<string, object> dictionary)
					{
						List<string> list = new List<string>();
						foreach (string key in dictionary.Keys)
						{
							string[] array2 = array;
							foreach (string value in array2)
							{
								if (key.Equals(value))
								{
									list.Add(key);
									break;
								}
							}
						}
						foreach (string item in list)
						{
							dictionary.Remove(item);
							ManualLogSource log2 = TaskCheat.Log;
							if (log2 != null)
							{
								log2.LogInfo((object)LanguageManager.GetFormattedText("ClearedConfigSection", item));
							}
						}
					}
				}
				catch (Exception ex)
				{
					ManualLogSource log3 = TaskCheat.Log;
					if (log3 != null)
					{
						log3.LogWarning((object)(LanguageManager.GetText("ReflectionClearConfigFailed") + ex.Message));
					}
				}
			}
			try
			{
				string configFilePath = ((BaseUnityPlugin)TaskCheat.Instance).Config.ConfigFilePath;
				if (File.Exists(configFilePath))
				{
					((BaseUnityPlugin)TaskCheat.Instance).Config.Save();
					Thread.Sleep(100);
					File.Delete(configFilePath);
					ManualLogSource log4 = TaskCheat.Log;
					if (log4 != null)
					{
						log4.LogInfo((object)LanguageManager.GetFormattedText("ForceDeletedConfigFile", configFilePath));
					}
					((BaseUnityPlugin)TaskCheat.Instance).Config.Save();
					ManualLogSource log5 = TaskCheat.Log;
					if (log5 != null)
					{
						log5.LogInfo((object)LanguageManager.GetText("RecreatedEmptyConfigFile"));
					}
				}
			}
			catch (Exception ex2)
			{
				ManualLogSource log6 = TaskCheat.Log;
				if (log6 != null)
				{
					log6.LogWarning((object)(LanguageManager.GetText("ForceDeleteConfigFileFailed") + ex2.Message));
				}
			}
			((BaseUnityPlugin)TaskCheat.Instance).Config.Save();
			ManualLogSource log7 = TaskCheat.Log;
			if (log7 != null)
			{
				log7.LogInfo((object)LanguageManager.GetText("SuccessfullyClearedAllConfig"));
			}
			return true;
		}
		catch (Exception ex3)
		{
			ManualLogSource log8 = TaskCheat.Log;
			if (log8 != null)
			{
				log8.LogError((object)(LanguageManager.GetText("ClearAllConfigError") + ex3.Message));
			}
			ManualLogSource log9 = TaskCheat.Log;
			if (log9 != null)
			{
				log9.LogError((object)ex3.StackTrace);
			}
			return false;
		}
	}
}
internal class TaskList
{
	public static List<List<string>> Text_AllTaskOrder = new List<List<string>>
	{
		new List<string> { "【任务】为城中路人代写书信^次|寻找城中街道来往行人中头顶【求信】标识者,为其代写书信赚取钱财。", "[Quest] Write ^ letters for pedestrians.|Look for pedestrians in the streets with a [Letter] mark over their heads. They'd pay you to write letters for them." },
		new List<string> { "【任务】接受城中商铺招工并完成^次|城中商铺时有【招工】需求跳出,可安排满足需求的家族成员前往做短工贴补家用。", "[Quest] Apply and get shop jobs ^ times.|Occasionally, shops put up [Hiring] signs. Send a clan member to earn some quick cash." },
		new List<string> { "【任务】在城中【粮肉铺】购买【粮食】^袋|鼠标悬置商铺之上可跳出建筑提示,有助于您寻找【粮肉铺】购买粮食,粮食是生活必需品,需保持充足哦。", "[Quest] Buy ^ bags of [Grains] from the [Grocery Store].|Hover your mouse cursor over a shop to learn more about it. Locate the [Grocery Store] and buy some grains, which you literally can't live without." },
		new List<string> { "【任务】在城中当铺典当物品^次|鼠标悬置商铺之上可跳出建筑提示,有助于您寻找【当铺】典当物品,换取钱财。", "[Quest] Pawn items ^ time at the Pawn Store.|Hover your mouse cursor over a shop to learn more about it. Locate the pawnshop and turn things you don't need into money." },
		new List<string> { "【任务】在城中与街头商贩交易^次|寻找城中街道来往行人中头顶【货物】或【铜钱】标识者,与之交易物品,赚取差价。", "[Quest] Trade ^ times with street peddlers.|Check pedestrians with a [Goods] or [Coins] mark. They want to trade, and you might actually make a profit." },
		new List<string> { "【任务】在城中招募^位门客|可点击左上方<color=#31211Dff>【人员】</color>打开本城人员列表中或在城中街道来往行人中寻找合适的【寒门子弟】(鼠标悬置在行人上有助于寻找寒门子弟),并向其发起招为门客的请求。", "[Quest] Recruit ^ retainer in town|Comb through pedestrians to find [civilians] (hover mouse cursor over them to see details) and recruit as retainers." },
		new List<string> { "【任务】在城中钱庄借贷钱财^次|鼠标悬置商铺之上可跳出建筑提示,有助于您寻找【钱庄】借贷,到期时需本息一并还清。", "[Quest] Take ^ loan from the local bank.|Hover your mouse cursor over a bank to learn more about it. Locate the [Bank] and take a loan. Don't forget to pay your interest." },
		new List<string> { "【任务】在城中建造属于您家族的^间商铺|在郡城场景状态下,点击下方【建造】按钮打开面板,在【商铺(您家族)】一栏选择可建造的商铺,商铺可以带来持续的收益。", "[Quest] Build ^ shop for your own clan.|Click the [Build] button in the city view and select available shops under the [Shops (clan)] tab. They will be your cash cows." },
		new List<string> { "【任务】升级您家族的商铺^次|在城中点击您建造好的商铺,打开【商铺面板】,可以找到升级商铺的功能,点击升级。", "[Quest] Upgrade your shops ^ times.|Click on your built shops and click 'Upgrade' in the details panel." },
		new List<string> { "【任务】在您商铺中招募^个伙计|在城中点击您建造好的商铺,打开【商铺面板】,可以找到招募伙计的功能,用合适的薪酬招募伙计可以增加商铺收益。", "[Quest] Hire ^ employees for your shops.|Click on a shop you built to bring up the [Shop] panel, where there's a Hire button. An employee with a reasonable pay could increase your shop's profit margin." },
		new List<string> { "【任务】在您祖宅中清除^块杂草|点击下方【地图】按钮打开江山图,找到并进入家族府邸,点击下方【建造】按钮进入编辑模式,点击某祖宅中的某块杂草,点击“X”按钮拆除此建筑,或者按住快速删除【快捷键】点击删除!", "[Quest] Demolish ^ patch of weeds in your old estate.|Find your estate in [Map] and enter [Build] mode. Select a patch of weeds, and click [X] or hold the fast delete [Shortcut] to demolish!" },
		new List<string> { "【任务】在您祖宅中移动1个废弃建筑^格|点击下方【地图】按钮打开江山图,找到并进入家族府邸,点击下方【建造】按钮进入编辑模式,鼠标拖动某个废弃建筑即可!", "[Quest] Move an abandoned building ^ tiles within your estate.|Find your estate in [Map], enter [Build] mode, and drag an abandoned structure!" },
		new List<string> { "【任务】在您的府邸中修复^间库房|在府邸场景状态下,点击下方【建造】按钮进入【编辑模式】,点击要修复建筑后出现【修复】按钮,点击【修复】按钮修复此建筑。", "[Quest] Repair ^ Warehouse in your estate.|In estate view, Click the [Build] button below to enter edit mode. Click on a building you want to repair, click the [Repair] button to repair it." },
		new List<string> { "【任务】在您的府邸中修复^间正房|在府邸场景状态下,点击下方【建造】按钮进入【编辑模式】,点击要修复建筑后出现【修复】按钮,点击【修复】按钮修复此建筑。", "[Quest] Repair ^ Main Suite in your estate.|In estate view, Click the [Build] button below to enter edit mode. Click on a building you want to repair, click the [Repair] button to repair it." },
		new List<string> { "【任务】将^名家族成员安排进正房|在府邸中点击您建造好的正房,打开【正房面板】,可以找到安排成员居住的功能。", "[Quest] Move ^ clan member into main suites.|Click on a Main Suite you built to bring up the [Main Suite] panel, where you can choose clan members to move in." },
		new List<string> { "【任务】为家族成员迎娶或招赘^位寒门子弟|可点击左上方<color=#31211Dff>【人员】</color>打开本城人员列表中或在城中街道来往行人中寻找合适的寒门子弟(鼠标悬置在行人上有助于寻找寒门子弟),并向其发起提亲或者招赘。", "[Quest] Find ^ civilian bride for your clan.|Roam the streets and find appropriate girls or boys of civilian background (hover mouse over them to see background) and propose marriage." },
		new List<string> { "【任务】在府邸建造^个围墙|进入家族府邸,点击下方【建造】按钮打开面板,在【装饰】一栏选择围墙建筑建造,围墙可增加安全值,防止发生府邸被盗事件。", "[Quest] Build ^ walls in the estate.|Click the [Build] button below to open the panel, select walls from the [Decoration] section." },
		new List<string> { "【任务】安排^名族人自动购买粮食|点击下方【族人】按钮打开族人面板,点击一名成年族人打开信息面板,点击下方【族人职责】按钮安排职责。", "[Quest] Assign ^ clan member to purchase grain automatically.|Click [Lineage] below, select an adult member, then tap [Set Duty] to set their responsibilities." },
		new List<string> { "【任务】在城中购买一座民居,并安排^位门客|在城中寻找并买下一座中意的民居(多找一会,有便宜的哦),选择家族门客安排进此民居,可自动做工交易赚取铜钱或者其他任务等。", "[Quest] Buy a house in town and assign ^ retainer to it|Buy any house and assign retainers to it. Retainers automatically perform assigned functions." },
		new List<string> { "【任务】把时间进行速度调为3倍速|在下方中间显示世间的旁边,点击选择时间进行速度的“3x”选项,时间会加速进行,拥有更好的游戏体验!", "[Quest] Set time speed to 3x.|Click the [3x] option next to the time display in the middle below, and the gameplay will speed up." },
		new List<string> { "【任务】为族人纳^名妾室(侧室)|可点击左上方<color=#31211Dff>【人员】</color>打开本城人员列表中或在城中街道来往行人中寻找合适的寒门子弟或者前往其他交好世家选择合适的人选,将其纳为某族人的妾室(侧室)。", "[Quest] Expand clan marriages for ^ member.|Select suitable candidates from civilians or allied clan in the county, then arrange them as secondary spouses (concubines) for clan members." },
		new List<string> { "【任务】安排^名族人自动收取商铺利润|点击下方【族人】按钮打开族人面板,点击一名成年族人打开信息面板,点击下方【族人职责】按钮安排职责。", "[Quest] Assign ^ clan member to auto-collect profits.|Click [Lineage] below, select an adult member, then tap [Set Duty] to set their responsibilities." },
		new List<string> { "【任务】为您家族购买^个农庄|点击下方【地图】按钮打开江山图,寻找正在出售的【农庄】,经营农庄可养活更多族人。", "[Quest] Buy ^ farm for your clan.|Click the [Map] button below to check the map and find [farms] for sale. This is how you create a steady cash flow." },
		new List<string> { "【任务】在您家族农庄中升级农房^次|点击下方【地图】按钮打开江山图,找到并进入您刚刚买下的农庄,在农庄中找到某间【农房】点击打开农房面板,升级此农房,升级农房可提高农庄容纳农户的数量。", "[Quest] Upgrade your farm cottages ^ times.|Click on a cottage in farm view, then the 'Upgrade' button in the details panel. This increases their capacity." },
		new List<string> { "【任务】在您家族农庄中开垦^个地块|在农庄场景状态下,点击下方【建造】按钮打开面板,在【生产】一栏选择水田、旱田、或菜园建造皆可。", "[Quest] Develop ^ plots of land in your farms.|In farm view, click the [Build] button below and select rice fields, paddy fields, or vegetable gardens under the [Productive] tab." },
		new List<string> { "【任务】在您农庄中建造^间畜舍或作坊|在农庄场景状态下,点击下方【建造】按钮打开面板,在【生产】一栏选择禽舍、羊圈、猪圈、牛棚或作坊用于建造。", "[Quest] Build ^ animal pens or workshop in your farms.|In farm view, click the [Build] button below and select animal pens or workshop under the [Productive] tab." },
		new List<string> { "【任务】在您家族农庄中收割^次农作物|在农庄场景中,点击收获田地中产出的粮食、蔬菜、水果等。", "[Quest] Harvest ^ times in your farms.|Simply click on grains, vegetables, and fruits ripe for harvest in farm view." },
		new List<string> { "【任务】家族诞生^名新成员|家族成员娶亲后,妻子会有概率怀有身孕,怀胎十月后新成员将诞生。", "[Quest] Give birth to ^ baby for your clan.|Once a clan member finds a bride, sooner or later she'd get pregnant. Give 10 months and you get a baby!" },
		new List<string> { "【任务】为年幼家族成员安排先生^位|在家族的空闲门客中,选择合适的人选安排给家族未成年子弟充当私人先生。", "[Quest] Hire ^ teacher for your clan's young ones.|Appoint retainers as private tutors for your clan's young." },
		new List<string> { "【任务】为家族成员购买^本书籍,并培养其进行研习|在城中找到一间【书肆】,购买您想要的书籍,然后将其赠与家族成员参透<color=#31211Dff>(注意不要打开前往藏书阁自动借阅,要手动【添加】书籍)</color>,有助于该成员属性增长。", "[Quest] Buy ^ book and make sure your clan members master them.|Find a [book store] in the city, buy books and give to clan members to study. Mastering a book boost the member's stats." },
		new List<string> { "【任务】与其他世家的子弟交互^次|在城中或者在其他世家中寻得某位成员,安排您家族成员与其进行交互。", "[Quest] Interact ^ times with members of other clans.|Get to know them, in either the streets or their homes. See how you can hang out with them." },
		new List<string> { "【任务】赠送其他世家子弟^次物品|选择一位要交好的世家子弟,点击【投其所好】,赠送他喜欢的物品,物品可在杂货铺、书店、珠宝店等铺子买到。", "[Quest] Send ^ gifts to other clan members.|Select a clan member you wish to befriend, click [Flatter] to present them with preferred items, which can be purchased from General stores, Book store, or Jewelry store." },
		new List<string> { "【任务】在地图中解锁^一个郡城|点击下方【地图】按钮打开江山图,点击某个未解锁的郡县区域,解锁本区域。", "[Quest] Unlock ^ city on the map.|Click on the [Map] button to bring up the world map, then click on a locked province to unlock." },
		new List<string> { "【任务】前往其他世家拜访^次|点击下方【地图】按钮打开江山图,找到并点击某个世家图标,打开世家面板,安排家族成员拜访!", "[Quest] Visit the other clan ^ time.|Click the [Map] button, find a clan icon, and arrange for clan members to visit!" },
		new List<string> { "【任务】与^位其他世家子弟好感度达到30|通过交互可以增加其他世家子弟对您家族的好感度。", "[Quest] Relationship with ^ member of other clan reaches 30.|Keep interacting with these people to build up your relationship." },
		new List<string> { "【任务】安排家族成员参加^次科举|每隔一段时间,会有科举事件跳出,届时您可以安排家族成员赴考。", "[Quest] Attend ^ National Exam.|The empire regularly hosts National Exams to select talents for government positions. Send your clan's best scholars to try your luck." },
		new List<string> { "【任务】安排^名家族子弟出征从军|每隔一段时间朝廷会出征平叛,安排家族子弟出征从军,从军有机会立下军功,获得官职,但也有战死的风险。", "[Quest] Send ^ clan member to the army.|The Imperial Court periodically launches military campaigns to suppress rebellions. Send your gallant young men to start a career in the army. Of course, they could be killed in the battle." },
		new List<string> { "【任务】在您府邸中修复或者建造^间厢房|在府邸场景状态下,新建或修复现有厢房,增加厢房可以招募和容纳更多仆人。", "[Quest] Repair\u200b or build ^ wing in your estate.|In estate view, build new or repair existing wings. These are living quarters for your servants." },
		new List<string> { "【任务】在您的府邸中升级^次厢房|在府邸场景状态下,点击一间厢房打开操作面板,点击升级,升级厢房可增加容纳仆人的数量。", "[Quest] Upgrade ^ wing in your estate.|In your estate, select a wing, open its panel, and tap [Upgrade] to increase servant capacity." },
		new List<string> { "【任务】为家族府邸招募^个仆人|在府邸中点击您建造好的厢房,打开【厢房面板】,可以找到招募仆人的功能。", "[Quest] Hire ^ servants for your estate.|Click on a wing you built to bring up the [wing] panel, where you can hire servants." },
		new List<string> { "【任务】为府邸中的正房安排^个仆人|在府邸中点击您建造好的正房,打开【正房面板】,可以找到增加仆人的功能。", "[Quest] Assign ^ servants to your main suites.|Click on a main suite you built to bring up the [main suite] panel, where you can assign servants to it." },
		new List<string> { "【任务】在府邸中修复或建造^间马厩|在府邸场景状态下,新建或修复现有马厩,马厩可以增加家族可容纳马匹数量。", "[Quest] Build ^ barn for your estate.|In estate view, build new or repair existing barns. Your clan will need more and bigger barns as you get more horses." },
		new List<string> { "【任务】买^匹马并赠与您家族成员|在城中找到一间【骡马市】,购买您看中的马匹,然后将其赠与家族成员,可增加该成员武力值,也是该成员游历和游学的必备条件。", "[Quest] Buy ^ horse and give them to clan members.|Find a [horse market] in the city, buy horses and give them to clan members. This will increase their Might. Also, they can't go out to see the world, or just for a study tour, without a horse." },
		new List<string> { "【任务】在您府邸中建造^座私塾或演武场|在府邸场景状态下,点击下方【建造】按钮打开面板,在【功能】一栏选择私塾或者演武场建造,私塾和演武场可安排先生为家族子弟授课。", "[Quest] Build ^ private school or training grounds in your estate.|In estate view, click [Build] and find private schools or training grounds under the [Functional] tab. These are where your teachers give lessons." },
		new List<string> { "【任务】安排家族成员在城中茶肆喝^次茶|在城中找到一间【茶肆】,安排家族成员任选一种茶座喝茶。", "[Quest] Send clan members to tea houses for ^ time.|Find a [tea house] in the city and send a clan member there." },
		new List<string> { "【任务】安排家族成员在城中松竹馆听^次小曲|在城中找到一间【松竹馆】,安排家族成员选一个您喜欢的女子听一曲。", "[Quest] Send clan members to courtesan lounges for ^ time.|Find a [courtesan lounge] in the city and send a clan member there. Choose any entertainer and enjoy the show." },
		new List<string> { "【任务】在城中将您拥有的^所民居出租|在城中点击您已经购买的一所还未使用的民居,打开操作面板后,选择出租。", "[Quest] Rent out ^ owned house in the city.|Click an owned vacant house in the city, open the action panel, then select [Lease] to lease it." },
		new List<string> { "【任务】安排^名族人自动收取民居租金|点击下方【族人】按钮打开族人面板,点击一名成年族人打开信息面板,点击下方【族人职责】按钮安排职责。", "[Quest] Assign ^ clan member to collect rent automatically.|Click [Lineage] below, select an adult member, then tap [Set Duty] to set their responsibilities." },
		new List<string> { "【任务】安排家族成员参与^次比武或比文招亲|在城中来往行人中,会有其他世家成员带着比武或者比文招亲的消息,安排家族子弟参加。", "[Quest] Send clan members to ^ dame contest.|Clans want the most outstanding husbands for their daughters, and often they do it in a special form of contest. Send your brilliant young men if there's such a contest going on." },
		new List<string> { "【任务】在城中铁匠铺买^把兵器并赠予家族成员|在城中找到一间【铁匠铺】,购买您满意的兵器,然后将其赠与家族成员,可增加该成员武力值。", "[Quest] Buy ^ weapon from the local smithy and give to clan members.|Find a [smithy] in the city and buy any weapons you fancy. Give them to clan members to boost their Might." },
		new List<string> { "【任务】在城中珠宝行买^件珠宝并赠予家族成员|在城中找到一间【珠宝行】,购买您满意的珠宝,然后将其赠与家族成员,可增加家族成员魅力值。", "[Quest] Buy ^ jewelry piece from the local jeweler and give to clan members.|Find a [jeweler] in the city and buy any jewelry you fancy. Give them to clan members to boost their Charisma." },
		new List<string> { "【任务】在城中某家商号中完成^次交易|在城中找到一间【商号】,选择一笔您希望进行的交易,并完成它。", "[Quest] Do ^ transaction in exchanges.|Find an [exchange] in the city, strike a deal and follow through." },
		new List<string> { "【任务】在未收复城池资助某股叛军^次|点击下方【地图】按钮打开江山图,查看未收复的城池,选择资助此城叛军,资助叛军可增加与其关系值,关系值达到一定程度可向其借兵。", "[Quest] Fund rebels in fallen cities ^ time.|Click the [Map] button to bring up the empire map. Choose a fallen city and fund the rebels occupying it. Over time, they may lend a helping hand when you're in need." },
		new List<string> { "【任务】在家族农庄安排^名庄头|进入家族农庄,点击左上角【管理】按钮打开农庄操作面板,点击【安排】按钮,选择作为庄头的合适人选,安排庄头后农庄每年年底可自动交租,无需再手动收获。", "[Quest] Appoint ^ manager to your farms.|Enter your farms, click the top-left [Manage] button to open the operations panel, tap [Appoint], select a suitable manager, and they’ll deliver the farm’s annual rent automatically." },
		new List<string> { "【任务】发现并治疗^位病人|查看自家家族成员或者其他世家成员的事件,如发现有身患疾病者为其治疗。", "[Quest] Discover and treat ^ patient.|Check the event history of clan members, your own or not. Find those troubled by ailments and heal them." },
		new List<string> { "【任务】为家族府邸新建^所藏书阁|在府邸场景状态下,点击下方【建造】按钮打开面板,在【功能】一栏选择藏书阁建造,藏书阁可以允许族人自动借阅书籍,不用在手动为每位族人添加书籍研读。", "[Quest] Build ^ library in your estate.|In estate view, click the [Build] button below to find available structures. Library are under the [Functional] tab." },
		new List<string> { "【任务】向家族府邸的藏书阁放入^本书籍|点击府邸中的一所藏书阁,打开藏书阁面板后,点击【添加】按钮向藏书阁添加书籍。", "[Quest] Stock ^ books in the Library|Click a library in your estate, open its panel, and tap [Add] to stock books." },
		new List<string> { "【任务】为^名族人设置自动借阅书籍|点击下方【族人】按钮打开族人面板,点击任意族人打开信息面板,点击【培养】按钮后,选择【研习】一栏,点开自动借阅书籍选项,并选择书籍类型。", "[Quest] Enable auto-borrow books for ^ clan member.|Open the [Lineage] panel below, select any member, then go to [Train] → [Read] to enable Auto-Borrow Books and choose a category." },
		new List<string> { "【任务】安排成员参加^次其他家族举办的宴会|与某个世家【关系值】提高之后,会有其他世家成员邀请你参加他们的宴会,安排家族子弟参加,结识更多其他世家子弟。", "[Quest] Send delegates to ^ party thrown by other clans.|After improving your \u200b\u200bRelationship\u200b\u200b with a clan, members of the clan will invite you to attend their parties. Send over a clan member if you hear about a party going on. Socialize and make friends." },
		new List<string> { "【任务】安排成员参加^次其他家族举办的诗会|与某个世家【关系值】提高之后,会有其他世家成员邀请你参加他们的诗会,安排家族子弟参加,结识更多其他世家子弟。", "[Quest] Send delegates to ^ poetry salons thrown by other clans.|After improving your \u200b\u200bRelationship\u200b\u200b with a clan, members of the clan will invite you to attend their poetry salons. Send over a clan member if you hear about a party going on. Socialize and make friends." },
		new List<string> { "【任务】在家族的农庄施肥^次|进入家族农庄,点击左上角【管理】按钮打开农庄操作面板,点击【施肥】按钮进入施肥模式,点击地块可施肥增加肥沃度,肥沃度有助于提高农作物的产量。", "[Quest] Fertilize your farms ^ times.|Enter your farm, click the top-left [Manage] button to open the operations panel, tap [Fertilize] to enter fertilization mode, then click plots to fertilize." },
		new List<string> { "【任务】发现^次某人被欺辱并为其报官|查看自家家族成员或者其他家族成员的事件,如发现有被人欺辱者,帮其报官。", "[Quest] Help the humiliated ^ time.|Check the event history of clan members, your own or not. Help them start a lawsuit if they've been humiliated." },
		new List<string> { "【任务】发现并揭发^次某人的罪行|在城中街道查看来往其他世家成员或者在其他世家查看已结识成员的事件,如有作奸犯科者揭发。", "[Quest] Discover and expose ^ crime.|Examine members of other clans, in either the streets or your friends list. Find their dirty secrets and make them pay." },
		new List<string> { "【任务】弹劾其他世家身居要职者^次|查看其他世家有官职成员的事件面板,若发现此人有可弹劾的罪行,可派家族成员弹劾。", "[Quest] Impeach members of other clans ^ time.|Clan members holding government positions can petition to impeach their competitors. Kick other clans out of the hierarchy!" },
		new List<string> { "【任务】由您家族率军收复^座城池|点击下方【地图】按钮打开江山图,打开未收复的城池,调集可调军队攻打并成功收复该城池。", "[Quest] Lead armies to reclaim ^ city.|Click the [Map] button and send your armies to take back fallen cities." },
		new List<string> { "【任务】任命^位官员|族人出任一个郡城或者县城的主政官员后,在【地图】点击此城打开此城面板,选择空缺官职任命。", "[Quest] Appoint ^ official.|Once a clan member governs a county or town, open its panel via \u200b[Map] and appoint vacant posts." },
		new List<string> { "【任务】罢免^位官员|族人出任一个郡城或者县城的主政官员后,在【地图】点击此城打开此城面板,罢免您不满意的官员。", "[Quest] Depose ^ official.|Once a clan member governs a county or town, open its panel via \u200b[Map] and depose unwanted officials." },
		new List<string> { "【任务】在主政城池新建^座民居|进入郡守是您家族成员的郡城,打开建造面板选择【民房(官府)】一栏的民房进行建造,建造民房可增加民生值。", "[Quest] Build ^ new house in your own cities.|If a clan member governs a province, you can build houses in its cities. Just select [House (public)] in the Build panel. Building houses increases local Economy." },
		new List<string> { "【任务】为郡城规划^间商铺|出任郡守后可以自由建造郡城,打开郡城建造面板后,选择【商铺(规划)】一栏,选择要规划建造的商铺后建造,会有其他世家前来竞标。", "[Quest] Plan ^ shops for the County City.|Unlock county construction as Governor. Open the build menu, select [Store (public)], then build—competing clans will bid." },
		new List<string> { "【任务】为家族府邸建造^间宴会阁|在府邸场景状态下,点击下方【建造】按钮打开面板,在【功能】一栏选择宴会阁建筑建造。", "[Quest] Build ^ party pavilion in your estate.|In estate view, click the [Build] button below to find available structures. Party pavilion are under the [Functional] tab." },
		new List<string> { "【任务】由您家族举办^场宴会|点击府邸中【宴会阁】,打开功能面板,选择举办赏灯宴、赏菊宴或者家宴。", "[Quest] Host ^ party.|Click a [party pavilion] in your estate and host parties of any kind - lantern parties, garden parties, or home parties." },
		new List<string> { "【任务】由您家族举办^场诗会|点击府邸中【宴会阁】,打开功能面板,选择举办诗会。", "[Quest] Have your clan host ^ poetry salon.|Click a [party pavilion] in your estate and host poetry salons." },
		new List<string> { "【任务】您家族受封封地^次|家族高级武官立下战功时,有机会受封爵位,并获得自己的封地。", "[Quest] Get fiefs and titles ^ time.|When achieving a military exploit, your senior military officer may get a fief and title." },
		new List<string> { "【任务】率家族成员在封地猎场狩猎^次|进入家族获得的封地,选择进入一处猎场,可安排家族成员进行狩猎。", "[Quest] Participate in ^ hunting trips in your clan fiefs.|Choose a hunting ground in any of your clan fiefs and send clan member to a hunting trip." },
		new List<string> { "【任务】在封地征集民夫修改^次地形|进入家族获得的封地,任选一处地块,征集民夫将其变为您想要的地形(如山地移平)。", "[Quest] Draft workers to alter the landscape ^ time.|You are the boss of your own fief. Draft workers to reshape the land to your liking, such as levelling a whole hill." },
		new List<string> { "【任务】为去世成员制作^次牌位并放入祠堂|在府邸中点击您建造或者修复好的祠堂,打开【祠堂面板】,可以选择去世祖先的牌位供奉(去世时制作已牌位)。", "[Quest] Make ^ idol for deceased clan members and worship them in the ancestor shrine.|Click any ancestor shrine you've \u200brepaired\u200b or built in estate view and put idols you've made there for worship." },
		new List<string> { "【任务】成功奏请^次朝廷出兵某城|点击下方【地图】按钮打开江山图,查看未收复的城池,安排有