| System/ItemTip/ItemTipUtility.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/ItemTip/TipBasePropertyWidget.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/ItemTip/TipLegendPropertyWidget.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/ItemTip/TipStrengthenPropertyWidget.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/ItemTip/TipSuitPropertyWidget.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
System/ItemTip/ItemTipUtility.cs
@@ -48,16 +48,19 @@ public struct BaseProperty { public List<Int2> baseProperties; public int star; public List<Int2> starProperties; } public struct LegendProperty { public bool isPreview; public List<Int2> properties; } public struct SuitInfo { public int job; public string name; public int level; public int maxSuitLevel; @@ -230,6 +233,7 @@ var star = starModel.GetEquipStarLevel(item.config.LV, item.config.EquipPlace); if (star > 0) { baseProperty.star = star; var starConfig = EquipStarConfig.Get(item.config.LV, item.config.EquipPlace, star); starProperties.AddRange(starConfig.BaseAttrInfo); } System/ItemTip/TipBasePropertyWidget.cs
@@ -11,10 +11,38 @@ public class TipBasePropertyWidget : MonoBehaviour { public void Display(ItemTipUtility.BaseProperty baseProperty) [SerializeField] Text[] m_PropertyBehaviours; public void Display(ItemTipUtility.BaseProperty data) { for (int i = 0; i < m_PropertyBehaviours.Length; i++) { var behaviour = m_PropertyBehaviours[i]; if (i < data.baseProperties.Count) { behaviour.gameObject.SetActive(true); var baseProperty = data.baseProperties[i]; var config = PlayerPropertyConfig.Get(baseProperty.x); var name = config.Name; var baseValue = PlayerPropertyConfig.GetPropertyDescription(baseProperty.x, baseProperty.y); if (data.star > 0) { var starProperty = data.starProperties[i]; var starValue = PlayerPropertyConfig.GetPropertyDescription(starProperty.x, starProperty.y); var starDescription = UIHelper.AppendColor(TextColType.Green, string.Format("({0}星+{1})", data.star, starValue)); behaviour.text = string.Format("{0}:{1} {2}", name, baseValue, starDescription); } else { behaviour.text = string.Format("{0}:{1} ", name, baseValue); } } else { behaviour.gameObject.SetActive(false); } } } } System/ItemTip/TipLegendPropertyWidget.cs
@@ -11,10 +11,33 @@ public class TipLegendPropertyWidget : MonoBehaviour { [SerializeField] Text[] m_PropertyBehaviours; public void Display(ItemTipUtility.LegendProperty legendProperty) public void Display(ItemTipUtility.LegendProperty data) { for (int i = 0; i < m_PropertyBehaviours.Length; i++) { var behaviour = m_PropertyBehaviours[i]; if (i < data.properties.Count) { behaviour.gameObject.SetActive(true); var property = data.properties[i]; var config = PlayerPropertyConfig.Get(property.x); var value = PlayerPropertyConfig.GetPropertyDescription(property.x, property.y); if (data.isPreview) { behaviour.text = string.Format("[推荐]{0}+{1}", config.Name, value); } else { behaviour.text = string.Format("{0}+{1}", config.Name, value); } } else { behaviour.gameObject.SetActive(false); } } } } System/ItemTip/TipStrengthenPropertyWidget.cs
@@ -11,10 +11,28 @@ public class TipStrengthenPropertyWidget : MonoBehaviour { [SerializeField] Text[] m_PropertyBehaviours; public void Display(ItemTipUtility.StrengthenProperty strengthenProperty) public void Display(ItemTipUtility.StrengthenProperty data) { for (int i = 0; i < m_PropertyBehaviours.Length; i++) { var behaviour = m_PropertyBehaviours[i]; if (i < data.properties.Count) { behaviour.gameObject.SetActive(true); var property = data.properties[i]; var config = PlayerPropertyConfig.Get(property.x); var name = config.Name; var value = PlayerPropertyConfig.GetPropertyDescription(property.x, property.y); behaviour.text = string.Format("{0}:{1}", name, value); } else { behaviour.gameObject.SetActive(false); } } } } System/ItemTip/TipSuitPropertyWidget.cs
@@ -5,18 +5,124 @@ using UnityEngine; using System.Collections; using UnityEngine.UI; using UnityEngine.Events; namespace Snxxz.UI { public class TipSuitPropertyWidget : MonoBehaviour { [SerializeField] Text m_SuitName; [SerializeField] StarToggle[] m_StarToggles; [SerializeField] Text[] m_SuitEquipNames; [SerializeField] EquipSuitPropertyBar m_TwoSuit; [SerializeField] EquipSuitPropertyBar m_FiveSuit; [SerializeField] Text m_EightSuitTitle; [SerializeField] Text m_EightSuitDescription; ItemTipUtility.SuitInfo suitInfo; public void Display(ItemTipUtility.SuitInfo suitInfo) { this.suitInfo = suitInfo; m_SuitName.text = suitInfo.name; for (int i = 0; i < m_SuitEquipNames.Length; i++) { var hasSuit = suitInfo.places.Contains(i + 1); m_SuitEquipNames[i - 1].color = UIHelper.GetUIColor(hasSuit ? TextColType.Green : TextColType.White, true); } var maxLevel = suitInfo.maxSuitLevel; m_StarToggles[0].SetActive(true, DisplaySuitProperty); m_StarToggles[1].SetActive(maxLevel >= 3, DisplaySuitProperty); m_StarToggles[2].SetActive(maxLevel >= 6, DisplaySuitProperty); m_StarToggles[3].SetActive(maxLevel >= 9, DisplaySuitProperty); } void DisplaySuitProperty(int star) { m_TwoSuit.Display(suitInfo.twoSuitProperties[star]); m_FiveSuit.Display(suitInfo.fiveSuitProperties[star]); m_EightSuitDescription.text = GetEightSuitDescription(suitInfo.job, suitInfo.level, star); var eightSuitActive = suitInfo.eightSuits[star]; var color = UIHelper.GetUIColor(eightSuitActive ? TextColType.Green : TextColType.White, true); m_EightSuitTitle.color = color; m_EightSuitDescription.color = color; } public void Dispose() { } private string GetEightSuitDescription(int job, int level, int star) { var configs = EquipSuitConfig.GetConfigs(job, level, EquipSuitType.EightSuit); for (int i = 0; i < configs.Count; i++) { var config = configs[i]; if (config.star == star) { var description = string.Empty; if (config.skillID > 0) { description = config.description; } else { var propertyConfig = PlayerPropertyConfig.Get(config.attr[0].x); var propertyDescription = PlayerPropertyConfig.GetPropertyDescription(config.attr[0].x, config.attr[0].y); description = StringUtility.Contact(propertyConfig.Name, " +", propertyDescription); } return description; } } return string.Empty; } [System.Serializable] public class StarToggle { public int star; public Text title; public Toggle toggle; UnityAction<int> action; public void SetActive(bool active, UnityAction<int> action) { title.gameObject.SetActive(active); toggle.isOn = active; toggle.interactable = active; this.action = action; if (active) { toggle.SetListener(OnValueChange); } else { toggle.RemoveAllListeners(); } } private void OnValueChange(bool value) { if (value) { if (action != null) { action(star); } } } } } }