From e686df54ce69a285bf10558ace1eabb485655d55 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期三, 07 十一月 2018 10:05:50 +0800
Subject: [PATCH] 4398 【1.2】聊天气泡框

---
 System/Chat/ChatBubbleModel.cs |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/System/Chat/ChatBubbleModel.cs b/System/Chat/ChatBubbleModel.cs
index 53d4cd9..6d936cf 100644
--- a/System/Chat/ChatBubbleModel.cs
+++ b/System/Chat/ChatBubbleModel.cs
@@ -5,25 +5,43 @@
 using UnityEngine;
 namespace Snxxz.UI
 {
-    public class ChatBubbleModel : Model, IBeforePlayerDataInitialize
+    public class ChatBubbleModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
     {
         public Dictionary<int, ChatBubble> chatBubbles = new Dictionary<int, ChatBubble>();
 
         public event Action chatBubbleStateRefresh;
 
         VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
+
+        bool serverInited = false;
         public override void Init()
         {
             ParseConfig();
+            PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
         }
 
         public override void UnInit()
         {
+            PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent;
         }
 
         public void OnBeforePlayerDataInitialize()
         {
             bubbleState = 0;
+            serverInited = false;
+        }
+
+        public void OnPlayerLoginOk()
+        {
+            serverInited = true;
+        }
+
+        private void PlayerDataRefreshInfoEvent(PlayerDataRefresh refreshType)
+        {
+            if (refreshType == PlayerDataRefresh.ExAttr10 && serverInited)
+            {
+                SysNotifyMgr.Instance.ShowTip("ChangeBubbleSuccess");
+            }
         }
 
         void ParseConfig()

--
Gitblit v1.8.0