少年修仙传客户端代码仓库
hch
2025-07-02 600733c8f592cb9e65f2b7a3e110ac1d686e6bfe
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
using vnxbqy.UI;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
class EquipEvolveSuccessWin : ILWindow
{
    Button closeBtn;
    Text upgrateName;
    List<Text> shenPros = new List<Text>();
    ItemCell itemCell;
 
    Text Base1Txt_Current;
    Text Base1Txt_Next;
    Text Base2Txt_Current;
    Text Base2Txt_Next;
    List<Transform> legendPros = new List<Transform>();
    List<Text> LegendCurrent = new List<Text>();
    List<Text> LegendNext = new List<Text>();
    Transform BasePropertyLine_2;
    float openTime = 0f;
 
    #region Built-in
    protected override void BindController()
    {
        closeBtn = proxy.GetWidgtEx<Button>("Btn_Close");
        upgrateName = proxy.GetWidgtEx<Text>("upgratetxt");
        legendPros.Add(proxy.GetWidgtEx<Transform>("LegendPro1"));
        legendPros.Add(proxy.GetWidgtEx<Transform>("LegendPro2"));
        legendPros.Add(proxy.GetWidgtEx<Transform>("LegendPro3"));
        shenPros.Add(proxy.GetWidgtEx<Text>("Txt_Current1"));
        shenPros.Add(proxy.GetWidgtEx<Text>("Txt_Current2"));
        shenPros.Add(proxy.GetWidgtEx<Text>("Txt_Current3"));
        itemCell = proxy.GetWidgtEx<ItemCell>("ItemCell");
 
        Base1Txt_Current = proxy.GetWidgtEx<Text>("Base1Txt_Current");
        Base1Txt_Next = proxy.GetWidgtEx<Text>("Base1Txt_Next");
        Base2Txt_Current = proxy.GetWidgtEx<Text>("Base2Txt_Current");
        Base2Txt_Next = proxy.GetWidgtEx<Text>("Base2Txt_Next");
        LegendCurrent.Add(proxy.GetWidgtEx<Text>("Legend1Txt_Current"));
        LegendCurrent.Add(proxy.GetWidgtEx<Text>("Legend2Txt_Current"));
        LegendCurrent.Add(proxy.GetWidgtEx<Text>("Legend3Txt_Current"));
        LegendNext.Add(proxy.GetWidgtEx<Text>("Legend1Txt_Next"));
        LegendNext.Add(proxy.GetWidgtEx<Text>("Legend2Txt_Next"));
        LegendNext.Add(proxy.GetWidgtEx<Text>("Legend3Txt_Next"));
        BasePropertyLine_2 = proxy.GetWidgtEx<Transform>("BasePropertyLine_2");
    }
 
    protected override void AddListeners()
    {
        closeBtn.SetListener(() => {
            //打开1秒内不响应关闭
            if (Time.time - openTime < 1)
            {
                return;
            }
            WindowCenter.Instance.CloseIL<EquipEvolveSuccessWin>();
        });
 
    }
 
    protected override void OnPreOpen()
    {
        openTime = Time.time;
        upgrateName.text = Language.Get("ShenEquipText" + EquipEvolveModel.Instance.GetRedEquipQuality(EquipEvolveModel.Instance.resultToEquipID));
        ShowBasePro();
        ShowLegendPro();
        var model = new ItemCellModel(EquipEvolveModel.Instance.resultToEquipID, false, 1);
        itemCell.Init(model);
        ShowShenPro();
 
    }
 
    protected override void OnPreClose()
    {
        
    }
 
    #endregion
 
 
    void ShowBasePro()
    {
        var equipConfig = ItemConfig.Get(EquipEvolveModel.Instance.resultFromEquipID);
        var nextEquipConfig = ItemConfig.Get(EquipEvolveModel.Instance.resultToEquipID);
        Base1Txt_Current.text = StringUtility.Contact(PlayerPropertyConfig.Get(equipConfig.Effect1).Name, ":", PlayerPropertyConfig.GetValueDescription(equipConfig.Effect1, equipConfig.EffectValueA1));
        Base1Txt_Next.text = PlayerPropertyConfig.GetValueDescription(nextEquipConfig.Effect1, nextEquipConfig.EffectValueA1);
 
        BasePropertyLine_2.SetActiveIL(false);
        if (equipConfig.Effect2 != 0)
        {
            BasePropertyLine_2.SetActiveIL(true);
            Base2Txt_Current.text = StringUtility.Contact(PlayerPropertyConfig.Get(equipConfig.Effect2).Name, ":", PlayerPropertyConfig.GetValueDescription(equipConfig.Effect2, equipConfig.EffectValueA2));
            Base2Txt_Next.text = PlayerPropertyConfig.GetValueDescription(nextEquipConfig.Effect2, nextEquipConfig.EffectValueA2);
        }
 
    }
 
    void ShowLegendPro()
    {
        for (int i = 0; i < legendPros.Count; i++)
        {
            legendPros[i].SetActiveIL(false);
        }
 
        var config = EquipShenAttrConfig.Get(EquipEvolveModel.Instance.resultToEquipID);
        if (config == null)
        {
            return;
        }
        int index = 0;
        for (int i = 0; i < config.LegendAttrID.Length; i++)
        {
            int curValue = 0;
            var proValue = config.LegendAttrValue[i];
            var proID = config.LegendAttrID[i];
            EquipEvolveModel.Instance.fromEquipLegends.TryGetValue(proID, out curValue);
            if (curValue == proValue)
            {
                continue;
            }
            legendPros[index].SetActiveIL(true);
            LegendCurrent[index].text = StringUtility.Contact(PlayerPropertyConfig.Get(proID).Name, ":", PlayerPropertyConfig.GetValueDescription(proID, curValue));
            LegendNext[index].text = PlayerPropertyConfig.GetValueDescription(proID, proValue);
            index++;
        }
    }
 
    void ShowShenPro()
    {
        var equipInfo = EquipShenAttrConfig.Get(EquipEvolveModel.Instance.resultToEquipID);
        int[] proID;
        int[] proValue;
        if (equipInfo.ShenAttrID.Length != 0)
        {
            proID = equipInfo.ShenAttrID;
            proValue = equipInfo.ShenAttrValue;
        }
        else if (equipInfo.XianAttrID.Length != 0)
        {
            proID = equipInfo.XianAttrID;
            proValue = equipInfo.XianAttrValue;
        }
        else
        {
            proID = equipInfo.JiAttrID;
            proValue = equipInfo.JiAttrValue;
        }
        for (int i = 0; i < shenPros.Count; i++)
        {
            if (i < proID.Length)
            {
                shenPros[i].SetActiveIL(true);
                shenPros[i].text = Language.Get("ShenEquipText" + EquipEvolveModel.Instance.GetRedEquipQuality(EquipEvolveModel.Instance.resultToEquipID)) +
                    PlayerPropertyConfig.GetFullDescription(proID[i], proValue[i]);
 
                continue;
            }
 
            shenPros[i].SetActiveIL(false);
        }
 
 
    }
}