From 7859ac0daa7c8f0cbe9d2ebfd8f0e91a09f05cfc Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期四, 14 三月 2019 15:27:20 +0800
Subject: [PATCH] 6340  【前端】【2.0】境界改版开发单

---
 System/Realm/RealmModel.cs                       |   24 ++++++++++++++++++++++++
 Core/GameEngine/Model/Config/RealmConfig.cs      |    9 ++-------
 Core/GameEngine/Model/Config/RealmConfig.cs.meta |    2 +-
 System/Realm/RealmEquipPreviewWin.cs             |   12 +++++++++---
 System/Realm/RealmLevelUpBehaviour.cs            |    3 ++-
 5 files changed, 38 insertions(+), 12 deletions(-)

diff --git a/Core/GameEngine/Model/Config/RealmConfig.cs b/Core/GameEngine/Model/Config/RealmConfig.cs
index 9b19dc9..ee62db6 100644
--- a/Core/GameEngine/Model/Config/RealmConfig.cs
+++ b/Core/GameEngine/Model/Config/RealmConfig.cs
@@ -25,7 +25,7 @@
 	public readonly int Quality;
 	public readonly int FightPower;
 	public readonly string equipNameIcon;
-	public readonly int[] equips;
+	public readonly string equips;
 	public readonly int effectId;
 	public readonly int requireIconEffect;
 
@@ -73,12 +73,7 @@
 
 			equipNameIcon = tables[11];
 
-			string[] equipsStringArray = tables[12].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
-			equips = new int[equipsStringArray.Length];
-			for (int i=0;i<equipsStringArray.Length;i++)
-			{
-				 int.TryParse(equipsStringArray[i],out equips[i]);
-			}
+			equips = tables[12];
 
 			int.TryParse(tables[13],out effectId); 
 
diff --git a/Core/GameEngine/Model/Config/RealmConfig.cs.meta b/Core/GameEngine/Model/Config/RealmConfig.cs.meta
index a6b8c42..3706e21 100644
--- a/Core/GameEngine/Model/Config/RealmConfig.cs.meta
+++ b/Core/GameEngine/Model/Config/RealmConfig.cs.meta
@@ -1,6 +1,6 @@
 fileFormatVersion: 2
 guid: d49ca04ff4a91bc4fb645c417f9ef0b3
-timeCreated: 1552547353
+timeCreated: 1552548022
 licenseType: Pro
 MonoImporter:
   serializedVersion: 2
diff --git a/System/Realm/RealmEquipPreviewWin.cs b/System/Realm/RealmEquipPreviewWin.cs
index 5a554ea..3ae2434 100644
--- a/System/Realm/RealmEquipPreviewWin.cs
+++ b/System/Realm/RealmEquipPreviewWin.cs
@@ -19,6 +19,8 @@
         [SerializeField] Button m_Close;
 
         public static int selectRealmLevel = 0;
+
+        RealmModel model { get { return ModelCenter.Instance.GetModel<RealmModel>(); } }
         #region Built-in
         protected override void BindController()
         {
@@ -53,13 +55,17 @@
             var config = RealmConfig.Get(selectRealmLevel);
             m_EquipName.SetSprite(config.equipNameIcon);
 
+
             var job = PlayerDatas.Instance.baseData.Job;
+            int[] equips = null;
+            model.TryGetRealmPreviewEquips(selectRealmLevel, job, out equips);
+
             UI3DModelExhibition.Instance.ShowPlayer(m_RawPlayer, new UI3DPlayerExhibitionData()
             {
                 job = job,
-                clothesId = config.equips != null && config.equips.Length > 0 ? config.equips[0] : 0,
-                weaponId = config.equips != null && config.equips.Length > 1 ? config.equips[1] : 0,
-                secondaryId = config.equips != null && config.equips.Length > 2 ? config.equips[2] : 0,
+                clothesId = equips != null && equips.Length > 0 ? equips[0] : 0,
+                weaponId = equips != null && equips.Length > 1 ? equips[1] : 0,
+                secondaryId = equips != null && equips.Length > 2 ? equips[2] : 0,
                 suitLevel = 1,
             });
         }
diff --git a/System/Realm/RealmLevelUpBehaviour.cs b/System/Realm/RealmLevelUpBehaviour.cs
index 37d0a8a..354e250 100644
--- a/System/Realm/RealmLevelUpBehaviour.cs
+++ b/System/Realm/RealmLevelUpBehaviour.cs
@@ -142,7 +142,8 @@
         public void DisplayBoss(int realmLevel)
         {
             var config = RealmConfig.Get(realmLevel);
-            m_Condition.text = Language.Get("RealmConditionBoss", config.Name);
+            var label = UIHelper.GetRealmColorByLv(realmLevel, StringUtility.Contact("[", config.Name, "]"));
+            m_Condition.text = Language.Get("RealmConditionBoss", label);
             var progress = model.isBossPass ? 1 : 0;
             m_Progress.text = StringUtility.Contact(progress, "/", 1);
             m_Progress.color = model.isBossPass ? UIHelper.s_LightGreen : UIHelper.s_DarkRedColor;
diff --git a/System/Realm/RealmModel.cs b/System/Realm/RealmModel.cs
index f29add6..02b79c7 100644
--- a/System/Realm/RealmModel.cs
+++ b/System/Realm/RealmModel.cs
@@ -11,6 +11,7 @@
     public class RealmModel : Model, IPlayerLoginOk, IBeforePlayerDataInitialize
     {
         Dictionary<int, Dictionary<int, int>> m_RealmProperties = new Dictionary<int, Dictionary<int, int>>();
+        Dictionary<int, Dictionary<int, int[]>> m_RealmPreviewEquips = new Dictionary<int, Dictionary<int, int[]>>();
         List<List<int>> m_RealmStages = new List<List<int>>();
         public int realmMaxLevel { get; private set; }
         public bool isBossPass { get; private set; }
@@ -98,6 +99,19 @@
                         stages.Add(config.Lv + 1);
                     }
                 }
+
+                if (!string.IsNullOrEmpty(config.equips))
+                {
+                    var json = LitJson.JsonMapper.ToObject(config.equips);
+                    Dictionary<int, int[]> dict = new Dictionary<int, int[]>();
+                    foreach (var jobKey in json.Keys)
+                    {
+                        var job = int.Parse(jobKey);
+                        var equipArray = LitJson.JsonMapper.ToObject<int[]>(json[jobKey].ToJson());
+                        dict.Add(job, equipArray);
+                    }
+                    m_RealmPreviewEquips.Add(config.Lv, dict);
+                }
             }
         }
 
@@ -117,6 +131,16 @@
             return false;
         }
 
+        public bool TryGetRealmPreviewEquips(int level, int job, out int[] equips)
+        {
+            equips = null;
+            if (m_RealmPreviewEquips.ContainsKey(level))
+            {
+                return m_RealmPreviewEquips[level].TryGetValue(job, out equips);
+            }
+            return false;
+        }
+
         public bool IsUnlockEquipRealm(int realmLevel, out int level)
         {
             level = 0;

--
Gitblit v1.8.0