From 2356bad529ebddb89da1c2c53ae114a296d9b9f7 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 27 八月 2025 23:24:25 +0800
Subject: [PATCH] 100 【主界面】官职晋升

---
 Main/Core/GameEngine/Player/PlayerBaseData.cs                                 |    4 
 Main/System/OfficialRank/OfficialUpWin.cs.meta                                |   11 +
 Main/Utility/EnumHelper.cs                                                    |    4 
 Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs      |   16 +
 Main/System/OfficialRank/OfficialRankManager.cs                               |  216 +++++++++++++++----
 Main/System/OfficialRank/OfficialUpCell.cs.meta                               |   11 +
 Main/System/OfficialRank/OfficialUpWin.cs                                     |  132 ++++++++++++
 Main/System/Redpoint/MainRedDot.cs                                            |    3 
 Main/System/OfficialRank/OfficialLVUPSuccessWin.cs.meta                       |   11 +
 Main/Utility/UIHelper.cs                                                      |   52 ++--
 Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs                             |   10 
 Main/System/Main/HomeWin.cs                                                   |   16 +
 Main/System/OfficialRank/OfficialUpCell.cs                                    |   66 ++++++
 Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs.meta |   11 +
 Main/Config/Configs/RealmConfig.cs                                            |    2 
 Main/Config/Configs/RealmLVUPTaskConfig.cs                                    |    2 
 Main/System/OfficialRank/OfficialLVUPSuccessWin.cs                            |   62 +++++
 17 files changed, 538 insertions(+), 91 deletions(-)

diff --git a/Main/Config/Configs/RealmConfig.cs b/Main/Config/Configs/RealmConfig.cs
index ff51fe3..2c8a21a 100644
--- a/Main/Config/Configs/RealmConfig.cs
+++ b/Main/Config/Configs/RealmConfig.cs
@@ -1,6 +1,6 @@
 锘�//--------------------------------------------------------
 //    [Author]:           YYL
-//    [  Date ]:           2025骞�8鏈�5鏃�
+//    [  Date ]:           2025骞�8鏈�27鏃�
 //--------------------------------------------------------
 
 using System.Collections.Generic;
diff --git a/Main/Config/Configs/RealmLVUPTaskConfig.cs b/Main/Config/Configs/RealmLVUPTaskConfig.cs
index f014c14..b1026cb 100644
--- a/Main/Config/Configs/RealmLVUPTaskConfig.cs
+++ b/Main/Config/Configs/RealmLVUPTaskConfig.cs
@@ -1,6 +1,6 @@
 锘�//--------------------------------------------------------
 //    [Author]:           YYL
-//    [  Date ]:           2025骞�8鏈�5鏃�
+//    [  Date ]:           2025骞�8鏈�27鏃�
 //--------------------------------------------------------
 
 using System.Collections.Generic;
diff --git a/Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs b/Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs
index 88afc81..1d26f9e 100644
--- a/Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs
+++ b/Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs
@@ -4,24 +4,24 @@
 public partial class RealmLVUPTaskConfig : ConfigBase<int, RealmLVUPTaskConfig>
 {
     //瀹樿亴锛氫换鍔D锛氱储寮昳d
-    private static Dictionary<int, Dictionary<int, int>> missionDict = new Dictionary<int, Dictionary<int, int>>();
+    private static Dictionary<int, Dictionary<int, RealmLVUPTaskConfig>> missionDict = new Dictionary<int, Dictionary<int, RealmLVUPTaskConfig>>();
 
     protected override void OnConfigParseCompleted()
     {
         if (!missionDict.ContainsKey(Lv))
         {
-            missionDict.Add(Lv, new Dictionary<int, int>());
+            missionDict.Add(Lv, new Dictionary<int, RealmLVUPTaskConfig>());
         }
-        missionDict[Lv][TaskID] = ID;
+        missionDict[Lv][TaskID] = this;
     }
 
-    public static int GetID(int realmLV, int taskID)
+    public static RealmLVUPTaskConfig GetID(int realmLV, int taskID)
     {
         if (missionDict.ContainsKey(realmLV) && missionDict[realmLV].ContainsKey(taskID))
         {
             return missionDict[realmLV][taskID];
         }
-        return -1;
+        return null;
     }
 
     public static List<int> GetMissionIDs(int lv)
diff --git a/Main/Core/GameEngine/Player/PlayerBaseData.cs b/Main/Core/GameEngine/Player/PlayerBaseData.cs
index 8c33b85..dac5f53 100644
--- a/Main/Core/GameEngine/Player/PlayerBaseData.cs
+++ b/Main/Core/GameEngine/Player/PlayerBaseData.cs
@@ -34,7 +34,7 @@
     public byte FBID;    //fb id
     public byte realmLevel;    //瀹樿亴
     public byte VIPLv;    //VIP绛夌骇
-    public uint ExAttr1;    // 鍗忓姪鐩爣鐜╁ID锛岄潪0鍙�0閫�鍑哄崗鍔�
+    public uint ExAttr1;    // 绛栧垝閰嶇疆鍏冲崱ID涓�201锛屽嵆 杩囧叧2-1(0/1) ,浣跨敤 ExAttr1 鍊煎垽鏂紝濡侲xAttr1鍊间负20103浠h〃褰撳墠宸茬粡杩囦簡绗�2绔犵1鍏崇3娉紝鍖呭惈浜嗘尝锛岄渶瑕佸嚮璐ヨ鍏冲崱boss鍚庢墠绠楄鍏宠繃鍏�
     public uint teamAutoOperateFlag;    //鎵╁睍灞炴��2锛屽悇椤圭洰涓撶敤
     public int dungeonLineId;    // 鍓湰绾胯矾id
     public int dungeonMapId;    // 鍓湰鐢ㄤ綔 DataMapId,鍗曚汉鍓湰瀛樺湪1.鍋囧壇鏈� 2.鏈嶅姟绔�1瀵瑰鎴风澶氬湴鍥惧悓鍒嗙嚎 3.鏈嶅姟绔�1瀵瑰鎴风澶氬湴鍥句笉鍚屽垎绾�
@@ -164,7 +164,7 @@
         CON = _serverInfo.CON;
         Setting = _serverInfo.Setting;
         FBID = _serverInfo.FBID;
-        ExAttr1 = _serverInfo.ExAttr1;
+        ExAttr1 = _serverInfo.ExAttr1;  //绛栧垝閰嶇疆鍏冲崱ID涓�201锛屽嵆 杩囧叧2-1(0/1) ,浣跨敤 ExAttr1 鍊煎垽鏂紝濡侲xAttr1鍊间负20103浠h〃褰撳墠宸茬粡杩囦簡绗�2绔犵1鍏崇3娉紝鍖呭惈浜嗘尝锛岄渶瑕佸嚮璐ヨ鍏冲崱boss鍚庢墠绠楄鍏宠繃鍏�
         teamAutoOperateFlag = _serverInfo.ExAttr2;
         dungeonLineId = (int)_serverInfo.ExAttr3 % 1000;
         dungeonMapId = (int)_serverInfo.ExAttr3 / 1000;
diff --git a/Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs b/Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs
new file mode 100644
index 0000000..9af42fb
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs
@@ -0,0 +1,16 @@
+using UnityEngine;
+using System.Collections;
+
+// A5 23 鎻愬崌澧冪晫绛夌骇 # tagCMRealmLVUp
+
+public class CA523_tagCMRealmLVUp : GameNetPackBasic {
+
+    public CA523_tagCMRealmLVUp () {
+        combineCmd = (ushort)0x03FE;
+        _cmd = (ushort)0xA523;
+    }
+
+    public override void WriteToBytes () {
+    }
+
+}
diff --git a/Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs.meta b/Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs.meta
new file mode 100644
index 0000000..afd2af5
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CA5_Function/CA523_tagCMRealmLVUp.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3a06990786c9e0942bdb91bbcb19914c
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs
index 277c3f0..6ec10e7 100644
--- a/Main/System/Main/HomeWin.cs
+++ b/Main/System/Main/HomeWin.cs
@@ -27,6 +27,11 @@
 
     [SerializeField] Button changeHeroPosBtn;
 
+    //绛夌骇
+    [SerializeField] Button officialUpBtn;
+
+
+    //搴曢儴鍔熻兘
     [SerializeField] Button autoBtn;
     [SerializeField] Button  blessLVBtn;
     [SerializeField] Text blessLVText;
@@ -80,10 +85,17 @@
             InvestModel.Instance.BuyInvest(InvestModel.monthCardType);
         });
 
-        blessLVBtn.AddListener(()=>
-        { 
+        blessLVBtn.AddListener(() =>
+        {
             UIManager.Instance.OpenWindow<BlessLVWin>();
         });
+
+        officialUpBtn.AddListener(()=>
+        {
+            if (RealmConfig.GetKeys().Count <= PlayerDatas.Instance.baseData.realmLevel)
+                return;
+            UIManager.Instance.OpenWindow<OfficialUpWin>();
+        });
     }
 
 
diff --git a/Main/System/OfficialRank/OfficialLVUPSuccessWin.cs b/Main/System/OfficialRank/OfficialLVUPSuccessWin.cs
new file mode 100644
index 0000000..9a4e02b
--- /dev/null
+++ b/Main/System/OfficialRank/OfficialLVUPSuccessWin.cs
@@ -0,0 +1,62 @@
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 瀹樿亴鍗囩骇鐣岄潰
+/// </summary>
+public class OfficialLVUPSuccessWin : UIBase
+{
+
+    [SerializeField] Text beforeNameText;
+    [SerializeField] Text nameText;
+    [SerializeField] Text lvText;
+    [SerializeField] Text nextLVText;
+    [SerializeField] Text[] attrNameText;
+    [SerializeField] Text[] attrPerTextArr;
+    [SerializeField] Text[] nextAttrPerTextArr;
+    [SerializeField] Button okBtn;
+
+
+
+    protected override void InitComponent()
+    {
+        okBtn.AddListener(CloseWindow);
+    }
+
+
+    protected override void OnPreOpen()
+    {
+
+        Refresh();
+    }
+
+    protected override void OnPreClose()
+    {
+    }
+
+
+    public override void Refresh()
+    {
+        var beforeConfig = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel - 1);
+        var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel);
+        beforeNameText.text = beforeConfig.Name;
+        beforeNameText.color = OfficialRankManager.Instance.GetOfficialRankColor(beforeConfig.Quality);
+        nameText.text = config.Name;
+        nameText.color = OfficialRankManager.Instance.GetOfficialRankColor(config.Quality);
+        lvText.text = beforeConfig.LVMax.ToString();
+        nextLVText.text = config.LVMax.ToString();
+
+        for (int i = 0; i < attrNameText.Length; i++)
+        {
+            attrNameText[i].text = PlayerPropertyConfig.Get(config.AddAttrType[i]).Name;
+            attrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(config.AddAttrType[i], beforeConfig.AddAttrType[i]);
+            nextAttrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(config.AddAttrType[i], config.AddAttrType[i]);
+        }
+
+
+    }
+
+}
\ No newline at end of file
diff --git a/Main/System/OfficialRank/OfficialLVUPSuccessWin.cs.meta b/Main/System/OfficialRank/OfficialLVUPSuccessWin.cs.meta
new file mode 100644
index 0000000..342159f
--- /dev/null
+++ b/Main/System/OfficialRank/OfficialLVUPSuccessWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e631511e7fa941d44911d5d592beb0ad
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/OfficialRank/OfficialRankManager.cs b/Main/System/OfficialRank/OfficialRankManager.cs
index 2685526..21d4b12 100644
--- a/Main/System/OfficialRank/OfficialRankManager.cs
+++ b/Main/System/OfficialRank/OfficialRankManager.cs
@@ -2,17 +2,70 @@
 
 using System;
 using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
 
 public class OfficialRankManager : GameSystemManager<OfficialRankManager>
 {
-    bool redpointDirty = false;
 
     #region 瀹樿亴浠诲姟
     //褰撳墠瀹樿亴鐨勪换鍔$姸鎬�
     int taskAwardState;
     Dictionary<int, int> taskValues = new Dictionary<int, int>();
-    public Dictionary<int, int[]> realMissionGuides = new Dictionary<int, int[]>();
     public event Action RealmMissionRefreshEvent;
+
+    public Dictionary<int, int> mainLevelDict = new Dictionary<int, int>();    //id锛氱储寮� 鐢ㄤ簬鍒ゆ柇杩橀渶澶氬皯鍏�
+    public override void Init()
+    {
+        PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
+        BlessLVManager.Instance.OnBlessLVUpdateEvent += UpdateRedpoint;
+        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitialize;
+        DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += UpdateRedpoint;
+
+
+        var levelList = MainLevelConfig.GetKeys().ToList();
+        levelList.Sort();
+        for (int i = 0; i < levelList.Count; i++)
+        { 
+            mainLevelDict[levelList[i]] = i;
+        }
+    }
+
+    public override void Release()
+    {
+        PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
+        BlessLVManager.Instance.OnBlessLVUpdateEvent -= UpdateRedpoint;
+        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerDataInitialize;
+        DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= UpdateRedpoint;
+    }
+
+    void BeforePlayerDataInitialize()
+    {
+        taskValues.Clear();
+        taskAwardState = 0;
+    }
+
+
+    void PlayerDataRefresh(PlayerDataType type)
+    {
+        if (type == PlayerDataType.LV ||
+            type == PlayerDataType.ExAttr1
+        )
+        {
+            //绛夌骇 閫氬叧
+            UpdateRedpoint();
+        }
+        else if (type == PlayerDataType.RealmLevel)
+        {
+            if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin)
+                return;
+            //鍗囩骇鎴愬姛琛ㄧ幇
+                if (!UIManager.Instance.IsOpened<OfficialLVUPSuccessWin>())
+                {
+                    UIManager.Instance.OpenWindow<OfficialLVUPSuccessWin>();
+                }
+        }
+    }
 
     // 杩斿洖鏈嶅姟绔殑璁板綍浠诲姟濂栧姳鐘舵�� 0鏈鍙�  1宸查鍙�
     public int GetMissionAwardState(int id)
@@ -20,16 +73,14 @@
         return (taskAwardState & (int)Math.Pow(2, id)) != 0 ? 1 : 0;
     }
 
-    //浠诲姟绫诲瀷	浠诲姟璇存槑	鎵�闇�鍊�
     // 1	绛夌骇杈惧埌x绾�	x绾�		
-    // 2	閫氬叧x鍦板浘x灞�	鍦板浘ID|灞�	
-    // 3	娑堣�楁垬閿�	x涓�
-
+    // 2	閫氳繃涓荤嚎鍏冲崱	鍏冲崱ID	
+    // 3	娑堣�楁垬閿�	x涓�     (浠呴�氱煡杩欎釜)
+    // 4	绁濈鏍�	绛夌骇	
     //瀹㈡埛绔樉绀虹殑浠诲姟鐘舵�� 0 浠h〃杩涜涓� 1 浠h〃鍙鍙� 2 浠h〃宸查鍙�
     public int GetMissionState(int realm, int missionID)
     {
-        var id = RealmLVUPTaskConfig.GetID(realm, missionID);
-        var config = RealmLVUPTaskConfig.Get(id);
+        var config = RealmLVUPTaskConfig.GetID(realm, missionID);
         var type = config.TaskType;
 
         if (GetMissionAwardState(missionID) == 1)
@@ -42,62 +93,49 @@
             case 1:
                 return PlayerDatas.Instance.baseData.LV >= config.NeedValueList[0] ? 1 : 0;
             case 2:
-                if (config.NeedValueList[0] == 0)
-                {
-                    return 0;
-                }
-                return 0;
+                //绛栧垝閰嶇疆鍏冲崱ID涓�201锛屽嵆 杩囧叧2-1(0/1) ,浣跨敤 ExAttr1 鍊煎垽鏂紝濡侲xAttr1鍊间负20103浠h〃褰撳墠宸茬粡杩囦簡绗�2绔犵1鍏崇3娉紝鍖呭惈浜嗘尝锛岄渶瑕佸嚮璐ヨ鍏冲崱boss鍚庢墠绠楄鍏宠繃鍏�
+                return PlayerDatas.Instance.baseData.ExAttr1 / 100 > config.NeedValueList[0] ? 1 : 0;
             case 3:
                 return taskValues.ContainsKey(missionID) && taskValues[missionID] >= config.NeedValueList[0] ? 1 : 0;
-            
+                
+            case 4:
+                return BlessLVManager.Instance.m_TreeLV >= config.NeedValueList[0] ? 1 : 0;
+
             default:
                 return 0;
         }
 
     }
 
-    public int GetMissionProcess(int id)
+    public void GetMissionProcess(int id, out int process, out int total)
     {
-        if (taskValues.ContainsKey(id))
+        var config = RealmLVUPTaskConfig.GetID(PlayerDatas.Instance.baseData.realmLevel, id);
+        var type = config.TaskType;
+        process = 1;
+        total = 1;
+        switch (type)
         {
-            return taskValues[id];
-        }
-        return 0;
-    }
-
-    //type: 1绛夌骇 2閫氬叧 3娑堣�楁垬閿�
-
-    public void RealMissionGuide(int type, int id = 0)
-    {
-        if (realMissionGuides.ContainsKey(type))
-        {
-            
-            int guideIndex = 0;
-            if (type == 1)
-            {
-                
-            }
-            else if (type == 2)
-            {
-                if (!FuncOpen.Instance.IsFuncOpen(164, true))
-                {
-                    return;
-                }
-            }
-            else if (type == 3)
-            {
-                if (FuncOpen.Instance.IsFuncOpen(108))
-                {
-                    guideIndex = 1;
-                }
-            }
-            
-
-            //NewBieCenter.Instance.StartNewBieGuideEx(guideID);
+            case 1:
+                process = PlayerDatas.Instance.baseData.LV;
+                total = config.NeedValueList[0];
+                break;
+            case 2:
+                process = PlayerDatas.Instance.baseData.ExAttr1 / 100 > config.NeedValueList[0] ? 1 : 0;
+                total = 1;
+                break;
+            case 3:
+                process = taskValues.ContainsKey(id) ? taskValues[id] : 0;
+                total = config.NeedValueList[0];
+                break;
+            case 4:
+                process = BlessLVManager.Instance.m_TreeLV;
+                total = config.NeedValueList[0];
+                break;
         }
 
     }
 
+    
 
     public void RequestAllAwards()
     {
@@ -126,6 +164,82 @@
         }
 
         RealmMissionRefreshEvent?.Invoke();
-        redpointDirty = true;
+        UpdateRedpoint();
     }
+
+    Redpoint redpoint = new Redpoint(MainRedDot.RedPoint_OfficialKey);
+    void UpdateRedpoint()
+    {
+        redpoint.state = RedPointState.None;
+
+        var ids = RealmLVUPTaskConfig.GetMissionIDs(PlayerDatas.Instance.baseData.realmLevel);
+        bool finish = true;
+        foreach (var id in ids)
+        {
+            if (GetMissionAwardState(id) != 1)
+            {
+                if (GetMissionState(PlayerDatas.Instance.baseData.realmLevel, id) == 1)
+                {
+                    redpoint.state = RedPointState.Simple;
+                }
+
+                finish = false;
+            }
+        }
+        
+        if (finish)
+            redpoint.state = RedPointState.Simple;
+    }
+
+
+
+
+    public Color GetOfficialRankColor(int quality)
+    {
+
+        switch (quality)
+        {
+            case 1:
+                // bbbbbb
+                return new Color32(187, 187, 187, 255);
+            case 2:
+                // ffffff
+                return new Color32(255, 255, 255, 255);
+            case 3:
+                // bbd5ff
+                return new Color32(187, 213, 255, 255);
+            case 4:
+                // e4bbfe
+                return new Color32(228, 187, 254, 255);
+            case 5:
+                // f7eba4
+                return new Color32(247, 235, 164, 255);
+            case 6:
+                // ffc096
+                return new Color32(255, 192, 150, 255);
+            case 7:
+                // fe9896
+                return new Color32(254, 152, 150, 255);
+            case 8:
+                // ffaffe
+                return new Color32(255, 174, 254, 255);
+            case 9:
+                // ffefcl
+                return new Color32(255, 239, 203, 255);
+            case 10:
+                // e9fffa
+                return new Color32(233, 255, 250, 255);
+            case 11:
+                // f5ddff
+                return new Color32(245, 221, 255, 255);
+            case 12:
+                // b3fcfe
+                return new Color32(179, 252, 254, 255);
+            case 13:
+                // ffd0f7
+                return new Color32(255, 208, 247, 255);
+        }
+        return Color.white;
+    }
+
 }
diff --git a/Main/System/OfficialRank/OfficialUpCell.cs b/Main/System/OfficialRank/OfficialUpCell.cs
new file mode 100644
index 0000000..9a2987b
--- /dev/null
+++ b/Main/System/OfficialRank/OfficialUpCell.cs
@@ -0,0 +1,66 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+/// <summary>
+/// 瀹樿亴浠诲姟
+/// </summary>
+public class OfficialUpCell : MonoBehaviour
+{
+
+    [SerializeField] Text stateName;
+    [SerializeField] Image stateImg;
+    [SerializeField] Image bgImg;
+    [SerializeField] Image finishImg;
+    [SerializeField] Image getAwardImg;
+    [SerializeField] Text taskName;
+    [SerializeField] Image taskProcess;
+    [SerializeField] Text taskProcessText;
+    [SerializeField] ItemCell taskReward;
+    [SerializeField] Button getBtn;
+    
+
+    public void Display(int id)
+    {
+        var config = RealmLVUPTaskConfig.GetID(PlayerDatas.Instance.baseData.realmLevel, id);
+        var state = OfficialRankManager.Instance.GetMissionState(PlayerDatas.Instance.baseData.realmLevel, id);
+        stateName.text = Language.Get("L1129_" + state);
+        stateImg.SetSprite("OfficialMisionState" + state);
+        finishImg.SetActive(state == 2);
+        getAwardImg.SetActive(state == 1);
+        bgImg.SetSprite(state == 0 ? "OfficialMissionBG0" : "OfficialMissionBG1");
+        switch (config.TaskType)
+        {
+            case 1:
+            case 3:
+            case 4:
+                taskName.text = Language.Get("OfficialMission" + config.TaskType, config.NeedValueList[0]);
+                break;
+            case 2:
+                var mainLVConfig = MainLevelConfig.Get(config.NeedValueList[0]);
+                taskName.text = Language.Get("OfficialMission2", mainLVConfig.ChapterID, mainLVConfig.LevelNum);
+                break;
+        }
+        int process;
+        int total;
+        OfficialRankManager.Instance.GetMissionProcess(id, out process, out total);
+        taskProcess.fillAmount = (float)process / total;
+        taskProcessText.text = process + "/" + total;
+        int itemID = config.AwardItemList[0][0];
+        taskReward.Init(new ItemCellModel(itemID, false, config.AwardItemList[0][1]));
+        taskReward.button.AddListener(() =>
+        {
+            ItemTipUtility.Show(itemID);
+        });
+
+        getBtn.AddListener(() =>
+        {
+            if (state != 1)
+                return;
+            OfficialRankManager.Instance.RequestAllAwards();
+        });
+
+    }
+
+}
\ No newline at end of file
diff --git a/Main/System/OfficialRank/OfficialUpCell.cs.meta b/Main/System/OfficialRank/OfficialUpCell.cs.meta
new file mode 100644
index 0000000..28c7cc6
--- /dev/null
+++ b/Main/System/OfficialRank/OfficialUpCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e58cf79fdccd0d54093f13a7cbf9868d
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/OfficialRank/OfficialUpWin.cs b/Main/System/OfficialRank/OfficialUpWin.cs
new file mode 100644
index 0000000..7a2823a
--- /dev/null
+++ b/Main/System/OfficialRank/OfficialUpWin.cs
@@ -0,0 +1,132 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+using DG.Tweening;
+using System;
+
+/// <summary>
+/// 瀹樿亴
+/// </summary>
+public class OfficialUpWin : UIBase
+{
+    [SerializeField] Text officialNameText;
+    [SerializeField] Text officialNextNameText;
+    [SerializeField] Image officialIcon;
+    [SerializeField] Image officialNextIcon;
+    [SerializeField] Button closeBtn;
+    [SerializeField] PositionTween[] paopaoArr;
+    [SerializeField] Text[] paopaoTextArrName;
+    [SerializeField] Text[] paopaoTextArrValue;
+    [SerializeField] OfficialUpCell[] missionCellArr;
+    [SerializeField] ButtonEx lvUpBtn;
+    [SerializeField] UIEffectPlayer effectPlayer;
+
+    protected override void InitComponent()
+    {
+        closeBtn.AddListener(CloseWindow);
+        lvUpBtn.AddListener(OnLvUp);
+    }
+
+    // 1	绛夌骇杈惧埌x绾�	x绾�		
+    // 2	閫氳繃涓荤嚎鍏冲崱	鍏冲崱ID	
+    // 3	娑堣�楁垬閿�	x涓�
+    // 4	绁濈鏍�	绛夌骇	
+    protected override void OnPreOpen()
+    {
+        OfficialRankManager.Instance.RealmMissionRefreshEvent += Refresh;
+        PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
+        BlessLVManager.Instance.OnBlessLVUpdateEvent += RefreshBtn;
+        Refresh();
+    }
+
+    protected override void OnPreClose()
+    {
+        OfficialRankManager.Instance.RealmMissionRefreshEvent -= Refresh;
+        PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
+        BlessLVManager.Instance.OnBlessLVUpdateEvent -= RefreshBtn;
+    }
+
+    public override void Refresh()
+    {
+        var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel);
+        officialNameText.text = config.Name;
+        officialNameText.color = OfficialRankManager.Instance.GetOfficialRankColor(config.Quality);
+        officialIcon.SetSprite("OfficialRank" + PlayerDatas.Instance.baseData.realmLevel);
+        var nextConfig = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel + 1);
+        officialNextNameText.text = nextConfig.Name;
+        officialNextNameText.color = OfficialRankManager.Instance.GetOfficialRankColor(nextConfig.Quality);
+        officialNextIcon.SetSprite("OfficialRank" + (PlayerDatas.Instance.baseData.realmLevel + 1));
+        for (int i = 0; i < paopaoArr.Length; i++)
+        {
+            paopaoArr[i].Play();
+            paopaoTextArrName[i].text = PlayerPropertyConfig.Get(nextConfig.AddAttrType[i]).Name;
+            paopaoTextArrValue[i].text = "+" + PlayerPropertyConfig.GetValueDescription(nextConfig.AddAttrType[i], nextConfig.AddAttrNum[i]);
+        }
+
+        RefreshBtn();
+    }
+
+
+    void OnLvUp()
+    {
+        var ids = RealmLVUPTaskConfig.GetMissionIDs(PlayerDatas.Instance.baseData.realmLevel);
+        foreach (var id in ids)
+        {
+            if (OfficialRankManager.Instance.GetMissionAwardState(id) != 1)
+            {
+                SysNotifyMgr.Instance.ShowTip("OfficialTask1");
+                return;
+            }
+        }
+
+        //鎵�鏈夋场娉¢鍚戞寜閽�
+        for (int i = 0; i < paopaoArr.Length; i++)
+        {
+            paopaoArr[i].Stop();
+            paopaoArr[i].transform.DOLocalMove(lvUpBtn.transform.localPosition, 0.4f);
+        }
+        effectPlayer.onComplete = () =>
+        {
+            CA523_tagCMRealmLVUp pak = new CA523_tagCMRealmLVUp();
+            GameNetSystem.Instance.SendInfo(pak);
+        };
+        effectPlayer.Play();
+    }
+
+
+    void RefreshBtn()
+    {
+        var ids = RealmLVUPTaskConfig.GetMissionIDs(PlayerDatas.Instance.baseData.realmLevel);
+        for (int i = 0; i < missionCellArr.Length; i++)
+        {
+            missionCellArr[i].Display(ids[i]);
+        }
+
+        for (int i = 0; i < missionCellArr.Length; i++)
+        {
+            if (OfficialRankManager.Instance.GetMissionAwardState(i + 1) != 1)
+            {
+                lvUpBtn.SetColorful(null, false);
+                return;
+            }
+        }
+        lvUpBtn.SetColorful(null, true);
+    }
+
+
+    void PlayerDataRefresh(PlayerDataType type)
+    {
+        if (type == PlayerDataType.RealmLevel)
+        {
+            Refresh();
+        }
+        else if (type == PlayerDataType.LV ||
+            type == PlayerDataType.ExAttr1
+        )
+        { 
+            //绛夌骇 閫氬叧
+            RefreshBtn();
+        }
+    }
+}
\ No newline at end of file
diff --git a/Main/System/OfficialRank/OfficialUpWin.cs.meta b/Main/System/OfficialRank/OfficialUpWin.cs.meta
new file mode 100644
index 0000000..920ade3
--- /dev/null
+++ b/Main/System/OfficialRank/OfficialUpWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3c74d5be428f2324e910c232fb4e414b
+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 6cf8139..baa25c4 100644
--- a/Main/System/Redpoint/MainRedDot.cs
+++ b/Main/System/Redpoint/MainRedDot.cs
@@ -48,7 +48,8 @@
     public Redpoint redPointBagFunc = new Redpoint(RedPoint_MainPackKey, RedPoint_BagFuncKey);
     #endregion
 
-
+    //瀹樿亴
+    public const int RedPoint_OfficialKey = 101;
 
 
     #region 浠欑洘鍏敤绾㈢偣
diff --git a/Main/Utility/EnumHelper.cs b/Main/Utility/EnumHelper.cs
index ad7e489..393305f 100644
--- a/Main/Utility/EnumHelper.cs
+++ b/Main/Utility/EnumHelper.cs
@@ -537,8 +537,8 @@
     WarehouseLV = 99,                   //浠撳簱绛夌骇   99
     EquipShowSwitch = 100,               //瑁呭鏄鹃殣寮�鍏�   100
     LuckValue = 101,                     //骞歌繍鍊�   101
-    ExAttr1 = 102,                       //鎵╁睍灞炴��1   102榄斾粏浼ゅ24
-    ExAttr2 = 103,                       //鎵╁睍灞炴��2   103缁勯槦鏄惁闇�瑕佸鏍�
+    ExAttr1 = 102,                       //鎵╁睍灞炴��1   102 涓荤嚎宸查�氬叧鍏冲崱
+    ExAttr2 = 103,                       //鎵╁睍灞炴��2   103 涓荤嚎褰撳墠鍒锋�墍鍦ㄧ珷鑺傚叧鍗¤褰�
     ExAttr3 = 104,                       //鎵╁睍灞炴��3   104鍏冪礌鏀诲嚮26
     ExAttr4 = 105,                       //鎵╁睍灞炴��4   105鍏冪礌闃插尽27
     ExAttr5 = 106,                       //鎵╁睍灞炴��5   106
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index e4599f8..69cd1df 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -769,7 +769,7 @@
         {
             return string.Empty;
         }
-        return GetRealmColorByLv(realmLv, config.Name, bright);
+        return AppendColor(realmLv, config.Name, bright);
     }
 
     //strFormat闄勫姞 澧冪晫鍚嶄互澶栫殑鏂囧瓧
@@ -788,31 +788,31 @@
     //     return GetRealmColorByLv(realmLv, string.Format(strFormat, config.Name), bright);
     // }
 
-    public static string GetRealmColorByLv(int realmLv, string msg, bool bright = true)
-    {
-        var config = RealmConfig.Get(realmLv);
-        if (config == null)
-        {
-            return string.Empty;
-        }
-        switch (config.Quality)
-        {
-            case 1:
-                return StringUtility.Contact("<color=#", bright ? "666666" : "dddddd", ">", msg, "</color>");
-            case 2:
-                return StringUtility.Contact("<color=#", bright ? "00b337" : "66ff00", ">", msg, "</color>");
-            case 3:
-                return StringUtility.Contact("<color=#", bright ? "0066ff" : "00c6ff", ">", msg, "</color>");
-            case 4:
-                return StringUtility.Contact("<color=#", bright ? "ff00f6" : "f000ff", ">", msg, "</color>");
-            case 5:
-                return StringUtility.Contact("<color=#", bright ? "ff6600" : "ff9000", ">", msg, "</color>");
-            case 6:
-                return StringUtility.Contact("<color=#", bright ? "ff0000" : "ff0000", ">", msg, "</color>");
-            default:
-                return msg;
-        }
-    }
+    // public static string GetRealmColorByLv(int realmLv, string msg, bool bright = true)
+    // {
+    //     var config = RealmConfig.Get(realmLv);
+    //     if (config == null)
+    //     {
+    //         return string.Empty;
+    //     }
+    //     switch (config.Quality)
+    //     {
+    //         case 1:
+    //             return StringUtility.Contact("<color=#", bright ? "666666" : "dddddd", ">", msg, "</color>");
+    //         case 2:
+    //             return StringUtility.Contact("<color=#", bright ? "00b337" : "66ff00", ">", msg, "</color>");
+    //         case 3:
+    //             return StringUtility.Contact("<color=#", bright ? "0066ff" : "00c6ff", ">", msg, "</color>");
+    //         case 4:
+    //             return StringUtility.Contact("<color=#", bright ? "ff00f6" : "f000ff", ">", msg, "</color>");
+    //         case 5:
+    //             return StringUtility.Contact("<color=#", bright ? "ff6600" : "ff9000", ">", msg, "</color>");
+    //         case 6:
+    //             return StringUtility.Contact("<color=#", bright ? "ff0000" : "ff0000", ">", msg, "</color>");
+    //         default:
+    //             return msg;
+    //     }
+    // }
 
     //鐗╁搧 鍚勫姛鑳藉搧璐�  浠庣簿鑹�1鍝佽川 瀵瑰簲 3寮�濮�
     /// <summary>

--
Gitblit v1.8.0