From ab6febff1dbce17e318a6d687b8d3e5077b85f01 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 10 十二月 2025 01:58:11 +0800
Subject: [PATCH] 363 【活动内容】开服庆典

---
 Main/System/OSActivity/OSGalaChangeWin.cs.meta   |   11 
 Main/Utility/EnumHelper.cs                       |    1 
 Main/System/OSActivity/OSGalaChangeWin.cs        |   64 ++++
 Main/System/OSActivity/OSActivityManager.cs      |  114 ++++++
 Main/System/OSActivity/OSGalaMissionWin.cs       |   70 ++++
 Main/System/OSActivity/OSGalaMissionCell.cs.meta |   11 
 Main/System/Redpoint/MainRedDot.cs               |    1 
 Main/System/OSActivity/OSGalaGiftCell.cs.meta    |   11 
 Main/System/OSActivity/OSGalaChangeCell.cs       |   66 ++++
 Main/Utility/UIHelper.cs                         |    6 
 Main/System/OSActivity/OSGalaBaseWin.cs          |  142 ++++++++
 Main/System/OSActivity/OSGalaMissionWin.cs.meta  |   11 
 Main/System/OSActivity/OSGalaGiftCell.cs         |  120 +++++++
 Main/Config/PartialConfigs/SuccessConfig.cs      |    2 
 Main/System/OSActivity/OSGalaBaseWin.cs.meta     |   11 
 Main/System/Main/HomeWin.cs                      |    9 
 Main/System/OSActivity/OSGalaMissionCell.cs      |  116 +++++++
 Main/System/OSActivity/OSGalaGiftWin.cs.meta     |   11 
 Main/System/Achievement/AchievementManager.cs    |   85 ++++
 Main/System/OSActivity/OSGalaChangeCell.cs.meta  |   11 
 Main/System/OSActivity/OSGalaGiftWin.cs          |   60 +++
 Main/System/Store/StoreModel.cs                  |    2 
 22 files changed, 922 insertions(+), 13 deletions(-)

diff --git a/Main/Config/PartialConfigs/SuccessConfig.cs b/Main/Config/PartialConfigs/SuccessConfig.cs
index 9952c7e..2806a36 100644
--- a/Main/Config/PartialConfigs/SuccessConfig.cs
+++ b/Main/Config/PartialConfigs/SuccessConfig.cs
@@ -20,7 +20,7 @@
         return null;
     }
 
-    //鑾峰緱鎴愬氨鏉′欢锛岄粯璁や竴涓被鍨嬪彧鏈変竴绉嶆潯浠�
+    //鑾峰緱鎴愬氨鏉′欢锛屽彧閫傜敤浜庡彧鏈�1绉嶆潯浠剁殑鎯呭喌鑾峰彇
     public static string GetConditionString(int type)
     {
         if (typeToIDsDict.ContainsKey(type))
diff --git a/Main/System/Achievement/AchievementManager.cs b/Main/System/Achievement/AchievementManager.cs
index cdbbb98..737274d 100644
--- a/Main/System/Achievement/AchievementManager.cs
+++ b/Main/System/Achievement/AchievementManager.cs
@@ -60,11 +60,14 @@
         UpdateRedpoint(types);
     }
 
-    public int GetAchievementProgress(int type)
+    public int GetAchievementProgress(int type, string condKey = "")
     {
         if (achivementDict.ContainsKey(type))
         {
-            var condKey = SuccessConfig.GetConditionString(type);
+            if (condKey.IsNullOrEmpty())
+            {
+                condKey = SuccessConfig.GetConditionString(type);
+            }
             if (achivementDict[type].ContainsKey(condKey))
             {
                 return achivementDict[type][condKey];
@@ -113,10 +116,10 @@
     }
 
     //鑾峰彇鎴愬氨鐘舵��  0: 鏈鍙� 1: 鏈揪鎴� 2: 宸查鍙�
-    public int GetAchievementState(int id)
+    public int GetAchievementState(int id, string condKey = "")
     {
         var config = SuccessConfig.Get(id);
-        var process = GetAchievementProgress(config.Type);
+        var process = GetAchievementProgress(config.Type, condKey);
         if (process < config.NeedCnt)
         {
             return 1;
@@ -131,10 +134,33 @@
 
     //涓荤嚎绔犺妭
     Redpoint mainLevelRedpoint = new Redpoint(MainRedDot.RedPoint_DailyKey, MainRedDot.RedPoint_MainMissionKey);
+    //搴嗗吀鎴愬氨
+    const int osGalaRepointSuccessID = MainRedDot.RedPoint_OSGala * 10 + 1;
+    Redpoint osGalaRedpoint = new Redpoint(MainRedDot.RedPoint_OSGala, osGalaRepointSuccessID);
+
     //绫诲瀷锛氱孩鐐筰d
     Dictionary<int, int> redpointDict = new Dictionary<int, int>()
     {
-        {1, MainRedDot.RedPoint_MainMissionKey}
+        {1, MainRedDot.RedPoint_MainMissionKey},
+        {2, osGalaRepointSuccessID},
+        {3, osGalaRepointSuccessID},
+        {4, osGalaRepointSuccessID},
+        {5, osGalaRepointSuccessID},
+        {6, osGalaRepointSuccessID},
+        {7, osGalaRepointSuccessID},
+        {8, osGalaRepointSuccessID},
+        {9, osGalaRepointSuccessID},
+        {10, osGalaRepointSuccessID},
+        {11, osGalaRepointSuccessID},
+        {12, osGalaRepointSuccessID},
+        {13, osGalaRepointSuccessID},
+        {14, osGalaRepointSuccessID},
+        {15, osGalaRepointSuccessID},
+        {16, osGalaRepointSuccessID},
+        {17, osGalaRepointSuccessID},
+        {18, osGalaRepointSuccessID},
+        {19, osGalaRepointSuccessID},
+
     };
 
     void UpdateRedpoint(List<int> _types)
@@ -144,9 +170,15 @@
             _types = redpointDict.Keys.ToList();
         }
 
+        bool isGalaRed = false;
+
         foreach (var type in _types)
         {
             if (!redpointDict.ContainsKey(type))
+            {
+                continue;
+            }
+            if (isGalaRed && type >= 2 && type <= 19)
             {
                 continue;
             }
@@ -162,11 +194,19 @@
             foreach (var id in allAchivement)
             {
                 var config = SuccessConfig.Get(id);
+                if (type == 6)
+                {
+                    process = GetAchievementProgress(type, config.Condition[0].ToString());
+                }
                 if (config.NeedCnt <= process)
                 {
                     if (!IsAchievementAwarded(id))
                     {
                         redpoint.state = RedPointState.Simple;
+                        if (type >= 2 && type <= 19)
+                        {
+                            isGalaRed = true;
+                        }
                         break;
                     }
                 }
@@ -185,6 +225,10 @@
                 return true;
             }
         }
+        else if (type >= 2 && type <= 19)
+        {
+            return OSActivityManager.Instance.IsOpenedOSGala();
+        }
         return false;
     }
 
@@ -198,8 +242,14 @@
 
     int CmpIds(int a, int b)
     {
-        var stateA = GetAchievementState(a);
-        var stateB = GetAchievementState(b);
+        var configA = SuccessConfig.Get(a);
+        var configB = SuccessConfig.Get(b);
+
+        var condA = configA.Condition.IsNullOrEmpty() ? "" : configA.Condition[0].ToString();
+        var condB = configB.Condition.IsNullOrEmpty() ? "" : configB.Condition[0].ToString();
+
+        var stateA = GetAchievementState(a, condA);
+        var stateB = GetAchievementState(b, condB);
 
         if (stateA != stateB)
         {
@@ -209,6 +259,27 @@
         return a - b;
     }
 
+    public List<int> GetAchievementIDsByTypes(int[] types)
+    {
+        List<int> allIds = new List<int>();
+        foreach (var type in types)
+        {
+            var ids = SuccessConfig.GetTypeToIDDict(type);
+            if (!ids.IsNullOrEmpty())
+            {
+                //鍚堝苟
+                allIds.AddRange(SuccessConfig.GetTypeToIDDict(type));
+            }
+            // else
+            // {
+            //     Debug.LogError($"{type}");
+            // }
+        }
+        allIds.Sort(CmpIds);
+        return allIds;
+    }
+
+
     public void SendGetAward(int id)
     {
         var config = SuccessConfig.Get(id);
diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs
index c639f73..e26736f 100644
--- a/Main/System/Main/HomeWin.cs
+++ b/Main/System/Main/HomeWin.cs
@@ -63,6 +63,7 @@
     [SerializeField] Button FirstChargeBtn;
     [SerializeField] Button osMainLevelBtn;
     [SerializeField] Button osHeroCallBtn;
+    [SerializeField] Button osGalaBtn;
 
     //鍧愰獞
     [SerializeField] Image horseBGImg;
@@ -197,6 +198,10 @@
         osHeroCallBtn.AddListener(() =>
         {
             UIManager.Instance.OpenWindow<OSHeroCallBaseWin>();
+        });
+        osGalaBtn.AddListener(() =>
+        {
+            UIManager.Instance.OpenWindow<OSGalaBaseWin>();
         });
     }
 
@@ -632,7 +637,8 @@
         {
             DisplayHorse();
         }
-        else if (funcId == (int)FuncOpenEnum.OSMainLevl || funcId == (int)FuncOpenEnum.OSHeroCall)
+        else if (funcId == (int)FuncOpenEnum.OSMainLevl || funcId == (int)FuncOpenEnum.OSHeroCall
+        || funcId == (int)FuncOpenEnum.OSGala)
         {
             DisplayOSActivity();
         }
@@ -683,6 +689,7 @@
     {
         osMainLevelBtn.SetActive(OSActivityManager.Instance.IsOpened(3));
         osHeroCallBtn.SetActive(OSActivityManager.Instance.IsOpened(4));
+        osGalaBtn.SetActive(OSActivityManager.Instance.IsOpenedOSGala());
     }
 
     void OnDayEvent()
diff --git a/Main/System/OSActivity/OSActivityManager.cs b/Main/System/OSActivity/OSActivityManager.cs
index 38faf81..f435452 100644
--- a/Main/System/OSActivity/OSActivityManager.cs
+++ b/Main/System/OSActivity/OSActivityManager.cs
@@ -65,9 +65,7 @@
             osHeroCallGiftSortList.Add(_list[i] + 100000000);
         }
 
-        config = FuncConfigConfig.Get("OSACelebration");
-        osGalaOpenDays = int.Parse(config.Numerical1);
-        osGalaScoreAwards = ConfigParse.ParseIntArray2Dict(config.Numerical2);
+        ParseOSGalaConfig();
     }
 
     // 寮�鏈嶆帓琛屾椿鍔ㄦ槸鍚﹀紑鍚�
@@ -147,6 +145,7 @@
         return a.CompareTo(b);
     }
 
+    //寮�鏈嶆嫑鍕熸绀煎寘
     public void RefreshGiftSortList()
     {
         osHeroCallGiftSortList.Sort(CmpGift);
@@ -165,6 +164,7 @@
     {
         osMainLevelRedpoint.state = !DayRemind.Instance.GetDayRemind(DayRemind.OSMainLevel) ? RedPointState.Simple : RedPointState.None;
         osHeroCallRedpoint.state = RedPointState.None;
+        osGalaRedpoint3.state = RedPointState.None;
 
         if (StoreModel.Instance.freeShopDict.Count == 0) return;
 
@@ -179,6 +179,22 @@
                 if (StoreModel.Instance.GetShopLimitBuyCount(shopID) < config.LimitCnt)
                 {
                     osHeroCallRedpoint.state = RedPointState.Simple;
+                    break;
+                }
+            }
+        }
+
+        if (StoreModel.Instance.freeShopDict.ContainsKey((int)StoreFunc.OSGalaGift))
+        {
+            var shopList = StoreModel.Instance.freeShopDict[(int)StoreFunc.OSGalaGift];
+
+            for (int i = 0; i < shopList.Count; i++)
+            {
+                var shopID = shopList[i];
+                var config = StoreConfig.Get(shopID);
+                if (StoreModel.Instance.GetShopLimitBuyCount(shopID) < config.LimitCnt)
+                {
+                    osGalaRedpoint3.state = RedPointState.Simple;
                     break;
                 }
             }
@@ -199,16 +215,29 @@
     #region 寮�鏈嶅簡鍏�
     //寮�鏈嶅簡鍏�
     public int osGalaOpenDays = 0; //鎸佺画澶╂暟
-    public Dictionary<int, int[][]> osGalaScoreAwards = new Dictionary<int, int[][]>();  // 寮�鏈嶅簡鍏哥Н鍒嗗鍔�
+    public Dictionary<int, int[][]> osGalaScoreAwards = new Dictionary<int, int[][]>();  // 寮�鏈嶅簡鍏哥Н鍒嗗鍔� 绉垎锛氬鍔�
+    public Dictionary<int, int> typeToGuideID = new Dictionary<int, int>();
+    public List<int> osGalaChangeSortList = new List<int>();    //鍏戞崲鍒楄〃锛堝晢搴�5锛�
+    public List<int> osGalaGiftSortList = new List<int>();    //寮�鏈嶅簡鍏哥ぜ鍖� 鍏呭�糏D + 100000000
 
     public int osGalaScore = 0; //褰撳墠绉垎 绱鐨勶紱娑堣�楃殑鏄揣甯�55
     public int osGalaAwardState = 0; //鎸変綅璁板綍鏄惁棰嗗彇
     public event Action OnOSGalaDataChangeEvent;
+
+    // 鍏戞崲鍟嗗簵
+    // Redpoint osGalaRedpoint2 = new Redpoint(MainRedDot.RedPoint_OSGala, MainRedDot.RedPoint_OSGala * 10 + 2);
+    // 绀煎寘鍏嶈垂
+    Redpoint osGalaRedpoint3 = new Redpoint(MainRedDot.RedPoint_OSGala, MainRedDot.RedPoint_OSGala * 10 + 3);
+    // 鎬诲鍔�
+    Redpoint osGalaRedpoint4 = new Redpoint(MainRedDot.RedPoint_OSGala, MainRedDot.RedPoint_OSGala * 10 + 4);
+
+
     public void UpdateOSGalaData(HAB05_tagSCOSACelebrationInfo netPack)
     {
         osGalaScore = (int)netPack.PointTotal;
         osGalaAwardState = (int)netPack.PointAward;
         OnOSGalaDataChangeEvent?.Invoke();
+        UpdateGalaRedpoint();
     }
 
     public bool IsOpenedOSGala()
@@ -221,6 +250,83 @@
         return TimeUtility.OpenDay <= osGalaOpenDays;
     }
 
+    // 鏄惁宸查鍙栧鍔�
+    public bool IsGotAward(int index)
+    {
+        return (osGalaAwardState & (1 << index)) != 0;
+    }
 
+    // 鏄惁鍙鍙栧鍔�
+    public bool CanGetAward(int index, int score)
+    {
+        if (IsGotAward(index))
+        {
+            return false;
+        }
+
+        if (osGalaScore < score)
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    void ParseOSGalaConfig()
+    {
+        var config = FuncConfigConfig.Get("OSACelebration");
+        osGalaOpenDays = int.Parse(config.Numerical1);
+        osGalaScoreAwards = ConfigParse.ParseIntArray2Dict(config.Numerical2);
+
+        config = FuncConfigConfig.Get("Achievement");
+        typeToGuideID = ConfigParse.ParseIntDict(config.Numerical1);
+
+
+        var list = StoreModel.Instance.storeTypeDict[(int)StoreFunc.OSGalaChange];
+        for (int i = 0; i < list.Count; i++)
+        {
+            var item = list[i];
+            osGalaChangeSortList.Add(item.shopId);
+        }
+
+        var _list1 = StoreModel.Instance.storeTypeDict[(int)StoreFunc.OSGalaGift];
+        var _list2 = RechargeManager.Instance.GetCTGIDListByType(19);
+        for (int i = 0; i < _list1.Count; i++)
+        {
+            var item = _list1[i];
+            osGalaGiftSortList.Add(item.shopId);
+        }
+        for (int i = 0; i < _list2.Count; i++)
+        {
+            osGalaGiftSortList.Add(_list2[i] + 100000000);
+        }
+    }
+
+    public void RefreshOSGalaGiftSortList()
+    {
+        osGalaGiftSortList.Sort(CmpGift);
+    }
+
+    public void RefreshOSGalaChangeSortList()
+    {
+        osGalaGiftSortList.Sort(CmpGift);
+    }
+
+    void UpdateGalaRedpoint()
+    {
+        osGalaRedpoint4.state = RedPointState.None;
+        var keys = osGalaScoreAwards.Keys.ToList();
+        keys.Sort();
+        for (int i = 0; i < keys.Count; i++)
+        {
+            var score = keys[i];
+            if (CanGetAward(i, score))
+            {
+                osGalaRedpoint4.state = RedPointState.Simple;
+                return;
+            }
+        }
+
+    }
     #endregion
 }
diff --git a/Main/System/OSActivity/OSGalaBaseWin.cs b/Main/System/OSActivity/OSGalaBaseWin.cs
new file mode 100644
index 0000000..1482eec
--- /dev/null
+++ b/Main/System/OSActivity/OSGalaBaseWin.cs
@@ -0,0 +1,142 @@
+锘�//--------------------------------------------------------
+//    [Author]:           鐜╀釜娓告垙
+//    [  Date ]:           Tuesday, July 24, 2018
+//--------------------------------------------------------
+
+
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+////寮�鏈嶇洓鍏�
+public class OSGalaBaseWin : FunctionsBaseWin
+{
+    [SerializeField] Image processImg;
+    [SerializeField] Text timeText;
+    [SerializeField] Text totalScoreText;
+    [SerializeField] ItemCell[] itemCells;
+    [SerializeField] Image[] gotImgs;
+    [SerializeField] Text[] scoreTexts;
+    [SerializeField] UIEffectPlayer[] effectPlayers;
+
+
+    protected override void OnPreOpen()
+    {
+        base.OnPreOpen();
+        OSActivityManager.Instance.OnOSGalaDataChangeEvent += OnOSGalaDataChangeEvent;
+        GlobalTimeEvent.Instance.secondEvent += ShowTime;
+        Display();
+    }
+
+    protected override void OnPreClose()
+    {
+        base.OnPreClose();
+        OSActivityManager.Instance.OnOSGalaDataChangeEvent -= OnOSGalaDataChangeEvent;
+        GlobalTimeEvent.Instance.secondEvent -= ShowTime;
+    }
+
+
+    protected override void OpenSubUIByTabIndex()
+    {
+        switch (functionOrder)
+        {
+            case 0:
+                currentSubUI = UIManager.Instance.OpenWindow<OSGalaMissionWin>();
+                break;
+            case 1:
+                currentSubUI = UIManager.Instance.OpenWindow<OSGalaChangeWin>();
+                break;
+            case 2:
+                currentSubUI = UIManager.Instance.OpenWindow<OSGalaGiftWin>();
+                break;
+        }
+    }
+
+    private void OnOSGalaDataChangeEvent()
+    {
+        Display();
+    }
+
+    void Display()
+    {
+        var keys = OSActivityManager.Instance.osGalaScoreAwards.Keys.ToList();
+        keys.Sort();
+        // value 鍒嗘锛屾寜keys涓殑杈炬爣鑾峰彇
+        var addValue = 1.0f / keys.Count;
+        var value = 0f;
+        for (int i = 0; i < keys.Count; i++)
+        {
+            var score = keys[i];
+            var award = OSActivityManager.Instance.osGalaScoreAwards[score];
+            if (OSActivityManager.Instance.osGalaScore >= score)
+            {
+                value += addValue;
+            }
+            else
+            {
+                break;
+            }
+        }
+        processImg.fillAmount = value;
+        ShowTime();
+        totalScoreText.text = Language.Get("OSActivity11") + OSActivityManager.Instance.osGalaScore.ToString();
+
+        for (int i = 0; i < itemCells.Length; i++)
+        {
+            if (i < keys.Count)
+            {
+                itemCells[i].SetActive(true);
+                int score = keys[i];
+                int index = i;
+                int itemID = OSActivityManager.Instance.osGalaScoreAwards[score][0][0];
+                itemCells[i].Init(new ItemCellModel(itemID, false, OSActivityManager.Instance.osGalaScoreAwards[score][0][1]));
+                itemCells[i].button.AddListener(() =>
+                {
+                    if (!OSActivityManager.Instance.CanGetAward(index, score))
+                    {
+                        ItemTipUtility.Show(itemID);
+                        return;
+                    }
+
+                    var pack = new CA504_tagCMPlayerGetReward();
+                    pack.RewardType = 9;
+                    pack.DataEx = (uint)score;
+                    GameNetSystem.Instance.SendInfo(pack);
+                });
+
+                gotImgs[i].SetActive(OSActivityManager.Instance.IsGotAward(i));
+                scoreTexts[i].text = keys[i].ToString();
+                if (OSActivityManager.Instance.CanGetAward(index, score))
+                {
+                    effectPlayers[i].Play();
+                }
+                else
+                {
+                    effectPlayers[i].Stop();
+                }
+            }
+            else
+            {
+                itemCells[i].SetActive(false);
+            }
+        }
+    }
+    
+    void ShowTime()
+    {
+        if (TimeUtility.OpenDay >= OSActivityManager.Instance.osGalaOpenDays)
+        {
+            timeText.text = Language.Get("OSActivity6");
+        }
+        else
+        {
+            timeText.text = Language.Get("OSActivity10") + TimeUtility.SecondsToShortDHMS(TimeUtility.GetRemindTimeByOpenDay(OSActivityManager.Instance.osGalaOpenDays));
+        }
+    }
+}
+
+
+
+
diff --git a/Main/System/OSActivity/OSGalaBaseWin.cs.meta b/Main/System/OSActivity/OSGalaBaseWin.cs.meta
new file mode 100644
index 0000000..e13eabe
--- /dev/null
+++ b/Main/System/OSActivity/OSGalaBaseWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 40d472c19a23cf7439b6b4171a3dc689
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/OSActivity/OSGalaChangeCell.cs b/Main/System/OSActivity/OSGalaChangeCell.cs
new file mode 100644
index 0000000..4d289fb
--- /dev/null
+++ b/Main/System/OSActivity/OSGalaChangeCell.cs
@@ -0,0 +1,66 @@
+锘縰sing System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class OSGalaChangeCell : CellView
+{
+    [SerializeField] ItemCell moneyItem;
+    [SerializeField] ItemCell[] itemCells;
+    [SerializeField] Button buyBtn;
+    [SerializeField] Transform saleOutRect;
+    [SerializeField] Text buyLimitText;
+
+    public void Display(int index)
+    {
+        var id = OSActivityManager.Instance.osGalaChangeSortList[index];
+        //鍟嗗簵
+        var storeConfig = StoreConfig.Get(id);
+
+        int scoreItemID = UIHelper.GetItemIDWithMoneyType(55);
+        moneyItem.Init(new ItemCellModel(scoreItemID, false, storeConfig.MoneyNum));
+        moneyItem.button.AddListener(() =>
+        {
+            ItemTipUtility.Show(scoreItemID);
+        });
+
+
+        var awards = StoreModel.Instance.GetShopItemlistEx(storeConfig);
+        for (int i = 0; i < itemCells.Length; i++)
+        {
+            var itemCell = itemCells[i];
+            if (i < awards.Count)
+            {
+                itemCell.SetActive(true);
+                int itemID = awards[i][0];
+                itemCell.Init(new ItemCellModel(itemID, true, awards[i][1]));
+                itemCell.button.SetListener(() => ItemTipUtility.Show(itemID));
+            }
+            else
+            {
+                itemCell.SetActive(false);
+            }
+        }
+
+        var state = StoreModel.Instance.GetShopIDState(id);
+        if (state == 1)
+        {
+            saleOutRect.SetActive(true);
+            buyBtn.SetActive(false);
+        }
+        else
+        {
+            saleOutRect.SetActive(false);
+            buyBtn.SetActive(true);
+            buyBtn.SetListener(() =>
+            {
+                StoreModel.Instance.SendBuyShopItem(storeConfig, 1);
+            });
+        }   
+        var buyCnt = StoreModel.Instance.GetShopLimitBuyCount(id);
+        buyLimitText.text = Language.Get("storename8", storeConfig.LimitCnt - buyCnt, storeConfig.LimitCnt);
+
+
+    }
+
+}
diff --git a/Main/System/OSActivity/OSGalaChangeCell.cs.meta b/Main/System/OSActivity/OSGalaChangeCell.cs.meta
new file mode 100644
index 0000000..53c3c46
--- /dev/null
+++ b/Main/System/OSActivity/OSGalaChangeCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 67af5ca397064d24387bb5dafc986b69
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/OSActivity/OSGalaChangeWin.cs b/Main/System/OSActivity/OSGalaChangeWin.cs
new file mode 100644
index 0000000..19bba93
--- /dev/null
+++ b/Main/System/OSActivity/OSGalaChangeWin.cs
@@ -0,0 +1,64 @@
+锘�//--------------------------------------------------------
+//    [Author]:           鐜╀釜娓告垙
+//    [  Date ]:           Tuesday, July 24, 2018
+//--------------------------------------------------------
+
+
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+////寮�鏈嶅簡鍏� - 鍏戞崲
+public class OSGalaChangeWin : UIBase
+{
+    [SerializeField] ScrollerController scrollerController;
+
+    protected override void OnPreOpen()
+    {
+        scrollerController.OnRefreshCell += OnRefreshCell;
+        StoreModel.Instance.RefreshBuyShopLimitEvent += RefreshStore;
+        OSActivityManager.Instance.RefreshOSGalaChangeSortList();
+        Display();
+    }
+
+    protected override void OnPreClose()
+    {
+        scrollerController.OnRefreshCell -= OnRefreshCell;
+        StoreModel.Instance.RefreshBuyShopLimitEvent -= RefreshStore;
+    }
+
+    void OnRefreshCell(ScrollerDataType type, CellView cell)
+    {
+        var _cell = cell as OSGalaChangeCell;
+        _cell.Display(cell.index);
+    }
+
+    void Display()
+    {
+        scrollerController.Refresh();
+        for (int i = 0; i < OSActivityManager.Instance.osGalaChangeSortList.Count; i++)
+        {
+            scrollerController.AddCell(ScrollerDataType.Header, i);
+        }
+        scrollerController.Restart();
+
+    }
+
+    void RefreshStore()
+    {
+        scrollerController.m_Scorller.RefreshActiveCellViews();
+    }
+
+
+}
+
+
+
+
+
+
+
+
+
+
diff --git a/Main/System/OSActivity/OSGalaChangeWin.cs.meta b/Main/System/OSActivity/OSGalaChangeWin.cs.meta
new file mode 100644
index 0000000..badc4f3
--- /dev/null
+++ b/Main/System/OSActivity/OSGalaChangeWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: da028c17d189bf4479d73388ae438c28
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/OSActivity/OSGalaGiftCell.cs b/Main/System/OSActivity/OSGalaGiftCell.cs
new file mode 100644
index 0000000..a7d8631
--- /dev/null
+++ b/Main/System/OSActivity/OSGalaGiftCell.cs
@@ -0,0 +1,120 @@
+锘縰sing System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class OSGalaGiftCell : CellView
+{
+    [SerializeField] Text nameText;
+    [SerializeField] ItemCell[] itemCells;
+    [SerializeField] Button buyBtn;
+    [SerializeField] Text moneyText;
+    [SerializeField] Image moneyIcon;
+    [SerializeField] Transform saleOutRect;
+    [SerializeField] Image redImg;
+    [SerializeField] Text buyLimitText;
+    [SerializeField] Image maskImg;
+
+    public void Display(int index)
+    {
+        var id = OSActivityManager.Instance.osGalaGiftSortList[index];
+        if (id > 100000000)
+        {
+            //鍏呭��
+            id -= 100000000;
+            var ctgConfig = CTGConfig.Get(id);
+            nameText.text = ctgConfig.Title;
+            for (int i = 0; i < itemCells.Length; i++)
+            {
+                var itemCell = itemCells[i];
+                if (i < ctgConfig.GainItemList.Length)
+                {
+                    itemCell.SetActive(true);
+                    int itemID = ctgConfig.GainItemList[i][0];
+                    itemCell.Init(new ItemCellModel(itemID, true, ctgConfig.GainItemList[i][1]));
+                    itemCell.button.SetListener(() => ItemTipUtility.Show(itemID));
+                }
+                else
+                {
+                    itemCell.SetActive(false);
+                }
+            }
+            RechargeManager.Instance.TryGetRechargeCount(id, out var rechargeCount);
+            var limitCnt = ctgConfig.DailyBuyCount;
+            if (rechargeCount.todayCount < limitCnt)
+            {
+                saleOutRect.SetActive(false);
+                maskImg.SetActive(false);
+                buyBtn.SetActive(true);
+                buyBtn.SetListener(() =>
+                {
+                    RechargeManager.Instance.CTG(id);
+                });
+
+                RechargeManager.Instance.TryGetOrderInfo(id, out var orderInfo);
+
+                moneyText.text = Language.Get("PayMoneyNum", orderInfo.PayRMBNumOnSale);
+                moneyIcon.SetActive(false);
+            }
+            else
+            {
+                saleOutRect.SetActive(true);
+                maskImg.SetActive(true);
+                buyBtn.SetActive(false);
+            }
+            buyLimitText.text = Language.Get("storename6", limitCnt - rechargeCount.todayCount, limitCnt);
+            redImg.SetActive(false);
+
+        }
+        else
+        {
+            //鍟嗗簵
+            var storeConfig = StoreConfig.Get(id);
+            nameText.text = storeConfig.Name;
+            var awards = StoreModel.Instance.GetShopItemlistEx(storeConfig);
+            for (int i = 0; i < itemCells.Length; i++)
+            {
+                var itemCell = itemCells[i];
+                if (i < awards.Count)
+                {
+                    itemCell.SetActive(true);
+                    int itemID = awards[i][0];
+                    itemCell.Init(new ItemCellModel(itemID, true, awards[i][1]));
+                    itemCell.button.SetListener(() => ItemTipUtility.Show(itemID));
+                }
+                else
+                {
+                    itemCell.SetActive(false);
+                }
+            }
+
+            var state = StoreModel.Instance.GetShopIDState(id);
+            if (state == 1)
+            {
+                saleOutRect.SetActive(true);
+                maskImg.SetActive(true);
+                buyBtn.SetActive(false);
+                redImg.SetActive(false);
+            }
+            else
+            {
+                saleOutRect.SetActive(false);
+                maskImg.SetActive(false);
+                buyBtn.SetActive(true);
+                buyBtn.SetListener(() =>
+                {
+                    StoreModel.Instance.SendBuyShopItemWithPopCheck(storeConfig, 1);
+                });
+                moneyText.text = storeConfig.MoneyNum == 0 ? Language.Get("L1127") : storeConfig.MoneyNum.ToString();
+                moneyIcon.SetActive(storeConfig.MoneyNum != 0);
+                moneyIcon.SetIconWithMoneyType(storeConfig.MoneyType);
+                redImg.SetActive(storeConfig.MoneyNum == 0);
+            }   
+            var buyCnt = StoreModel.Instance.GetShopLimitBuyCount(id);
+            buyLimitText.text = Language.Get("storename6", storeConfig.LimitCnt - buyCnt, storeConfig.LimitCnt);
+
+        }
+
+    }
+
+}
diff --git a/Main/System/OSActivity/OSGalaGiftCell.cs.meta b/Main/System/OSActivity/OSGalaGiftCell.cs.meta
new file mode 100644
index 0000000..2d3954c
--- /dev/null
+++ b/Main/System/OSActivity/OSGalaGiftCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d7390224540c1054c9ba0e96bae8674b
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/OSActivity/OSGalaGiftWin.cs b/Main/System/OSActivity/OSGalaGiftWin.cs
new file mode 100644
index 0000000..950a344
--- /dev/null
+++ b/Main/System/OSActivity/OSGalaGiftWin.cs
@@ -0,0 +1,60 @@
+锘�//--------------------------------------------------------
+//    [Author]:           鐜╀釜娓告垙
+//    [  Date ]:           Tuesday, July 24, 2018
+//--------------------------------------------------------
+
+
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+////寮�鏈嶅簡鍏� - 绀煎寘
+public class OSGalaGiftWin : UIBase
+{
+    [SerializeField] ScrollerController scrollerController;
+
+    protected override void OnPreOpen()
+    {
+        scrollerController.OnRefreshCell += OnRefreshCell;
+        StoreModel.Instance.RefreshBuyShopLimitEvent += RefreshStore;
+        RechargeManager.Instance.rechargeCountEvent += OnRechargeCountEvent;
+        OSActivityManager.Instance.RefreshOSGalaGiftSortList();
+        Display();
+    }
+
+    protected override void OnPreClose()
+    {
+        scrollerController.OnRefreshCell -= OnRefreshCell;
+        StoreModel.Instance.RefreshBuyShopLimitEvent -= RefreshStore;
+        RechargeManager.Instance.rechargeCountEvent -= OnRechargeCountEvent;
+    }
+
+    void OnRefreshCell(ScrollerDataType type, CellView cell)
+    {
+        var _cell = cell as OSGalaGiftCell;
+        _cell.Display(cell.index);
+    }
+
+    void Display()
+    {
+        scrollerController.Refresh();
+        for (int i = 0; i < OSActivityManager.Instance.osGalaGiftSortList.Count; i++)
+        {
+            scrollerController.AddCell(ScrollerDataType.Header, i);
+        }
+        scrollerController.Restart();
+
+    }
+
+    void RefreshStore()
+    {
+        scrollerController.m_Scorller.RefreshActiveCellViews();
+    }
+
+    void OnRechargeCountEvent(int id)
+    {
+        scrollerController.m_Scorller.RefreshActiveCellViews();
+    }
+}
+
diff --git a/Main/System/OSActivity/OSGalaGiftWin.cs.meta b/Main/System/OSActivity/OSGalaGiftWin.cs.meta
new file mode 100644
index 0000000..fd5887f
--- /dev/null
+++ b/Main/System/OSActivity/OSGalaGiftWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2ef7df34ebcd38d42ba1ca95b494ba7d
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/OSActivity/OSGalaMissionCell.cs b/Main/System/OSActivity/OSGalaMissionCell.cs
new file mode 100644
index 0000000..a713339
--- /dev/null
+++ b/Main/System/OSActivity/OSGalaMissionCell.cs
@@ -0,0 +1,116 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+public class OSGalaMissionCell : CellView
+{
+    [SerializeField] Text nameText;
+    [SerializeField] Image processImg;
+    [SerializeField] Text processText;
+    [SerializeField] ItemCell[] itemCells;
+
+    [SerializeField] Button getBtn;
+    [SerializeField] Button gotoBtn;
+    [SerializeField] Transform gotRect;
+
+
+    public void Display(int id)
+    {
+        var config = SuccessConfig.Get(id);
+        int targetValue = 0;
+        int curValue = 0;
+        var type = config.Type;
+        if (type == 2)
+        {
+            // 涓荤嚎鍏冲崱娲诲姩
+            nameText.text = Language.Get($"Achievement{type}", config.NeedCnt / 100, config.NeedCnt % 100);
+
+        }
+        else if (type == 4)
+        {
+            nameText.text = Language.Get($"Achievement{type}", UIHelper.AppendColor(OfficialRankManager.Instance.GetOfficialRankColor(config.NeedCnt),
+                            RealmConfig.Get(config.NeedCnt).Name));
+        }
+        else if (type == 6)
+        {
+            // 瑁呭鍝佽川
+            nameText.text = Language.Get($"Achievement{type}", config.NeedCnt, UIHelper.GetQualityNameWithColor(config.Condition[0]));
+        }
+        else if (config.Condition.IsNullOrEmpty())
+        {
+            nameText.text = Language.Get($"Achievement{type}", config.NeedCnt);
+        }
+        else
+        {
+            nameText.text = Language.Get($"Achievement{type}", config.NeedCnt, config.Condition[0]);
+        }
+
+        if (type == 2)
+        {
+            targetValue = MainLevelConfig.GetToTargetLevelIndex(config.NeedCnt) + 1;
+            curValue = MainLevelConfig.GetToTargetLevelIndex(AchievementManager.Instance.GetAchievementProgress(type)) + 1;
+        }
+        else if (type == 6)
+        {
+            targetValue = config.NeedCnt;
+            curValue = AchievementManager.Instance.GetAchievementProgress(type, config.Condition[0].ToString());
+        }
+        else
+        {
+            targetValue = config.NeedCnt;
+            curValue = AchievementManager.Instance.GetAchievementProgress(type);
+        }
+        
+        processImg.fillAmount = (float)curValue / targetValue;
+        processText.text = Math.Min(targetValue, curValue) + "/" + targetValue;
+
+        var cond = config.Condition.IsNullOrEmpty() ? "" : config.Condition[0].ToString();
+        var state = AchievementManager.Instance.GetAchievementState(id, cond);
+        for (int i = 0; i < itemCells.Length; i++)
+        {
+            if (i < config.AwardItemList.Length)
+            {
+                itemCells[i].SetActive(true);
+                int itemID = config.AwardItemList[i][0];
+                itemCells[i].Init(new ItemCellModel(itemID, false, config.AwardItemList[i][1]));
+                itemCells[i].button.AddListener(() =>
+                {
+                    ItemTipUtility.Show(itemID);
+                });
+            }
+            else
+            {
+                itemCells[i].SetActive(false);
+            }
+        }
+
+        getBtn.SetActive(state == 0);
+        gotoBtn.SetActive(state == 1);
+        gotRect.SetActive(state == 2);
+
+
+        getBtn.AddListener(() =>
+        {
+            AchievementManager.Instance.SendGetAward(id);
+        });
+        
+        gotoBtn.AddListener(() =>
+        {
+            UIManager.Instance.CloseWindow<OSGalaBaseWin>();
+
+            int guideID = 0;
+            OSActivityManager.Instance.typeToGuideID.TryGetValue(type, out guideID);
+            if (guideID > 0)
+            {
+                NewBieCenter.Instance.StartNewBieGuide(guideID);
+            }
+        });
+    }
+
+
+}
+
+
diff --git a/Main/System/OSActivity/OSGalaMissionCell.cs.meta b/Main/System/OSActivity/OSGalaMissionCell.cs.meta
new file mode 100644
index 0000000..a0e43e9
--- /dev/null
+++ b/Main/System/OSActivity/OSGalaMissionCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3eca62a486d2d9a40bea2997c93082fe
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/OSActivity/OSGalaMissionWin.cs b/Main/System/OSActivity/OSGalaMissionWin.cs
new file mode 100644
index 0000000..39d15df
--- /dev/null
+++ b/Main/System/OSActivity/OSGalaMissionWin.cs
@@ -0,0 +1,70 @@
+锘�//--------------------------------------------------------
+//    [Author]:           鐜╀釜娓告垙
+//    [  Date ]:           Tuesday, July 24, 2018
+//--------------------------------------------------------
+
+
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+////寮�鏈嶆椿鍔�-涓荤嚎鍏冲崱娲诲姩
+public class OSGalaMissionWin : UIBase
+{
+    [SerializeField] ScrollerController scroller;
+
+    int[] types = new int[] { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
+
+    List<int> ids = new List<int>();
+    protected override void OnPreOpen()
+    {
+        scroller.OnRefreshCell += OnRefreshCell;
+        AchievementManager.Instance.OnAchievementUpdateEvent += OnAchievementUpdateEvent;
+        CreateScroller();
+
+
+    }
+
+    protected override void OnPreClose()
+    {
+        scroller.OnRefreshCell -= OnRefreshCell;
+        AchievementManager.Instance.OnAchievementUpdateEvent -= OnAchievementUpdateEvent;
+
+    }
+
+    void OnAchievementUpdateEvent(int type)
+    {
+        // -1 涓烘墍鏈夌被鍨�
+        if (type >= 2 && type <= 19 || type == -1)
+        {
+            ids = AchievementManager.Instance.GetAchievementIDsByTypes(types);
+            scroller.m_Scorller.RefreshActiveCellViews();
+        }
+    }
+
+    void CreateScroller()
+    {
+        ids = AchievementManager.Instance.GetAchievementIDsByTypes(types);
+        var count = ids.Count;
+        scroller.Refresh();
+        for (int i = 0; i < count; i++)
+        {
+            scroller.AddCell(ScrollerDataType.Header, i);
+        }
+        scroller.Restart();
+
+    }
+
+
+    void OnRefreshCell(ScrollerDataType type, CellView cell)
+    {
+        var _cell = cell as OSGalaMissionCell;
+        _cell.Display(ids[cell.index]);
+    }
+
+}
+
+
+
+
diff --git a/Main/System/OSActivity/OSGalaMissionWin.cs.meta b/Main/System/OSActivity/OSGalaMissionWin.cs.meta
new file mode 100644
index 0000000..bc41b82
--- /dev/null
+++ b/Main/System/OSActivity/OSGalaMissionWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 030ec9a086c424f4d92911dac344b8ff
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/Redpoint/MainRedDot.cs b/Main/System/Redpoint/MainRedDot.cs
index 124a859..cd3f9e1 100644
--- a/Main/System/Redpoint/MainRedDot.cs
+++ b/Main/System/Redpoint/MainRedDot.cs
@@ -73,6 +73,7 @@
     public const int RedPoint_OSMainLevel = 111;    //寮�鏈嶆
     public const int RedPoint_OSHeroCard = 112;
     public const int RedPoint_OSGala = 113; //寮�鏈嶅簡鍏�
+    Redpoint osGalaRedpoint = new Redpoint(RedPoint_OSGala);
 
     public const int RedPoint_Download = 116;
 
diff --git a/Main/System/Store/StoreModel.cs b/Main/System/Store/StoreModel.cs
index 9028651..56e6eb9 100644
--- a/Main/System/Store/StoreModel.cs
+++ b/Main/System/Store/StoreModel.cs
@@ -570,6 +570,8 @@
     Guild = 2, //2锛氬叕浼�
     Hero = 3, //3锛氬皢榄�
     OSHeroCall = 4, //4锛氬紑鏈嶆嫑鍕熺ぜ鍖�
+    OSGalaChange = 5, //5锛氬紑鏈嶅簡鍏稿厬鎹�
+    OSGalaGift = 6, //6锛氬紑鏈嶅簡鍏哥ぜ鍖�
 
 }
 
diff --git a/Main/Utility/EnumHelper.cs b/Main/Utility/EnumHelper.cs
index 2ac80e5..f428ab2 100644
--- a/Main/Utility/EnumHelper.cs
+++ b/Main/Utility/EnumHelper.cs
@@ -711,6 +711,7 @@
     default44,  // 272 姝﹀皢鎷涘嫙绉垎
     GoldRush = 285, // 娣橀噾浠�
     ChallengeVoucher = 286,//鎸戞垬鍑瘉
+    OSGalaScore = 288, //寮�鏈嶅簡鍏哥Н鍒�
 };
 
 
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index d42ccdc..a4310db 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -1004,6 +1004,7 @@
         {43, PlayerDataType.default34},
         {42, PlayerDataType.default33},
         {53, PlayerDataType.ChallengeVoucher},
+        {55, PlayerDataType.OSGalaScore},
         {99, PlayerDataType.ExAttr11},
     };
 
@@ -1152,6 +1153,11 @@
                     //鎸戞垬鍑瘉
                     return PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ChallengeVoucher);
                 }
+            case 55:
+                {
+                    //寮�鏈嶅簡鍏哥Н鍒�
+                    return PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.OSGalaScore);
+                }
             case 98:
                 {
                     //杩囨湡鍨嬩唬閲戝埜

--
Gitblit v1.8.0