| System/EquipGem/EquipEvolution.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/EquipGem/EquipEvolutionWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/EquipGem/EquipStrengthModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/EquipGem/EquipStrengthWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/EquipTrain/EquipTrainModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/ItemTip/EquipTipWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/ItemTip/TipGemInfoWidget.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/ItemTip/TipLegendPropertyWidget.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/KnapSack/Logic/ItemTipsModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
System/EquipGem/EquipEvolution.cs
@@ -13,13 +13,16 @@ [SerializeField] Button m_EvolutionBtn; [SerializeField] RichText m_TexLv; [SerializeField] RichText m_TextConent; EquipStrengthModel strengthModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } } private void Start() { m_EvolutionBtn.AddListener(OnClickEvolutionBtn); } public void SetEquipEvolution() public void SetEquipEvolution(int equipPlace, int equipLv) { var evolve = strengthModel.GetEquipPlusEvolve(equipPlace, equipLv); m_TexLv.text = Language.Get("Z1024", equipLv); m_TextConent.text = evolve.AttrName + "+" + evolve.AttrValue; } private void OnClickEvolutionBtn() { System/EquipGem/EquipEvolutionWin.cs
@@ -9,7 +9,8 @@ using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { namespace Snxxz.UI { public class EquipEvolutionWin : Window { @@ -23,34 +24,152 @@ [SerializeField] RichText m_TextAttributesA; [SerializeField] RichText m_TextAttributesB; [SerializeField] ItemCell m_ItemCell; [SerializeField] ItemCell m_ItemCell; [SerializeField] GameObject m_AdvancedObj; [SerializeField] GameObject m_FullLevelObj; [SerializeField] RichText m_TextAttributesFull; [SerializeField] RichText m_TextLvFull; #region Built-in EquipStrengthModel strengthModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } } PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } } int equipType; protected override void BindController() { } protected override void AddListeners() { m_CloseButton.AddListener(()=> { CloseImmediately(); }); m_CloseButton.AddListener(() => { CloseImmediately(); }); m_EvolutionBtn.AddListener(OnClickEvolutionBtn); } protected override void OnPreOpen() { { SetEquipEvolution(); } protected override void OnAfterOpen() { strengthModel.EquipStrngthEvolutionLv += EquipStrngthEvolutionLv; } protected override void OnPreClose() { } { strengthModel.EquipStrngthEvolutionLv -= EquipStrngthEvolutionLv; } protected override void OnAfterClose() { } } #endregion private void OnClickEvolutionBtn() { var isBool = IsCarryOut(); if (isBool) { int equipIndex = EquipPlaceMapConfig.GetServerPlace(strengthModel.SelectLevel, strengthModel.SelectEquipPlace); strengthModel.SendEquipPlusEvolve(equipIndex); } } private void EquipStrngthEvolutionLv() { SetEquipEvolution(); } private void Reinforceable(int advancedLv) { m_AdvancedObj.SetActive(true); var evolve = strengthModel.GetEquipPlusEvolve(strengthModel.SelectEquipPlace, advancedLv); var evolveNext = strengthModel.GetEquipPlusEvolve(strengthModel.SelectEquipPlace, (advancedLv + 1)); m_TextLvNow.text = Language.Get("Z1024", advancedLv); m_TextAttributes.text = evolve.AttrName + "+" + evolve.AttrValue; m_TextLvNext.text = Language.Get("Z1024", advancedLv + 1); m_TextAttribute2.text = evolveNext.AttrName + "+" + evolveNext.AttrValue; ItemCellModel cellModel = new ItemCellModel(evolve.CostItemID, true, (ulong)1); m_ItemCell.Init(cellModel); if (advancedLv == 0) { m_TextAttributesA.text = "装备强化等级到达" + evolveNext.NeedPlusLV + "级"; m_TextAttributesB.text = "消耗" + evolveNext.CostItemCount + "个强化水晶"; } else { m_TextAttributesA.text = "装备强化等级到达" + evolve.NeedPlusLV + "级"; m_TextAttributesB.text = "消耗" + evolve.CostItemCount + "个强化水晶"; } } private void FullLevel(int advancedLv) { m_FullLevelObj.SetActive(true); var evolve = strengthModel.GetEquipPlusEvolve(strengthModel.SelectEquipPlace, advancedLv); m_TextLvFull.text = Language.Get("Z1024", advancedLv); m_TextAttributesFull.text = evolve.AttrName + "+" + evolve.AttrValue; } private void SetEquipEvolution() { m_AdvancedObj.SetActive(false); m_FullLevelObj.SetActive(false); int equipLevel = strengthModel.SelectLevel; int equipPlace = strengthModel.SelectEquipPlace; int equipIndex = EquipPlaceMapConfig.GetServerPlace(equipLevel, equipPlace); equipType = strengthModel.GetEquipStrengthType(equipPlace); int equipLv = 0; int advancedLv = 0; if (strengthModel.EquipStrengthDic.ContainsKey(equipIndex))//获取当前强化等级 { equipLv = strengthModel.EquipStrengthDic[equipIndex].EquipPartStarLV; advancedLv = strengthModel.EquipStrengthDic[equipIndex].EvolveLV; } int advancedMaxLv = 0; if (strengthModel.EvolutionTypeMaxDic.ContainsKey(equipType)) { advancedMaxLv = strengthModel.EvolutionTypeMaxDic[equipType]; } if (advancedLv < advancedMaxLv) { Reinforceable(advancedLv); } else { FullLevel(advancedLv); } } private bool IsCarryOut() { int equipLv = 0; int advancedLv = 0; int itemCount = 0; int equipIndex = EquipPlaceMapConfig.GetServerPlace(strengthModel.SelectLevel, strengthModel.SelectEquipPlace); if (strengthModel.EquipStrengthDic.ContainsKey(equipIndex))//获取当前强化等级 { equipLv = strengthModel.EquipStrengthDic[equipIndex].EquipPartStarLV; advancedLv = strengthModel.EquipStrengthDic[equipIndex].EvolveLV; } var equipPlusEvolve = strengthModel.GetEquipPlusEvolve(strengthModel.SelectEquipPlace, advancedLv + 1); if (equipPlusEvolve == null) { DebugEx.LogError("没有找到表数据"); return false; } itemCount = playerPack.GetItemCountByID(PackType.Item, equipPlusEvolve.CostItemID); if (equipPlusEvolve.NeedPlusLV > equipLv) { DebugEx.LogError("所需强化等级不足"); return false; } if (equipPlusEvolve.CostItemCount > itemCount) { DebugEx.LogError("所需材料不足"); return false; } return true; } } } System/EquipGem/EquipStrengthModel.cs
@@ -49,6 +49,8 @@ public Dictionary<int, int> PartTypeDic = new Dictionary<int, int>();//强化的部位类型 public Dictionary<int, int> EvolutionTypeMaxDic = new Dictionary<int, int>(); public event Action EquipStrengthUpdate;//强化数据刷新 public event Action EquipStrengthLvUpdate;//强化升级成功 public event Action EquipStrngthEvolutionLv;//进阶成功 public event Action SelectEquipRefresh;//二级页签刷新 public event Action SelectLevelRefresh;//一级页签刷新 @@ -126,7 +128,16 @@ equipStrength.EvolveLV = equipPartPlus.EvolveLV; if (EquipStrengthDic.ContainsKey(equipPartPlus.EquipIndex)) { var equip = EquipStrengthDic[equipPartPlus.EquipIndex]; EquipStrengthDic[equipPartPlus.EquipIndex] = equipStrength; if (equip.EquipPartStarLV != equipPartPlus.EquipPartStarLV && EquipStrengthLvUpdate!=null) { EquipStrengthLvUpdate(); } if (equip.EvolveLV != equipPartPlus.EvolveLV && EquipStrngthEvolutionLv != null) { EquipStrngthEvolutionLv(); } } else { @@ -243,10 +254,15 @@ return itemPlusConfig; } public EquipPlusEvolveClass GetEquipPlusEvolve(int equipType, int equipLv = 0)//获取装备进化数据 public EquipPlusEvolveClass GetEquipPlusEvolve(int equipPlace, int equipLv)//获取装备进化数据 { EquipPlusEvolveClass equipPlusEvolve = new EquipPlusEvolveClass(); var equipPlusEvolveConfig = EquipPlusEvolveConfig.GetEquipPlaceAndEvolveLV(equipType, equipLv); int lvType = 1; if (equipLv != 0) { lvType = equipLv; } var equipPlusEvolveConfig = EquipPlusEvolveConfig.GetEquipPlaceAndEvolveLV(equipPlace, lvType); if (equipPlusEvolveConfig != null) { equipPlusEvolve.EquipType = equipPlusEvolveConfig.EquipPlace; @@ -270,25 +286,25 @@ switch (config.ISPercentage) { case 0: equipPlusEvolve.AttrValue = value.ToString(); if (equipLv == 0) { equipPlusEvolve.AttrValue = 0.ToString(); } equipPlusEvolve.AttrValue = value.ToString(); } break; case 1: equipPlusEvolve.AttrValue = (value / 100).ToString() + "%"; if (equipLv == 0) { equipPlusEvolve.AttrValue = 0.ToString() + "%"; } equipPlusEvolve.AttrValue = (value / 100).ToString() + "%"; } break; case 2: equipPlusEvolve.AttrValue = value.ToString() + "%"; if (equipLv == 0) { equipPlusEvolve.AttrValue = 0.ToString() + "%"; } equipPlusEvolve.AttrValue = value.ToString() + "%"; } break; } } System/EquipGem/EquipStrengthWin.cs
@@ -25,6 +25,9 @@ [SerializeField] Button m_AutomaticBtn; [SerializeField] Button m_StopBtn; [SerializeField] UIEffect m_UIEffect1A; [SerializeField] UIEffect m_UIEffect1B; EquipStrengthModel strengthModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } } EquipGemModel model { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } } EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } } @@ -137,7 +140,7 @@ { SetStrengthenedState(); m_Controller.m_Scorller.RefreshActiveCellViews(); } } } void DisplayEquips() { @@ -194,7 +197,7 @@ OnClickStopBtn(); IsAutomaticBool = false; } DisplayEquips(); DisplayEquips(); if (strengthModel.SelectLevel != -1) { SetStrengthenedState(); @@ -236,9 +239,11 @@ int equipIndex = EquipPlaceMapConfig.GetServerPlace(equipLevel, equipPlace); int star = equipStarModel.GetEquipStarLevel(equipLevel, equipPlace); int equipLv = 0; int advancedLv = 0; if (strengthModel.EquipStrengthDic.ContainsKey(equipIndex))//获取当前强化等级 { equipLv = strengthModel.EquipStrengthDic[equipIndex].EquipPartStarLV; advancedLv = strengthModel.EquipStrengthDic[equipIndex].EvolveLV; } int equipType = strengthModel.GetEquipStrengthType(equipPlace); @@ -251,10 +256,11 @@ int maxLv = strengthModel.GetEquipLevelMax(equipType);//获取最大强化等级 m_EquipEvolution.gameObject.SetActive(true); m_EquipEvolution.SetEquipEvolution(equipPlace, advancedLv); if (equipLv >= maxLv)//满级 { m_BottomFrame.SetActive(false); m_EquipStrengthFull.gameObject.SetActive(true); m_EquipStrengthFull.gameObject.SetActive(true); m_EquipStrengthFull.SetEquipStrengthFull(equipGuid, equipLevel, equipPlace); } else if (maxLv > equipLv && equipLv >= itemPlusMaxConfig.levelMax)//强化上限 System/EquipTrain/EquipTrainModel.cs
@@ -105,11 +105,35 @@ public void Train(int level, int place, bool[] inevitables) { var code = 0; var inevitableCount = 0; for (int i = 0; i < inevitables.Length; i++) { inevitableCount += inevitables[i] ? 1 : 0; code += inevitables[i] ? MathUtility.Power(2, i) : 0; } var need = GetMaterialNeed(level, place); var itemId = GetTrainMaterial(level, place); var own = packModel.GetItemCountByID(PackType.Item, itemId); if (need > own) { return; } if (inevitableCount > 0) { var trainLevel = GetTrainLevel(level, place); var trainType = GetTrainType(place); var config = EquipWashConfig.Get(trainType, trainLevel + 1); var moneyNeed = config != null ? config.mustCosts[inevitableCount - 1] : 0; var moneyOwn = PlayerDatas.Instance.baseData.diamond; if (moneyNeed > moneyOwn) { return; } } var equipWash = new CA325_tagCMEquipXLAttrChange(); equipWash.EquipPlace = (byte)EquipSet.ClientPlaceToServerPlace(level, place); equipWash.CheckUseGoldAttr = (byte)code; System/ItemTip/EquipTipWin.cs
@@ -126,6 +126,8 @@ public TipStrengthenPropertyWidget strengthenPropertyWidget; public TipTrainPropertyWidget trainPropertyWidget; public TipAuctionTipWidget auctionTipWidget; public Text job; public Text equipPlace; public void SetActive(bool active) { @@ -187,6 +189,17 @@ auctionTipWidget.Display(overdueTime); } var itemConfig = ItemConfig.Get(data.itemId); if (JobNameConfig.Has(itemConfig.JobLimit)) { job.text = Language.Get("EquipWin_JobTitleText_1") + JobNameConfig.Get(itemConfig.JobLimit).name; } else { job.text = ""; } equipPlace.text = Language.Get("EquipWin_PartTitleText_1") + UIHelper.GetEquipPlaceName(itemConfig.EquipPlace); } } System/ItemTip/TipGemInfoWidget.cs
@@ -29,14 +29,16 @@ public class GemBehaviour { public Image gemIcon; public Image locked; public Text gemName; public Text[] propertyBehaviours; public Text propertyBehaviour; public RectTransform unLockContainer; public void Display(bool active, int gem) { if (active) { locked.gameObject.SetActive(false); if (gem > 0) { var config = ItemConfig.Get(gem); @@ -70,44 +72,30 @@ properties.Add(new Int2(config.Effect5, config.EffectValueA5)); } for (int i = 0; i < propertyBehaviours.Length; i++) var lines = new string[properties.Count]; for (int i = 0; i < properties.Count; i++) { var behaviour = propertyBehaviours[i]; if (i < properties.Count) { var property = properties[i]; behaviour.gameObject.SetActive(true); behaviour.text = string.Format("{0}+{1}", property.x, PlayerPropertyConfig.GetPropertyDescription(property.x, property.y)); } else { behaviour.gameObject.SetActive(false); } var property = properties[i]; lines[i] = string.Format("{0}+{1}", property.x, PlayerPropertyConfig.GetPropertyDescription(property.x, property.y)); } propertyBehaviour.text = string.Join("\r\n", lines); } else { gemIcon.gameObject.SetActive(false); gemName.text = "未镶嵌"; for (int i = 0; i < propertyBehaviours.Length; i++) { var behaviour = propertyBehaviours[i]; behaviour.gameObject.SetActive(false); } propertyBehaviour.gameObject.SetActive(false); } unLockContainer.gameObject.SetActive(false); } else { locked.gameObject.SetActive(true); gemIcon.gameObject.SetActive(false); gemName.text = "未镶嵌"; for (int i = 0; i < propertyBehaviours.Length; i++) { var behaviour = propertyBehaviours[i]; behaviour.gameObject.SetActive(false); } propertyBehaviour.gameObject.SetActive(false); unLockContainer.gameObject.SetActive(true); } } System/ItemTip/TipLegendPropertyWidget.cs
@@ -17,19 +17,19 @@ { var count = data.properties.Count; var lines = new string[count]; for (int i = 0; i < count; i++) { var property = data.properties[i]; var config = PlayerPropertyConfig.Get(property.x); var value = PlayerPropertyConfig.GetPropertyDescription(property.x, property.y); var quality = LegendPropertyConfig.Get(property.x).quality; if (data.isPreview) { lines[i] = string.Format("[推荐]{0}+{1}", config.Name, value); lines[i] = UIHelper.AppendColor(quality, string.Format("[推荐]{0}+{1}", config.Name, value)); } else { lines[i] = string.Format("{0}+{1}", config.Name, value); lines[i] = UIHelper.AppendColor(quality, string.Format("{0}+{1}", config.Name, value)); } } System/KnapSack/Logic/ItemTipsModel.cs
@@ -588,14 +588,7 @@ WindowCenter.Instance.Open<BoxInfoWin>(); break; case ItemWinType.equipWin: if (curAttrData.isPreview) { EquipTipUtility.Show(curAttrData.isCompare ? EquipTipType.EquipCompare : EquipTipType.Equip, curAttrData.itemId); } else { EquipTipUtility.Show(curAttrData.isCompare ? EquipTipType.EquipCompare : EquipTipType.Equip, curAttrData.guid); } WindowCenter.Instance.Open<EquipWin>(); break; case ItemWinType.wingsWin: WindowCenter.Instance.Open<WingsWin>();