少年修仙传客户端代码仓库
client_Wu Xijin
2019-02-25 cdb0198fb8e85811ec1e06b15f36df9cbe0fdb9a
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
using Snxxz.UI;
using System.Collections.Generic;
 
using UnityEngine;
using UnityEngine.UI;
 
public class EquipSuitCell : CellView
{
    [SerializeField]
    public Button suitCellToggle;
    [SerializeField]
    public GameObject equipBg;
    [SerializeField]
    public ItemCell itemCell;
    [SerializeField]
    public GameObject haveEquip;
    [SerializeField]
    public Text haveCondiText;
    [SerializeField]
    public GameObject noEquip;
    [SerializeField]
    public Text placeText;
    [SerializeField]
    public Text condiText;
 
    [SerializeField]
    public Text nameText;
    [SerializeField]
    public GameObject suitLvObj;
    [SerializeField]
    public Text suitLvText;
    [SerializeField]
    public GameObject selectImg;
    [SerializeField]
    public GameObject unSelectImg;
    [SerializeField]
    public Image groupTypeIcon;
    [SerializeField]
    public RedpointBehaviour redpoint;
 
    PlayerSuitModel _suitModel;
    PlayerSuitModel SuitModel
    {
        get { return _suitModel ?? (_suitModel = ModelCenter.Instance.GetModel<PlayerSuitModel>()); }
    }
 
    PackModel _playerPack;
    PackModel playerPack
    {
        get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); }
    }
 
    public void SetDisplayModel(int repointId,int equipPlace,SuitType suitType,int selectIndex)
    {
        redpoint.redpointId = repointId;
        int suitLv = SuitModel.GetServerSuitLv(equipPlace, (int)suitType);
        int groupType = SuitModel.GetGroupType(equipPlace);
        ItemModel itemModel = playerPack.GetItemByIndex(PackType.Equip,equipPlace);
        suitLvObj.SetActive(false);
        haveCondiText.gameObject.SetActive(false);
        if (itemModel != null)
        {
            itemCell.gameObject.SetActive(true);
            itemCell.Init(itemModel);
            bool isMaker = SuitModel.IsMakerSuit(suitType, itemModel.config.ItemColor, itemModel.config.StarLevel);
            switch (suitType)
            {
                case SuitType.LowSuit:
                    if (!isMaker)
                    {
                        haveEquip.SetActive(false);
                        noEquip.SetActive(true);
                        placeText.text = Language.Get("EquipWash101") + UIHelper.GetEquipPlaceName(equipPlace);
                        condiText.text = Language.Get("EquipSuitUnLowNeed",StringUtility.Contact(Language.Get("EquipSuitOrange"), 1, Language.Get("EquipSuitStar")));
                    }
                    else
                    {
                        haveEquip.SetActive(true);
                        noEquip.SetActive(false);
 
                        if (suitLv > 0)
                        {
                            suitLvObj.SetActive(true);
                            suitLvText.text = Language.Get("EquipSuitLV", suitLv);
                        }
                    }
                    break;
                case SuitType.HighSuit:
                    int lowSuitLv = SuitModel.GetServerSuitLv(equipPlace,(int)SuitType.LowSuit);
                    if (!isMaker)
                    {
                        haveEquip.SetActive(false);
                        noEquip.SetActive(true);
                        placeText.text = Language.Get("EquipWash101") + UIHelper.GetEquipPlaceName(equipPlace);
                        condiText.text = Language.Get("EquipSuitUnLowNeed", StringUtility.Contact(Language.Get("EquipSuitRed"),2, Language.Get("EquipSuitStar")));
                    }
                    else
                    {
                        haveEquip.SetActive(true);
                        noEquip.SetActive(false);
                        if (suitLv > 0)
                        {
                            suitLvObj.SetActive(true);
                            suitLvText.text = Language.Get("EquipSuitLV", suitLv);
                        }
 
                        if(suitLv >= lowSuitLv && !SuitModel.IsReachMax(equipPlace,(int)suitType,suitLv))
                        {
                            haveCondiText.gameObject.SetActive(true);
                            haveCondiText.text = Language.Get("NewEquipSuitNormal",lowSuitLv + 1);
                        }
                    }
                    break;
            }
            nameText.text = UIHelper.AppendStringColor(itemModel.config.ItemColor, itemModel.config.ItemName, true);
        }
        else
        {
            haveEquip.SetActive(false);
            noEquip.SetActive(true);
            itemCell.gameObject.SetActive(false);
            placeText.text = Language.Get("EquipWash101") + UIHelper.GetEquipPlaceName(equipPlace);
            switch (suitType)
            {
                case SuitType.LowSuit:
                    condiText.text = Language.Get("EquipSuitUnLowNeed", StringUtility.Contact(Language.Get("EquipSuitOrange"), 1, Language.Get("EquipSuitStar")));
                    break;
                case SuitType.HighSuit:
                    condiText.text = Language.Get("EquipSuitUnLowNeed", StringUtility.Contact(Language.Get("EquipSuitRed"), 2, Language.Get("EquipSuitStar")));
                    break;
            }
        }
 
        if (this.index == selectIndex)
        {
            selectImg.SetActive(true);
            unSelectImg.SetActive(false);
        }
        else
        {
            selectImg.SetActive(false);
            unSelectImg.SetActive(true);
        }
 
        switch(groupType)
        {
            case 1:
                groupTypeIcon.SetSprite("Biaoqian_fang");
                break;
            case 2:
                groupTypeIcon.SetSprite("Biaoqian_Xian");
                break;
        }
    }
 
 
}