From fc14844134b5ed2c8a4e2e3ad9042c8cbaab43ef Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期五, 07 十二月 2018 11:09:10 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/OpenServerActivity/FlashRushToBuyCoolDown.cs |   48 +++++++++++++++++++++++++++++++++---------------
 1 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/System/OpenServerActivity/FlashRushToBuyCoolDown.cs b/System/OpenServerActivity/FlashRushToBuyCoolDown.cs
index 37227a3..784d7e6 100644
--- a/System/OpenServerActivity/FlashRushToBuyCoolDown.cs
+++ b/System/OpenServerActivity/FlashRushToBuyCoolDown.cs
@@ -14,21 +14,23 @@
 
         private void OnEnable()
         {
-            SecondEvent();
-            GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
-            GlobalTimeEvent.Instance.secondEvent += SecondEvent;
+            DisplayTime();
+            WindowCenter.Instance.windowBeforeOpenEvent += OpenWindow;
         }
 
         private void OnDisable()
         {
-            GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
+            WindowCenter.Instance.windowBeforeOpenEvent -= OpenWindow;
         }
 
 
-        private void SecondEvent()
+        private void OpenWindow(Window win)
         {
+            if (win.name != typeof(MainInterfaceWin).Name) return;
+
             DisplayTime();
         }
+
 
         void DisplayTime()
         {
@@ -43,22 +45,38 @@
                 case FlashRushToBuyModel.FlashRushToBuySate.NoOpen:
                     break;
                 case FlashRushToBuyModel.FlashRushToBuySate.InAdvance:
-                    if(seconds <= 3600)
+
+                    int saleDay = operation.startDate.day + saleShop.dayIndex;
+                    int offsetDay = saleDay - TimeUtility.ServerNow.Day;
+                    if(offsetDay > 1)
                     {
-                        int split = (3600 - seconds)/30 % 2;
-                        if(split == 0)
-                        {
-                            timeText.text = Language.Get("FlashRushToBuy109", TimeUtility.SecondsToMS(seconds));
-                        }
-                        else
-                        {
-                            timeText.text = Language.Get("FlashRushToBuy106", operation.ToDisplayBuyTime(operationTime.startHour, operationTime.startMinute));
-                        }
+                        string saleDate = StringUtility.Contact(operation.startDate.month, Language.Get("Month"),saleDay,Language.Get("Day"));
+                        timeText.text = saleDate;
+                    }
+                    else if(offsetDay == 1)
+                    {
+                        timeText.text = Language.Get("FlashRushToBuy110");
                     }
                     else
                     {
                         timeText.text = Language.Get("FlashRushToBuy106", operation.ToDisplayBuyTime(operationTime.startHour, operationTime.startMinute));
                     }
+                    //if(seconds <= 3600)
+                    //{
+                    //    int split = (3600 - seconds)/30 % 2;
+                    //    if(split == 0)
+                    //    {
+                    //        timeText.text = Language.Get("FlashRushToBuy109", TimeUtility.SecondsToMS(seconds));
+                    //    }
+                    //    else
+                    //    {
+                    //        timeText.text = Language.Get("FlashRushToBuy106", operation.ToDisplayBuyTime(operationTime.startHour, operationTime.startMinute));
+                    //    }
+                    //}
+                    //else
+                    //{
+                    //    timeText.text = Language.Get("FlashRushToBuy106", operation.ToDisplayBuyTime(operationTime.startHour, operationTime.startMinute));
+                    //}
                     break;
                 case FlashRushToBuyModel.FlashRushToBuySate.Begining:
                     timeText.text = Language.Get("FlashRushToBuy107");

--
Gitblit v1.8.0