Decompiled source of SunianModCollection v0.93.9

plugins/ZongCaiDan.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace WujinMods;

[BepInPlugin("cn.wujin.zongcaidan", "夙念mod合集", "0.93.9")]
public class ZongCaiDan : BaseUnityPlugin
{
	internal static ManualLogSource 日志;

	internal static ZongCaiDan 实例;

	private const int 页_开局 = 0;

	private const int 页_府邸 = 1;

	private const int 页_商铺 = 2;

	private const int 页_城市 = 3;

	private const int 页_门客 = 4;

	private const int 页_画面 = 5;

	private const int 页_角色 = 6;

	private const int 页_家族 = 7;

	private const int 页_通用 = 8;

	private const int 页_农场 = 9;

	private const int 页_物品 = 10;

	private const int 页_库存 = 11;

	private const int 页_封地 = 12;

	private const int 页_马匹 = 13;

	private const int 页_赞助 = 14;

	private bool 显示 = false;

	private int 当前页 = 1;

	private EventSystem 被停用的输入系统;

	private Rect 窗口位置;

	private bool 窗口位置已设置;

	private readonly List<Rect> 禁止拖动区域 = new List<Rect>();

	private bool 正在拖动;

	private Vector2 拖动偏移;

	private Font 中文字体;

	private bool 样式已建;

	private GUIStyle 标题样式;

	private GUIStyle 副标题样式;

	private GUIStyle 正文样式;

	private GUIStyle 提示样式;

	private GUIStyle 按钮样式;

	private GUIStyle 小按钮样式;

	private GUIStyle 输入样式;

	private GUIStyle 菜单项样式;

	private GUIStyle 菜单项选中样式;

	private GUIStyle 开关样式;

	private GUIStyle 选中按钮样式;

	private GUIStyle 编号样式;

	private static readonly string[] 属性名 = new string[3] { "环境", "安全", "便捷" };

	private static readonly int[] 属性列 = new int[3] { 30, 31, 32 };

	private string[] 输入值 = new string[3];

	private int 输入缓存府邸 = -1;

	private int 提示倒计时 = 0;

	private string 提示文字 = "";

	private int 选宽 = 1920;

	private int 选高 = 1080;

	private bool 分辨率已初始化 = false;

	private ConfigEntry<bool> 配置_自动开启;

	private ConfigEntry<bool> 配置_自动升满;

	private ConfigEntry<bool> 配置_自动配仆;

	private ConfigEntry<bool> 配置_自动月例;

	private bool 自动伺候;

	private bool 自动升满;

	private bool 自动配仆;

	private bool 自动月例;

	private float 自动计时;

	private ConfigEntry<bool> 配置_商铺升满;

	private ConfigEntry<bool> 配置_商铺招满;

	private ConfigEntry<float> 配置_商铺费率;

	private ConfigEntry<bool> 配置_新生儿全自动;

	private ConfigEntry<bool> 配置_新生借阅;

	private ConfigEntry<bool> 配置_新生副食;

	private ConfigEntry<bool> 配置_新生装备;

	private ConfigEntry<bool> 配置_新生不弹窗;

	internal static bool 新生不弹窗 = true;

	internal static bool 新生借阅 = true;

	internal static bool 新生副食 = true;

	internal static bool 新生装备 = true;

	private bool 商铺升满;

	private bool 商铺招满;

	private float 商铺计时;

	internal static float 商铺营收费率 = 1f;

	private string 商铺费率输入 = "100";

	private ConfigEntry<float> 配置_菜单背景透明;

	private float 菜单背景透明 = 0.97f;

	private int 门客_性别筛选 = -1;

	private int 门客_技能筛选 = 0;

	private int 门客_新增性别 = 1;

	private int 门客_新增技能 = 1;

	private int 门客_天赋 = -1;

	private int 门客_新增天赋 = 0;

	private int 门客_新增品性 = 5;

	private int 角色目标 = -1;

	private int 角色输入缓存 = -1;

	private string[] 角色数值输入 = new string[11];

	private string 幸运输入 = "";

	private static readonly int[] 角色数值列 = new int[11]
	{
		30, 6, 21, 11, 20, 16, 27, 7, 8, 9,
		10
	};

	private static readonly string[] 角色数值名 = new string[11]
	{
		"体力", "年龄", "健康", "心情", "魅力", "声誉", "计谋", "文才", "武艺", "商才",
		"艺术"
	};

	private readonly Dictionary<string, int[]> 成员锁 = new Dictionary<string, int[]>();

	private float 上次锁检查;

	private int 封地税缓存 = -1;

	private string[] 封地税输入 = new string[3];

	private string 封地税倍率输入 = "10";

	internal static float 军营容量倍率 = 1f;

	internal static float 军营战力倍率 = 1f;

	private ConfigEntry<float> 配置_军营容量倍;

	private ConfigEntry<float> 配置_军营战力倍;

	private string 军营容量倍输入 = "1";

	private string 军营战力倍输入 = "1";

	private string 封地人口倍输入 = "1";

	private int 封地页缓存 = -1;

	private ConfigEntry<string> 配置_封地人口倍率串;

	private ConfigEntry<string> 配置_城市倍率串;

	private bool 物产下拉开;

	private Texture2D 支付宝码;

	private Texture2D 微信码;

	private Vector2 物产下滚;

	private ConfigEntry<bool> 配置_成人自动装备;

	private ConfigEntry<bool> 配置_自动配马;

	private ConfigEntry<bool> 配置_自动全满族人;

	private bool 成人自动装备 = true;

	private bool 功名下拉开;

	private bool 爵位下拉开;

	private bool 封地下拉开;

	private bool 喜好下拉开;

	private bool 品性下拉开;

	private bool 天赋下拉开;

	private bool 技能下拉开;

	private Vector2 功名下滚;

	private Vector2 爵位下滚;

	private Vector2 封地下滚;

	private Vector2 喜好下滚;

	private Vector2 品性下滚;

	private Vector2 天赋下滚;

	private Vector2 技能下滚;

	private int 爵位选封地 = -1;

	private bool 官服下拉开;

	private ConfigEntry<bool> 配置_自动吃丹;

	private bool 自动吃长寿丹 = false;

	private float 上次吃丹;

	private int 封地目标 = -1;

	private Vector2 官服下滚;

	private string 天赋值输入 = "0";

	private string 技能等级输入 = "0";

	private bool 自动配马 = true;

	private bool 自动全满族人 = true;

	private bool 开局自动已做;

	private float 菜单宽 = 1200f;

	private float 菜单高 = 900f;

	private ConfigEntry<float> 配置_菜单宽;

	private ConfigEntry<float> 配置_菜单高;

	private string 菜单宽输入 = "900";

	private string 菜单高输入 = "840";

	private bool 门客解除面板开;

	private readonly HashSet<int> 门客解除勾选 = new HashSet<int>();

	private Vector2 门客解除滚动;

	private string 物品搜索 = "";

	private string 物品数量输入 = "1";

	private Vector2 物品滚动;

	private List<KeyValuePair<int, string>> 物品名表;

	private readonly HashSet<int> 物品勾选 = new HashSet<int>();

	private readonly Dictionary<int, Sprite> 物品图标 = new Dictionary<int, Sprite>();

	internal static float 仓库容量倍数 = 1f;

	internal static float 厢房容量倍数 = 1f;

	internal static float 马厩容量倍数 = 1f;

	internal static float 农场住房倍数 = 1f;

	private ConfigEntry<float> 配置_仓库倍;

	private ConfigEntry<float> 配置_厢房倍;

	private ConfigEntry<float> 配置_马厩倍;

	private ConfigEntry<float> 配置_农场住房倍;

	private string 仓库倍输入 = "1";

	private string 厢房倍输入 = "1";

	private string 马厩倍输入 = "1";

	private string 农场住房倍输入 = "1";

	private readonly Dictionary<int, Texture> 物品贴图 = new Dictionary<int, Texture>();

	private string 门客_数量输入 = "1";

	private bool 删除待确认;

	private float 删除确认时间;

	internal static int 培养偏好 = 0;

	private ConfigEntry<int> 配置_培养偏好;

	private ConfigEntry<bool> 配置_永远20岁;

	internal static bool 永远20岁开 = true;

	private static readonly string[] 品性名 = new string[15]
	{
		"随机", "骄傲", "刚正", "活泼", "善良", "真诚", "洒脱", "高冷", "自卑", "怯懦",
		"腼腆", "凶狠", "善变", "忧郁", "多疑"
	};

	private ConfigEntry<bool> 配置_门客打工;

	private ConfigEntry<bool> 配置_门客交易;

	private bool 门客打工开;

	private bool 门客交易开;

	private readonly HashSet<string> 门客工作排除 = new HashSet<string>();

	private ConfigEntry<bool> 配置_开局点数开;

	private ConfigEntry<int> 配置_开局点数值;

	internal static bool 开局点数开 = true;

	internal static int 开局点数值 = 999;

	private string 开局点数输入 = "999";

	private string 上次场景ID = "";

	private string 金钱输入 = "";

	private string 元宝输入 = "";

	private int 城市目标 = -1;

	private int 城市输入缓存 = -1;

	private string[] 城市输入 = new string[6];

	private int 农场目标 = -1;

	private int 农场输入缓存 = -1;

	private string[] 农场输入 = new string[5];

	private static readonly int[] 农场列 = new int[5] { 3, 7, 10, 11, 12 };

	private string 人口倍率输入 = "1";

	private string 民怨倍率输入 = "1";

	internal static float[] 人口增长倍率 = new float[12];

	internal static float[] 封地人口倍率 = new float[13];

	internal static float[] 民怨增长倍率 = new float[12];

	private readonly Dictionary<string, int[]> 原始值表 = new Dictionary<string, int[]>();

	internal static bool 框选开 = false;

	internal static bool 粘贴待定 = false;

	internal static Rect 建造工具条区域 = new Rect(0f, 0f, 0f, 0f);

	internal static bool 拖框中;

	internal static bool 框选有拖动;

	private bool 待清选中;

	private Vector2 拖框起点;

	private Vector2 拖框当前;

	private bool 右键按下中;

	private bool 右键是Ctrl按下;

	private Vector2 右键起点;

	private readonly List<string> 框选选中 = new List<string>();

	private readonly List<string[]> 框选剪贴板 = new List<string[]>();

	private readonly List<KeyValuePair<GameObject, Vector2Int>> 预览物 = new List<KeyValuePair<GameObject, Vector2Int>>();

	private GameObject 预览根;

	private static bool 上次建造面板开;

	private Quaternion 原镜头旋转 = Quaternion.identity;

	private string 框选提示 = "";

	private string 框选场景缓存 = "";

	private PerBackMapScene 场景组件缓存;

	private BuildPanel 建造面板组件;

	private bool 已自检;

	private bool 世家已拉;

	private bool 族人已满;

	private float 启动秒;

	private static readonly string[] 技能名 = new string[7] { "全部", "巫", "医", "相", "卜", "魅", "工" };

	private static readonly string[] 天赋名 = new string[5] { "无", "文", "武", "商", "艺" };

	internal static bool 工具条被指
	{
		get
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if (!Mainload.isBuildPanelOpen)
				{
					return false;
				}
				if (((Rect)(ref 建造工具条区域)).width <= 0f)
				{
					return false;
				}
				Vector2 val = default(Vector2);
				((Vector2)(ref val))..ctor(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y);
				return ((Rect)(ref 建造工具条区域)).Contains(val);
			}
			catch
			{
				return false;
			}
		}
	}

	internal static bool 建造面板开
	{
		get
		{
			try
			{
				return Mainload.isBuildPanelOpen;
			}
			catch
			{
				return false;
			}
		}
	}

	internal static bool 建造拦截 => 框选开 || 粘贴待定 || 工具条被指;

	internal static int 城所属封地(int 城市)
	{
		try
		{
			int num = 0;
			for (int i = 1; i <= 12; i++)
			{
				num += AllText.Text_City[i - 1][Mainload.SetData[4]].Split(new char[1] { '~' })[1].Split(new char[1] { '|' }).Length;
				if (城市 < num)
				{
					return i;
				}
			}
		}
		catch
		{
		}
		return 0;
	}

	private void Awake()
	{
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: 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_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0882: Unknown result type (might be due to invalid IL or missing references)
		//IL_0889: Expected O, but got Unknown
		日志 = ((BaseUnityPlugin)this).Logger;
		实例 = this;
		日志.LogInfo((object)"加载成功");
		try
		{
			中文字体 = Font.CreateDynamicFontFromOSFont(new string[5] { "Microsoft YaHei", "微软雅黑", "SimHei", "SimSun", "Arial" }, 16);
		}
		catch (Exception ex)
		{
			日志.LogWarning((object)("创建中文字体失败:" + ex.Message));
		}
		Resolution currentResolution = Screen.currentResolution;
		选宽 = ((Resolution)(ref currentResolution)).width;
		currentResolution = Screen.currentResolution;
		选高 = ((Resolution)(ref currentResolution)).height;
		配置_自动开启 = ((BaseUnityPlugin)this).Config.Bind<bool>("自动伺候", "开启", true, "每 2 秒自动检查住宅/仆房");
		配置_自动升满 = ((BaseUnityPlugin)this).Config.Bind<bool>("自动伺候", "自动升满", true, "钱够就自动升到最高级");
		配置_自动配仆 = ((BaseUnityPlugin)this).Config.Bind<bool>("自动伺候", "自动分配仆人", true, "自动把仆人塞满房间");
		配置_自动月例 = ((BaseUnityPlugin)this).Config.Bind<bool>("自动伺候", "自动满月例", true, "住宅月例自动拉满");
		自动伺候 = 配置_自动开启.Value;
		自动升满 = 配置_自动升满.Value;
		自动配仆 = 配置_自动配仆.Value;
		自动月例 = 配置_自动月例.Value;
		配置_商铺升满 = ((BaseUnityPlugin)this).Config.Bind<bool>("商铺", "自动升满商铺", true, "钱够就自动把自家商铺升到上限");
		配置_商铺招满 = ((BaseUnityPlugin)this).Config.Bind<bool>("商铺", "自动招满仆人", true, "钱够就自动把伙计补满");
		商铺升满 = 配置_商铺升满.Value;
		商铺招满 = 配置_商铺招满.Value;
		配置_培养偏好 = ((BaseUnityPlugin)this).Config.Bind<int>("门客", "培养技能偏好", 0, "0=关闭;1巫 2医 3相 4卜 5魅 6工。培养面板会自动挑对应技能的先生");
		培养偏好 = 配置_培养偏好.Value;
		配置_永远20岁 = ((BaseUnityPlugin)this).Config.Bind<bool>("门客", "永远20岁", true, "门客年龄永远停在 20 岁,不会变老死亡");
		永远20岁开 = 配置_永远20岁.Value;
		配置_开局点数开 = ((BaseUnityPlugin)this).Config.Bind<bool>("开局", "开启开局点数修改", true, "开局创建角色时剩余特质点数直接设成下面的值");
		配置_开局点数值 = ((BaseUnityPlugin)this).Config.Bind<int>("开局", "剩余特质点数", 999, "默认 999");
		开局点数开 = 配置_开局点数开.Value;
		开局点数值 = 配置_开局点数值.Value;
		开局点数输入 = 开局点数值.ToString();
		配置_门客打工 = ((BaseUnityPlugin)this).Config.Bind<bool>("门客工作", "自动打工", false, "空闲门客自动安排写文写状(文+武),不需要民居");
		配置_门客交易 = ((BaseUnityPlugin)this).Config.Bind<bool>("门客工作", "自动交易", false, "空闲门客自动安排街头交易(吃商)");
		门客打工开 = 配置_门客打工.Value;
		门客交易开 = 配置_门客交易.Value;
		配置_新生儿全自动 = ((BaseUnityPlugin)this).Config.Bind<bool>("新生儿", "自动安排并确认", true, "新生儿出生时自动点确定");
		配置_新生借阅 = ((BaseUnityPlugin)this).Config.Bind<bool>("新生儿", "自动藏书阁借阅", true, "新生儿自动打开藏书阁借阅");
		配置_新生副食 = ((BaseUnityPlugin)this).Config.Bind<bool>("新生儿", "自动副食全选", true, "新生儿副食全部勾选");
		配置_新生装备 = ((BaseUnityPlugin)this).Config.Bind<bool>("新生儿", "自动穿装备", true, "新生儿有空装备槽就自动穿最好的");
		配置_成人自动装备 = ((BaseUnityPlugin)this).Config.Bind<bool>("族人", "成年人自动装备", true, "进存档后检测一次:成年人没装备就从仓库挑最好的穿上");
		配置_自动配马 = ((BaseUnityPlugin)this).Config.Bind<bool>("族人", "自动配马", true, "进存档后检测一次:没马的人挑属性最好的马配上");
		配置_自动吃丹 = ((BaseUnityPlugin)this).Config.Bind<bool>("族人", "自动吃长寿丹", false, "勾上后自动吃背包里的长寿丹(极品优先),给当前选中的族人加寿元");
		配置_自动全满族人 = ((BaseUnityPlugin)this).Config.Bind<bool>("族人", "读档自动全满全族", true, "加载存档时把全部家族成员的属性按游戏上限拉满");
		配置_军营容量倍 = ((BaseUnityPlugin)this).Config.Bind<float>("军营", "士兵容量倍率", 1f, "军营地能容纳的士兵倍数");
		配置_军营战力倍 = ((BaseUnityPlugin)this).Config.Bind<float>("军营", "战斗力倍率", 1f, "军营战斗力倍数");
		军营容量倍率 = Mathf.Max(1f, 配置_军营容量倍.Value);
		军营战力倍率 = Mathf.Max(1f, 配置_军营战力倍.Value);
		军营容量倍输入 = 军营容量倍率.ToString("0.##");
		军营战力倍输入 = 军营战力倍率.ToString("0.##");
		成人自动装备 = 配置_成人自动装备.Value;
		自动配马 = 配置_自动配马.Value;
		自动全满族人 = 配置_自动全满族人.Value;
		自动吃长寿丹 = 配置_自动吃丹.Value;
		配置_新生不弹窗 = ((BaseUnityPlugin)this).Config.Bind<bool>("新生儿", "不弹出窗口", true, "新生儿出生时完全自动处理,不显示窗口");
		新生借阅 = 配置_新生借阅.Value;
		新生副食 = 配置_新生副食.Value;
		新生装备 = 配置_新生装备.Value;
		新生不弹窗 = 配置_新生不弹窗.Value;
		配置_商铺费率 = ((BaseUnityPlugin)this).Config.Bind<float>("商铺", "营收费率百分比", 100f, "100 = 原版;200 = 两倍营收");
		商铺营收费率 = 配置_商铺费率.Value / 100f;
		if (商铺营收费率 <= 0f)
		{
			商铺营收费率 = 1f;
		}
		商铺费率输入 = (商铺营收费率 * 100f).ToString("0.##");
		配置_菜单背景透明 = ((BaseUnityPlugin)this).Config.Bind<float>("画面", "菜单背景透明度", 97f, "0~100,越小背景越透");
		菜单背景透明 = Mathf.Clamp(配置_菜单背景透明.Value, 0f, 100f) / 100f;
		配置_菜单宽 = ((BaseUnityPlugin)this).Config.Bind<float>("画面", "菜单宽度B", 1200f, "600~1600");
		配置_菜单高 = ((BaseUnityPlugin)this).Config.Bind<float>("画面", "菜单高度B", 900f, "500~1200");
		菜单宽 = Mathf.Clamp(配置_菜单宽.Value, 600f, 1600f);
		菜单高 = Mathf.Clamp(配置_菜单高.Value, 500f, 1200f);
		菜单宽输入 = 菜单宽.ToString("f0");
		菜单高输入 = 菜单高.ToString("f0");
		配置_仓库倍 = ((BaseUnityPlugin)this).Config.Bind<float>("库存", "仓库容量倍数", 1f, "库房容量倍数(1 = 原版),改完即时生效");
		配置_厢房倍 = ((BaseUnityPlugin)this).Config.Bind<float>("库存", "厢房容量倍数", 1f, "厢房仆人容量倍数");
		配置_马厩倍 = ((BaseUnityPlugin)this).Config.Bind<float>("库存", "马厩容量倍数", 1f, "马厩马匹容量倍数");
		配置_农场住房倍 = ((BaseUnityPlugin)this).Config.Bind<float>("农场", "住房倍率", 1f, "农庄农户上限倍数(1 = 原版)");
		仓库容量倍数 = Mathf.Max(1f, 配置_仓库倍.Value);
		厢房容量倍数 = Mathf.Max(1f, 配置_厢房倍.Value);
		马厩容量倍数 = Mathf.Max(1f, 配置_马厩倍.Value);
		农场住房倍数 = Mathf.Max(1f, 配置_农场住房倍.Value);
		仓库倍输入 = 仓库容量倍数.ToString("0.##");
		厢房倍输入 = 厢房容量倍数.ToString("0.##");
		马厩倍输入 = 马厩容量倍数.ToString("0.##");
		农场住房倍输入 = 农场住房倍数.ToString("0.##");
		配置_封地人口倍率串 = ((BaseUnityPlugin)this).Config.Bind<string>("封地", "人口倍率保存", "", "自动保存,不用手改");
		配置_城市倍率串 = ((BaseUnityPlugin)this).Config.Bind<string>("城市", "人口民怨倍率保存", "", "自动保存,不用手改");
		载入倍率设置();
		try
		{
			Harmony val = new Harmony("cn.wujin.zongcaidan");
			val.PatchAll(typeof(ZongCaiDan).Assembly);
			日志.LogDebug((object)"Harmony 补丁已应用(更多分辨率)");
		}
		catch (Exception ex2)
		{
			日志.LogWarning((object)("Harmony 补丁应用失败:" + ex2.Message));
		}
	}

	private void Update()
	{
		启动秒 += Time.unscaledDeltaTime;
		try
		{
			string sceneID = Mainload.SceneID;
			if (!string.IsNullOrEmpty(sceneID) && sceneID != 上次场景ID)
			{
				上次场景ID = sceneID;
			}
		}
		catch
		{
		}
		try
		{
			if (Mainload.Fudi_now == null || Mainload.Fudi_now.Count <= 0)
			{
				世家已拉 = false;
				族人已满 = false;
			}
			else
			{
				if (!世家已拉)
				{
					世家已拉 = true;
					拉满世家关系(显示提示: false);
				}
				if (!族人已满 && Mainload.Member_now != null && Mainload.Member_now.Count > 0)
				{
					族人已满 = true;
					if (自动全满族人)
					{
						自动拉满全族();
					}
				}
			}
		}
		catch
		{
		}
		if (!已自检 && 启动秒 > 10f)
		{
			已自检 = true;
			try
			{
				日志.LogDebug((object)("自检:Fudi_now=" + ((Mainload.Fudi_now == null) ? "空" : Mainload.Fudi_now.Count.ToString()) + ",SceneID=" + Mainload.SceneID));
				if (Mainload.Fudi_now != null && Mainload.Fudi_now.Count > 0)
				{
					日志.LogDebug((object)("自检:第1座 环境=" + 读值(0, 30) + " 安全=" + 读值(0, 31) + " 便捷=" + 读值(0, 32)));
				}
			}
			catch (Exception ex)
			{
				日志.LogWarning((object)("自检失败:" + ex.Message));
			}
		}
		try
		{
			if (Input.GetKeyDown((KeyCode)278))
			{
				设置显示(!显示);
			}
			if (显示 && Input.GetKeyDown((KeyCode)27))
			{
				设置显示(开: false);
			}
		}
		catch (Exception)
		{
		}
		try
		{
			if (成员锁.Count > 0 && Time.unscaledTime - 上次锁检查 > 0.5f)
			{
				上次锁检查 = Time.unscaledTime;
				foreach (KeyValuePair<string, int[]> item in 成员锁)
				{
					int[] value = item.Value;
					if (value == null || (value[0] < 0 && value[1] < 0 && value[2] < 0 && value[3] < 0))
					{
						continue;
					}
					List<string> list = null;
					try
					{
						for (int i = 0; i < Mainload.Member_now.Count; i++)
						{
							if (Mainload.Member_now[i][0] == item.Key)
							{
								list = Mainload.Member_now[i];
								break;
							}
						}
					}
					catch
					{
					}
					if (list != null && list.Count >= 31)
					{
						if (value[0] >= 0 && list[6] != value[0].ToString())
						{
							list[6] = value[0].ToString();
						}
						if (value[1] >= 0 && list[30] != value[1].ToString())
						{
							list[30] = value[1].ToString();
						}
						if (value[2] >= 0 && list[21] != value[2].ToString())
						{
							list[21] = value[2].ToString();
						}
						if (value[3] >= 0 && list[11] != value[3].ToString())
						{
							list[11] = value[3].ToString();
						}
					}
				}
			}
		}
		catch
		{
		}
		try
		{
			if (!开局自动已做 && 启动秒 > 8f)
			{
				开局自动已做 = true;
				if (成人自动装备)
				{
					自动给成年人穿装备();
				}
				if (自动配马)
				{
					自动给族人配马();
				}
			}
		}
		catch
		{
		}
		if (提示倒计时 > 0)
		{
			提示倒计时--;
		}
	}

	private void 设置显示(bool 开)
	{
		显示 = 开;
		if (开)
		{
			Cursor.visible = true;
			Cursor.lockState = (CursorLockMode)0;
			if ((Object)(object)被停用的输入系统 == (Object)null)
			{
				被停用的输入系统 = EventSystem.current;
			}
			if ((Object)(object)被停用的输入系统 != (Object)null)
			{
				((Behaviour)被停用的输入系统).enabled = false;
			}
			if ((Object)(object)中文字体 == (Object)null)
			{
				try
				{
					中文字体 = Font.CreateDynamicFontFromOSFont(new string[5] { "Microsoft YaHei", "微软雅黑", "SimHei", "SimSun", "Arial" }, 16);
				}
				catch
				{
				}
			}
			输入缓存府邸 = -1;
		}
		else if ((Object)(object)被停用的输入系统 != (Object)null)
		{
			((Behaviour)被停用的输入系统).enabled = true;
			被停用的输入系统 = null;
		}
	}

	private void 建样式()
	{
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Expected O, but got Unknown
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Expected O, but got Unknown
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_013f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Expected O, but got Unknown
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_0199: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a3: Expected O, but got Unknown
		//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fd: Expected O, but got Unknown
		//IL_0228: Unknown result type (might be due to invalid IL or missing references)
		//IL_0232: Expected O, but got Unknown
		//IL_025d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0267: Expected O, but got Unknown
		//IL_029f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a9: Expected O, but got Unknown
		//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fa: Expected O, but got Unknown
		//IL_0314: Unknown result type (might be due to invalid IL or missing references)
		//IL_0333: Unknown result type (might be due to invalid IL or missing references)
		//IL_033d: Expected O, but got Unknown
		//IL_0357: Unknown result type (might be due to invalid IL or missing references)
		//IL_037a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0384: Expected O, but got Unknown
		//IL_03af: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b9: Expected O, but got Unknown
		//IL_040d: Unknown result type (might be due to invalid IL or missing references)
		if (样式已建)
		{
			return;
		}
		if ((Object)(object)中文字体 == (Object)null)
		{
			try
			{
				中文字体 = Font.CreateDynamicFontFromOSFont(new string[5] { "Microsoft YaHei", "微软雅黑", "SimHei", "SimSun", "Arial" }, 16);
			}
			catch
			{
			}
		}
		标题样式 = new GUIStyle(GUI.skin.label);
		标题样式.font = 中文字体;
		标题样式.fontSize = 24;
		标题样式.fontStyle = (FontStyle)1;
		标题样式.normal.textColor = new Color(1f, 0.86f, 0.42f);
		副标题样式 = new GUIStyle(GUI.skin.label);
		副标题样式.font = 中文字体;
		副标题样式.fontSize = 18;
		副标题样式.fontStyle = (FontStyle)1;
		副标题样式.normal.textColor = new Color(1f, 0.88f, 0.55f);
		正文样式 = new GUIStyle(GUI.skin.label);
		正文样式.font = 中文字体;
		正文样式.fontSize = 17;
		正文样式.normal.textColor = new Color(0.97f, 0.95f, 0.9f);
		提示样式 = new GUIStyle(GUI.skin.label);
		提示样式.font = 中文字体;
		提示样式.fontSize = 15;
		提示样式.normal.textColor = new Color(1f, 0.45f, 0.4f);
		按钮样式 = new GUIStyle(GUI.skin.button);
		按钮样式.font = 中文字体;
		按钮样式.fontSize = 17;
		小按钮样式 = new GUIStyle(GUI.skin.button);
		小按钮样式.font = 中文字体;
		小按钮样式.fontSize = 15;
		输入样式 = new GUIStyle(GUI.skin.textField);
		输入样式.font = 中文字体;
		输入样式.fontSize = 17;
		输入样式.alignment = (TextAnchor)4;
		菜单项样式 = new GUIStyle(GUI.skin.button);
		菜单项样式.font = 中文字体;
		菜单项样式.fontSize = 18;
		菜单项样式.alignment = (TextAnchor)3;
		菜单项样式.padding.left = 14;
		菜单项选中样式 = new GUIStyle(菜单项样式);
		菜单项选中样式.normal.textColor = new Color(1f, 0.85f, 0.3f);
		菜单项选中样式.fontStyle = (FontStyle)1;
		选中按钮样式 = new GUIStyle(按钮样式);
		选中按钮样式.normal.textColor = new Color(1f, 0.85f, 0.3f);
		选中按钮样式.fontStyle = (FontStyle)1;
		开关样式 = new GUIStyle(GUI.skin.toggle);
		开关样式.font = 中文字体;
		开关样式.fontSize = 16;
		编号样式 = new GUIStyle(GUI.skin.label);
		编号样式.font = 中文字体;
		编号样式.fontSize = 16;
		编号样式.fontStyle = (FontStyle)1;
		编号样式.alignment = (TextAnchor)3;
		编号样式.normal.textColor = new Color(1f, 0.93f, 0.55f);
		GUIStyle[] array = (GUIStyle[])(object)new GUIStyle[12]
		{
			标题样式, 副标题样式, 正文样式, 提示样式, 按钮样式, 小按钮样式, 输入样式, 菜单项样式, 菜单项选中样式, 开关样式,
			选中按钮样式, 编号样式
		};
		foreach (GUIStyle val in array)
		{
			val.clipping = (TextClipping)0;
		}
		样式已建 = true;
	}

	private void OnGUI()
	{
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0219: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Unknown result type (might be due to invalid IL or missing references)
		//IL_0273: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0320: Unknown result type (might be due to invalid IL or missing references)
		//IL_036b: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0421: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_0583: Unknown result type (might be due to invalid IL or missing references)
		//IL_0691: Unknown result type (might be due to invalid IL or missing references)
		//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0181: Unknown result type (might be due to invalid IL or missing references)
		//IL_0187: Invalid comparison between Unknown and I4
		//IL_0743: Unknown result type (might be due to invalid IL or missing references)
		//IL_077e: Unknown result type (might be due to invalid IL or missing references)
		建样式();
		try
		{
			绘制建造框选();
		}
		catch (Exception ex)
		{
			日志.LogWarning((object)("建造框选出错:" + ex.Message));
		}
		try
		{
			绘制建筑标签();
		}
		catch (Exception ex2)
		{
			日志.LogWarning((object)("建筑标签出错:" + ex2.Message));
		}
		if (!显示)
		{
			return;
		}
		float num = Mathf.Min(菜单宽, (float)Screen.width - 24f);
		float num2 = Mathf.Min(菜单高, (float)Screen.height - 48f);
		if (!窗口位置已设置)
		{
			窗口位置 = new Rect(((float)Screen.width - num) / 2f, ((float)Screen.height - num2) / 2f, num, num2);
			窗口位置已设置 = true;
		}
		((Rect)(ref 窗口位置)).width = num;
		((Rect)(ref 窗口位置)).height = num2;
		((Rect)(ref 窗口位置)).x = Mathf.Clamp(((Rect)(ref 窗口位置)).x, 6f, Mathf.Max(6f, (float)Screen.width - num - 6f));
		((Rect)(ref 窗口位置)).y = Mathf.Clamp(((Rect)(ref 窗口位置)).y, 6f, Mathf.Max(6f, (float)Screen.height - num2 - 6f));
		try
		{
			if (Event.current != null && (int)Event.current.type == 7)
			{
				禁止拖动区域.Clear();
			}
		}
		catch
		{
		}
		处理拖动();
		Rect val = 窗口位置;
		GUI.color = new Color(0.09f, 0.08f, 0.07f, 菜单背景透明);
		GUI.DrawTexture(val, (Texture)(object)Texture2D.whiteTexture);
		GUI.color = new Color(0.85f, 0.68f, 0.3f, 0.9f);
		GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width, 2f), (Texture)(object)Texture2D.whiteTexture);
		GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).yMax - 2f, ((Rect)(ref val)).width, 2f), (Texture)(object)Texture2D.whiteTexture);
		GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, 2f, ((Rect)(ref val)).height), (Texture)(object)Texture2D.whiteTexture);
		GUI.DrawTexture(new Rect(((Rect)(ref val)).xMax - 2f, ((Rect)(ref val)).y, 2f, ((Rect)(ref val)).height), (Texture)(object)Texture2D.whiteTexture);
		GUI.color = Color.white;
		GUI.Label(new Rect(((Rect)(ref val)).x + 24f, ((Rect)(ref val)).y + 10f, num - 200f, 44f), "夙念mod合集", 标题样式);
		if (GUI.Button(new Rect(((Rect)(ref val)).x + num - 140f, ((Rect)(ref val)).y + 16f, 120f, 30f), "关闭 (Home)", 小按钮样式))
		{
			设置显示(开: false);
		}
		GUI.Label(new Rect(((Rect)(ref val)).x + 24f, ((Rect)(ref val)).y + 54f, num - 48f, 28f), "加载成功", 提示样式);
		float num3 = 196f;
		float num4 = ((Rect)(ref val)).y + 86f;
		float num5 = num2 - 110f;
		GUI.color = new Color(0.13f, 0.12f, 0.1f, Mathf.Min(1f, 菜单背景透明 + 0.03f));
		GUI.DrawTexture(new Rect(((Rect)(ref val)).x + 16f, num4, num3, num5), (Texture)(object)Texture2D.whiteTexture);
		GUI.color = Color.white;
		float num6 = num4 + 12f;
		GUI.Label(new Rect(((Rect)(ref val)).x + 30f, num6, num3 - 30f, 30f), "属性修改", 副标题样式);
		num6 += 34f;
		List<KeyValuePair<int, string>> list = new List<KeyValuePair<int, string>>
		{
			new KeyValuePair<int, string>(0, "开局属性修改"),
			new KeyValuePair<int, string>(8, "货币修改"),
			new KeyValuePair<int, string>(1, "府邸修改"),
			new KeyValuePair<int, string>(2, "商铺修改"),
			new KeyValuePair<int, string>(3, "城市修改"),
			new KeyValuePair<int, string>(9, "农场修改"),
			new KeyValuePair<int, string>(4, "门客修改"),
			new KeyValuePair<int, string>(10, "物品添加"),
			new KeyValuePair<int, string>(13, "马匹添加"),
			new KeyValuePair<int, string>(11, "库存修改"),
			new KeyValuePair<int, string>(6, "角色属性"),
			new KeyValuePair<int, string>(7, "家族属性"),
			new KeyValuePair<int, string>(12, "封地修改")
		};
		for (int i = 0; i < list.Count; i++)
		{
			int key = list[i].Key;
			string value = list[i].Value;
			if (GUI.Button(new Rect(((Rect)(ref val)).x + 24f, num6, num3 - 16f, 36f), (当前页 == key) ? ("▶  " + value) : ("    " + value), (当前页 == key) ? 菜单项选中样式 : 菜单项样式))
			{
				当前页 = key;
				if (key == 1)
				{
					输入缓存府邸 = -1;
				}
				if (key == 3)
				{
					城市输入缓存 = -1;
				}
				if (key == 9)
				{
					农场输入缓存 = -1;
				}
				if (key == 4)
				{
					门客解除面板开 = false;
				}
				if (key == 6)
				{
					角色输入缓存 = -1;
				}
				if (key == 12)
				{
					封地税缓存 = -1;
				}
			}
			num6 += 44f;
		}
		num6 += 18f;
		GUI.Label(new Rect(((Rect)(ref val)).x + 30f, num6, num3 - 30f, 30f), "赞助", 副标题样式);
		num6 += 32f;
		if (GUI.Button(new Rect(((Rect)(ref val)).x + 24f, num6, num3 - 16f, 36f), (当前页 == 14) ? "▶  赞助作者" : "    赞助作者", (当前页 == 14) ? 菜单项选中样式 : 菜单项样式))
		{
			当前页 = 14;
		}
		num6 += 44f;
		num6 += 8f;
		GUI.Label(new Rect(((Rect)(ref val)).x + 30f, num6, num3 - 30f, 30f), "画面", 副标题样式);
		num6 += 32f;
		if (GUI.Button(new Rect(((Rect)(ref val)).x + 24f, num6, num3 - 16f, 36f), (当前页 == 5) ? "▶  画面设置" : "    画面设置", (当前页 == 5) ? 菜单项选中样式 : 菜单项样式))
		{
			当前页 = 5;
			分辨率已初始化 = false;
		}
		float x = ((Rect)(ref val)).x + 16f + num3 + 16f;
		float w = num - (16f + num3 + 16f) - 20f;
		if (当前页 == 0)
		{
			绘制开局页(x, num4, w, num5);
		}
		else if (当前页 == 1)
		{
			绘制府邸页(x, num4, w, num5);
		}
		else if (当前页 == 2)
		{
			绘制商铺页(x, num4, w, num5);
		}
		else if (当前页 == 3)
		{
			绘制城市页(x, num4, w, num5);
		}
		else if (当前页 == 9)
		{
			绘制农场页(x, num4, w, num5);
		}
		else if (当前页 == 4)
		{
			绘制门客页(x, num4, w, num5);
		}
		else if (当前页 == 10)
		{
			绘制物品页(x, num4, w, num5);
		}
		else if (当前页 == 13)
		{
			绘制马匹页(x, num4, w, num5);
		}
		else if (当前页 == 11)
		{
			绘制库存页(x, num4, w, num5);
		}
		else if (当前页 == 6)
		{
			绘制角色页(x, num4, w, num5);
		}
		else if (当前页 == 7)
		{
			绘制家族页(x, num4, w, num5);
		}
		else if (当前页 == 12)
		{
			绘制封地页(x, num4, w, num5);
		}
		else if (当前页 == 14)
		{
			绘制赞助页(x, num4, w, num5);
		}
		else if (当前页 == 5)
		{
			绘制画面页(x, num4, w, num5);
		}
		else if (当前页 == 8)
		{
			绘制通用页(x, num4, w, num5);
		}
	}

	private void 绘制商铺页(float x, float y, float w, float h)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_018f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0227: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0326: Unknown result type (might be due to invalid IL or missing references)
		//IL_035b: Unknown result type (might be due to invalid IL or missing references)
		//IL_038f: Unknown result type (might be due to invalid IL or missing references)
		GUI.Label(new Rect(x, y, w, 44f), "商铺修改", 标题样式);
		int num = 0;
		int num2 = 0;
		string text = "";
		try
		{
			text = Mainload.SceneID ?? "";
			List<List<string>> buildInto_s = Mainload.BuildInto_s;
			if (buildInto_s != null)
			{
				num = buildInto_s.Count;
				for (int i = 0; i < buildInto_s.Count; i++)
				{
					List<string> list = buildInto_s[i];
					if (list != null && list.Count > 6 && list[6] == "-1")
					{
						num2++;
					}
				}
			}
		}
		catch
		{
		}
		GUI.Label(new Rect(x, y + 44f, w, 30f), "当前场景:" + text, 正文样式);
		GUI.Label(new Rect(x, y + 76f, w, 26f), "自家商铺:" + num2 + " 间 / 共 " + num + " 间", 提示样式);
		float num3 = y + 120f;
		商铺升满 = GUI.Toggle(new Rect(x, num3, 320f, 28f), 商铺升满, " 自动升满商铺(钱够就升)", 开关样式);
		配置_商铺升满.Value = 商铺升满;
		num3 += 36f;
		商铺招满 = GUI.Toggle(new Rect(x, num3, 320f, 28f), 商铺招满, " 自动招满仆人(钱够就招)", 开关样式);
		配置_商铺招满.Value = 商铺招满;
		num3 += 44f;
		GUI.Label(new Rect(x, num3, 150f, 30f), "营收费率(%)", 正文样式);
		商铺费率输入 = 画输入框(new Rect(x + 156f, num3, 100f, 30f), 商铺费率输入, 8);
		if (GUI.Button(new Rect(x + 264f, num3, 80f, 30f), "应用", 小按钮样式) && float.TryParse(商铺费率输入, out var result))
		{
			result = Mathf.Clamp(result, 1f, 10000f);
			商铺营收费率 = result / 100f;
			配置_商铺费率.Value = result;
			商铺费率输入 = result.ToString("0.##");
			提示文字 = "营收费率已设为 " + 商铺费率输入 + "%";
			提示倒计时 = 240;
		}
		GUI.Label(new Rect(x + 356f, num3 + 6f, w - 356f, 26f), "当前 " + (商铺营收费率 * 100f).ToString("0.##") + "%", 提示样式);
		num3 += 44f;
		if (GUI.Button(new Rect(x, num3, 170f, 34f), "立即执行一次", 按钮样式))
		{
			执行自动商铺(显示结果: true);
		}
		num3 += 46f;
		GUI.Label(new Rect(x, num3, w, 26f), "只处理自己家的商铺;升级上限按游戏当前设定(默认 10 级),钱不够会自动停。", 提示样式);
		if (提示倒计时 > 0)
		{
			GUI.Label(new Rect(x, num3 + 30f, w, 26f), 提示文字, 提示样式);
		}
	}

	private bool 选择钮(Rect r, string 文本, bool 选中)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		return GUI.Button(r, 文本, 选中 ? 选中按钮样式 : 小按钮样式);
	}

	private void 绘制门客页(float x, float y, float w, float h)
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_023f: Unknown result type (might be due to invalid IL or missing references)
		//IL_027f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_031e: Unknown result type (might be due to invalid IL or missing references)
		//IL_034f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0395: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_042d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0469: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0603: Unknown result type (might be due to invalid IL or missing references)
		//IL_0643: Unknown result type (might be due to invalid IL or missing references)
		//IL_0689: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0719: Unknown result type (might be due to invalid IL or missing references)
		//IL_0775: Unknown result type (might be due to invalid IL or missing references)
		//IL_07a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0817: Unknown result type (might be due to invalid IL or missing references)
		//IL_0842: Unknown result type (might be due to invalid IL or missing references)
		//IL_0886: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_08fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0936: Unknown result type (might be due to invalid IL or missing references)
		//IL_0973: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_09e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a36: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a5f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a98: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b2b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b74: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b98: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b5b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b60: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bcc: Unknown result type (might be due to invalid IL or missing references)
		if (门客解除面板开)
		{
			绘制门客解除页(x, y, w, h);
			return;
		}
		GUI.Label(new Rect(x, y, w, 40f), "门客修改", 标题样式);
		int num = 0;
		int num2 = 0;
		try
		{
			num = ((Mainload.MenKe_Now != null) ? Mainload.MenKe_Now.Count : 0);
		}
		catch
		{
		}
		try
		{
			num2 = FormulaData.MenkeNumMax();
		}
		catch
		{
		}
		GUI.Label(new Rect(x, y + 42f, w, 26f), "门客:" + num + "(游戏原版上限 " + num2 + ",已解除)", 正文样式);
		bool flag = 永远20岁开;
		永远20岁开 = GUI.Toggle(new Rect(x, y + 72f, 200f, 28f), 永远20岁开, " 永远 20 岁", 开关样式);
		配置_永远20岁.Value = 永远20岁开;
		if (永远20岁开 && !flag)
		{
			try
			{
				for (int i = 0; i < Mainload.MenKe_Now.Count; i++)
				{
					List<string> list = Mainload.MenKe_Now[i];
					if (list != null && list.Count > 3)
					{
						list[3] = "20";
					}
				}
				提示文字 = "已把现有门客都设为 20 岁";
				提示倒计时 = 240;
			}
			catch
			{
			}
		}
		GUI.Label(new Rect(x + 210f, y + 74f, w - 210f, 26f), "开启后门客不会变老死亡", 提示样式);
		GUI.Label(new Rect(x, y + 106f, w, 24f), "修改现有门客(属性拉满)", 副标题样式);
		float num3 = x;
		if (选择钮(new Rect(num3, y + 132f, 58f, 30f), "全部", 门客_性别筛选 < 0))
		{
			门客_性别筛选 = -1;
		}
		num3 += 62f;
		if (选择钮(new Rect(num3, y + 132f, 54f, 30f), "男", 门客_性别筛选 == 1))
		{
			门客_性别筛选 = 1;
		}
		num3 += 58f;
		if (选择钮(new Rect(num3, y + 132f, 54f, 30f), "女", 门客_性别筛选 == 0))
		{
			门客_性别筛选 = 0;
		}
		num3 += 70f;
		for (int j = 0; j <= 6; j++)
		{
			if (选择钮(new Rect(num3, y + 132f, 46f, 30f), 技能名[j], 门客_技能筛选 == j))
			{
				门客_技能筛选 = j;
			}
			num3 += 48f;
		}
		GUI.Label(new Rect(x, y + 168f, 90f, 30f), "天赋", 正文样式);
		num3 = x + 92f;
		if (选择钮(new Rect(num3, y + 168f, 62f, 30f), "不改", 门客_天赋 < 0))
		{
			门客_天赋 = -1;
		}
		num3 += 66f;
		for (int k = 0; k < 天赋名.Length; k++)
		{
			if (选择钮(new Rect(num3, y + 168f, 54f, 30f), 天赋名[k], 门客_天赋 == k))
			{
				门客_天赋 = k;
			}
			num3 += 58f;
		}
		if (GUI.Button(new Rect(x, y + 204f, 196f, 32f), "把符合的门客属性拉满", 按钮样式))
		{
			门客拉满();
		}
		if (GUI.Button(new Rect(x + 208f, y + 204f, 112f, 32f), "随机换立绘", 按钮样式))
		{
			门客随机立绘();
		}
		if (GUI.Button(new Rect(x + 328f, y + 204f, 112f, 32f), "清空占用", 按钮样式))
		{
			门客清空占用();
		}
		GUI.Label(new Rect(x + 448f, y + 208f, w - 448f, 26f), "属性 100", 提示样式);
		string text = (删除待确认 ? "再点一次确认删除" : "删除筛选结果");
		if (GUI.Button(new Rect(x, y + 242f, 160f, 32f), text, 删除待确认 ? 选中按钮样式 : 按钮样式))
		{
			if (!删除待确认)
			{
				删除待确认 = true;
				删除确认时间 = Time.realtimeSinceStartup;
				提示文字 = "再点一次「删除筛选结果」确认,5 秒内有效";
				提示倒计时 = 300;
			}
			else if (Time.realtimeSinceStartup - 删除确认时间 <= 5f)
			{
				删除待确认 = false;
				门客删除筛选();
			}
			else
			{
				删除待确认 = false;
				提示文字 = "确认超时,已取消";
				提示倒计时 = 240;
			}
		}
		GUI.Label(new Rect(x + 170f, y + 246f, w - 170f, 26f), "按当前 性别/技能 筛选删除,需点两次确认", 提示样式);
		GUI.Label(new Rect(x, y + 282f, w, 24f), "新增满属性门客", 副标题样式);
		num3 = x;
		if (选择钮(new Rect(num3, y + 308f, 54f, 30f), "男", 门客_新增性别 == 1))
		{
			门客_新增性别 = 1;
		}
		num3 += 58f;
		if (选择钮(new Rect(num3, y + 308f, 54f, 30f), "女", 门客_新增性别 == 0))
		{
			门客_新增性别 = 0;
		}
		num3 += 70f;
		for (int l = 1; l <= 6; l++)
		{
			if (选择钮(new Rect(num3, y + 308f, 54f, 30f), 技能名[l], 门客_新增技能 == l))
			{
				门客_新增技能 = l;
			}
			num3 += 58f;
		}
		GUI.Label(new Rect(x, y + 344f, 90f, 30f), "天赋", 正文样式);
		num3 = x + 92f;
		for (int m = 0; m < 天赋名.Length; m++)
		{
			if (选择钮(new Rect(num3, y + 344f, 54f, 30f), 天赋名[m], 门客_新增天赋 == m))
			{
				门客_新增天赋 = m;
			}
			num3 += 58f;
		}
		GUI.Label(new Rect(x, y + 380f, 60f, 30f), "品性", 正文样式);
		if (GUI.Button(new Rect(x + 64f, y + 380f, 34f, 30f), "◀", 小按钮样式))
		{
			门客_新增品性 = (门客_新增品性 - 1 + 15) % 15;
		}
		string text2 = ((门客_新增品性 >= 0 && 门客_新增品性 < 品性名.Length) ? 品性名[门客_新增品性] : "真诚");
		GUI.Label(new Rect(x + 104f, y + 382f, 120f, 30f), text2, 正文样式);
		if (GUI.Button(new Rect(x + 228f, y + 380f, 34f, 30f), "▶", 小按钮样式))
		{
			门客_新增品性 = (门客_新增品性 + 1) % 15;
		}
		if (GUI.Button(new Rect(x + 270f, y + 380f, 70f, 30f), "随机", (门客_新增品性 == 0) ? 选中按钮样式 : 小按钮样式))
		{
			门客_新增品性 = 0;
		}
		GUI.Label(new Rect(x + 350f, y + 382f, w - 350f, 26f), "默认真诚,可自选", 提示样式);
		if (GUI.Button(new Rect(x, y + 416f, 150f, 34f), "新增一名", 按钮样式))
		{
			新增门客();
		}
		if (GUI.Button(new Rect(x + 158f, y + 416f, 86f, 34f), "加 5 个", 按钮样式))
		{
			批量新增门客(5);
		}
		if (GUI.Button(new Rect(x + 252f, y + 416f, 86f, 34f), "加 10 个", 按钮样式))
		{
			批量新增门客(10);
		}
		门客_数量输入 = 画输入框(new Rect(x + 346f, y + 416f, 70f, 34f), 门客_数量输入, 4);
		if (GUI.Button(new Rect(x + 422f, y + 416f, 110f, 34f), "按数量加", 按钮样式) && int.TryParse((门客_数量输入 ?? "").Trim(), out var result))
		{
			批量新增门客(result);
		}
		GUI.Label(new Rect(x, y + 458f, w, 24f), "门客工作(不需要民居)", 副标题样式);
		门客打工开 = GUI.Toggle(new Rect(x, y + 484f, 190f, 28f), 门客打工开, " 自动打工(写文写状)", 开关样式);
		门客交易开 = GUI.Toggle(new Rect(x + 200f, y + 484f, 150f, 28f), 门客交易开, " 自动交易", 开关样式);
		配置_门客打工.Value = 门客打工开;
		配置_门客交易.Value = 门客交易开;
		if (GUI.Button(new Rect(x, y + 518f, 170f, 32f), "立即安排门客", 按钮样式))
		{
			门客自动安排(清排除: true);
		}
		if (GUI.Button(new Rect(x + 180f, y + 518f, 170f, 32f), "选中门客解除工作", 按钮样式))
		{
			门客解除面板开 = true;
			门客解除勾选.Clear();
			门客解除滚动 = Vector2.zero;
		}
		GUI.Label(new Rect(x, y + 556f, w, 26f), "打工=游戏里的「写文写状」吃文+武;交易=「街头交易」吃商。不再自动安排,点「立即安排门客」才安排。", 提示样式);
		GUI.Label(new Rect(x, y + 588f, w, 26f), "先生技能只在府邸修改的新生儿区域设置,避免冲突。", 提示样式);
		if (提示倒计时 > 0)
		{
			GUI.Label(new Rect(x, y + 618f, w, 26f), 提示文字, 提示样式);
		}
	}

	private void 门客拉满()
	{
		int num = 0;
		try
		{
			for (int i = 0; i < Mainload.MenKe_Now.Count; i++)
			{
				List<string> list = Mainload.MenKe_Now[i];
				if (list == null || list.Count < 17)
				{
					continue;
				}
				string[] array = list[2].Split(new char[1] { '|' });
				if (array.Length < 7)
				{
					continue;
				}
				int.TryParse(array[4], out var result);
				int.TryParse(array[6], out var result2);
				if ((门客_性别筛选 < 0 || result == 门客_性别筛选) && (门客_技能筛选 <= 0 || result2 == 门客_技能筛选))
				{
					list[4] = "100";
					list[5] = "100";
					list[6] = "100";
					list[7] = "100";
					list[8] = "100";
					list[11] = "100";
					list[13] = "100";
					list[15] = "100";
					list[16] = "10";
					if (!int.TryParse(list[14], out var result3) || result3 <= 0)
					{
						list[14] = "99";
					}
					if (!int.TryParse(list[17], out var result4) || result4 < -1)
					{
						list[17] = "-1";
					}
					if (!int.TryParse(list[19], out var result5) || result5 <= 0)
					{
						list[19] = "100";
					}
					if (门客_技能筛选 > 0)
					{
						array[6] = 门客_技能筛选.ToString();
					}
					if (门客_天赋 >= 0 && array.Length >= 4)
					{
						array[2] = 门客_天赋.ToString();
						array[3] = ((门客_天赋 == 0) ? "0" : "100");
					}
					if (门客_技能筛选 > 0 || 门客_天赋 >= 0)
					{
						list[2] = string.Join("|", array);
					}
					num++;
				}
			}
			提示文字 = "已拉满 " + num + " 名门客";
			提示倒计时 = 300;
		}
		catch (Exception ex)
		{
			提示文字 = "拉满失败:" + ex.Message;
			提示倒计时 = 300;
			日志.LogWarning((object)("门客拉满失败:" + ex.Message));
		}
	}

	private void 门客随机立绘()
	{
		int num = 0;
		try
		{
			for (int i = 0; i < Mainload.MenKe_Now.Count; i++)
			{
				List<string> list = Mainload.MenKe_Now[i];
				if (list == null || list.Count < 3)
				{
					continue;
				}
				string[] array = list[2].Split(new char[1] { '|' });
				if (array.Length >= 7)
				{
					int.TryParse(array[4], out var result);
					int.TryParse(array[6], out var result2);
					if ((门客_性别筛选 < 0 || result == 门客_性别筛选) && (门客_技能筛选 <= 0 || result2 == 门客_技能筛选))
					{
						list[1] = FormulaData.Create_LiHuiID(4);
						num++;
					}
				}
			}
			提示文字 = "已随机更换 " + num + " 名门客的立绘";
			提示倒计时 = 300;
		}
		catch (Exception ex)
		{
			提示文字 = "换立绘失败:" + ex.Message;
			提示倒计时 = 300;
		}
	}

	private void 门客清空占用()
	{
		int num = 0;
		try
		{
			for (int i = 0; i < Mainload.MenKe_Now.Count; i++)
			{
				List<string> list = Mainload.MenKe_Now[i];
				if (list == null || list.Count < 11)
				{
					continue;
				}
				string[] array = list[2].Split(new char[1] { '|' });
				if (array.Length >= 7)
				{
					int.TryParse(array[4], out var result);
					int.TryParse(array[6], out var result2);
					if ((门客_性别筛选 < 0 || result == 门客_性别筛选) && (门客_技能筛选 <= 0 || result2 == 门客_技能筛选))
					{
						list[9] = "0|null|null";
						list[10] = "0";
						num++;
					}
				}
			}
			提示文字 = "已清空 " + num + " 名门客的占用状态,现在可以在街上被选到";
			提示倒计时 = 300;
		}
		catch (Exception ex)
		{
			提示文字 = "清空占用失败:" + ex.Message;
			提示倒计时 = 300;
		}
	}

	private void 门客删除筛选()
	{
		int num = 0;
		try
		{
			for (int num2 = Mainload.MenKe_Now.Count - 1; num2 >= 0; num2--)
			{
				List<string> list = Mainload.MenKe_Now[num2];
				if (list != null && list.Count >= 3)
				{
					string[] array = list[2].Split(new char[1] { '|' });
					if (array.Length >= 7)
					{
						int.TryParse(array[4], out var result);
						int.TryParse(array[6], out var result2);
						if ((门客_性别筛选 < 0 || result == 门客_性别筛选) && (门客_技能筛选 <= 0 || result2 == 门客_技能筛选))
						{
							try
							{
								string[] array2 = list[9].Split(new char[1] { '|' });
								if (array2.Length >= 3 && array2[2] != "null")
								{
									for (int i = 0; i < Mainload.Member_now.Count; i++)
									{
										if (Mainload.Member_now[i][0] == array2[2])
										{
											FormulaData.ChangeTeacher(i, num2, -1);
											break;
										}
									}
								}
							}
							catch
							{
							}
							Mainload.MenKe_Now.RemoveAt(num2);
							num++;
						}
					}
				}
			}
			提示文字 = "已删除 " + num + " 名门客";
			提示倒计时 = 300;
			日志.LogDebug((object)("删除门客:" + num + " 名"));
		}
		catch (Exception ex)
		{
			提示文字 = "删除失败:" + ex.Message;
			提示倒计时 = 300;
			日志.LogWarning((object)("删除门客失败:" + ex.Message));
		}
	}

	internal static int 生成门客(int 性别, int 技能, int 天赋 = 0, int 品性 = 5)
	{
		if (技能 < 1 || 技能 > 6)
		{
			return -1;
		}
		int num = ((品性 <= 0) ? (TrueRandom.GetRanom(14) + 1) : 品性);
		if (num < 1)
		{
			num = 1;
		}
		if (num > 14)
		{
			num = 14;
		}
		try
		{
			List<string> list = ((Mainload.MenKe_Now.Count <= 0) ? FormulaData.CreatHanMen_ShuoMei(性别.ToString(), 100f, 100f, 100f, 100f, 100, 0) : new List<string>(Mainload.MenKe_Now[0]));
			while (list.Count < 22)
			{
				list.Add("null");
			}
			string text = 性别.ToString();
			string text2 = "门客";
			try
			{
				text2 = RandName.GetXing_Name(text);
			}
			catch
			{
			}
			string[] array = list[2].Split(new char[1] { '|' });
			if (array.Length >= 7)
			{
				array[0] = text2;
				array[4] = text;
				array[6] = 技能.ToString();
				array[2] = 天赋.ToString();
				array[3] = ((天赋 == 0) ? "0" : "100");
				if (array.Length > 8)
				{
					array[8] = num.ToString();
				}
			}
			list[2] = string.Join("|", array);
			list[0] = "MK" + DateTime.Now.Ticks + TrueRandom.GetRanom(999);
			try
			{
				list[1] = FormulaData.Create_LiHuiID(4);
			}
			catch
			{
			}
			list[3] = "20";
			list[4] = "100";
			list[5] = "100";
			list[6] = "100";
			list[7] = "100";
			list[8] = "100";
			list[9] = "0|null|null";
			list[10] = "0";
			list[11] = "100";
			list[13] = "100";
			list[14] = "99";
			list[15] = "100";
			list[16] = "10";
			list[17] = "-1";
			list[18] = "50";
			list[19] = "100";
			list[20] = "0";
			list[21] = "null";
			Mainload.MenKe_Now.Add(list);
			return Mainload.MenKe_Now.Count - 1;
		}
		catch (Exception ex)
		{
			ManualLogSource obj3 = 日志;
			if (obj3 != null)
			{
				obj3.LogWarning((object)("生成门客失败:" + ex.Message));
			}
			return -1;
		}
	}

	private void 新增门客()
	{
		int num = 生成门客(门客_新增性别, 门客_新增技能, 门客_新增天赋, 门客_新增品性);
		if (num < 0)
		{
			提示文字 = "新增失败";
			提示倒计时 = 300;
			return;
		}
		string text = "门客";
		try
		{
			text = Mainload.MenKe_Now[num][2].Split(new char[1] { '|' })[0];
		}
		catch
		{
		}
		提示文字 = "已新增门客:" + text + "(" + 技能名[门客_新增技能] + ")";
		提示倒计时 = 300;
		日志.LogDebug((object)("新增满属性门客:" + text + " 技能=" + 技能名[门客_新增技能]));
	}

	private void 批量新增门客(int 数量)
	{
		if (数量 <= 0)
		{
			提示文字 = "数量要大于 0";
			提示倒计时 = 240;
			return;
		}
		int num = 0;
		for (int i = 0; i < 数量; i++)
		{
			int num2 = 生成门客(门客_新增性别, 门客_新增技能, 门客_新增天赋, 门客_新增品性);
			if (num2 < 0)
			{
				break;
			}
			num++;
		}
		提示文字 = "已新增 " + num + " 名门客(" + 技能名[门客_新增技能] + ")";
		提示倒计时 = 300;
		日志.LogDebug((object)("批量新增门客:" + num + " 名,技能=" + 技能名[门客_新增技能]));
	}

	internal static void 自动选先生()
	{
		if (培养偏好 <= 0)
		{
			return;
		}
		try
		{
			int memberIndex_click = Mainload.MemberIndex_click;
			if (memberIndex_click < 0 || memberIndex_click >= Mainload.Member_now.Count)
			{
				return;
			}
			string text = Mainload.Member_now[memberIndex_click][0];
			int num = -1;
			for (int i = 0; i < Mainload.MenKe_Now.Count; i++)
			{
				string[] array = Mainload.MenKe_Now[i][9].Split(new char[1] { '|' });
				if (array.Length >= 3 && array[2] == text)
				{
					num = i;
					break;
				}
			}
			if (num >= 0)
			{
				return;
			}
			int num2 = -1;
			for (int j = 0; j < Mainload.MenKe_Now.Count; j++)
			{
				List<string> list = Mainload.MenKe_Now[j];
				if (list == null || list.Count < 17)
				{
					continue;
				}
				string[] array2 = list[2].Split(new char[1] { '|' });
				if (array2.Length < 7)
				{
					continue;
				}
				int.TryParse(array2[6], out var result);
				if (result != 培养偏好)
				{
					continue;
				}
				int.TryParse(list[16], out var result2);
				if (result2 > 0)
				{
					string[] array3 = list[9].Split(new char[1] { '|' });
					if (array3.Length < 3 || !(array3[2] != "null"))
					{
						num2 = j;
						break;
					}
				}
			}
			if (num2 < 0)
			{
				int ranom = TrueRandom.GetRanom(2);
				num2 = 生成门客(ranom, 培养偏好);
				if (num2 >= 0)
				{
					ManualLogSource obj = 日志;
					if (obj != null)
					{
						obj.LogDebug((object)("全家没有对应门客,已自动生成一名:" + 技能名[培养偏好]));
					}
				}
			}
			if (num2 >= 0)
			{
				FormulaData.ChangeTeacher(memberIndex_click, -1, num2);
				List<string> list2 = Mainload.MenKe_Now[num2];
				string[] array4 = list2[9].Split(new char[1] { '|' });
				list2[9] = array4[0] + "|" + array4[1] + "|" + text;
				list2[10] = "1";
				ManualLogSource obj2 = 日志;
				if (obj2 != null)
				{
					obj2.LogDebug((object)("自动安排先生:" + 技能名[培养偏好] + "(门客 " + num2 + ")"));
				}
			}
		}
		catch (Exception ex)
		{
			ManualLogSource obj3 = 日志;
			if (obj3 != null)
			{
				obj3.LogWarning((object)("自动安排先生失败:" + ex.Message));
			}
		}
	}

	private static float 读浮点(string 文本)
	{
		float result;
		return float.TryParse(文本, out result) ? result : 0f;
	}

	private void 门客自动安排(bool 清排除)
	{
		try
		{
			string sceneID = Mainload.SceneID;
			if (string.IsNullOrEmpty(sceneID))
			{
				return;
			}
			string[] array = sceneID.Split(new char[1] { '|' });
			if (array.Length < 2 || (array[0] != "S" && array[0] != "C") || !int.TryParse(array[1], out var result) || result < 0 || result >= Mainload.CityData_now.Count || (!门客打工开 && !门客交易开))
			{
				return;
			}
			if (清排除)
			{
				门客工作排除.Clear();
			}
			int num = 0;
			for (int i = 0; i < Mainload.MenKe_Now.Count; i++)
			{
				List<string> list = Mainload.MenKe_Now[i];
				if (list == null || list.Count < 17 || 门客工作排除.Contains(list[0]) || list[10] != "0")
				{
					continue;
				}
				string[] array2 = list[9].Split(new char[1] { '|' });
				if (array2.Length >= 3 && (array2[1] != "null" || array2[2] != "null"))
				{
					continue;
				}
				float num2 = 读浮点(list[4]);
				float num3 = 读浮点(list[5]);
				float num4 = 读浮点(list[6]);
				string text = "";
				int num5 = 0;
				float num6 = 0f;
				if (门客交易开 && num4 >= num2 && num4 >= num3)
				{
					text = "18";
					num5 = 1;
					num6 = num4;
				}
				else if (门客打工开)
				{
					text = "17";
					num5 = 0;
					num6 = num2 + num3;
				}
				if (!(text == ""))
				{
					string[] array3 = Mainload.CityData_now[result][0][16].Split(new char[1] { '|' });
					if (array3.Length >= 4)
					{
						array3[num5] = (读浮点(array3[num5]) + num6).ToString();
						Mainload.CityData_now[result][0][16] = string.Join("|", array3);
						list[9] = result + "|null|null";
						list[10] = text;
						list[12] = "1";
						num++;
					}
				}
			}
			if (num > 0)
			{
				提示文字 = "已安排 " + num + " 名门客工作(城市 " + (result + 1) + ")";
				提示倒计时 = 300;
				日志.LogDebug((object)("门客自动安排:" + num + " 名,城市=" + result));
			}
		}
		catch (Exception ex)
		{
			日志.LogWarning((object)("门客自动安排失败:" + ex.Message));
		}
	}

	private bool 解除门客工作(int 索引)
	{
		try
		{
			if (索引 < 0 || 索引 >= Mainload.MenKe_Now.Count)
			{
				return false;
			}
			List<string> list = Mainload.MenKe_Now[索引];
			if (list == null || list.Count < 17)
			{
				return false;
			}
			string text = list[10];
			if (text != "17" && text != "18" && text != "19" && text != "20")
			{
				return false;
			}
			string[] array = list[9].Split(new char[1] { '|' });
			if (array.Length < 1 || !int.TryParse(array[0], out var result))
			{
				return false;
			}
			if (result < 0 || result >= Mainload.CityData_now.Count)
			{
				return false;
			}
			string[] array2 = Mainload.CityData_now[result][0][16].Split(new char[1] { '|' });
			if (array2.Length < 4)
			{
				return false;
			}
			float num = 读浮点(list[4]);
			float num2 = 读浮点(list[5]);
			float num3 = 读浮点(list[6]);
			float num4 = 读浮点(list[15]);
			switch (text)
			{
			case "17":
				array2[0] = Mathf.Max(0f, 读浮点(array2[0]) - num - num2).ToString();
				break;
			case "18":
				array2[1] = Mathf.Max(0f, 读浮点(array2[1]) - num3).ToString();
				break;
			case "19":
				array2[2] = Mathf.Max(0f, 读浮点(array2[2]) - num4).ToString();
				break;
			case "20":
				array2[3] = Mathf.Max(0f, 读浮点(array2[3]) - num4).ToString();
				break;
			}
			Mainload.CityData_now[result][0][16] = string.Join("|", array2);
			list[9] = "0|null|null";
			list[10] = "0";
			list[12] = "1";
			门客工作排除.Add(list[0]);
			return true;
		}
		catch
		{
			return false;
		}
	}

	private void 绘制门客解除页(float x, float y, float w, float h)
	{
		//IL_0009: 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_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_0444: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_022a: Unknown result type (might be due to invalid IL or missing references)
		//IL_032f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0338: Unknown result type (might be due to invalid IL or missing references)
		//IL_033b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0340: Unknown result type (might be due to invalid IL or missing references)
		//IL_0342: Unknown result type (might be due to invalid IL or missing references)
		//IL_0347: Unknown result type (might be due to invalid IL or missing references)
		//IL_0513: Unknown result type (might be due to invalid IL or missing references)
		GUI.Label(new Rect(x, y, w, 40f), "门客修改 · 解除工作", 标题样式);
		if (GUI.Button(new Rect(x + w - 110f, y + 2f, 110f, 34f), "返回", 小按钮样式))
		{
			门客解除面板开 = false;
			return;
		}
		int index = 0;
		try
		{
			index = Mainload.SetData[4];
		}
		catch
		{
		}
		List<int> list = new List<int>();
		try
		{
			for (int i = 0; i < Mainload.MenKe_Now.Count; i++)
			{
				List<string> list2 = Mainload.MenKe_Now[i];
				if (list2 == null || list2.Count < 17)
				{
					continue;
				}
				string text = list2[10];
				switch (text)
				{
				default:
					if (!(text == "20"))
					{
						continue;
					}
					break;
				case "17":
				case "18":
				case "19":
					break;
				}
				list.Add(i);
			}
		}
		catch
		{
		}
		GUI.Label(new Rect(x, y + 44f, w, 28f), "正在工作的门客:" + list.Count + " 名(勾选后点「解除勾选的工作」,可以多选)", 正文样式);
		if (GUI.Button(new Rect(x, y + 76f, 90f, 30f), "全选", 小按钮样式))
		{
			foreach (int item in list)
			{
				门客解除勾选.Add(item);
			}
		}
		if (GUI.Button(new Rect(x + 96f, y + 76f, 90f, 30f), "清空勾选", 小按钮样式))
		{
			门客解除勾选.Clear();
		}
		if (GUI.Button(new Rect(x + 192f, y + 76f, 170f, 30f), "解除勾选的工作", 按钮样式))
		{
			int num = 0;
			foreach (int item2 in new List<int>(门客解除勾选))
			{
				if (解除门客工作(item2))
				{
					num++;
				}
			}
			门客解除勾选.Clear();
			提示文字 = "已解除 " + num + " 名门客的工作";
			提示倒计时 = 300;
		}
		float num2 = y + 116f;
		float num3 = Mathf.Max(100f, h - 116f - 8f);
		Rect val = default(Rect);
		((Rect)(ref val))..ctor(x, num2, w, num3);
		Rect val2 = default(Rect);
		((Rect)(ref val2))..ctor(0f, 0f, w - 20f, Mathf.Max(num3, (float)list.Count * 36f + 8f));
		禁止拖动区域.Add(val);
		门客解除滚动 = GUI.BeginScrollView(val, 门客解除滚动, val2);
		for (int j = 0; j < list.Count; j++)
		{
			int num4 = list[j];
			List<string> list3 = Mainload.MenKe_Now[num4];
			string text2 = "";
			string text3 = "";
			string text4 = "";
			try
			{
				text2 = list3[2].Split(new char[1] { '|' })[0];
				text3 = AllText.Text_AllMemberState[int.Parse(list3[10])][index];
				if (int.TryParse(list3[9].Split(new char[1] { '|' })[0], out var result))
				{
					text4 = AllText.Text_City[result][index].Split(new char[1] { '~' })[0];
				}
			}
			catch
			{
			}
			bool flag = 门客解除勾选.Contains(num4);
			bool flag2 = GUI.Toggle(new Rect(2f, (float)j * 36f + 4f, w - 30f, 30f), flag, " " + text2 + "\u3000" + text3 + ((text4.Length > 0) ? ("\u3000" + text4) : ""), 开关样式);
			if (flag2 != flag)
			{
				if (flag2)
				{
					门客解除勾选.Add(num4);
				}
				else
				{
					门客解除勾选.Remove(num4);
				}
			}
		}
		GUI.EndScrollView();
		if (提示倒计时 > 0)
		{
			GUI.Label(new Rect(x, num2 + num3 - 26f, w, 24f), 提示文字, 提示样式);
		}
	}

	private void 绘制角色页(float x, float y, float w, float h)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_068b: Unknown result type (might be due to invalid IL or missing references)
		//IL_06bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_071f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0927: Unknown result type (might be due to invalid IL or missing references)
		//IL_0956: Unknown result type (might be due to invalid IL or missing references)
		//IL_0988: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e13: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e78: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ebe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f04: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f4a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f8f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fb8: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a5c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a85: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fec: Unknown result type (might be due to invalid IL or missing references)
		//IL_031c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0345: Unknown result type (might be due to invalid IL or missing references)
		//IL_0823: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b01: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b2a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03eb: 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_0ba6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bcf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0467: Unknown result type (might be due to invalid IL or missing references)
		//IL_0490: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c4b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c74: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cea: Unknown result type (might be due to invalid IL or missing references)
		GUI.Label(new Rect(x, y, w, 44f), "角色属性", 标题样式);
		int num = 0;
		try
		{
			num = ((Mainload.Member_now != null) ? Mainload.Member_now.Count : 0);
		}
		catch
		{
		}
		if (num <= 0)
		{
			GUI.Label(new Rect(x, y + 44f, w, 30f), "还没读到家族成员。", 正文样式);
			return;
		}
		if (角色目标 < 0 || 角色目标 >= num)
		{
			角色目标 = 0;
		}
		if (GUI.Button(new Rect(x, y + 44f, 34f, 30f), "◀", 小按钮样式))
		{
			角色目标 = (角色目标 - 1 + num) % num;
			角色输入缓存 = -1;
		}
		if (GUI.Button(new Rect(x + 44f, y + 44f, 34f, 30f), "▶", 小按钮样式))
		{
			角色目标 = (角色目标 + 1) % num;
			角色输入缓存 = -1;
		}
		List<string> list = null;
		try
		{
			list = Mainload.Member_now[角色目标];
		}
		catch
		{
		}
		if (list == null)
		{
			GUI.Label(new Rect(x, y + 86f, w, 30f), "读取成员数据失败。", 正文样式);
			return;
		}
		string text = "?";
		string text2 = "?";
		try
		{
			string[] array = list[4].Split(new char[1] { '|' });
			text = array[0];
			text2 = ((array.Length > 4 && array[4] == "1") ? "男" : "女");
		}
		catch
		{
		}
		GUI.Label(new Rect(x + 90f, y + 47f, w - 90f, 30f), "目标:" + text + "(" + text2 + ")· 第 " + (角色目标 + 1) + " / " + num + " 位", 副标题样式);
		float num2 = y + 84f;
		GUI.Label(new Rect(x, num2 + 3f, 60f, 26f), "功名", 正文样式);
		if (GUI.Button(new Rect(x + 62f, num2, 300f, 28f), 功名名(list) + " ▼", 小按钮样式))
		{
			关全部下拉();
			功名下拉开 = true;
		}
		if (功名下拉开)
		{
			画功名下拉(x + 62f, num2 + 30f, list);
			return;
		}
		num2 += 30f;
		GUI.Label(new Rect(x, num2 + 3f, 60f, 26f), "封地", 正文样式);
		if (GUI.Button(new Rect(x + 62f, num2, 300f, 28f), 所选封地名(list) + " ▼", 小按钮样式))
		{
			关全部下拉();
			封地下拉开 = true;
		}
		if (封地下拉开)
		{
			画封地下拉(x + 62f, num2 + 30f, list);
			return;
		}
		num2 += 30f;
		GUI.Label(new Rect(x, num2 + 3f, 60f, 26f), "爵位", 正文样式);
		if (GUI.Button(new Rect(x + 62f, num2, 300f, 28f), 爵位名(list) + " ▼", 小按钮样式))
		{
			关全部下拉();
			爵位下拉开 = true;
		}
		if (爵位下拉开)
		{
			画爵位下拉(x + 62f, num2 + 30f, list);
			return;
		}
		num2 += 30f;
		GUI.Label(new Rect(x, num2 + 3f, 60f, 26f), "官服", 正文样式);
		if (GUI.Button(new Rect(x + 62f, num2, 300f, 28f), 官服名(list) + " ▼", 小按钮样式))
		{
			关全部下拉();
			官服下拉开 = true;
		}
		if (官服下拉开)
		{
			画官服下拉(x + 62f, num2 + 30f, list);
			return;
		}
		num2 += 30f;
		if (角色输入缓存 != 角色目标)
		{
			角色输入缓存 = 角色目标;
			for (int i = 0; i < 角色数值列.Length; i++)
			{
				string text3 = "0";
				try
				{
					text3 = list[角色数值列[i]];
				}
				catch
				{
				}
				角色数值输入[i] = text3;
			}
			try
			{
				幸运输入 = list[4].Split(new char[1] { '|' })[7];
			}
			catch
			{
				幸运输入 = "0";
			}
			try
			{
				int.TryParse(list[14].Split(new char[1] { '|' })[1], out 爵位选封地);
			}
			catch
			{
				爵位选封地 = 0;
			}
			try
			{
				天赋值输入 = list[4].Split(new char[1] { '|' })[3];
			}
			catch
			{
				天赋值输入 = "0";
			}
			try
			{
				技能等级输入 = list[33];
			}
			catch
			{
				技能等级输入 = "0";
			}
		}
		string 成员ID = "";
		try
		{
			成员ID = list[0];
		}
		catch
		{
		}
		int[] array2 = 取锁(成员ID);
		for (int j = 0; j < 角色数值名.Length; j++)
		{
			string text4 = "0";
			try
			{
				text4 = list[角色数值列[j]];
			}
			catch
			{
			}
			GUI.Label(new Rect(x, num2 + 4f, 64f, 26f), 角色数值名[j], 正文样式);
			GUI.Label(new Rect(x + 66f, num2 + 4f, 130f, 26f), "当前:" + text4, 正文样式);
			角色数值输入[j] = 画输入框(new Rect(x + 200f, num2, 90f, 28f), 角色数值输入[j], 12);
			if (GUI.Button(new Rect(x + 294f, num2, 54f, 28f), "设置", 小按钮样式))
			{
				int num3 = 取整(角色数值输入[j]);
				if (num3 < 0)
				{
					num3 = 0;
				}
				if (num3 > 999999)
				{
					num3 = 999999;
				}
				try
				{
					list[角色数值列[j]] = num3.ToString();
				}
				catch
				{
				}
				角色数值输入[j] = num3.ToString();
				提示文字 = text + " 的" + 角色数值名[j] + "已设为 " + num3;
				提示倒计时 = 240;
			}
			int num4 = 锁位找(j);
			if (num4 >= 0)
			{
				bool flag = array2[num4] >= 0;
				if (GUI.Button(new Rect(x + 352f, num2, 58f, 28f), flag ? "已锁" : "锁", flag ? 选中按钮样式 : 小按钮样式))
				{
					if (flag)
					{
						array2[num4] = -1;
					}
					else
					{
						int.TryParse(text4, out var result);
						array2[num4] = result;
					}
					提示文字 = (flag ? (角色数值名[j] + "已解锁") : (角色数值名[j] + "已锁在 " + array2[num4]));
					提示倒计时 = 240;
				}
			}
			num2 += 28f;
		}
		string text5 = "0";
		try
		{
			text5 = list[4].Split(new char[1] { '|' })[7];
		}
		catch
		{
		}
		GUI.Label(new Rect(x, num2 + 4f, 64f, 26f), "幸运", 正文样式);
		GUI.Label(new Rect(x + 66f, num2 + 4f, 130f, 26f), "当前:" + text5, 正文样式);
		幸运输入 = 画输入框(new Rect(x + 200f, num2, 90f, 28f), 幸运输入, 9);
		if (GUI.Button(new Rect(x + 294f, num2, 54f, 28f), "设置", 小按钮样式))
		{
			int num5 = 取整(幸运输入);
			if (num5 < 0)
			{
				num5 = 0;
			}
			if (num5 > 999999)
			{
				num5 = 999999;
			}
			写资料串(list, 7, num5.ToString());
			幸运输入 = num5.ToString();
			提示文字 = text + " 的幸运已设为 " + num5;
			提示倒计时 = 240;
		}
		num2 += 28f;
		GUI.Label(new Rect(x, num2 + 3f, 60f, 26f), "喜好", 正文样式);
		if (GUI.Button(new Rect(x + 62f, num2, 300f, 28f), 喜好名(list) + " ▼", 小按钮样式))
		{
			关全部下拉();
			喜好下拉开 = true;
		}
		if (喜好下拉开)
		{
			画喜好下拉(x + 62f, num2 + 30f, list);
			return;
		}
		num2 += 28f;
		GUI.Label(new Rect(x, num2 + 3f, 60f, 26f), "品性", 正文样式);
		if (GUI.Button(new Rect(x + 62f, num2, 300f, 28f), 品性名2(list) + " ▼", 小按钮样式))
		{
			关全部下拉();
			品性下拉开 = true;
		}
		if (品性下拉开)
		{
			画品性下拉(x + 62f, num2 + 30f, list);
			return;
		}
		num2 += 28f;
		GUI.Label(new Rect(x, num2 + 3f, 60f, 26f), "天赋", 正文样式);
		if (GUI.Button(new Rect(x + 62f, num2, 240f, 28f), 天赋名2(list) + "(100)▼", 小按钮样式))
		{
			关全部下拉();
			天赋下拉开 = true;
		}
		if (天赋下拉开)
		{
			画天赋下拉(x + 62f, num2 + 30f, list);
			return;
		}
		num2 += 28f;
		GUI.Label(new Rect(x, num2 + 3f, 60f, 26f), "技能", 正文样式);
		if (GUI.Button(new Rect(x + 62f, num2, 240f, 28f), 技能名2(list) + "(等级10)▼", 小按钮样式))
		{
			关全部下拉();
			技能下拉开 = true;
		}
		if (技能下拉开)
		{
			画技能下拉(x + 62f, num2 + 30f, list);
			return;
		}
		num2 += 28f;
		if (GUI.Button(new Rect(x, num2, 300f, 34f), "全属性一键满(按游戏上限)", 按钮样式))
		{
			全属性满(list);
			try
			{
				array2[0] = 取整(list[6]);
			}
			catch
			{
			}
			array2[1] = 20;
			array2[2] = 100;
			array2[3] = 100;
			for (int k = 0; k < 角色数值列.Length; k++)
			{
				try
				{
					角色数值输入[k] = list[角色数值列[k]];
				}
				catch
				{
				}
			}
			try
			{
				幸运输入 = list[4].Split(new char[1] { '|' })[7];
			}
			catch
			{
			}
			提示文字 = "已拉满并锁住 年龄/体力/健康/心情";
			提示倒计时 = 240;
		}
		num2 += 38f;
		int num6 = 读物品数量(68);
		int num7 = 读物品数量(72);
		string text6 = "0";
		try
		{
			text6 = list[4].Split(new char[1] { '|' })[5];
		}
		catch
		{
		}
		GUI.Label(new Rect(x, num2 + 2f, 260f, 26f), "长寿丹 " + num6 + "\u3000极品 " + num7 + "\u3000寿元 " + text6, 提示样式);
		num2 += 30f;
		成人自动装备 = GUI.Toggle(new Rect(x, num2, 210f, 28f), 成人自动装备, " 成年人进档自动装备", 开关样式);
		配置_成人自动装备.Value = 成人自动装备;
		自动配马 = GUI.Toggle(new Rect(x + 220f, num2, 150f, 28f), 自动配马, " 自动配马", 开关样式);
		配置_自动配马.Value = 自动配马;
		自动吃长寿丹 = GUI.Toggle(new Rect(x + 380f, num2, 200f, 28f), 自动吃长寿丹, " 自动吃长寿丹", 开关样式);
		配置_自动吃丹.Value = 自动吃长寿丹;
		自动全满族人 = GUI.Toggle(new Rect(x + 590f, num2, 280f, 28f), 自动全满族人, " 读档自动全满全族", 开关样式);
		配置_自动全满族人.Value = 自动全满族人;
		num2 += 30f;
		GUI.Label(new Rect(x, num2, w, 26f), "体力按年龄上限、其余封顶 100,年龄不动;年龄/体力/健康/心情可点「锁」锁住。", 提示样式);
		num2 += 26f;
		GUI.Label(new Rect(x, num2, w, 26f), "「读档自动全满全族」:每次加载存档时,把 Member_now 里所有家族成员的属性拉满一次。", 提示样式);
		if (提示倒计时 > 0)
		{
			GUI.Label(new Rect(x, num2 + 24f, w, 26f), 提示文字, 提示样式);
		}
	}

	private static int 锁位找(int i)
	{
		if (角色数值名[i] == "年龄")
		{
			return 0;
		}
		if (角色数值名[i] == "体力")
		{
			return 1;
		}
		if (角色数值名[i] == "健康")
		{
			return 2;
		}
		if (角色数值名[i] == "心情")
		{
			return 3;
		}
		return -1;
	}

	private int[] 取锁(string 成员ID)
	{
		if (!成员锁.TryGetValue(成员ID, out var value) || value == null)
		{
			value = new int[4] { -1, -1, -1, -1 };
			成员锁[成员ID] = value;
		}
		return value;
	}

	private static string 功名名(List<string> 行)
	{
		try
		{
			int num = int.Parse(行[13]);
			if (num < 0 || num >= AllText.Text_All_GongMing.Count)
			{
				return "无";
			}
			return AllText.Text_All_GongMing[num][Mainload.SetData[4]];
		}
		catch
		{
			return "?";
		}
	}

	private void 循环功名(List<string> 行, int 步)
	{
		try
		{
			int count = AllText.Text_All_GongMing.Count;
			int num = int.Parse(行[13]) + 步;
			if (num < -1)
			{
				num = count - 1;
			}
			if (num >= count)
			{
				num = -1;
			}
			行[13] = num.ToString();
			提示文字 = "功名:" + 功名名(行);
			提示倒计时 = 240;
		}
		catch
		{
		}
	}

	private static string 爵位名(List<string> 行)
	{
		try
		{
			string[] array = 行[14].Split(new char[1] { '|' });
			int num = int.Parse(array[0]);
			int num2 = int.Parse(array[1]);
			if (num == 0 && num2 == 0)
			{
				return "无";
			}
			return AllText.Text_AllJueWei[num][Mainload.SetData[4]].Replace("@", AllText.Text_AllFengdi[num2][Mainload.SetData[4]]);
		}
		catch
		{
			return "?";
		}
	}

	private void 循环爵位(List<string> 行, int 步)
	{
		try
		{
			int count = AllText.Text_AllJueWei.Count;
			int num = 爵位当前值(行) + 步;
			if (num < 0)
			{
				num = count - 1;
			}
			if (num >= count)
			{
				num = 0;
			}
			循环爵位设置(行, num);
			提示倒计时 = 240;
		}
		catch
		{
		}
	}

	private static int 功名当前值(List<string> 行)
	{
		int result;
		return int.TryParse(行[13], out result) ? result : (-1);
	}

	private static int 爵位当前值(List<string> 行)
	{
		try
		{
			return int.Parse(行[14].Split(new char[1] { '|' })[0]);
		}
		catch
		{
			return 0;
		}
	}

	private void 循环爵位设置(List<string> 行, int j, int 优先封地 = -1)
	{
		try
		{
			if (j <= 0)
			{
				行[14] = "0|0";
				提示文字 = "爵位:无";
				return;
			}
			int result = 优先封地;
			if (result <= 0)
			{
				try
				{
					int.TryParse(行[14].Split(new char[1] { '|' })[1], out result);
				}
				catch
				{
				}
			}
			if (result <= 0)
			{
				int num = -1;
				try
				{
					for (int i = 1; i < Mainload.Fengdi_now.Count; i++)
					{
						if (Mainload.Fengdi_now[i][0] == "0")
						{
							num = i;
							break;
						}
					}
				}
				catch
				{
				}
				if (num <= 0)
				{
					提示文字 = "没有空封地可封(要先去占城/扩张)";
					return;
				}
				try
				{
					Mainload.Fengdi_now[num][0] = "1";
				}
				catch
				{
				}
				result = num;
			}
			行[14] = j + "|" + result;
			try
			{
				int num2 = 0;
				switch (j)
				{
				case 4:
					num2 = 1;
					break;
				case 3:
					num2 = 4;
					break;
				case 2:
					num2 = 5;
					break;
				case 1:
					num2 = 6;
					break;
				}
				行[12] = ((num2 > 0) ? ("5@" + num2 + "@0@-1@-1|0") : "0@0@0@-1@-1|0");
			}
			catch
			{
			}
			提示文字 = "爵位:" + 爵位名(行);
		}
		catch
		{
		}
	}

	private bool 画下拉(float x, float y, float 宽, List<KeyValuePair<int, string>> 选项, int 选中值, ref Vector2 滚动, out int 选中)
	{
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: 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_006b: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: 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_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)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		选中 = 选中值;
		float num = 28f;
		int num2 = Mathf.Min(选项.Count, 9);
		Rect val = default(Rect);
		((Rect)(ref val))..ctor(x, y, 宽, Mathf.Max(34f, (float)num2 * num + 6f));
		禁止拖动区域.Add(val);
		Color color = GUI.color;
		GUI.color = new Color(0.09f, 0.08f, 0.07f, 0.98f);
		GUI.DrawTexture(val, (Texture)(object)Texture2D.whiteTexture);
		GUI.color = color;
		Rect val2 = default(Rect);
		((Rect)(ref val2))..ctor(((Rect)(ref val)).x + 2f, ((Rect)(ref val)).y + 3f, ((Rect)(ref val)).width - 4f, ((Rect)(ref val)).height - 6f);
		Rect val3 = default(Rect);
		((Rect)(ref val3))..ctor(0f, 0f, ((Rect)(ref val)).width - 18f, (float)选项.Count * num);
		滚动 = GUI.BeginScrollView(val2, 滚动, val3);
		for (int i = 0; i < 选项.Count; i++)
		{
			bool flag = 选项[i].Key == 选中值;
			if (GUI.Button(new Rect(0f, (float)i * num, ((Rect)(ref val3)).width, num - 2f), 选项[i].Value, flag ? 选中按钮样式 : 小按钮样式))
			{
				选中 = 选项[i].Key;
				GUI.EndScrollView();
				return true;
			}
		}
		GUI.EndScrollView();
		return false;
	}

	private void 画功名下拉(float x, float y, List<string> 行)
	{
		List<KeyValuePair<int, string>> list = new List<KeyValuePair<int, string>>();
		list.Add(new KeyValuePair<int, string>(-1, "无"));
		int num = 0;
		try
		{
			num = AllText.Text_All_GongMing.Count;
		}
		catch
		{
		}
		for (int i = 0; i < num; i++)
		{
			string value = "?";
			try
			{
				value = AllText.Text_All_GongMing[i][Mainload.SetData[4]];
			}
			catch
			{
			}
			list.Add(new KeyValuePair<int, string>(i, value));
		}
		if (画下拉(x, y, 220f, list, 功名当前值(行), ref 功名下滚, out var 选中))
		{
			行[13] = 选中.ToString();
			功名下拉开 = false;
			提示文字 = "功名:" + 功名名(行);
			提示倒计时 = 240;
		}
	}

	private void 画爵位下拉(float x, float y, List<string> 行)
	{
		int result = 爵位选封地;
		if (result <= 0)
		{
			try
			{
				int.TryParse(行[14].Split(new char[1] { '|' })[1], out result);
			}
			catch
			{
			}
		}
		string newValue = ((result > 0) ? AllText.Text_AllFengdi[result][Mainload.SetData[4]] : "封地");
		List<KeyValuePair<int, string>> list = new List<KeyValuePair<int, string>>();
		list.Add(new KeyValuePair<int, string>(0, "无"));
		int num = 0;
		try
		{
			num = AllText.Text_AllJueWei.Count;
		}
		catch
		{
		}
		for (int i = 1; i < num; i++)
		{
			string value = "?";
			try
			{
				value = AllText.Text_AllJueWei[i][Mainload.SetData[4]].Replace("@", newValue);
			}
			catch
			{
			}
			list.Add(new KeyValuePair<int, string>(i, value));
		}
		if (画下拉(x, y, 300f, list, 爵位当前值(行), ref 爵位下滚, out var 选中))
		{
			循环爵位设置(行, 选中, 爵位选封地);
			爵位下拉开 = false;
			提示倒计时 = 240;
		}
	}

	private static string 封地全名(int f)
	{
		try
		{
			string text = AllText.Text_AllFengdi[f][Mainload.SetData[4]];
			string text2 = "";
			try
			{
				text2 = AllText.Text_City[f - 1][Mainload.SetData[4]].Split(new char[1] { '~' })[0];
			}
			catch
			{
			}
			return string.IsNullOrEmpty(text2) ? text : (text2 + "·" + text);
		}
		catch
		{
			return "封地 " + f;
		}
	}

	private string 所选封地名(List<string> 行)
	{
		int result = 爵位选封地;
		if (result <= 0)
		{
			try
			{
				int.TryParse(行[14].Split(new char[1] { '|' })[1], out result);
			}
			catch
			{
			}
		}
		if (result <= 0)
		{
			return "(未选封地)";
		}
		return 封地全名(result);
	}

	private void 画封地下拉(float x, float y, List<string> 行)
	{
		List<KeyValuePair<int, string>> list = new List<KeyValuePair<int, string>>();
		list.Add(new KeyValuePair<int, string>(0, "(不选封地)"));
		int num = 0;
		try
		{
			num = Mainload.Fengdi_now.Count;
		}
		catch
		{
		}
		string 排除ID = "";
		try
		{
			排除ID = 行[0];
		}
		catch
		{
		}
		for (int i = 1; i < num; i++)
		{
			string text = 封地全名(i);
			string text2 = 封地被谁用(i, 排除ID);
			if (text2 != null)
			{
				text = text + "(已封给" + text2 + ")";
			}
			else
			{
				try
				{
					if (Mainload.Fengdi_now[i][0] == "1")
					{
						text += "(自家)";
					}
				}
				catch
				{
				}
			}
			list.Add(new KeyValuePair<int, string>(i, text));
		}
		if (!画下拉(x, y, 280f, list, 爵位选封地, ref 封地下滚, out var 选中))
		{
			return;
		}
		if (选中 > 0)
		{
			string text3 = 封地被谁用(选中, 排除ID);
			if (text3 != null)
			{
				提示文字 = "这块封地已经封给 " + text3 + " 了(一个郡只能一个封地)";
				提示倒计时 = 300;
				封地下拉开 = false;
				return;
			}
		}
		爵位选封地 = 选中;
		if (选中 > 0)
		{
			try
			{
				Mainload.Fengdi_now[选中][0] = "1";
			}
			catch
			{
			}
			int num2 = 爵位当前值(行);
			if (num2 > 0)
			{
				循环爵位设置(行, num2, 选中);
			}
			提示文字 = "选中封地:" + 所选封地名(行) + "(已标记为自家)";
		}
		else
		{
			提示文字 = "已取消封地选择";
		}
		封地下拉开 = false;
		提示倒计时 = 240;
	}

	private string 封地被谁用(int f, string 排除ID)
	{
		try
		{
			for (int i = 0; i < Mainload.Member_now.Count; i++)
			{
				List<string> list = Mainload.Member_now[i];
				if (list != null && list.Count >= 15 && !(list[0] == 排除ID))
				{
					string[] array = list[14].Split(new char[1] { '|' });
					if (array.Length > 1 && int.TryParse(array[0], out var result) && result > 0 && int.TryParse(array[1], out var result2) && result2 == f)
					{
						return list[4].Split(new char[1] { '|' })[0];
					}
				}
			}
		}
		catch
		{
		}
		return null;
	}

	private void 关全部下拉()
	{
		功名下拉开 = (封地下拉开 = (爵位下拉开 = (官服下拉开 = (喜好下拉开 = (品性下拉开 = (天赋下拉开 = (技能下拉开 = false)))))));
	}

	private static int 官服值(List<string> 行)
	{
		try
		{
			string[] array = 行[12].Split(new char[1] { '|' })[0].Split(new char[1] { '@' });
			if (array.Length > 1 && array[0] == "5" && int.TryParse(array[1], out var result))
			{
				return result;
			}
		}
		catch
		{
		}
		return 0;
	}

	private static string 官服名(List<string> 行)
	{
		int num = 官服值(行);
		return (num > 0) ? ("官服 " + num) : "无(便服)";
	}

	private void 画官服下拉(float x, float y, List<string> 行)
	{
		List<KeyValuePair<int, string>> list = new List<KeyValuePair<int, string>>();
		list.Add(new KeyValuePair<int, string>(0, "无(便服)"));
		for (int i = 1; i <= 6; i++)
		{
			list.Add(new KeyValuePair<int, string>(i, "官服 " + i));
		}
		if (画下拉(x, y, 240f, list, 官服值(行), ref 官服下滚, out var 选中))
		{
			行[12] = ((选中 > 0) ? ("5@" + 选中 + "@0@-1@-1|0") : "0@0@0@-1@-1|0");
			关全部下拉();
			提示文字 = "形象:" + 官服名(行);
			提示倒计时 = 240;
		}
	}

	private static int 喜好值(List<string> 行)
	{
		try
		{
			return int.Parse(行[4].Split(new char[1] { '|' })[9]);
		}
		catch
		{
			return 0;
		}
	}

	private static string 喜好名(List<string> 行)
	{
		try
		{
			return AllText.Text_AllLike[喜好值(行)][Mainload.SetData[4]];
		}
		catch
		{
			return "?";
		}
	}

	private void 画喜好下拉(float x, float y, List<string> 行)
	{
		List<KeyValuePair<int, string>> list = new List<KeyValuePair<int, string>>();
		list.Add(new KeyValuePair<int, string>(-1, "随机"));
		int num = 0;
		try
		{
			num = AllText.Text_AllLike.Count;
		}
		catch
		{
		}
		for (int i = 0; i < num; i++)
		{
			string value = "?";
			try
			{
				value = AllText.Text_AllLike[i][Mainload.SetData[4]];
			}
			catch
			{
			}
			list.Add(new KeyValuePair<int, string>(i, value));
		}
		if (画下拉(x, y, 240f, list, 喜好值(行), ref 喜好下滚, out var 选中))
		{
			if (选中 < 0)
			{
				写资料串(行, 9, ((num > 0) ? TrueRandom.GetRanom(num) : 0).ToString());
				提示文字 = "喜好随机到:" + 喜好名(行);
			}
			else
			{
				写资料串(行, 9, 选中.ToString());
				提示文字 = "喜好:" + 喜好名(行);
			}
			关全部下拉();
			提示倒计时 = 240;
		}
	}

	private static int 品性值(List<string> 行)
	{
		try
		{
			return int.Parse(行[5]);
		}
		catch
		{
			return 1;
		}
	}

	private static int 善良品性()
	{
		try
		{
			int count = AllText.Text_PinXing.Count;
			for (int i = 1; i < count; i++)
			{
				if (AllText.Text_PinXing[i][Mainload.SetData[4]] == "善良")
				{
					return i;
				}
			}
		}
		catch
		{
		}
		return 5;
	}

	private static string 品性名2(List<string> 行)
	{
		try
		{
			int num = 品性值(行);
			if (num <= 0 || num >= AllText.Text_PinXing.Count)
			{
				num = 善良品性();
			}
			return AllText.Text_PinXing[num][Mainload.SetData[4]];
		}
		catch
		{
			return "善良";
		}
	}

	private void 画品性下拉(float x, float y, List<string> 行)
	{
		List<KeyValuePair<int, string>> list = new List<KeyValuePair<int, string>>();
		int num = 0;
		try
		{
			num = AllText.Text_PinXing.Count;
		}
		catch
		{
		}
		for (int i = 1; i < num; i++)
		{
			string value = "?";
			try
			{
				value = AllText.Text_PinXing[i][Mainload.SetData[4]];
			}
			catch
			{
			}
			list.Add(new KeyValuePair<int, string>(i, value));
		}
		int num2 = 品性值(行);
		if (num2 <= 0 || num2 >= AllText.Text_PinXing.Count)
		{
			num2 = 善良品性();
		}
		if (画下拉(x, y, 240f, list, num2, ref 品性下滚, out var 选中))
		{
			行[5] = 选中.ToString();
			关全部下拉();
			提示文字 = "品性:" + 品性名2(行);
			提示倒计时 = 240;
		}
	}

	private static int 天赋值(List<string> 行)
	{
		try
		{
			return int.Parse(行[4].Split(new char[1] { '|' })[2]);
		}
		catch
		{
			return 0;
		}
	}

	private static string 天赋名2(List<string> 行)
	{
		try
		{
			int num = 天赋值(行);
			if (num < 0 || num >= AllText.Text_AllTianFu.Count)
			{
				num = 1;
			}
			return AllText.Text_AllTianFu[num][Mainload.SetData[4]];
		}
		catch
		{
			return "文";
		}
	}

	private void 画天赋下拉(float x, float y, List<string> 行)
	{
		List<KeyValuePair<int, string>> list = new List<KeyValuePair<int, string>>();
		int num = 0;
		try
		{
			num = AllText.Text_AllTianFu.Count;
		}
		catch
		{
		}
		for (int i = 0; i < num; i++)
		{
			string value = "?";
			try
			{
				value = AllText.Text_AllTianFu[i][Mainload.SetData[4]];
			}
			catch
			{
			}
			list.Add(new KeyValuePair<int, string>(i, value));
		}
		int num2 = 天赋值(行);
		if (num2 < 0 || num2 >= AllText.Text_AllTianFu.Count)
		{
			num2 = 1;
		}
		if (画下拉(x, y, 200f, list, num2, ref 天赋下滚, out var 选中))
		{
			写资料串(行, 2, 选中.ToString());
			写资料串(行, 3, "100");
			关全部下拉();
			提示文字 = "天赋:" + 天赋名2(行) + "(数值 100)";
			提示倒计时 = 240;
		}
	}

	private static int 技能值(List<string> 行)
	{
		try
		{
			return int.Parse(行[4].Split(new char[1] { '|' })[6]);
		}
		catch
		{
			return 0;
		}
	}

	private static string 技能名2(List<string> 行)
	{
		try
		{
			return AllText.Text_AllMemberSkill[技能值(行)][Mainload.SetData[4]];
		}
		catch
		{
			return "?";
		}
	}

	private void 画技能下拉(float x, float y, List<string> 行)
	{
		List<KeyValuePair<int, string>> list = new List<KeyValuePair<int, string>>();
		int num = 0;
		try
		{
			num = AllText.Text_AllMemberSkill.Count;
		}
		catch
		{
		}
		for (int i = 0; i < num; i++)
		{
			string value = "?";
			try
			{
				value = AllText.Text_AllMemberSkill[i][Mainload.SetData[4]];
			}
			catch
			{
			}
			list.Add(new KeyValuePair<int, string>(i, value));
		}
		if (画下拉(x, y, 200f, list, 技能值(行), ref 技能下滚, out var 选中))
		{
			写资料串(行, 6, 选中.ToString());
			try
			{
				行[33] = "10";
			}
			catch
			{
			}
			关全部下拉();
			提示文字 = "技能:" + 技能名2(行) + "(等级 10)";
			提示倒计时 = 240;
		}
	}

	private static void 写资料串(List<string> 行, int idx, string 值)
	{
		try
		{
			string[] array = 行[4].Split(new char[1] { '|' });
			if (idx >= 0 && idx < array.Length)
			{
				array[idx] = 值;
				行[4] = string.Join("|", array);
			}
		}
		catch
		{
		}
	}

	private static void 减物品(int 物品ID, int 数量)
	{
		try
		{
			string text = 物品ID.ToString();
			for (int i = 0; i < Mainload.Prop_have.Count; i++)
			{
				List<string> list = Mainload.Prop_have[i];
				if (list != null && list.Count >= 2 && !(list[0] != text))
				{
					long.TryParse(list[1], out var result);
					result -= 数量;
					if (result <= 0)
					{
						Mainload.Prop_have.RemoveAt(i);
					}
					else
					{
						list[1] = result.ToString();
					}
					break;
				}
			}
		}
		catch
		{
		}
	}

	private void 减成员年龄(List<string> 行, string 成员ID, int 减)
	{
		try
		{
			if (int.TryParse(行[6], out var result))
			{
				行[6] = Mathf.Max(1, result - 减).ToString();
				if (成员锁.TryGetValue(成员ID, out var value) && value != null && value[0] >= 0)
				{
					value[0] = Mathf.Max(1, value[0] - 减);
				}
				角色输入缓存 = -1;
			}
		}
		catch
		{
		}
	}

	internal void 吃丹救急(int 索引, bool 年结)
	{
		if (!自动吃长寿丹 || !年结)
		{
			return;
		}
		try
		{
			if (Mainload.Member_now == null || 索引 < 0 || 索引 >= Mainload.Member_now.Count)
			{
				return;
			}
			List<string> list = Mainload.Member_now[索引];
			if (!int.TryParse(list[6], out var result) || result < 50)
			{
				return;
			}
			int num = 读物品数量(72);
			int num2 = 读物品数量(68);
			if (num > 0 || num2 > 0)
			{
				int num3 = ((num > 0) ? 72 : 68);
				减物品(num3, 1);
				int num4 = ((num3 == 72) ? 20 : 5);
				string[] array = list[4].Split(new char[1] { '|' });
				if (!int.TryParse(array[5], out var result2))
				{
					result2 = result;
				}
				array[5] = (result2 + num4).ToString();
				list[4] = string.Join("|", array);
				ManualLogSource obj = 日志;
				if (obj != null)
				{
					obj.LogDebug((object)("自动吃长寿丹:" + array[0] + " 寿元 +" + num4 + "(现在 " + array[5] + ")"));
				}
			}
		}
		catch
		{
		}
	}

	private static void 全属性满(List<string> 行)
	{
		try
		{
			for (int i = 7; i <= 10; i++)
			{
				行[i] = "1