From 8ebdcb8980b7a630beb6a1ff82381baa0ab2ddb5 Mon Sep 17 00:00:00 2001
From: client_Lhy <995049470@qq.com>
Date: 星期四, 04 七月 2019 13:58:27 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into LuaOrgan

---
 System/MainInterfacePanel/MainRedDot.cs |   56 +++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 45 insertions(+), 11 deletions(-)

diff --git a/System/MainInterfacePanel/MainRedDot.cs b/System/MainInterfacePanel/MainRedDot.cs
index 7940fba..a40be8b 100644
--- a/System/MainInterfacePanel/MainRedDot.cs
+++ b/System/MainInterfacePanel/MainRedDot.cs
@@ -8,21 +8,22 @@
 using System.Collections.Generic;
 using System;
 
-namespace Snxxz.UI {
+namespace Snxxz.UI
+{
 
     [XLua.LuaCallCSharp]
-public class MainRedDot : Singleton<MainRedDot> {
-
-
+    public class MainRedDot : Singleton<MainRedDot>
+    {
         public const int RedPoint_key = 1;
         public const int FAIRY_REDPOINT_KEY1 = 107;
         public const int RedPoint_key1 = 106;
         public const int RedPoint_UpFuncBase = 2;
         public const int RedPoint_VipDot = 35;//VIP鐣岄潰
+
         private Redpoint redPointStrePrentOne = new Redpoint(RedPoint_key);
-        private Redpoint redPointStrePrent = new Redpoint(RedPoint_key,RedPoint_key1);
-        private Redpoint redpointUpFuncBase = new Redpoint(RedPoint_UpFuncBase);
-        private Redpoint welfareRedPoint = new Redpoint(RedPoint_UpFuncBase, 201);
+        private Redpoint rightTopRedpint = new Redpoint(RedPoint_UpFuncBase);
+        private Redpoint redPointStrePrent = new Redpoint(RedPoint_key, RedPoint_key1);
+        private Redpoint welfareRedPoint = new Redpoint(201);
         private Redpoint realmRedpoint = new Redpoint(114);
         private Redpoint redPointVipDot = new Redpoint(RedPoint_VipDot);
 
@@ -52,13 +53,13 @@
         public const int RedPoint_BagFuncKey = 10201;
         public const int RedPoint_DepotFuncKey = 10204;
         public Redpoint redPointMainPack = new Redpoint(RedPoint_MainPackKey);
-        public Redpoint redPointBagFunc = new Redpoint(RedPoint_MainPackKey,RedPoint_BagFuncKey);
+        public Redpoint redPointBagFunc = new Redpoint(RedPoint_MainPackKey, RedPoint_BagFuncKey);
         public Redpoint redPointDepotFunc = new Redpoint(RedPoint_MainPackKey, RedPoint_DepotFuncKey);
         #endregion
 
         #region 娲楃偧绾㈢偣
         public const int RedPoint_WashFuncKey = 10605;
-        public Redpoint redPointWashFunc = new Redpoint(RedPoint_key1,RedPoint_WashFuncKey);
+        public Redpoint redPointWashFunc = new Redpoint(RedPoint_key1, RedPoint_WashFuncKey);
         #endregion
 
         #region 濂楄绾㈢偣
@@ -67,7 +68,7 @@
         #endregion
 
         #region 浠欑洘鍏敤绾㈢偣
-        public const int FAIRY_REDPOINT_KEY2 = 10701; 
+        public const int FAIRY_REDPOINT_KEY2 = 10701;
         public Redpoint fairyLaunch = new Redpoint(RedPoint_key, FAIRY_REDPOINT_KEY1);
         public Redpoint fairyBaseFuncRedPoint = new Redpoint(FAIRY_REDPOINT_KEY1, FAIRY_REDPOINT_KEY2);
         #endregion
@@ -99,12 +100,45 @@
         #endregion
 
         #region 浠欑洘娲诲姩绾㈢偣
-        public readonly Redpoint fairyActivityRedpoint = new Redpoint(2, 218);
+        public readonly Redpoint fairyActivityRedpoint = new Redpoint(218);
         #endregion
 
         public void Register()
         {
+            RedpointCenter.Instance.redpointValueChangeEvent -= OnRedpointChange;
+            RedpointCenter.Instance.redpointValueChangeEvent += OnRedpointChange;
+        }
 
+        List<int> rightTopHideRedpoints = new List<int>()
+        {
+            22,
+            37,
+            201,
+            203,
+            210,
+            212,
+            214,
+            216,
+            218,
+        };
+
+        private void OnRedpointChange(int id)
+        {
+            if (rightTopHideRedpoints.Contains(id))
+            {
+                var redpiontState = RedPointState.None;
+                for (int i = 0; i < rightTopHideRedpoints.Count; i++)
+                {
+                    var redpointId = rightTopHideRedpoints[i];
+                    if (RedpointCenter.Instance.GetRedpointState(redpointId) != RedPointState.None)
+                    {
+                        redpiontState = RedPointState.Simple;
+                        break;
+                    }
+                }
+
+                rightTopRedpint.state = redpiontState;
+            }
         }
 
     }

--
Gitblit v1.8.0