ui基本完毕,修了一大把的bug

This commit is contained in:
FloatGaming
2026-07-13 02:28:39 +08:00
parent 1e20d73e90
commit fd22501f71
958 changed files with 378289 additions and 41038 deletions
+21 -1
View File
@@ -1,9 +1,12 @@
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using System.Text.RegularExpressions;
public class get_item_prefab : MonoBehaviour
{
private static readonly Regex RichTextTagRegex = new Regex("<.*?>", RegexOptions.Compiled);
[SerializeField] private bool testColorChange;
[SerializeField] private Color defaultItemNameColor = Color.white;
public Image item_btm;
@@ -41,7 +44,14 @@ public class get_item_prefab : MonoBehaviour
if (itemName != null)
{
itemName.text = displayName ?? string.Empty;
string resolvedName = displayName ?? string.Empty;
itemName.supportRichText = testColorChange;
if (!testColorChange)
{
resolvedName = StripRichTextTags(resolvedName);
}
itemName.text = resolvedName;
}
ApplyItemNameColor(testColorChange ? qualityColor : defaultItemNameColor);
@@ -66,4 +76,14 @@ public class get_item_prefab : MonoBehaviour
itemName.color = color;
}
}
private static string StripRichTextTags(string value)
{
if (string.IsNullOrEmpty(value))
{
return string.Empty;
}
return RichTextTagRegex.Replace(value, string.Empty);
}
}
+1
View File
@@ -203,6 +203,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
testColorChange: 0
defaultItemNameColor: {r: 1, g: 1, b: 1, a: 1}
item_btm: {fileID: 7767232844961157683}
itemProfile: {fileID: 514154942639368217}
itemAmount: {fileID: 508704441844867492}