| | |
| | | #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();
|
| | | }
|
| | |
| | |
|
| | | 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;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|