少年修仙传客户端代码仓库
client_linchunjie
2019-05-14 bc2d65658f516301b60eb83cb1640e69d6e2e4f2
System/Message/RichNormalEvent.cs
@@ -18,6 +18,9 @@
        RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.AncientRobotName, this);
        RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.AuctionBidding, this);
        RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.RandomChat, this);
        RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.TaskFeedback, this);
        RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.MyFightPoint, this);
        RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.MyReikiRoot, this);
    }
    public override bool Execute(RichTextEventEnum type, RichTextMgr.HrefInfo href)
@@ -127,6 +130,23 @@
                    }
                }
                break;
            case RichTextEventEnum.TaskFeedback:
                {
                    if (href.mSplits.ContainsKey("taskfeedback"))
                    {
                        var taskId = 0;
                        int.TryParse(href.mSplits["taskfeedback"], out taskId);
                        TaskFeedback feedback;
                        var feedbackModel = ModelCenter.Instance.GetModel<TaskFeedbackModel>();
                        if (feedbackModel.TryGetTaskFeedback(taskId, out feedback))
                        {
                            feedbackModel.ExecuteTaskFeedback(taskId);
                            return true;
                        }
                    }
                }
                break;
        }
        return false;
    }
@@ -150,6 +170,47 @@
                    }
                }
                break;
            case RichTextEventEnum.MyFightPoint:
                {
                    var colorType = 0;
                    if (RichTextMgr.Inst.presentRichText != null)
                    {
                        colorType = RichTextMgr.Inst.presentRichText.colorType == RichText.ColorType.Dark ? 0 : 1;
                    }
                    var fightPoint = PlayerDatas.Instance.baseData.FightPoint;
                    var targetValue = int.Parse(dic["myfightpoint"]);
                    if (fightPoint < targetValue)
                    {
                        var label = dic.ContainsKey("replacelabel1") ? dic["replacelabel1"] : string.Empty;
                        return UIHelper.AppendColor(TextColType.Red, StringUtility.Contact(label, fightPoint, "/", targetValue), colorType == 1);
                    }
                    else
                    {
                        var label = dic.ContainsKey("replacelabel2") ? dic["replacelabel2"] : string.Empty;
                        return UIHelper.AppendColor(TextColType.Green, label, colorType == 1);
                    }
                }
            case RichTextEventEnum.MyReikiRoot:
                {
                    var colorType = 0;
                    if (RichTextMgr.Inst.presentRichText != null)
                    {
                        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 label = dic.ContainsKey("replacelabel1") ? dic["replacelabel1"] : string.Empty;
                        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 string.Empty;
    }