少年修仙传客户端代码仓库
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
using vnxbqy.UI;
using UnityEngine;
 
public class TreasureProbabilityHeaderCell : CellView
{
    [SerializeField] ImageEx imgPart;
    [SerializeField] ImageEx imgIncomplete;
    [SerializeField] TextEx txtPart;
    [SerializeField] TextEx txtIncomplete;
    [SerializeField] TextEx txtQuality;
    public void Display(int num, CellView cell)
    {
        int quality = cell.info.Value.infoInt1;
        int treasureID = TreasurePavilionModel.Instance.xbIDArr[TreasurePavilionModel.Instance.xbIndex];
        int treasureType = XBGetItemConfig.Get(treasureID).TreasureType;
        var rateDict = TreasurePavilionModel.Instance.GetRateDict(treasureID);
        var probabilityDict = TreasurePavilionModel.Instance.probabilityDisplayDict[treasureType];
        int incompleteLibID = probabilityDict[quality][0];
        double incompleteRate = (double)rateDict[incompleteLibID]/100;
        if (quality == 0)
        {
            imgPart.SetActive(false);
            int partLibID = probabilityDict[quality][0];
            double partRate = (double)rateDict[partLibID]/100;
            txtIncomplete.text = StringUtility.Contact(partRate.ToString("F2"), "%");
        }
        else
        {
            imgPart.SetActive(true);
            int partLibID = probabilityDict[quality][1];
            double partRate = (double)rateDict[partLibID]/100;
            txtPart.text = StringUtility.Contact(partRate.ToString("F2"), "%");
        }
        txtQuality.text = Language.Get("TreasureProbabilityColor_" + quality);
        imgPart.SetSprite("TreasureProbabilityColor_" + quality);
        imgIncomplete.SetSprite("TreasureProbabilityColor_" + quality);
        txtIncomplete.text = StringUtility.Contact(incompleteRate.ToString("F2"), "%");
    }
 
 
 
}