少年修仙传客户端代码仓库
client_linchunjie
2019-07-04 5af0e771d2ff58e53fba041a936be42b2f323fca
7763 【2.0.200】【开发】古神印记门票合成红点
2个文件已修改
129 ■■■■■ 已修改文件
System/Compose/New/ComposeFirstTypeCell.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Compose/New/ComposeWinModel.cs 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Compose/New/ComposeFirstTypeCell.cs
@@ -27,8 +27,13 @@
            unlockTypeName.text = itemCompound.secondTypeName;
            arrowImg.gameObject.SetActive(thirdType != 0);
            UpdateBtnImg(selectSecondType);
            if (firstType == (int)ComposeFuncType.Item
                 && composeModel.secondTypeRedDict.ContainsKey(secondType))
            var index = composeModel.composeRedpointCategories.FindIndex((x) =>
             {
                 return x.x == firstType && x.y == secondType;
             });
            if (index != -1)
            {
                redpoint.gameObject.SetActive(true);
                redpoint.redpointId = composeModel.secondTypeRedDict[secondType].id;
System/Compose/New/ComposeWinModel.cs
@@ -1114,43 +1114,86 @@
    #region 红点逻辑
    public const int COMPOSE_REDKEY = 109;
    public const int COMPOSETOOL_REDKEY = 10905;
    public const int COMPOSETICKET_REDKEY = 10903;
    public const int COMPOSEBTN_REDKEY = 10910;
    public Redpoint composeRed = new Redpoint(MainRedDot.RedPoint_key, COMPOSE_REDKEY);
    public Redpoint composeBtnRed = new Redpoint(COMPOSEBTN_REDKEY);
    public Redpoint composeToolRed = new Redpoint(COMPOSE_REDKEY, COMPOSETOOL_REDKEY);
    public Redpoint composeTicketRed = new Redpoint(COMPOSE_REDKEY, COMPOSETICKET_REDKEY);
    public Dictionary<int, Redpoint> secondTypeRedDict = new Dictionary<int, Redpoint>();
    public Dictionary<string, Redpoint> thirdTypeRedDict = new Dictionary<string, Redpoint>();
    public List<Int3> composeRedpointCategories = new List<Int3>();
    public void SetComposeTypeRed()
    {
        var funcConfig = FuncConfigConfig.Get("ComposeRedpoint");
        var stringArray = funcConfig.Numerical1.Split('|');
        for (int i = 0; i < stringArray.Length; i++)
        {
            Int3 category;
            if (Int3.TryParse(stringArray[i], out category))
            {
                composeRedpointCategories.Add(category);
            }
        }
        secondTypeRedDict.Clear();
        thirdTypeRedDict.Clear();
        if (composeDataDict.ContainsKey((int)ComposeFuncType.Item))
        //if (composeDataDict.ContainsKey((int)ComposeFuncType.Item))
        //{
        //    var firstTypeData = composeDataDict[(int)ComposeFuncType.Item];
        //    var secondTypeDict = firstTypeData.secondTypeDict;
        //    foreach (var second in secondTypeDict.Keys)
        //    {
        //        var thirdTypeDict = secondTypeDict[second].thirdTypeDict;
        //        int secondRedKey = COMPOSETOOL_REDKEY * 100 + second;
        //        Redpoint secondRed = new Redpoint(COMPOSETOOL_REDKEY, secondRedKey);
        //        secondTypeRedDict.Add(second, secondRed);
        //        foreach (var third in thirdTypeDict.Keys)
        //        {
        //            int thirdRedKey = secondRedKey * 100 + third;
        //            Redpoint thirdRed = new Redpoint(secondRedKey, thirdRedKey);
        //            string key = StringUtility.Contact(second, 10, third);
        //            thirdTypeRedDict.Add(key, thirdRed);
        //        }
        //    }
        //}
        foreach (var category in composeRedpointCategories)
        {
            var firstTypeData = composeDataDict[(int)ComposeFuncType.Item];
            var secondTypeDict = firstTypeData.secondTypeDict;
            foreach (var second in secondTypeDict.Keys)
            if (composeDataDict.ContainsKey(category.x))
            {
                var thirdTypeDict = secondTypeDict[second].thirdTypeDict;
                int secondRedKey = COMPOSETOOL_REDKEY * 100 + second;
                Redpoint secondRed = new Redpoint(COMPOSETOOL_REDKEY, secondRedKey);
                secondTypeRedDict.Add(second, secondRed);
                foreach (var third in thirdTypeDict.Keys)
                var firstTypeData = composeDataDict[category.x];
                var secondTypeDict = firstTypeData.secondTypeDict;
                foreach (var second in secondTypeDict.Keys)
                {
                    int thirdRedKey = secondRedKey * 100 + third;
                    Redpoint thirdRed = new Redpoint(secondRedKey, thirdRedKey);
                    string key = StringUtility.Contact(second, 10, third);
                    thirdTypeRedDict.Add(key, thirdRed);
                    var thirdTypeDict = secondTypeDict[second].thirdTypeDict;
                    int secondRedKey = COMPOSETICKET_REDKEY * 100 + second;
                    Redpoint secondRed = new Redpoint(COMPOSETICKET_REDKEY, secondRedKey);
                    secondTypeRedDict.Add(second, secondRed);
                    foreach (var third in thirdTypeDict.Keys)
                    {
                        int thirdRedKey = secondRedKey * 100 + third;
                        Redpoint thirdRed = new Redpoint(secondRedKey, thirdRedKey);
                        string key = StringUtility.Contact(second, 10, third);
                        thirdTypeRedDict.Add(key, thirdRed);
                    }
                }
            }
        }
    }
    readonly List<int> redpointItemTypes = new List<int>()
    {
        35,
        44,
    };
    private void OnItemCntRefresh(PackType type, int index, int id)
    {
        if (type != PackType.Item) return;
        ItemConfig itemConfig = ItemConfig.Get(id);
        if (itemConfig != null && itemConfig.Type == (int)ItemType.ComposeSuitStone)
        if (itemConfig != null && redpointItemTypes.Contains(itemConfig.Type))
        {
            RefreshComposeRed();
        }
@@ -1158,36 +1201,39 @@
    public void RefreshComposeRed()
    {
        ComposeFirstTypeData firstTypeData = null;
        TryGetFirstTypeData((int)ComposeFuncType.Item, out firstTypeData);
        if (firstTypeData == null
           || !FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Compose)) return;
        ComposeSecondTypeData secondTypeData = null;
        TryGetSecondTypeData((int)ComposeFuncType.Item, 3, out secondTypeData);
        if (secondTypeData != null)
        if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Compose))
        {
            var thirdTypeDict = secondTypeData.thirdTypeDict;
            foreach (var third in thirdTypeDict.Keys)
            return;
        }
        foreach (var category in composeRedpointCategories)
        {
            ComposeSecondTypeData secondTypeData = null;
            TryGetSecondTypeData(category.x, category.y, out secondTypeData);
            if (secondTypeData != null)
            {
                List<ComposeThirdTypeData> thirdTypeDatas = thirdTypeDict[third];
                for (int i = 0; i < thirdTypeDatas.Count; i++)
                var thirdTypeDict = secondTypeData.thirdTypeDict;
                foreach (var third in thirdTypeDict.Keys)
                {
                    var itemCompound = thirdTypeDatas[i].itemCompound;
                    int makeID = itemCompound.makeID[0];
                    string key = StringUtility.Contact(3, 10, third);
                    if (IsComposeJobLimit(makeID) && IsEnoughFixedMat(itemCompound))
                    List<ComposeThirdTypeData> thirdTypeDatas = thirdTypeDict[third];
                    for (int i = 0; i < thirdTypeDatas.Count; i++)
                    {
                        if (thirdTypeRedDict[key].state != RedPointState.Simple)
                        var itemCompound = thirdTypeDatas[i].itemCompound;
                        int makeID = itemCompound.makeID[0];
                        string key = StringUtility.Contact(category.y, 10, third);
                        if (IsEnoughFixedMat(itemCompound))
                        {
                            thirdTypeRedDict[key].state = RedPointState.Simple;
                            if (thirdTypeRedDict[key].state != RedPointState.Simple)
                            {
                                thirdTypeRedDict[key].state = RedPointState.Simple;
                            }
                        }
                    }
                    else
                    {
                        if (thirdTypeRedDict[key].state != RedPointState.None)
                        else
                        {
                            thirdTypeRedDict[key].state = RedPointState.None;
                            if (thirdTypeRedDict[key].state != RedPointState.None)
                            {
                                thirdTypeRedDict[key].state = RedPointState.None;
                            }
                        }
                    }
                }