| Lua/Gen/SnxxzUIEquipTrainModelWrap.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/EquipStar/EquipStarLevelSelectBehaviour.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/EquipStar/EquipStarUpgradeCandidateSlot.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/EquipTrain/EquipTrainCandidateBehaviour.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/EquipTrain/EquipTrainLevelBehaviour.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/EquipTrain/EquipTrainModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/EquipTrain/EquipTrainPropertyBar.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/EquipTrain/EquipTrainPropertyBarBehaviour.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/EquipTrain/EquipTrainWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Lua/Gen/SnxxzUIEquipTrainModelWrap.cs
@@ -559,11 +559,6 @@ { string _equipGuid = LuaAPI.lua_tostring(L, 2); bool gen_ret = gen_to_be_invoked.IsEquipPlaceTrainable( _equipGuid ); LuaAPI.lua_pushboolean(L, gen_ret); return 1; } System/EquipStar/EquipStarLevelSelectBehaviour.cs
@@ -53,7 +53,7 @@ slotBehaviours.Add(behaviour); } m_BackGround.SetSprite(""); m_BackGround.SetSprite("RealmEquip_16"); m_Arrow.transform.localEulerAngles = new Vector3(0, 0, 180); } @@ -65,7 +65,7 @@ } slotBehaviours.Clear(); m_BackGround.SetSprite(""); m_BackGround.SetSprite("RealmEquip_5"); m_Arrow.transform.localEulerAngles = Vector3.zero; } System/EquipStar/EquipStarUpgradeCandidateSlot.cs
@@ -55,6 +55,7 @@ m_EmptyItem.gameObject.SetActive(true); var place = this.candidate.place; m_Description1.text = string.Format("部位:{0}", UIHelper.GetEquipPlaceName(place)); m_Description1.color = UIHelper.GetUIColor(TextColType.Black, true); m_Description2.text = "未穿戴装备"; } else @@ -63,7 +64,7 @@ m_EmptyItem.gameObject.SetActive(false); m_ItemCell.Init(item); m_Description1.text = item.config.ItemName; m_Description1.color = UIHelper.GetUIColor(item.config.ItemColor); m_Description1.color = UIHelper.GetUIColor(item.config.ItemColor, true); m_Description2.text = string.Empty; } } System/EquipTrain/EquipTrainCandidateBehaviour.cs
@@ -53,7 +53,9 @@ m_EmptyItem.gameObject.SetActive(true); var place = this.candidate.place; m_Description1.text = string.Format("部位:{0}", UIHelper.GetEquipPlaceName(place)); m_Description1.color = UIHelper.GetUIColor(TextColType.Black, true); m_Description2.text = "未穿戴装备"; m_Description2.color = UIHelper.GetUIColor(TextColType.Red, true); } else { @@ -61,9 +63,10 @@ m_EmptyItem.gameObject.SetActive(false); m_ItemCell.Init(item); m_Description1.text = item.config.ItemName; m_Description1.color = UIHelper.GetUIColor(item.config.ItemColor); m_Description1.color = UIHelper.GetUIColor(item.config.ItemColor, true); var trainLevel = model.GetTrainLevel(candidate.level, candidate.place); m_Description2.text = string.Format("洗练等级:{0}级", trainLevel); m_Description2.color = UIHelper.GetUIColor(TextColType.Black, true); } } System/EquipTrain/EquipTrainLevelBehaviour.cs
@@ -53,7 +53,7 @@ slotBehaviours.Add(behaviour); } m_BackGround.SetSprite(""); m_BackGround.SetSprite("RealmEquip_16"); m_Arrow.transform.localEulerAngles = new Vector3(0, 0, 180); } @@ -65,7 +65,7 @@ } slotBehaviours.Clear(); m_BackGround.SetSprite(""); m_BackGround.SetSprite("RealmEquip_5"); m_Arrow.transform.localEulerAngles = Vector3.zero; } System/EquipTrain/EquipTrainModel.cs
@@ -80,6 +80,20 @@ } } } if (selectedLevel.value > 0) { var level = selectedLevel.value; var place = selectedPlace.value; var trainState = GetEquipPlaceTrainState(level, place); equipTrainLevel.value = GetTrainLevel(level, place); equipTrainMaxLevel.value = trainState == TrainState.Empty ? -1 : GetMaxTrainLevel(level, place); material.value = GetTrainMaterial(level, place); InitTrainableProperties(level, place); operateType.value = CalculateTrainOperateType(level, place); } } public void Train(int level, int place, bool[] inevitables) @@ -146,8 +160,9 @@ candidate.selected.value = candidate.level == level && candidate.place == place; } var trainState = GetEquipPlaceTrainState(level, place); equipTrainLevel.value = GetTrainLevel(level, place); equipTrainMaxLevel.value = GetMaxTrainLevel(level, place); equipTrainMaxLevel.value = trainState == TrainState.Empty ? -1 : GetMaxTrainLevel(level, place); material.value = GetTrainMaterial(level, place); InitTrainableProperties(level, place); @@ -156,6 +171,13 @@ public void SetInevitable(int index, bool invevitable) { var equipGuid = equipModel.GetEquip(selectedLevel.value, selectedPlace.value); if (string.IsNullOrEmpty(equipGuid)) { SysNotifyMgr.Instance.ShowTip("Wash_NoEquip1"); return; } if (propertyBars.Count > index) { propertyBars[index].inevitable.value = invevitable; @@ -219,22 +241,34 @@ return candidatePlaces.Fetch(); } public bool IsEquipPlaceTrainable(string equipGuid) public TrainState GetEquipPlaceTrainState(int level, int place) { var equipGuid = equipModel.GetEquip(level, place); if (string.IsNullOrEmpty(equipGuid)) { return false; return TrainState.Empty; } var equip = packModel.GetItemByGuid(equipGuid); if (equip == null) { return false; return TrainState.Empty; } var maxStarLevel = GetMaxTrainLevel(equip.config.LV, equip.config.EquipPlace); var currentStarLevel = GetTrainLevel(equip.config.LV, equip.config.EquipPlace); return currentStarLevel < maxStarLevel; var absoluteMax = GetMaxTrainLevel(equip.config.EquipPlace); if (currentStarLevel >= absoluteMax) { return TrainState.MaxLevel; } var relativeMax = GetMaxTrainLevel(equip.config.LV, equip.config.EquipPlace); if (currentStarLevel >= relativeMax) { return TrainState.StarLimit; } return TrainState.Allowable; } public Int3 GetUnSavedProperties(int level, int place) @@ -275,38 +309,36 @@ private void InitTrainableProperties(int level, int place) { var equipGuid = equipModel.GetEquip(level, place); propertyBars.Clear(); if (IsEquipPlaceTrainable(equipGuid)) { var unSavedProperties = GetUnSavedProperties(level, place); var trainedProperties = GetTrainedProperties(level, place); var trainLevel = GetTrainLevel(level, place); var data = EquipWashConfig.Get(GetTrainType(place), trainLevel + 1); var trainState = GetEquipPlaceTrainState(level, place); var absoluteMax = GetMaxTrainLevel(place); var propertyBar = new EquipTrainPropertyBar(data.config.attType1, data.config.attMax1); propertyBar.propertyValue.value = trainedProperties.x; propertyBar.deltaValue.value = unSavedProperties.x; propertyBars.Add(propertyBar); var unSavedProperties = GetUnSavedProperties(level, place); var trainedProperties = GetTrainedProperties(level, place); var trainLevel = GetTrainLevel(level, place); var data = EquipWashConfig.Get(GetTrainType(place), Mathf.Clamp(trainLevel + 1, 1, absoluteMax)); propertyBar = new EquipTrainPropertyBar(data.config.attType2, data.config.attMax2); propertyBar.propertyValue.value = trainedProperties.y; propertyBar.deltaValue.value = unSavedProperties.y; propertyBars.Add(propertyBar); var propertyBar = new EquipTrainPropertyBar(data.config.attType1, trainState == TrainState.Empty ? 0 : data.config.attMax1, trainState); propertyBar.propertyValue.value = trainedProperties.x; propertyBar.deltaValue.value = unSavedProperties.x; propertyBars.Add(propertyBar); propertyBar = new EquipTrainPropertyBar(data.config.attType3, data.config.attMax3); propertyBar.propertyValue.value = trainedProperties.z; propertyBar.deltaValue.value = unSavedProperties.z; propertyBars.Add(propertyBar); } propertyBar = new EquipTrainPropertyBar(data.config.attType2, trainState == TrainState.Empty ? 0 : data.config.attMax2, trainState); propertyBar.propertyValue.value = trainedProperties.y; propertyBar.deltaValue.value = unSavedProperties.y; propertyBars.Add(propertyBar); propertyBar = new EquipTrainPropertyBar(data.config.attType3, trainState == TrainState.Empty ? 0 : data.config.attMax3, trainState); propertyBar.propertyValue.value = trainedProperties.z; propertyBar.deltaValue.value = unSavedProperties.z; propertyBars.Add(propertyBar); inevitableMaterialCount.value = CalculateInevitableMaterialCount(); } private int GetTrainMaterial(int level, int place) { var equipGuid = equipModel.GetEquip(level, place); if (IsEquipPlaceTrainable(equipGuid)) if (GetEquipPlaceTrainState(level, place) == TrainState.Allowable) { var star = starModel.GetEquipStarLevel(level, place); var type = GetTrainType(place); @@ -345,8 +377,7 @@ return TrainOperateType.Save; } var equipGuid = equipModel.GetEquip(level, place); var trainable = IsEquipPlaceTrainable(equipGuid); var trainable = GetEquipPlaceTrainState(level, place) == TrainState.Allowable; if (trainable) { return TrainOperateType.Train; @@ -375,6 +406,13 @@ Max = 4, } public enum TrainState { Empty, StarLimit, MaxLevel, Allowable, } } } System/EquipTrain/EquipTrainPropertyBar.cs
@@ -9,14 +9,16 @@ { public readonly int propertyId; public readonly int upperLimit; public readonly EquipTrainModel.TrainState trainState; public readonly LogicInt propertyValue = new LogicInt(); public readonly LogicInt deltaValue = new LogicInt(); public readonly LogicBool inevitable = new LogicBool(); public EquipTrainPropertyBar(int propertyId, int upperLimit) public EquipTrainPropertyBar(int propertyId, int upperLimit, EquipTrainModel.TrainState trainState) { this.propertyId = propertyId; this.upperLimit = upperLimit; this.trainState = trainState; } } System/EquipTrain/EquipTrainPropertyBarBehaviour.cs
@@ -41,6 +41,29 @@ { var config = PlayerPropertyConfig.Get(propertyBar.propertyId); m_PropertyName.text = config.Name; switch (propertyBar.trainState) { case EquipTrainModel.TrainState.Empty: m_Progress.value = 0; m_Value.text = "0"; m_DeltaValue.gameObject.SetActive(false); break; case EquipTrainModel.TrainState.StarLimit: m_Progress.value = 1; m_Value.text = string.Format("{0}/{1}", propertyBar.propertyValue, propertyBar.upperLimit); m_DeltaValue.gameObject.SetActive(false); break; case EquipTrainModel.TrainState.MaxLevel: m_Progress.value = 1; m_Value.text = string.Format("{0}/{1}", propertyBar.propertyValue, propertyBar.upperLimit); m_DeltaValue.gameObject.SetActive(false); break; case EquipTrainModel.TrainState.Allowable: m_Inevitable.gameObject.SetActive(true); break; } } private void DisplayDynamicInfo(bool force) @@ -55,16 +78,14 @@ var value = propertyBar.propertyValue.Fetch(); var maxValue = propertyBar.upperLimit; m_Value.text = string.Format("{0}/{1}", value, maxValue); m_Progress.value = Mathf.Clamp01((float)value / maxValue); m_Inevitable.gameObject.SetActive(value < maxValue); } if (force || propertyBar.deltaValue.dirty) { var deltaValue = propertyBar.deltaValue.Fetch(); var isPerfect = propertyBar.propertyValue.value >= propertyBar.upperLimit; var isPerfect = propertyBar.upperLimit > 0 && propertyBar.propertyValue.value >= propertyBar.upperLimit; if (isPerfect) { m_DeltaValue.text = "完美"; @@ -84,18 +105,29 @@ } else { m_DeltaValue.text = string.Format("+{0}", deltaValue); m_DeltaValue.text = ""; m_DeltaValue.color = UIHelper.GetUIColor(TextColType.Green, true); } } } } private void SwitchInevitable() { model.SetInevitable(m_Index - 1, !propertyBar.inevitable.value); switch (propertyBar.trainState) { case EquipTrainModel.TrainState.Empty: SysNotifyMgr.Instance.ShowTip("Wash_NoEquip1"); break; case EquipTrainModel.TrainState.StarLimit: break; case EquipTrainModel.TrainState.Allowable: model.SetInevitable(m_Index - 1, !propertyBar.inevitable.value); break; case EquipTrainModel.TrainState.MaxLevel: break; } } } System/EquipTrain/EquipTrainWin.cs
@@ -18,6 +18,7 @@ [SerializeField] Text m_MaxTrainLevel; [SerializeField] ItemCell m_TargetEquip; [SerializeField] RectTransform m_EquipEmpty; [SerializeField] MaterialCell m_MaterialCell; [SerializeField] InevitableMaterialCell m_InevitableMaterial; @@ -125,11 +126,13 @@ var equip = packModel.GetItemByGuid(equipGuid); if (equip != null) { m_EquipEmpty.gameObject.SetActive(false); m_TargetEquip.gameObject.SetActive(true); m_TargetEquip.Init(equip); } else { m_EquipEmpty.gameObject.SetActive(true); m_TargetEquip.gameObject.SetActive(false); } } @@ -138,7 +141,7 @@ { var trainLevel = model.equipTrainLevel.Fetch(); m_TrainLevel.text = string.Format("{0}级洗练", trainLevel); m_MaxLevelContainer.gameObject.SetActive(model.equipTrainLevel.value >= model.equipTrainMaxLevel.value); m_MaxLevelContainer.gameObject.SetActive(trainLevel > 0 && trainLevel >= model.equipTrainMaxLevel.value); } if (force || model.equipTrainMaxLevel.dirty) @@ -147,7 +150,11 @@ var place = model.selectedPlace.value; var maxTrain = model.equipTrainMaxLevel.Fetch(); if (maxTrain > 0) if (maxTrain < 0) { m_MaxTrainLevel.text = "穿戴装备可洗练"; } else if (maxTrain > 0) { var star = starModel.GetEquipStarLevel(level, place); m_MaxTrainLevel.text = string.Format("{0}星装备最高可洗练至{1}级", star, maxTrain); @@ -199,8 +206,7 @@ private void DisplayInevitableMaterial(int level, int place, int need) { var equipGuid = equipModel.GetEquip(level, place); var trainable = model.IsEquipPlaceTrainable(equipGuid); var trainable = model.GetEquipPlaceTrainState(level, place) == EquipTrainModel.TrainState.Allowable; if (trainable) { var own = packModel.GetItemCountByID(PackType.Item, GeneralDefine.equipTrainMustItemId);