| Core/GameEngine/Model/Config/TaskFeedbackConfig.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Core/GameEngine/Model/Config/TaskFeedbackConfig.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Lua/Gen/TaskFeedbackConfigWrap.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/MainInterfacePanel/TaskFeedbackModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Message/RichNormalEvent.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Message/TRichAnalysis.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Utility/UIHelper.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Core/GameEngine/Model/Config/TaskFeedbackConfig.cs
@@ -1,6 +1,6 @@ //-------------------------------------------------------- // [Author]: Fish // [ Date ]: Thursday, May 16, 2019 // [ Date ]: Friday, May 17, 2019 //-------------------------------------------------------- using System.Collections.Generic; @@ -21,9 +21,9 @@ public readonly string sideTasks; public readonly string reikiRoot; public readonly int[] succGuide; public readonly int[] failGuide; public readonly int jump; public readonly int[] failFuncs; public readonly string remind; public readonly string[] remind; public TaskFeedbackConfig() { @@ -56,12 +56,7 @@ int.TryParse(succGuideStringArray[i],out succGuide[i]); } string[] failGuideStringArray = tables[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); failGuide = new int[failGuideStringArray.Length]; for (int i=0;i<failGuideStringArray.Length;i++) { int.TryParse(failGuideStringArray[i],out failGuide[i]); } int.TryParse(tables[8],out jump); string[] failFuncsStringArray = tables[9].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); failFuncs = new int[failFuncsStringArray.Length]; @@ -70,7 +65,7 @@ int.TryParse(failFuncsStringArray[i],out failFuncs[i]); } remind = tables[10]; remind = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); } catch (Exception ex) { Core/GameEngine/Model/Config/TaskFeedbackConfig.cs.meta
@@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: b80a883f246077d46ab59d6938182ec9 timeCreated: 1557997420 timeCreated: 1558059182 licenseType: Pro MonoImporter: serializedVersion: 2 Lua/Gen/TaskFeedbackConfigWrap.cs
@@ -32,8 +32,6 @@ Utils.RegisterFunc(L, Utils.GETTER_IDX, "items", _g_get_items); Utils.RegisterFunc(L, Utils.GETTER_IDX, "sideTasks", _g_get_sideTasks); Utils.RegisterFunc(L, Utils.GETTER_IDX, "succGuide", _g_get_succGuide); Utils.RegisterFunc(L, Utils.GETTER_IDX, "failGuide", _g_get_failGuide); Utils.RegisterFunc(L, Utils.GETTER_IDX, "remind", _g_get_remind); @@ -378,40 +376,5 @@ } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_failGuide(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); TaskFeedbackConfig gen_to_be_invoked = (TaskFeedbackConfig)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.failGuide); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_remind(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); TaskFeedbackConfig gen_to_be_invoked = (TaskFeedbackConfig)translator.FastGetCSObj(L, 1); LuaAPI.lua_pushstring(L, gen_to_be_invoked.remind); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } } } System/MainInterfacePanel/TaskFeedbackModel.cs
@@ -111,6 +111,11 @@ public void ExecuteTaskFeedback(int taskId) { if (NewBieCenter.Instance.inGuiding || FunctionalGuideCenter.Instance.ExistAnyUnderwayGuide()) { return; } TaskFeedback feedback; if (TryGetTaskFeedback(taskId, out feedback)) { @@ -128,28 +133,29 @@ int condition = 0; if (IsSatisfyCondition(feedback, out condition)) { if (config.succGuide != null && config.succGuide.Length > 0) var guide = config.succGuide != null && config.succGuide.Length > 0 ? config.succGuide[0] : 0; if (config.jump != 0 && (guide == 0 || NewBieCenter.Instance.IsGuideCompleted(guide))) { ExecuteGuide(config.succGuide[0]); WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)config.jump); } else { ExecuteGuide(guide); } } else { if (!string.IsNullOrEmpty(config.remind)) if (config.remind != null && config.remind.Length > 0) { SysNotifyMgr.Instance.ShowTip(config.remind); var index = Mathf.Min(condition, config.remind.Length - 1); SysNotifyMgr.Instance.ShowTip(config.remind[index]); } if (config.failFuncs != null && config.failFuncs.Length > 0) { taskFeedbackFuncs.Clear(); taskFeedbackFuncs.AddRange(config.failFuncs); WindowCenter.Instance.Open<TaskFeedbackFuncWin>(); } if (config.failGuide != null && config.failGuide.Length > 0) { ExecuteGuide(config.failGuide[0]); } } } @@ -159,29 +165,30 @@ int condition = 0; if (IsSatisfyCondition(feedback, out condition)) { if (config.succGuide != null && config.succGuide.Length > 0) var guide = config.succGuide != null && config.succGuide.Length > 0 ? config.succGuide[0] : 0; if (config.jump != 0 && (guide == 0 || NewBieCenter.Instance.IsGuideCompleted(guide))) { ExecuteGuide(config.succGuide[0]); WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)config.jump); } else { ExecuteGuide(guide); } } else { if (!string.IsNullOrEmpty(config.remind)) if (config.remind != null && config.remind.Length > 0) { SysNotifyMgr.Instance.ShowTip(config.remind); var taskIndex = feedback.IndexOfSideTasks(condition); var index = Mathf.Min(taskIndex, config.remind.Length - 1); SysNotifyMgr.Instance.ShowTip(config.remind[index]); } if (config.failFuncs != null && config.failFuncs.Length > 0) { taskFeedbackFuncs.Clear(); taskFeedbackFuncs.AddRange(config.failFuncs); WindowCenter.Instance.Open<TaskFeedbackFuncWin>(); } var index = feedback.IndexOfSideTasks(condition); if (config.failGuide != null && index >= 0 && index < config.failGuide.Length) { ExecuteGuide(config.failGuide[index]); } } } @@ -191,32 +198,30 @@ int condition = 0; if (IsSatisfyCondition(feedback, out condition)) { if (config.succGuide != null && config.succGuide.Length > 0) var guide = config.succGuide != null && config.succGuide.Length > 0 ? config.succGuide[0] : 0; if (config.jump != 0 && (guide == 0 || NewBieCenter.Instance.IsGuideCompleted(guide))) { ExecuteGuide(config.succGuide[0]); WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)config.jump); } else { ExecuteGuide(guide); } } else { if (!string.IsNullOrEmpty(config.remind)) if (config.remind != null && config.remind.Length > 0) { SysNotifyMgr.Instance.ShowTip(config.remind); var taskIndex = feedback.IndexOfSideTasks(condition); var index = Mathf.Min(taskIndex, config.remind.Length - 1); SysNotifyMgr.Instance.ShowTip(config.remind[index]); } if (config.failFuncs != null && config.failFuncs.Length > 0) { taskFeedbackFuncs.Clear(); taskFeedbackFuncs.AddRange(config.failFuncs); WindowCenter.Instance.Open<TaskFeedbackFuncWin>(); } if (!IsSatisfySideTask(feedback.sideTasks, out condition)) { var index = feedback.IndexOfSideTasks(condition); if (config.failGuide != null && index >= 0 && index < config.failGuide.Length) { ExecuteGuide(config.failGuide[index]); } } } } @@ -268,6 +273,7 @@ { if (reikiRootModel.GetReikiRootPoint(reikiRoot[0]) < reikiRoot[1]) { condition = 1; return false; } } System/Message/RichNormalEvent.cs
@@ -216,18 +216,50 @@ { colorType = RichTextMgr.Inst.presentRichText.colorType == RichText.ColorType.Dark ? 0 : 1; } var reikiRootModel = ModelCenter.Instance.GetModel<ReikiRootModel>(); var point = reikiRootModel.GetReikiRootTotalPoint(); var targetValue = int.Parse(dic["myreikiroot"]); if (point < targetValue) var satisfy = false; var targetValue = 0; var point = 0; var property = 0; if (int.TryParse(dic["myreikiroot"], out targetValue)) { point = reikiRootModel.GetReikiRootTotalPoint(); satisfy = point >= targetValue; } else { var jsonArray = LitJson.JsonMapper.ToObject<int[][]>(dic["myreikiroot"]); var job = PlayerDatas.Instance.baseData.Job; for (int i = 0; i < jsonArray.Length; i++) { if (i == job - 1) { property = jsonArray[i][0]; point = reikiRootModel.GetReikiRootPoint(jsonArray[i][0]); targetValue = jsonArray[i][1]; satisfy = point >= targetValue; break; } } } if (!satisfy) { var label = dic.ContainsKey("replacelabel1") ? dic["replacelabel1"] : string.Empty; if (property != 0) { var propertyConfig = PlayerPropertyConfig.Get(property); label = StringUtility.Contact(propertyConfig.Name, ":"); } return UIHelper.AppendColor(TextColType.Red, StringUtility.Contact(label, point, "/", targetValue), colorType == 1); } else { var label = dic.ContainsKey("replacelabel2") ? dic["replacelabel2"] : string.Empty; return UIHelper.AppendColor(TextColType.Green, label, colorType == 1); return label; } } } System/Message/TRichAnalysis.cs
@@ -1,51 +1,54 @@ using System.Collections; using System.Collections.Generic; using System.Text; using UnityEngine; public abstract class TRichAnalysis<T> where T:class,new() { private static T _inst = null; public static T Inst { get { if (_inst == null) { _inst = new T(); } return _inst; } } protected static StringBuilder m_StringBuilder = new StringBuilder(); protected static Dictionary<string, string> displayDic = new Dictionary<string, string>(); public abstract string Analysis(string val,bool IsRich); public abstract string CalculateTextIndex(string val,int index); protected static readonly char SPLITEVENT = '|'; protected static readonly char SPLITDATA = ' '; protected static readonly char SPLITVALUE = '='; private static string[] poolStrs=new string[1]; protected string[] GetSplitEvent(string val) { return val.Split(SPLITEVENT); } protected string[] GetSplitData(string val) { return val.Split(SPLITDATA); } protected string[] GetSplitValue(string val) { if (WordAnalysis.Color_Start_Regex.IsMatch(val)) { poolStrs[0] = val; return poolStrs; } return val.Split(SPLITVALUE); } } using System.Collections; using System.Collections.Generic; using System.Text; using UnityEngine; public abstract class TRichAnalysis<T> where T:class,new() { private static T _inst = null; public static T Inst { get { if (_inst == null) { _inst = new T(); } return _inst; } } protected static StringBuilder m_StringBuilder = new StringBuilder(); protected static Dictionary<string, string> displayDic = new Dictionary<string, string>(); public abstract string Analysis(string val,bool IsRich); public abstract string CalculateTextIndex(string val,int index); protected static readonly char SPLITEVENT = '|'; protected static readonly char SPLITDATA = ' '; protected static readonly char SPLITVALUE = '='; private static string[] poolStrs=new string[1]; protected string[] GetSplitEvent(string val) { return val.Split(SPLITEVENT); } protected string[] GetSplitData(string val) { return val.Split(SPLITDATA); } protected string[] GetSplitValue(string val) { var newVal = val.Replace("=", ""); var count = val.Length - newVal.Length; if (count == 1 && WordAnalysis.Color_Start_Regex.IsMatch(val)) { poolStrs[0] = val; return poolStrs; } return val.Split(new char[] { SPLITVALUE }, 2); } } Utility/UIHelper.cs
@@ -591,7 +591,8 @@ public static string AppendColor(TextColType type, string msg, bool bright = false) { if (m_TextColorRegex.IsMatch(msg)) if (m_TextColorRegex.IsMatch(msg) && msg.ToLower().StartsWith("<color=#") && msg.ToLower().EndsWith("</color>")) { Match match = m_TextColorRegex.Match(msg); msg = match.Groups[1].Value;