From 101b9a8619dcb2f7b10fe3f9bd793db8758dc72d Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期四, 23 八月 2018 15:52:21 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/OpenServerActivity/OSGiftModel.cs |   33 +++++++++++++++++++++------------
 1 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/System/OpenServerActivity/OSGiftModel.cs b/System/OpenServerActivity/OSGiftModel.cs
index 8b748c1..f9921d5 100644
--- a/System/OpenServerActivity/OSGiftModel.cs
+++ b/System/OpenServerActivity/OSGiftModel.cs
@@ -27,22 +27,12 @@
             {
                 onStateUpate(6);
             }
+            UpdateRedpoint();
         }
 
         public event Action<int> onStateUpate;
 
         public bool activate { get; private set; }
-
-        private bool m_GiftGetNotify = false;
-        public bool giftGetNotify
-        {
-            get { return m_GiftGetNotify; }
-            set
-            {
-                m_GiftGetNotify = value;
-                OSGiftRedpoint.state = value ? RedPointState.Simple : RedPointState.None;
-            }
-        }
 
         StoreModel storeModel
         {
@@ -80,6 +70,7 @@
                 {
                     onStateUpate(6);
                 }
+                UpdateRedpoint();
             }
         }
 
@@ -94,6 +85,7 @@
                     onStateUpate(6);
                 }
             }
+            UpdateRedpoint();
         }
 
         public bool CheckActivate()
@@ -131,7 +123,24 @@
 
         public void OnBeforePlayerDataInitialize()
         {
-            giftGetNotify = false;
+        }
+        
+        public void SetDayRemind()
+        {
+            if (OSGiftRedpoint.state == RedPointState.Simple)
+            {
+                DayRemind.Instance.SetDayRemind(DayRemind.OSGIFT_REDPOINT, true);
+                UpdateRedpoint();
+            }
+        }
+
+        void UpdateRedpoint()
+        {
+            OSGiftRedpoint.state = RedPointState.None;
+            if (CheckActivate() && !DayRemind.Instance.GetDayRemind(DayRemind.OSGIFT_REDPOINT))
+            {
+                OSGiftRedpoint.state = RedPointState.Simple;
+            }
         }
 
         public Redpoint OSGiftRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20906);

--
Gitblit v1.8.0