diff --git a/ProjectNLD/Assets/Code/Scripts/Gameplay/Condition/Conditions/ConditionLevelPass.cs b/ProjectNLD/Assets/Code/Scripts/Gameplay/Condition/Conditions/ConditionLevelPass.cs index 2c4275debc3..41247c251f8 100644 --- a/ProjectNLD/Assets/Code/Scripts/Gameplay/Condition/Conditions/ConditionLevelPass.cs +++ b/ProjectNLD/Assets/Code/Scripts/Gameplay/Condition/Conditions/ConditionLevelPass.cs @@ -23,6 +23,8 @@ public class ConditionLevelPass : ICondition public string[] GetArgLocalizations(List args) { - return null; + int id = (int)args[0]; + + return new string[1] { id.ToString() }; } } \ No newline at end of file diff --git a/ProjectNLD/Assets/Code/Scripts/Gameplay/Level/LevelInfo.cs b/ProjectNLD/Assets/Code/Scripts/Gameplay/Level/LevelInfo.cs index 9f0d4290a44..bb52b0a2659 100644 --- a/ProjectNLD/Assets/Code/Scripts/Gameplay/Level/LevelInfo.cs +++ b/ProjectNLD/Assets/Code/Scripts/Gameplay/Level/LevelInfo.cs @@ -305,6 +305,18 @@ public class LevelInfo : IRedPointTreeNode } #region API + /// + /// 获取解锁条件文本 + /// + /// + public string GetUnlockLocalizationText() + { + if (Cfg.Unlock.Length > 0) + return ConditionManager.Instance.GetConditionLocalization(Cfg.Unlock[0]); + else + return null; + } + /// /// 获得星级目标的文本 /// diff --git a/ProjectNLD/Assets/Code/Scripts/Gameplay/UI/SelectLevel/UI_LevelSelectController.cs b/ProjectNLD/Assets/Code/Scripts/Gameplay/UI/SelectLevel/UI_LevelSelectController.cs index b009cf5ad35..88fd7df1eaa 100644 --- a/ProjectNLD/Assets/Code/Scripts/Gameplay/UI/SelectLevel/UI_LevelSelectController.cs +++ b/ProjectNLD/Assets/Code/Scripts/Gameplay/UI/SelectLevel/UI_LevelSelectController.cs @@ -13,6 +13,7 @@ using PhxhSDK; using TMPro; using UnityEngine; using UnityEngine.UI; +using Framework.Condition; using Constants = Framework.Constants; public class UI_LevelSelectController : UIWindow @@ -1541,6 +1542,10 @@ public class UI_LevelSelectController : UIWindow /// 星级根节点 /// private GameObject goStarRoot; + /// + /// 锁 + /// + private GameObject goLock; #endregion /// @@ -1560,6 +1565,14 @@ public class UI_LevelSelectController : UIWindow /// private readonly Action levelAction; + /// + /// 是否上锁 + /// + public bool IsLock + { + set { goLock.IsScaleShow(value); } + } + public LevelItem(GameObject root, Action level) : base(root) { levelAction = level; @@ -1571,6 +1584,7 @@ public class UI_LevelSelectController : UIWindow goStraight = FindObj("Root/ImageStraight"); goDown = FindObj("Root/ImageDown"); goStarRoot = FindObj("Root/UI_Stars"); + goLock = FindObj("Root/ImageLocked"); Transform tsStarRoot = goStarRoot.transform; goStars = new GameObject[tsStarRoot.childCount]; for (int i = 0; i < tsStarRoot.childCount; ++i) @@ -1590,12 +1604,14 @@ public class UI_LevelSelectController : UIWindow { levelInfo = info; - if (null == levelInfo || levelInfo.IsLock) + if (null == levelInfo) { IsScaleShow = false; return; } + IsLock = levelInfo.IsLock; + textLevelName.text = info.IndexName; if ((index & 1) == 1) // 奇数 { @@ -1661,6 +1677,11 @@ public class UI_LevelSelectController : UIWindow private void OnClick() { + if (levelInfo.IsLock) + { + UITipsManager.ShowTips(levelInfo.GetUnlockLocalizationText()); + return; + } levelAction?.Invoke(levelInfo); } } @@ -1718,16 +1739,7 @@ public class UI_LevelSelectController : UIWindow return; } - showCount = 0; - foreach (LevelInfo levelInfo in listLevelInfo) - { - if (levelInfo.IsLock) - break; - - ++showCount; - } - - recycleView.ShowList(showCount); + recycleView.ShowList(listLevelInfo.Count); IsScaleShow = true; }