少年修仙传客户端代码仓库
lcy
2024-12-16 a39c35fc6449430cd02bccb681c4a0a880e46cd9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
namespace vnxbqy.UI
{
    public class TipSpiritWeaponPropertyWidget : MonoBehaviour
    {
        [SerializeField] Text m_PropertyBehaviour;
 
        public void Display(ItemTipUtility.SpiritWeaponProperty data)
        {
            var itemConfig = ItemConfig.Get(data.itemId);
            var count = data.properties.Count + (itemConfig.EquipPlace == 14 ? 1 : 0);
            var lines = new string[count];
            var lineIndex = 0;
            foreach (var property in data.properties)
            {
                var config = PlayerPropertyConfig.Get(property.x);
                var name = config.Name;
 
                var value = (property.x == 79 || property.x == 80) ?
                    ItemLogicUtility.Instance.GetSpecialSpiritPropertyValue(data.itemId) : property.y;
 
                var valueDescription = string.Empty;
                var maxLevel = ItemLogicUtility.Instance.GetSpecialSpiritPropertyMaxLevel(data.itemId);
                switch (property.x)
                {
                    case 79:
                        valueDescription = UIHelper.ReplaceNewLine(Language.Get("EquipTip_ExtraDamage", value, maxLevel, property.y));
                        lines[lineIndex++] = UIHelper.AppendColor(property.z, valueDescription);
                        break;
                    case 80:
                        valueDescription = UIHelper.ReplaceNewLine(Language.Get("EquipTip_ExtraHpBack", value, maxLevel, property.y));
                        lines[lineIndex++] = UIHelper.AppendColor(property.z, valueDescription);
                        break;
                    default:
                        valueDescription = PlayerPropertyConfig.GetValueDescription(property.x, value);
                        lines[lineIndex++] = UIHelper.AppendColor(property.z, string.Format("{0}: {1}", name, valueDescription));
                        break;
                }
            }
 
            switch (itemConfig.EquipPlace)
            {
                case 13:
                    break;
                case 14:
                    lines[lineIndex] = UIHelper.ReplaceNewLine(Language.Get("Automatic_Picking"));
                    break;
                case 16:
                    break;
                case 17:
                    break;
            }
 
            m_PropertyBehaviour.text = string.Join("\r\n", lines);
        }
 
    }
}