| | |
| | | using Snxxz.UI; |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using TableConfig; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | |
| | | Text conditionText; |
| | | [SerializeField] |
| | | Text needLvText; |
| | | [SerializeField] |
| | | Text realmTitleText; |
| | | [SerializeField] Image realmImg; |
| | | [SerializeField] |
| | | Text itemTypeText; |
| | | |
| | |
| | | ItemCellModel cellModel = new ItemCellModel(itemTipsModel.curAttrData.itemId, itemTipsModel.curAttrData.isPreview, (ulong)itemTipsModel.curAttrData.count,itemTipsModel.curAttrData.isBind |
| | | ,itemTipsModel.curAttrData.guid, itemTipsModel.curAttrData.packType,false); |
| | | itemCell.Init(cellModel); |
| | | conditionText.text = Language.Get("KnapS110"); |
| | | needLvText.text = itemTipsModel.curAttrData.itemConfig.UseLV.ToString(); |
| | | |
| | | if (itemTipsModel.curAttrData.itemConfig.UseLV > 1) |
| | | { |
| | | conditionText.gameObject.SetActive(true); |
| | | needLvText.gameObject.SetActive(true); |
| | | } |
| | | else |
| | | { |
| | | conditionText.gameObject.SetActive(false); |
| | | needLvText.gameObject.SetActive(false); |
| | | } |
| | | realmTitleText.gameObject.SetActive(false); |
| | | realmImg.gameObject.SetActive(false); |
| | | |
| | | if (PlayerDatas.Instance.baseData.LV >= itemTipsModel.curAttrData.itemConfig.UseLV) |
| | | ChestsConfig chestsConfig = ConfigManager.Instance.GetTemplate<ChestsConfig>(itemTipsModel.curAttrData.itemId); |
| | | if (chestsConfig != null && chestsConfig.OpenMoney > 0) |
| | | { |
| | | conditionText.color = conditionColor; |
| | | needLvText.color = conditionColor; |
| | | conditionText.gameObject.SetActive(true); |
| | | ulong haveMoney = UIHelper.GetMoneyCnt(1); |
| | | if (haveMoney >= (ulong)chestsConfig.OpenMoney) |
| | | { |
| | | conditionText.text = Language.Get("OpenBoxCostMoney", UIHelper.GetTextColorByItemColor(TextColType.Green, chestsConfig.OpenMoney.ToString())); |
| | | } |
| | | else |
| | | { |
| | | conditionText.color = conditionRedColor; |
| | | needLvText.color = conditionRedColor; |
| | | conditionText.text = Language.Get("OpenBoxCostMoney", UIHelper.GetTextColorByItemColor(TextColType.Red, chestsConfig.OpenMoney.ToString())); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | CheckUselimit(); |
| | | } |
| | | |
| | | itemDesText.text = itemTipsModel.curAttrData.itemConfig.Description; |
| | |
| | | } |
| | | } |
| | | |
| | | private void CheckUselimit() |
| | | { |
| | | int[] uselimits = itemTipsModel.curAttrData.itemConfig.UseCondiType; |
| | | if (uselimits == null) return; |
| | | |
| | | for (int i = 0; i < uselimits.Length; i++) |
| | | { |
| | | switch (uselimits[i]) |
| | | { |
| | | case 0: |
| | | if (itemTipsModel.curAttrData.itemConfig.UseLV > 1) |
| | | { |
| | | conditionText.gameObject.SetActive(true); |
| | | needLvText.gameObject.SetActive(true); |
| | | } |
| | | conditionText.text = Language.Get("KnapS110"); |
| | | needLvText.text = itemTipsModel.curAttrData.itemConfig.UseLV.ToString(); |
| | | |
| | | if (PlayerDatas.Instance.baseData.LV >= itemTipsModel.curAttrData.itemConfig.UseLV) |
| | | { |
| | | conditionText.color = conditionColor; |
| | | needLvText.color = conditionColor; |
| | | } |
| | | else |
| | | { |
| | | conditionText.color = conditionRedColor; |
| | | needLvText.color = conditionRedColor; |
| | | } |
| | | |
| | | break; |
| | | case 1: |
| | | realmTitleText.gameObject.SetActive(true); |
| | | realmImg.gameObject.SetActive(true); |
| | | realmTitleText.text = Language.Get("RealmLimit1"); |
| | | RealmConfig realmConfig = ConfigManager.Instance.GetTemplate<RealmConfig>(itemTipsModel.curAttrData.itemConfig.RealmLimit); |
| | | if (itemTipsModel.curAttrData.itemConfig.RealmLimit <= 0) |
| | | { |
| | | realmImg.SetSprite("NoRealm"); |
| | | } |
| | | else |
| | | { |
| | | if (realmConfig != null) |
| | | { |
| | | realmImg.SetSprite(realmConfig.Img); |
| | | } |
| | | } |
| | | |
| | | if (PlayerDatas.Instance.baseData.realmLevel >= itemTipsModel.curAttrData.itemConfig.RealmLimit) |
| | | { |
| | | realmTitleText.color = conditionColor; |
| | | } |
| | | else |
| | | { |
| | | realmTitleText.color = conditionRedColor; |
| | | } |
| | | break; |
| | | case 2: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private void SetDateLimitUI(double time) |
| | | { |
| | | dateText.gameObject.SetActive(true); |