/// <summary> /// 修改相枢入邪值 /// </summary> /// <param name="instance">DateFile类的实例</param> private void DisplayXXField(DateFile instance) { // 入邪值 int evilValue = HelperBase.LifeDateHelper(instance, actorId, 501); GUILayout.BeginHorizontal(); GUILayout.Box("当前入邪值: ", boxStyle, GUILayout.Width(evilButtonWidth)); if (evilValue == -1) { GUILayout.Box("无", boxStyle, GUILayout.Width(evilButtonWidth)); GUILayout.EndHorizontal(); } else { GUILayout.Box($"{evilValue}", boxStyle, GUILayout.Width(evilButtonWidth)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("恢复正常", buttonStyle, GUILayout.Width(evilButtonWidth))) { HelperBase.SetActorXXValue(instance, actorId, 0); } if (GUILayout.Button("相枢入邪", buttonStyle, GUILayout.Width(evilButtonWidth))) { HelperBase.SetActorXXValue(instance, actorId, 100); } if (actorId != 0 && actorId != instance.mianActorId) { if (GUILayout.Button("相枢化魔", buttonStyle, GUILayout.Width(evilButtonWidth))) { HelperBase.SetActorXXValue(instance, actorId, 200); } } GUILayout.EndHorizontal(); } }
/// <summary> /// 显示修改健康、寿命选项卡 /// </summary> private void DisplayHealthAge() { GUILayout.Label("<color=#F28234>注意:\n1.基础寿命为不含人物特性加成的寿命\n2. 人物健康修改为0后,过月就会死亡</color>", labelStyle); GUILayout.BeginHorizontal(); ActorPropertyHelper.Instance.FieldHelper(11); ActorPropertyHelper.Instance.FieldHelper(13); if (ActorMenu.instance != null) { ActorPropertyHelper.Instance.FieldHelper(12, DateFile.instance.MaxHealth(actorId)); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button("一键疗伤", buttonStyle, GUILayout.Width(healthButtonWidth))) { HelperBase.CureHelper(DateFile.instance, actorId, 0); } if (GUILayout.Button("一键祛毒", buttonStyle, GUILayout.Width(healthButtonWidth))) { HelperBase.CureHelper(DateFile.instance, actorId, 1); } if (GUILayout.Button("一键调理内息", buttonStyle, GUILayout.Width(healthButtonWidth))) { HelperBase.CureHelper(DateFile.instance, actorId, 2); } if (GUILayout.Button("我全部都要", buttonStyle, GUILayout.Width(healthButtonWidth))) { HelperBase.CureHelper(DateFile.instance, actorId, 0); HelperBase.CureHelper(DateFile.instance, actorId, 1); HelperBase.CureHelper(DateFile.instance, actorId, 2); } GUILayout.EndHorizontal(); }
private static bool Prefix(int ___readBookId, int ___studySkillTyp, BuildingWindow __instance) { #if DEBUG Main.logger.Log($"[TaiwuEditor]快速读书: id: {___readBookId},SkillTyp: {___studySkillTyp}"); #endif if (!Main.enabled || !Main.settings.basicUISettings[1] || ___studySkillTyp < 1 || ___studySkillTyp > 17 || ___readBookId < 1) { return(true); } else { HelperBase.EasyReadV2(___readBookId, ___studySkillTyp, Main.settings.pagesPerFastRead); __instance.UpdateReadBookWindow(); return(false); } }
/// <summary> /// 显示待修改人物的ID /// </summary> private void DisplayId(DateFile instance) { GUILayout.BeginHorizontal(); GUILayout.Box("<color=#87CEEB>人物ID:</color>", boxStyle, GUILayout.Width(idFieldWidth)); switch (basePropertyChoose) { // 修改上次打开人物菜单的人物 case 1: if (ActorMenu.instance != null && ActorMenu.instance.actorId > -1) { actorId = (ActorMenu.instance.actorId == 0) ? instance.mianActorId : ActorMenu.instance.actorId; GUILayout.Box($"{actorId}", boxStyle, GUILayout.Width(idFieldWidth)); } break; case 2: if (actorId > 0) { displayedActorId = GUILayout.TextField(displayedActorId, textFieldStyle, GUILayout.Width(idFieldWidth)); if (GUILayout.Button("确定", buttonStyle, GUILayout.Width(idFieldWidth))) { if (HelperBase.TryParseInt(displayedActorId, out int parsedValue) && parsedValue > -1) { actorId = (parsedValue == 0) ? instance.mianActorId : parsedValue; } else { displayedActorId = actorId.ToString(); } } } break; default: actorId = DateFile.instance.mianActorId; GUILayout.Box($"{actorId}", boxStyle, GUILayout.Width(idFieldWidth)); break; } GUILayout.EndHorizontal(); }
private static bool Prefix(ref StorySystem __instance, ref bool ___keepHiding) { if (!Main.enabled || !Main.settings.basicUISettings[3]) { return(true); } /// 借鉴<see cref="StorySystem.StorySystemOpend"/>。<see cref="StorySystem.StoryToBattle"/>会将此值设为true /// 用这个值判断是否本次调用<see cref="StorySystem.OpenStory"/>是否由<see cref="StorySystem.StoryToBattle"/> /// 返回的,防止奇遇终点是战斗时,无限进入战斗。 if (___keepHiding) { return(true); } int storyId = __instance.storySystemStoryId; #if DEBUG Main.logger.Log($"[TaiwuEditor]OpenStory: StoryId: {storyId}"); #endif if (storyId > 0) { bool storyIdExist = false; for (int i = 0; i < Main.settings.includedStoryTyps.Length; i++) { if (Main.settings.includedStoryTyps[i]) { if (Main.settings.GetStoryTyp(i).IsContainStoryId(storyId)) { storyIdExist = true; break; } } } if (!storyIdExist) { return(true); } // 关闭奇遇窗口 ToStoryMenu.Instance.CloseToStoryMenu(); // 终点的事件ID int storyEndEventId = int.Parse(DateFile.instance.baseStoryDate[storyId][302]); #if DEBUG Main.logger.Log($"[TaiwuEditor]OpenStory: storyEndEventId: {storyEndEventId}"); Main.logger.Log($"[TaiwuEditor]OpenStory: StoryPlayer: {StorySystem.instance.storyPlayer.name}"); Main.logger.Log($"[TaiwuEditor]OpenStory: StoryPlayer_placeid: {StorySystem.instance.storyPlayer.parent.parent.parent.name}"); #endif if (HelperBase.EventSetup(StorySystem.StoryBaseManager, storyEndEventId, __instance.storySystemPartId, __instance.storySystemPlaceId, __instance.storySystemStoryId)) { #if DEBUG Main.logger.Log("EventSetup successful"); #endif } else { Main.logger.Log($"[TaiwuEditor]OpenStory has been removed due to storyEndEventId is 0"); __instance.StoryEnd(); } return(false); } return(true); }
/// <summary> /// 基本功能界面 /// </summary> private void BasicFuncUI() { scrollPosition[0] = GUILayout.BeginScrollView(scrollPosition[0], GUILayout.MinWidth(mWindowWidth)); GUILayout.BeginVertical("Box"); for (int i = 0; i < modSettings.basicUISettings.Length; i++) { modSettings.basicUISettings[i] = GUILayout.Toggle(modSettings.basicUISettings[i], modSettings.GetBasicSettingName(i), toggleStyle); switch (i) { case 1: if (modSettings.basicUISettings[i]) { GUILayout.Label($"每次阅读<color=#F28234>{modSettings.pagesPerFastRead}</color>篇(只对功法类书籍有效,技艺类书籍会全部读完)", labelStyle); modSettings.pagesPerFastRead = (int)GUILayout.HorizontalScrollbar(modSettings.pagesPerFastRead, 1, 11, 1); } break; case 3: if (modSettings.basicUISettings[i] && modSettings.includedStoryTyps != null && modSettings.includedStoryTyps.Length == modSettings.includedStoryTyps.Length) { GUILayout.BeginHorizontal("Box"); if (GUILayout.Button("<color=#F28234>全选</color>", buttonStyle)) { for (int j = 0; j < modSettings.includedStoryTyps.Length; j++) { modSettings.includedStoryTyps[j] = true; } } for (int j = 0; j < modSettings.includedStoryTyps.Length; j++) { modSettings.includedStoryTyps[j] = GUILayout.Toggle(modSettings.includedStoryTyps[j], modSettings.GetStoryTyp(j).Name, toggleStyle); } GUILayout.EndHorizontal(); } break; case 8: case 9: int choice = i - 8; if (modSettings.basicUISettings[i] && choice > -1 && choice < modSettings.customLockValue.Length) { string choiceName = modSettings.GetLockValueName(choice); GUILayout.Label($"自定义最大{choiceName}(范围0-100)\n<color=#F28234>设置为0则根据剑冢世界进度自动设定最大{choiceName}(推荐)</color>", labelStyle); GUILayout.BeginHorizontal(); tmpCustomLockValue[choice] = GUILayout.TextField(tmpCustomLockValue[choice], textFieldStyle, GUILayout.Width(ActorPropertyHelper.fieldHelperTextWidth)); if (GUILayout.Button("确定", buttonStyle, GUILayout.Width(ActorPropertyHelper.fieldHelperBtnWidth))) { if (HelperBase.TryParseInt(tmpCustomLockValue[choice], out int value)) { modSettings.customLockValue[choice] = value; } else { tmpCustomLockValue[choice] = modSettings.customLockValue[choice].ToString(); } } GUILayout.EndHorizontal(); } break; } } GUILayout.EndVertical(); GUILayout.EndScrollView(); }