From e4b9000c3ff10c3d8f6d4e6c2e2c1f77d8235fc2 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期日, 20 十月 2019 20:06:16 +0800
Subject: [PATCH] 0312 神装属性tip显示(纯客户端读表)
---
System/ItemTip/TipShenPropertyWidget.cs.meta | 12 ++++
System/KnapSack/Logic/ShenPropertyUtility.cs | 56 ++++++++++--------
System/Message/HrefAnalysis.cs | 4
System/KnapSack/Logic/LegendPropertyUtility.cs | 4
System/ItemTip/TipShenPropertyWidget.cs | 37 ++++++++++++
System/ItemTip/ItemTipUtility.cs | 23 ++++++-
System/ItemTip/EquipTipWin.cs | 9 +++
7 files changed, 114 insertions(+), 31 deletions(-)
diff --git a/System/ItemTip/EquipTipWin.cs b/System/ItemTip/EquipTipWin.cs
index 13b38e8..f83e9c0 100644
--- a/System/ItemTip/EquipTipWin.cs
+++ b/System/ItemTip/EquipTipWin.cs
@@ -123,6 +123,7 @@
public LayoutElementSizeClamp sizeClamp;
public TipEquipBaseInfoWidget baseInfoWidget;
public TipBasePropertyWidget basePropertyWidget;
+ public TipShenPropertyWidget shenPropertyWidget;
public TipLegendPropertyWidget legendPropertyWidget;
public TipSkillInfoWidget skillInfoWidget;
public TipSuitBriefWidget suitBriefWidget;
@@ -172,6 +173,14 @@
basePropertyWidget.Display(data.baseProperty);
}
+ //绁炶灞炴��
+ var hasShenProperty = !data.shenProperty.properties.IsNullOrEmpty();
+ shenPropertyWidget.gameObject.SetActive(hasShenProperty);
+ if (hasShenProperty)
+ {
+ shenPropertyWidget.Display(data.shenProperty);
+ }
+
var hasLegendProperty = !data.legendProperty.properties.IsNullOrEmpty();
legendPropertyWidget.gameObject.SetActive(hasLegendProperty);
if (hasLegendProperty)
diff --git a/System/ItemTip/ItemTipUtility.cs b/System/ItemTip/ItemTipUtility.cs
index 36354e7..355647d 100644
--- a/System/ItemTip/ItemTipUtility.cs
+++ b/System/ItemTip/ItemTipUtility.cs
@@ -36,6 +36,7 @@
public BaseProperty baseProperty;
public BaseProperty petMountBaseProperty;
public SpiritWeaponProperty spiritWeaponProperty;
+ public ShenProperty shenProperty;
public LegendProperty legendProperty;
public SkillInfo skillInfo;
public SuitInfo suitInfo;
@@ -511,6 +512,7 @@
gemInfo = GetGemInfo(guid),
trainProperty = GetTrainProperty(guid),
operates = operatable ? GetOperates(guid) : null,
+ shenProperty = GetShenProperty(item.itemId)
};
}
@@ -529,7 +531,8 @@
suitInfo = GetSuitInfo(itemId),
gemInfo = GetGemInfo(itemId),
starInfo = GetStarInfo(itemId),
- getWay = GetGetWay(itemId)
+ getWay = GetGetWay(itemId),
+ shenProperty = GetShenProperty(itemId)
};
}
@@ -714,6 +717,7 @@
strengthenProperty = strengthenProperty,
gemInfo = gemInfo,
trainProperty = trainProperty,
+ shenProperty = GetShenProperty(info.itemId)
};
}
@@ -733,7 +737,8 @@
suitInfo = GetSuitInfo(itemId),
gemInfo = GetGemInfo(itemId),
starInfo = GetStarInfo(itemId),
- operates = GetGoodOperates(goodId)
+ operates = GetGoodOperates(goodId),
+ shenProperty = GetShenProperty(itemId)
};
}
@@ -786,6 +791,7 @@
petMountBaseProperty = GetPetMountBaseProperty(item.itemId),
operates = operatable ? GetOperates(guid) : null,
refineMaterials = GetWingRefineMaterials(guid),
+ shenProperty = GetShenProperty(item.itemId)
};
}
@@ -801,6 +807,7 @@
legendProperty = GetLegendProperty(itemId),
petMountBaseProperty = GetPetMountBaseProperty(itemId),
getWay = GetGetWay(itemId),
+ shenProperty = GetShenProperty(itemId)
};
}
@@ -816,6 +823,7 @@
spiritWeaponProperty = GetSpiritWeaponProperty(itemId),
petMountBaseProperty = GetPetMountBaseProperty(itemId),
operates = GetGoodOperates(goodId),
+ shenProperty = GetShenProperty(itemId)
};
}
@@ -1145,7 +1153,7 @@
var config = ItemConfig.Get(itemId);
- data.properties = ShenPropertyUtility.GetEquipProperties(itemId);
+ data.properties = ShenPropertyUtility.GetEquipShenProperties(itemId);
return data;
@@ -1175,6 +1183,15 @@
{
data.trueCount = LegendPropertyUtility.GetEquipPropertyCount(itemId);
data.properties = LegendPropertyUtility.GetEquipProperties(itemId);
+ if (data.properties == null)
+ {
+ data.properties = LegendPropertyUtility.GetLegendProFromEquipShen(itemId);
+ if (data.properties != null)
+ {
+ data.trueCount = 0;
+ data.isPreview = false;
+ }
+ }
}
return data;
diff --git a/System/ItemTip/TipShenPropertyWidget.cs b/System/ItemTip/TipShenPropertyWidget.cs
new file mode 100644
index 0000000..bdfc5f3
--- /dev/null
+++ b/System/ItemTip/TipShenPropertyWidget.cs
@@ -0,0 +1,37 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, March 12, 2019
+//--------------------------------------------------------
+using UnityEngine;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+
+ public class TipShenPropertyWidget : MonoBehaviour
+ {
+ [SerializeField] Text m_PropertyBehaviours;
+
+ public void Display(ItemTipUtility.ShenProperty data)
+ {
+ var count = data.properties.Count;
+ var lines = new List<string>();
+ for (int i = 0; i < count; i++)
+ {
+ var property = data.properties[i];
+ string shenText = Language.Get("ShenEquipText" + property.z);
+ lines.Add(UIHelper.AppendColor(5, shenText + PlayerPropertyConfig.GetFullDescription(property.x, property.y)));
+ }
+
+
+ m_PropertyBehaviours.text = string.Join("\r\n", lines.ToArray());
+ }
+
+ }
+
+}
+
+
+
diff --git a/System/ItemTip/TipShenPropertyWidget.cs.meta b/System/ItemTip/TipShenPropertyWidget.cs.meta
new file mode 100644
index 0000000..cde40c3
--- /dev/null
+++ b/System/ItemTip/TipShenPropertyWidget.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 0536b99051bae5946afd08a7676d66e8
+timeCreated: 1571500535
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/KnapSack/Logic/LegendPropertyUtility.cs b/System/KnapSack/Logic/LegendPropertyUtility.cs
index ba188c3..ba9c6aa 100644
--- a/System/KnapSack/Logic/LegendPropertyUtility.cs
+++ b/System/KnapSack/Logic/LegendPropertyUtility.cs
@@ -21,13 +21,13 @@
var legendPropertyConfig = LegendPropertyValueConfig.Get(config.Type, config.LV, config.ItemColor, config.SuiteiD != 0, config.StarLevel);
if (legendPropertyConfig == null)
{
- return GetLegendProFromEquipShen(itemId);
+ return null;
}
return new List<Int2>(legendPropertyConfig.previewValue);
}
- private static List<Int2> GetLegendProFromEquipShen(int itemId)
+ public static List<Int2> GetLegendProFromEquipShen(int itemId)
{
var shenConfig = EquipShenAttrConfig.Get(itemId);
if (shenConfig == null)
diff --git a/System/KnapSack/Logic/ShenPropertyUtility.cs b/System/KnapSack/Logic/ShenPropertyUtility.cs
index 59781aa..5bfc265 100644
--- a/System/KnapSack/Logic/ShenPropertyUtility.cs
+++ b/System/KnapSack/Logic/ShenPropertyUtility.cs
@@ -10,42 +10,50 @@
{
}
- public static List<Int3> GetEquipProperties(int itemId)
+ public static List<Int3> GetEquipShenProperties(int itemId)
{
- var config = ItemConfig.Get(itemId);
- if (config == null)
+ var shenConfig = EquipShenAttrConfig.Get(itemId);
+ if (shenConfig == null)
{
return null;
}
-
- var legendPropertyConfig = LegendPropertyValueConfig.Get(config.Type, config.LV, config.ItemColor, config.SuiteiD != 0, config.StarLevel);
- if (legendPropertyConfig == null)
+ var pro = new Int3[shenConfig.ShenAttrID.Length + shenConfig.XianAttrID.Length + shenConfig.JiAttrID.Length];
+ int count = 0;
+ for (int i = 0; i < shenConfig.ShenAttrID.Length; i++)
{
- return null;
+ pro[i].x = shenConfig.ShenAttrID[i];
+ pro[i].y = shenConfig.ShenAttrValue[i];
+ pro[i].z = 1;
+ count++;
}
- //return new List<Int2>(legendPropertyConfig.previewValue);
- return null;
+ for (int i = 0; i < shenConfig.XianAttrID.Length; i++)
+ {
+
+ pro[count].x = shenConfig.XianAttrID[i];
+ pro[count].y = shenConfig.XianAttrValue[i];
+ pro[count].z = 2;
+ count++;
+ }
+
+ for (int i = 0; i < shenConfig.JiAttrID.Length; i++)
+ {
+
+ pro[count].x = shenConfig.JiAttrID[i];
+ pro[count].y = shenConfig.JiAttrValue[i];
+ pro[count].z = 3;
+ count++;
+ }
+
+ return new List<Int3>(pro);
}
- public static int GetEquipPropertyCount(int itemId)
- {
- var config = ItemConfig.Get(itemId);
- if (config == null)
- {
- return 0;
- }
+
- var legendPropertyConfig = LegendPropertyValueConfig.Get(config.Type, config.LV, config.ItemColor, config.SuiteiD != 0, config.StarLevel);
- if (legendPropertyConfig == null)
- {
- return 0;
- }
-
- return legendPropertyConfig.propertyCount;
- }
}
+
+
diff --git a/System/Message/HrefAnalysis.cs b/System/Message/HrefAnalysis.cs
index 91d7880..3becc4f 100644
--- a/System/Message/HrefAnalysis.cs
+++ b/System/Message/HrefAnalysis.cs
@@ -307,8 +307,8 @@
}
}
- public static Regex EquipRegex = new Regex(@"\[([\u4e00-\u9fa5a-zA-Z0-9\|'_\(\)锛堬級\. :锛歖+?)\]", RegexOptions.Singleline);
- public static Regex EquipDetailRegex = new Regex("#item#([\u4e00-\u9fa5a-zA-Z0-9\\|'_\\(\\)锛堬級\\. :锛歕\,\\[\\]a-zA-Z\"\\{\\}-]+?)#item#", RegexOptions.Singleline);
+ public static Regex EquipRegex = new Regex(@"\[([\u4e00-\u9fa5a-zA-Z0-9\|'_\(\)锛堬級\*. :锛歖+?)\]", RegexOptions.Singleline);
+ public static Regex EquipDetailRegex = new Regex("#item#([\u4e00-\u9fa5a-zA-Z0-9\\|'_\\(\\)锛堬級\\*\\. :锛歕\,\\[\\]a-zA-Z\"\\{\\}-]+?)#item#", RegexOptions.Singleline);
public bool ExcuteHrefEvent(string msg, int index = 0, bool fromAutoTask = false)
{
--
Gitblit v1.8.0