static void Postfix(DateFile __instance, int __result) { if (!Main.enabled || !Main.settings.lunhuiAdvanced) { return; } if (__instance.deadActors.Count > 0) { int num32 = __instance.deadActors[UnityEngine.Random.Range(0, __instance.deadActors.Count)]; List <int> value = new List <int>(__instance.GetLifeDateList(num32, 801, false)) { num32 }; __instance.actorLife[__result].Add(801, value); if (__instance.GetActorFavor(false, __instance.MianActorID(), num32, false, false) >= 30000) { UIDate.instance.changTrunEvents.Add(new int[] { 239, num32, __instance.GetActorAtPlace(__instance.MianActorID())[0] }); } __instance.deadActors.Remove(num32); } }
void ScanNpc() { actorList.Clear(); DateFile dateFile = DateFile.instance; Dictionary <int, Dictionary <int, string> > actors = dateFile.actorsDate; foreach (int index in actors.Keys) { Dictionary <int, string> actor = actors[index]; int str = dateFile.BaseAttr(index, 0, 0); int con = dateFile.BaseAttr(index, 1, 0); int agi = dateFile.BaseAttr(index, 2, 0); int bon = dateFile.BaseAttr(index, 3, 0); int inv = dateFile.BaseAttr(index, 4, 0); int pat = dateFile.BaseAttr(index, 5, 0); int age = int.Parse(dateFile.GetActorDate(index, 11, false)); int gender = int.Parse(dateFile.GetActorDate(index, 14, false)); int charm = int.Parse(DateFile.instance.GetActorDate(index, 15, true)); int samsara = dateFile.GetLifeDateList(index, 801, false).Count; int health = ActorMenu.instance.Health(index); int cv = charmValue; if (charmValue == 0) { cv = -999; } if (inv >= intValue && str >= strValue && con >= conValue && agi >= agiValue && bon >= bonValue && pat >= patValue && charm >= cv && age >= minage && health >= healthValue && samsara >= samsaraCount && (maxage == 0 || age <= maxage) && (genderValue == 0 || gender == genderValue) ) { string genderText; if (gender == 1) { genderText = "男"; } else { genderText = "女"; } string place; if (int.Parse(dateFile.GetActorDate(index, 8, false)) != 1) { place = dateFile.massageDate[8010][3].Split(new char[] { '|' })[1]; } else { List <int> list = new List <int>(dateFile.GetActorAtPlace(index)); place = string.Format("{0}{1}", new object[] { dateFile.GetNewMapDate(list[0], list[1], 98), dateFile.GetNewMapDate(list[0], list[1], 0) }); } string actorName = dateFile.GetActorName(index); string charmText = ((int.Parse(DateFile.instance.GetActorDate(index, 11, false)) > 14) ? ((int.Parse(DateFile.instance.GetActorDate(index, 8, false)) != 1 || int.Parse(DateFile.instance.GetActorDate(index, 305, false)) != 0) ? DateFile.instance.massageDate[25][int.Parse(DateFile.instance.GetActorDate(index, 14, false)) - 1].Split(new char[] { '|' })[Mathf.Clamp(int.Parse(DateFile.instance.GetActorDate(index, 15, true)) / 100, 0, 9)] : DateFile.instance.massageDate[25][5].Split(new char[] { '|' })[1]) : DateFile.instance.massageDate[25][5].Split(new char[] { '|' })[0]); List <int> samsaraList = dateFile.GetLifeDateList(index, 801, false); string samsaraNames = ""; foreach (int samsaraId in samsaraList) { samsaraNames = samsaraNames + " " + dateFile.GetActorName(samsaraId); } int[] actorResources = ActorMenu.instance.GetActorResources(index); if (GetLevelValue(index, 0, 1) >= gongfa[0] && GetLevelValue(index, 1, 1) >= gongfa[1] && GetLevelValue(index, 1, 1) >= gongfa[1] && GetLevelValue(index, 2, 1) >= gongfa[2] && GetLevelValue(index, 3, 1) >= gongfa[3] && GetLevelValue(index, 4, 1) >= gongfa[4] && GetLevelValue(index, 5, 1) >= gongfa[5] && GetLevelValue(index, 6, 1) >= gongfa[6] && GetLevelValue(index, 7, 1) >= gongfa[7] && GetLevelValue(index, 8, 1) >= gongfa[8] && GetLevelValue(index, 9, 1) >= gongfa[9] && GetLevelValue(index, 10, 1) >= gongfa[10] && GetLevelValue(index, 11, 1) >= gongfa[11] && GetLevelValue(index, 12, 1) >= gongfa[12] && GetLevelValue(index, 13, 1) >= gongfa[13] && GetLevelValue(index, 0, 0) >= life[0] && GetLevelValue(index, 1, 0) >= life[1] && GetLevelValue(index, 2, 0) >= life[2] && GetLevelValue(index, 3, 0) >= life[3] && GetLevelValue(index, 4, 0) >= life[4] && GetLevelValue(index, 5, 0) >= life[5] && GetLevelValue(index, 6, 0) >= life[6] && GetLevelValue(index, 7, 0) >= life[7] && GetLevelValue(index, 8, 0) >= life[8] && GetLevelValue(index, 9, 0) >= life[9] && GetLevelValue(index, 10, 0) >= life[10] && GetLevelValue(index, 11, 0) >= life[11] && GetLevelValue(index, 12, 0) >= life[12] && GetLevelValue(index, 13, 0) >= life[13] && GetLevelValue(index, 14, 0) >= life[14] && GetLevelValue(index, 15, 0) >= life[15] ) { string gn = dateFile.massageDate[9][0].Split(new char[] { '|' })[DateFile.instance.GetActorGoodness(index)]; int groupid = int.Parse(DateFile.instance.GetActorDate(index, 19, false)); //身份组ID int gangLevel = int.Parse(DateFile.instance.GetActorDate(index, 20, false)); //身份等级 int gangValueId = DateFile.instance.GetGangValueId(groupid, gangLevel); int key2 = (gangLevel >= 0) ? 1001 : (1001 + int.Parse(DateFile.instance.GetActorDate(index, 14, false))); //性别标识 string gangLevelText = dateFile.SetColoer((gangValueId != 0) ? (20011 - Mathf.Abs(gangLevel)) : 20002, DateFile.instance.presetGangGroupDateValue[gangValueId][key2], false); //身份gangLevelText if (ScanFeature(index, GetFeatureKey(actorFeatureText)) || actorFeatureText == "") { if (goodnessText.Equals("全部") || gn.Contains(goodnessText)) { if ((actorName.Contains(name) || samsaraNames.Contains(name)) && (dateFile.GetGangDate(groupid, 0).Contains(gangValue)) && (gangLevelText.Contains(gangLevelValue))) { actorList.Add(new string[] { actorName, age.ToString(), genderText, place, charm + "(" + charmText + ")", //魅力 dateFile.GetGangDate(groupid, 0), //从属gangText gangLevelText, //身份gangLevelText gn, //立场goodnessText GetSpouse(index), // GetSkillDevelopText(index), GetGongFaDevelopText(index), GetHealth(index),//健康 str.ToString(), con.ToString(), agi.ToString(), bon.ToString(), inv.ToString(), pat.ToString(), GetLevel(index, 0, 1), GetLevel(index, 1, 1), GetLevel(index, 2, 1), GetLevel(index, 3, 1), GetLevel(index, 4, 1), GetLevel(index, 5, 1), GetLevel(index, 6, 1), GetLevel(index, 7, 1), GetLevel(index, 8, 1), GetLevel(index, 9, 1), GetLevel(index, 10, 1), GetLevel(index, 11, 1), GetLevel(index, 12, 1), GetLevel(index, 13, 1), GetLevel(index, 0, 0), GetLevel(index, 1, 0), GetLevel(index, 2, 0), GetLevel(index, 3, 0), GetLevel(index, 4, 0), GetLevel(index, 5, 0), GetLevel(index, 6, 0), GetLevel(index, 7, 0), GetLevel(index, 8, 0), GetLevel(index, 9, 0), GetLevel(index, 10, 0), GetLevel(index, 11, 0), GetLevel(index, 12, 0), GetLevel(index, 13, 0), GetLevel(index, 14, 0), GetLevel(index, 15, 0), actorResources[0].ToString(), actorResources[1].ToString(), actorResources[2].ToString(), actorResources[3].ToString(), actorResources[4].ToString(), actorResources[5].ToString(), actorResources[6].ToString(), samsaraNames, GetActorFeatureNameText(index) }); } } } } } } }
private void WindowFunction(int windowId) { if (Input.GetKey(KeyCode.LeftControl)) { GUI.DragWindow(mWindowRect); } GUILayout.BeginVertical("box"); GUILayout.BeginHorizontal("box"); GUILayout.Label("NPC查找器"); if (GUILayout.Button("关闭", GUILayout.Width(150))) { ToggleWindow(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal("box"); GUILayout.Label("年龄:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(minage.ToString(), 3, GUILayout.Width(30)), out minage); GUILayout.Label("--", GUILayout.Width(10)); int.TryParse(GUILayout.TextField(maxage.ToString(), 3, GUILayout.Width(30)), out maxage); GUILayout.Space(10); GUILayout.Label("性别:", GUILayout.Width(30)); GUILayout.Space(5); isall = GUILayout.Toggle(isall, "全部", GUILayout.Width(45)); if (isall) { iswoman = false; isman = false; genderValue = 0; } isman = GUILayout.Toggle(isman, "男", GUILayout.Width(30)); if (isman) { isall = false; iswoman = false; genderValue = 1; } iswoman = GUILayout.Toggle(iswoman, "女", GUILayout.Width(30)); if (iswoman) { isall = false; isman = false; genderValue = 2; } GUILayout.Space(10); GUILayout.Label("膂力:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(strValue.ToString(), 10, GUILayout.Width(30)), out strValue); GUILayout.Space(5); GUILayout.Label("体质:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(conValue.ToString(), 10, GUILayout.Width(30)), out conValue); GUILayout.Space(5); GUILayout.Label("灵敏:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(agiValue.ToString(), 10, GUILayout.Width(30)), out agiValue); GUILayout.Space(5); GUILayout.Label("根骨:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(bonValue.ToString(), 10, GUILayout.Width(30)), out bonValue); GUILayout.Space(5); GUILayout.Label("悟性:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(intValue.ToString(), 10, GUILayout.Width(30)), out intValue); GUILayout.Space(5); GUILayout.Label("定力:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(patValue.ToString(), 10, GUILayout.Width(30)), out patValue); GUILayout.Space(5); GUILayout.Label("魅力:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(charmValue.ToString(), 10, GUILayout.Width(30)), out charmValue); GUILayout.Space(5); GUILayout.Label("健康:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(healthValue.ToString(), 10, GUILayout.Width(30)), out healthValue); GUILayout.Space(5); GUILayout.Label("轮回次数:", GUILayout.Width(60)); int.TryParse(GUILayout.TextField(samsaraCount.ToString(), 10, GUILayout.Width(30)), out samsaraCount); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal("box"); GUILayout.Label("内功:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(gongfa[0].ToString(), 10, GUILayout.Width(30)), out gongfa[0]); GUILayout.Space(5); GUILayout.Label("身法:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(gongfa[1].ToString(), 10, GUILayout.Width(30)), out gongfa[1]); GUILayout.Space(5); GUILayout.Label("绝技:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(gongfa[2].ToString(), 10, GUILayout.Width(30)), out gongfa[2]); GUILayout.Space(5); GUILayout.Label("拳掌:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(gongfa[3].ToString(), 10, GUILayout.Width(30)), out gongfa[3]); GUILayout.Space(5); GUILayout.Label("指法:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(gongfa[4].ToString(), 10, GUILayout.Width(30)), out gongfa[4]); GUILayout.Space(5); GUILayout.Label("腿法:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(gongfa[5].ToString(), 10, GUILayout.Width(30)), out gongfa[5]); GUILayout.Space(5); GUILayout.Label("暗器:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(gongfa[6].ToString(), 10, GUILayout.Width(30)), out gongfa[6]); GUILayout.Space(5); GUILayout.Label("剑法:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(gongfa[7].ToString(), 10, GUILayout.Width(30)), out gongfa[7]); GUILayout.Space(5); GUILayout.Label("刀法:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(gongfa[8].ToString(), 10, GUILayout.Width(30)), out gongfa[8]); GUILayout.Space(5); GUILayout.Label("长兵:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(gongfa[9].ToString(), 10, GUILayout.Width(30)), out gongfa[9]); GUILayout.Space(5); GUILayout.Label("奇门:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(gongfa[10].ToString(), 10, GUILayout.Width(30)), out gongfa[10]); GUILayout.Space(5); GUILayout.Label("软兵:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(gongfa[11].ToString(), 10, GUILayout.Width(30)), out gongfa[11]); GUILayout.Space(5); GUILayout.Label("御射:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(gongfa[12].ToString(), 10, GUILayout.Width(30)), out gongfa[12]); GUILayout.Space(5); GUILayout.Label("乐器:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(gongfa[13].ToString(), 10, GUILayout.Width(30)), out gongfa[13]); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal("box"); GUILayout.Label("音律:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[0].ToString(), 10, GUILayout.Width(30)), out life[0]); GUILayout.Space(5); GUILayout.Label("弈棋:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[1].ToString(), 10, GUILayout.Width(30)), out life[1]); GUILayout.Space(5); GUILayout.Label("诗书:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[2].ToString(), 10, GUILayout.Width(30)), out life[2]); GUILayout.Space(5); GUILayout.Label("绘画:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[3].ToString(), 10, GUILayout.Width(30)), out life[3]); GUILayout.Space(5); GUILayout.Label("术数:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[4].ToString(), 10, GUILayout.Width(30)), out life[4]); GUILayout.Space(5); GUILayout.Label("品鉴:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[5].ToString(), 10, GUILayout.Width(30)), out life[5]); GUILayout.Space(5); GUILayout.Label("锻造:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[6].ToString(), 10, GUILayout.Width(30)), out life[6]); GUILayout.Space(5); GUILayout.Label("制木:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[7].ToString(), 10, GUILayout.Width(30)), out life[7]); GUILayout.Space(5); GUILayout.Label("医术:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[8].ToString(), 10, GUILayout.Width(30)), out life[8]); GUILayout.Space(5); GUILayout.Label("毒术:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[9].ToString(), 10, GUILayout.Width(30)), out life[9]); GUILayout.Space(5); GUILayout.Label("织锦:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[10].ToString(), 10, GUILayout.Width(30)), out life[10]); GUILayout.Space(5); GUILayout.Label("巧匠:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[11].ToString(), 10, GUILayout.Width(30)), out life[11]); GUILayout.Space(5); GUILayout.Label("道法:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[12].ToString(), 10, GUILayout.Width(30)), out life[12]); GUILayout.Space(5); GUILayout.Label("佛学:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[13].ToString(), 10, GUILayout.Width(30)), out life[13]); GUILayout.Space(5); GUILayout.Label("厨艺:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[14].ToString(), 10, GUILayout.Width(30)), out life[14]); GUILayout.Space(5); GUILayout.Label("杂学:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(life[15].ToString(), 10, GUILayout.Width(30)), out life[15]); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal("box"); GUILayout.Label("姓名(包括前世):", GUILayout.Width(120)); name = GUILayout.TextField(name, 10, GUILayout.Width(80)); //从属gangText GUILayout.Label("从属:", GUILayout.Width(50)); gangValue = GUILayout.TextField(gangValue, 10, GUILayout.Width(60)); //身份gangLevelText //GUILayout.Label("从属:", GUILayout.Width(50)); //gangValue = GUILayout.TextField(gangValue, 10, GUILayout.Width(60)); //立场goodnessText string goodnessText = ""; GUILayout.Label("立场:", GUILayout.Width(30)); for (int i = 0; i < goodness.Length; i++) { goodness[i] = GUILayout.Toggle(goodness[i], goodnessValue[i].ToString(), GUILayout.Width(45)); if (goodness[i]) { for (int j = 0; j < goodness.Length; j++) { if (i != j) { goodness[j] = false; goodnessText = goodnessValue[i].ToString(); } } } } GUILayout.Space(30); if (GUILayout.Button("查找", GUILayout.Width(150))) { actorList.Clear(); DateFile dateFile = DateFile.instance; Dictionary <int, Dictionary <int, string> > actors = dateFile.actorsDate; foreach (int index in actors.Keys) { Dictionary <int, string> actor = actors[index]; int str = dateFile.BaseAttr(index, 0, 0); int con = dateFile.BaseAttr(index, 1, 0); int agi = dateFile.BaseAttr(index, 2, 0); int bon = dateFile.BaseAttr(index, 3, 0); int inv = dateFile.BaseAttr(index, 4, 0); int pat = dateFile.BaseAttr(index, 5, 0); int age = int.Parse(dateFile.GetActorDate(index, 11, false)); int gender = int.Parse(dateFile.GetActorDate(index, 14, false)); int charm = int.Parse(DateFile.instance.GetActorDate(index, 15, true)); int samsara = dateFile.GetLifeDateList(index, 801, false).Count; int health = ActorMenu.instance.Health(index); if (inv >= intValue && str >= strValue && con >= conValue && agi >= agiValue && bon >= bonValue && pat >= patValue && charm >= charmValue && age >= minage && health >= healthValue && samsara >= samsaraCount && (maxage == 0 || age <= maxage) && (genderValue == 0 || gender == genderValue) ) { string genderText; if (gender == 1) { genderText = "男"; } else { genderText = "女"; } string place; if (int.Parse(dateFile.GetActorDate(index, 8, false)) != 1) { place = dateFile.massageDate[8010][3].Split(new char[] { '|' })[1]; } else { List <int> list = new List <int>(dateFile.GetActorAtPlace(index)); place = string.Format("{0}{1}", new object[] { dateFile.GetNewMapDate(list[0], list[1], 98), dateFile.GetNewMapDate(list[0], list[1], 0) }); } string actorName = dateFile.GetActorName(index); string charmText = ((int.Parse(DateFile.instance.GetActorDate(index, 11, false)) > 14) ? ((int.Parse(DateFile.instance.GetActorDate(index, 8, false)) != 1 || int.Parse(DateFile.instance.GetActorDate(index, 305, false)) != 0) ? DateFile.instance.massageDate[25][int.Parse(DateFile.instance.GetActorDate(index, 14, false)) - 1].Split(new char[] { '|' })[Mathf.Clamp(int.Parse(DateFile.instance.GetActorDate(index, 15, true)) / 100, 0, 9)] : DateFile.instance.massageDate[25][5].Split(new char[] { '|' })[1]) : DateFile.instance.massageDate[25][5].Split(new char[] { '|' })[0]); List <int> samsaraList = dateFile.GetLifeDateList(index, 801, false); string samsaraNames = ""; foreach (int samsaraId in samsaraList) { samsaraNames = samsaraNames + " " + dateFile.GetActorName(samsaraId); } if (GetLevelValue(index, 0, 1) >= gongfa[0] && GetLevelValue(index, 1, 1) >= gongfa[1] && GetLevelValue(index, 1, 1) >= gongfa[1] && GetLevelValue(index, 2, 1) >= gongfa[2] && GetLevelValue(index, 3, 1) >= gongfa[3] && GetLevelValue(index, 4, 1) >= gongfa[4] && GetLevelValue(index, 5, 1) >= gongfa[5] && GetLevelValue(index, 6, 1) >= gongfa[6] && GetLevelValue(index, 7, 1) >= gongfa[7] && GetLevelValue(index, 8, 1) >= gongfa[8] && GetLevelValue(index, 9, 1) >= gongfa[9] && GetLevelValue(index, 10, 1) >= gongfa[10] && GetLevelValue(index, 11, 1) >= gongfa[11] && GetLevelValue(index, 12, 1) >= gongfa[12] && GetLevelValue(index, 13, 1) >= gongfa[13] && GetLevelValue(index, 0, 0) >= life[0] && GetLevelValue(index, 1, 0) >= life[1] && GetLevelValue(index, 2, 0) >= life[2] && GetLevelValue(index, 3, 0) >= life[3] && GetLevelValue(index, 4, 0) >= life[4] && GetLevelValue(index, 5, 0) >= life[5] && GetLevelValue(index, 6, 0) >= life[6] && GetLevelValue(index, 7, 0) >= life[7] && GetLevelValue(index, 8, 0) >= life[8] && GetLevelValue(index, 9, 0) >= life[9] && GetLevelValue(index, 10, 0) >= life[10] && GetLevelValue(index, 11, 0) >= life[11] && GetLevelValue(index, 12, 0) >= life[12] && GetLevelValue(index, 13, 0) >= life[13] && GetLevelValue(index, 14, 0) >= life[14] && GetLevelValue(index, 15, 0) >= life[15] ) { string gn = dateFile.massageDate[9][0].Split(new char[] { '|' })[DateFile.instance.GetActorGoodness(index)]; int groupid = int.Parse(DateFile.instance.GetActorDate(index, 19, false));//身份组ID if (goodnessText.Equals("全部") || gn.Contains(goodnessText)) { if ((actorName.Contains(name) || samsaraNames.Contains(name)) && (dateFile.GetGangDate(groupid, 0).Contains(gangValue))) { int gangLevel = int.Parse(DateFile.instance.GetActorDate(index, 20, false)); //身份等级 int gangValueId = DateFile.instance.GetGangValueId(groupid, gangLevel); int key2 = (gangLevel >= 0) ? 1001 : (1001 + int.Parse(DateFile.instance.GetActorDate(index, 14, false))); //性别标识 actorList.Add(new string[] { actorName, age.ToString(), genderText, place, charm + "(" + charmText + ")", //魅力 dateFile.GetGangDate(groupid, 0), //从属gangText dateFile.SetColoer((gangValueId != 0) ? (20011 - Mathf.Abs(gangLevel)) : 20002, DateFile.instance.presetGangGroupDateValue[gangValueId][key2], false), //身份gangLevelText gn, //立场goodnessText GetHealth(index), //健康 str.ToString(), con.ToString(), agi.ToString(), bon.ToString(), inv.ToString(), pat.ToString(), GetLevel(index, 0, 1), GetLevel(index, 1, 1), GetLevel(index, 2, 1), GetLevel(index, 3, 1), GetLevel(index, 4, 1), GetLevel(index, 5, 1), GetLevel(index, 6, 1), GetLevel(index, 7, 1), GetLevel(index, 8, 1), GetLevel(index, 9, 1), GetLevel(index, 10, 1), GetLevel(index, 11, 1), GetLevel(index, 12, 1), GetLevel(index, 13, 1), GetLevel(index, 0, 0), GetLevel(index, 1, 0), GetLevel(index, 2, 0), GetLevel(index, 3, 0), GetLevel(index, 4, 0), GetLevel(index, 5, 0), GetLevel(index, 6, 0), GetLevel(index, 7, 0), GetLevel(index, 8, 0), GetLevel(index, 9, 0), GetLevel(index, 10, 0), GetLevel(index, 11, 0), GetLevel(index, 12, 0), GetLevel(index, 13, 0), GetLevel(index, 14, 0), GetLevel(index, 15, 0), samsaraNames }); } } } } } } GUILayout.EndHorizontal(); if (actorList.Count > 0) { scrollPosition = GUILayout.BeginScrollView(scrollPosition, false, false, new GUIStyle(), new GUIStyle(), GUILayout.Height(80), GUILayout.Width(Screen.width * 0.8f - 40f)); GUILayout.BeginVertical("Box"); GUILayout.BeginHorizontal("box"); var amountWidth = mColumns.Where(x => !x.skip).Sum(x => x.width); var expandWidth = mColumns.Where(x => x.expand && !x.skip).Sum(x => x.width); var mods = actorList; var colWidth = mColumns.Select(x => x.expand ? GUILayout.Width(x.width / expandWidth * (960f - 60 + expandWidth - amountWidth)) : GUILayout.Width(x.width)).ToArray(); for (int i = 0; i < mColumns.Count; i++) { if (mColumns[i].skip) { continue; } GUILayout.Label(mColumns[i].name, colWidth[i]); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal("box"); for (int i = 0; i < mColumns.Count; i++) { if (mColumns[i].skip) { continue; } if (GUILayout.Button("O", colWidth[i])) { Debug.Log("Clicked the " + mColumns[i].name); sortIndex = i; actorList.Sort(SortList); desc = !desc; } } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.EndScrollView(); scrollPosition2 = GUILayout.BeginScrollView(scrollPosition2, GUILayout.ExpandHeight(false)); scrollPosition = new Vector2(scrollPosition2.x, 0); GUILayout.BeginVertical("box"); int c = mods.Count; c = c > 50 ? 50 : c; for (int i = 0; i < c; i++) { GUILayout.BeginVertical("box"); GUILayout.BeginHorizontal(); for (int j = 0; j < mods[i].Count(); j++) { GUILayout.BeginHorizontal(colWidth[j]); GUILayout.Label(mods[i][j].ToString()); GUILayout.EndHorizontal(); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); } GUILayout.EndVertical(); GUILayout.EndScrollView(); } GUILayout.EndVertical(); GUILayout.Space(3); }
private void WindowFunction(int windowId) { if (Input.GetKey(KeyCode.LeftControl)) { GUI.DragWindow(mWindowRect); } GUILayout.BeginVertical("box"); GUILayout.BeginHorizontal("box"); GUILayout.Label("NPC查找器"); if (GUILayout.Button("关闭", GUILayout.Width(150))) { ToggleWindow(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal("box"); GUILayout.Label("年龄:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(minage.ToString(), 3, GUILayout.Width(30)), out minage); GUILayout.Label("--", GUILayout.Width(10)); int.TryParse(GUILayout.TextField(maxage.ToString(), 3, GUILayout.Width(30)), out maxage); GUILayout.Space(5); GUILayout.Label("性别:", GUILayout.Width(30)); GUILayout.Space(5); isall = GUILayout.Toggle(isall, "全部", GUILayout.Width(45)); if (isall) { iswoman = false; isman = false; genderValue = 0; } isman = GUILayout.Toggle(isman, "男", GUILayout.Width(30)); if (isman) { isall = false; iswoman = false; genderValue = 1; } iswoman = GUILayout.Toggle(iswoman, "女", GUILayout.Width(30)); if (iswoman) { isall = false; isman = false; genderValue = 2; } GUILayout.Space(10); GUILayout.Label("膂力:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(strValue.ToString(), 10, GUILayout.Width(30)), out strValue); GUILayout.Space(5); GUILayout.Label("体质:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(conValue.ToString(), 10, GUILayout.Width(30)), out conValue); GUILayout.Space(5); GUILayout.Label("灵敏:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(agiValue.ToString(), 10, GUILayout.Width(30)), out agiValue); GUILayout.Space(5); GUILayout.Label("根骨:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(bonValue.ToString(), 10, GUILayout.Width(30)), out bonValue); GUILayout.Space(5); GUILayout.Label("悟性:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(intValue.ToString(), 10, GUILayout.Width(30)), out intValue); GUILayout.Space(5); GUILayout.Label("定力:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(patValue.ToString(), 10, GUILayout.Width(30)), out patValue); GUILayout.Space(5); GUILayout.Label("魅力:", GUILayout.Width(30)); int.TryParse(GUILayout.TextField(charmValue.ToString(), 10, GUILayout.Width(30)), out charmValue); GUILayout.Space(50); if (GUILayout.Button("查找", GUILayout.Width(150))) { actorList.Clear(); DateFile dateFile = DateFile.instance; Dictionary <int, Dictionary <int, string> > actors = dateFile.actorsDate; foreach (int index in actors.Keys) { Dictionary <int, string> actor = actors[index]; int str = dateFile.BaseAttr(index, 0, 0); int con = dateFile.BaseAttr(index, 1, 0); int agi = dateFile.BaseAttr(index, 2, 0); int bon = dateFile.BaseAttr(index, 3, 0); int inv = dateFile.BaseAttr(index, 4, 0); int pat = dateFile.BaseAttr(index, 5, 0); int age = int.Parse(dateFile.GetActorDate(index, 11, false)); int gender = int.Parse(dateFile.GetActorDate(index, 14, false)); int charm = int.Parse(DateFile.instance.GetActorDate(index, 15, true)); if (inv >= intValue && str > strValue && con > conValue && agi > agiValue && bon > bonValue && pat > patValue && charm > charmValue && age > minage && (maxage == 0 || age < maxage) && (genderValue == 0 || gender == genderValue) ) { string genderText; if (gender == 1) { genderText = "男"; } else { genderText = "女"; } string place; if (int.Parse(dateFile.GetActorDate(index, 8, false)) != 1) { place = dateFile.massageDate[8010][3].Split(new char[] { '|' })[1]; } else { List <int> list = new List <int>(dateFile.GetActorAtPlace(index)); place = string.Format("{0}{1}", new object[] { dateFile.GetNewMapDate(list[0], list[1], 98), dateFile.GetNewMapDate(list[0], list[1], 0) }); } string charmText = ((int.Parse(DateFile.instance.GetActorDate(index, 11, false)) > 14) ? ((int.Parse(DateFile.instance.GetActorDate(index, 8, false)) != 1 || int.Parse(DateFile.instance.GetActorDate(index, 305, false)) != 0) ? DateFile.instance.massageDate[25][int.Parse(DateFile.instance.GetActorDate(index, 14, false)) - 1].Split(new char[] { '|' })[Mathf.Clamp(int.Parse(DateFile.instance.GetActorDate(index, 15, true)) / 100, 0, 9)] : DateFile.instance.massageDate[25][5].Split(new char[] { '|' })[1]) : DateFile.instance.massageDate[25][5].Split(new char[] { '|' })[0]); actorList.Add(string.Format("\n姓名:{1} 年龄:{8} 性别:{9} 位置:{10} 魅力:{11} 膂力:{2} 体质:{3} 灵敏:{4} 根骨:{5} 悟性:{6} 定力:{7} ", index, dateFile.GetActorName(index), str, con, agi, bon, inv, pat, age, genderText, place, charm + "(" + charmText + ")")); } } } GUILayout.EndHorizontal(); if (actorList.Count > 0) { scrollPosition = GUILayout.BeginScrollView(scrollPosition, GUILayout.ExpandHeight(false)); foreach (string actor in actorList) { GUILayout.Label(actor); } GUILayout.EndScrollView(); } GUILayout.EndVertical(); GUILayout.Space(3); }