From 7dcbca7f53bcfa8df7811fd51097598469aaab9c Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期三, 29 八月 2018 15:28:04 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
---
System/Compose/New/ComposeToolsWin.cs | 122 +++++-----
Core/GameEngine/Model/TelPartialConfig/tagItemCompoundConfig.cs | 30 ++
System/Compose/New/ComposeWinModel.cs | 98 ++++---
System/Compose/New/ComposeWingsWin.cs | 88 ++++---
System/Compose/New/SelectEquipModel.cs | 7
System/FairyAu/WarehouseGrid.cs | 7
System/FairyAu/PlayerFairyAuTreasureData.cs | 1
System/Compose/New/ComposeTicketWin.cs | 142 +++++------
System/Compose/New/ComposeEquipWin.cs | 52 ++-
System/Compose/New/ComposeDogzEquipWin.cs | 61 +++--
System/FairyAu/WarehouseTipsWin.cs | 65 ++++
11 files changed, 400 insertions(+), 273 deletions(-)
diff --git a/Core/GameEngine/Model/TelPartialConfig/tagItemCompoundConfig.cs b/Core/GameEngine/Model/TelPartialConfig/tagItemCompoundConfig.cs
index 502a075..daac07e 100644
--- a/Core/GameEngine/Model/TelPartialConfig/tagItemCompoundConfig.cs
+++ b/Core/GameEngine/Model/TelPartialConfig/tagItemCompoundConfig.cs
@@ -7,6 +7,7 @@
{
private static Dictionary<int, Dictionary<int, Dictionary<int, List<ItemCompoundConfig>>>> allComposeModelDict = new Dictionary<int, Dictionary<int, Dictionary<int, List<ItemCompoundConfig>>>>();
static Dictionary<int, List<ItemCompoundConfig>> ticketComposeDict = new Dictionary<int, List<ItemCompoundConfig>>();
+ static Dictionary<int, Dictionary<DisplayItemArray, int[]>> displayItemDict = new Dictionary<int, Dictionary<DisplayItemArray, int[]>>();
public void OnConfigParseCompleted()
{
if (!allComposeModelDict.ContainsKey(firstType))
@@ -43,6 +44,25 @@
}
}
+ }
+
+ int[] makeIDs = ConfigParse.GetMultipleStr<int>(makeID);
+ int[] unfixedItemIDs = ConfigParse.GetMultipleStr<int>(unfixedItemID);
+ int[] fixedItemIDs = ConfigParse.GetMultipleStr<int>(itemID);
+ int[] fixedItemCounts = ConfigParse.GetMultipleStr<int>(itemCount);
+ int[] unfixedDisplay = ConfigParse.GetMultipleStr<int>(unfixedItemDisplay);
+ int[] fixedDisplay = ConfigParse.GetMultipleStr<int>(itemDisplay);
+
+ if (!displayItemDict.ContainsKey(id))
+ {
+ Dictionary<DisplayItemArray, int[]> arrayDict = new Dictionary<DisplayItemArray, int[]>();
+ arrayDict.Add(DisplayItemArray.MakeIds,makeIDs);
+ arrayDict.Add(DisplayItemArray.UnfixedIds,unfixedItemIDs);
+ arrayDict.Add(DisplayItemArray.UnfixedDisplay,unfixedDisplay);
+ arrayDict.Add(DisplayItemArray.FixedIds,fixedItemIDs);
+ arrayDict.Add(DisplayItemArray.FixedCounts, fixedItemCounts);
+ arrayDict.Add(DisplayItemArray.FixedDisplay,fixedDisplay);
+ displayItemDict.Add(id, arrayDict);
}
if (firstType == (int)ComposeFuncType.Ticket)
@@ -125,6 +145,16 @@
return ticketComposeDict.TryGetValue(_ticketId, out list);
}
+ public static int[] GetDisplayArrayByType(int id,DisplayItemArray display)
+ {
+ int[] array = null;
+ if(displayItemDict.ContainsKey(id))
+ {
+ displayItemDict[id].TryGetValue(display,out array);
+ }
+ return array;
+ }
+
}
}
diff --git a/System/Compose/New/ComposeDogzEquipWin.cs b/System/Compose/New/ComposeDogzEquipWin.cs
index 1aee84e..d9201be 100644
--- a/System/Compose/New/ComposeDogzEquipWin.cs
+++ b/System/Compose/New/ComposeDogzEquipWin.cs
@@ -104,8 +104,7 @@
UIEventTrigger.Get(helpBtn.gameObject).OnDown = OnClickHelpBtn;
UIEventTrigger.Get(helpBtn.gameObject).OnUp = OnDownUp;
successRate = 0;
- composeWinModel.funcType = ComposeFuncType.MountDogz;
- firstTypeDict = composeWinModel.GetFirstTypeModel();
+ firstTypeDict = composeWinModel.GetFirstTypeModel((int)ComposeFuncType.MountDogz);
CreateCell();
if(curSecondType == 0)
{
@@ -208,7 +207,7 @@
{
arrowIcon.transform.localRotation = Quaternion.Euler(0, 0, -90);
icon.SetSprite("ComposeFirstClassChoosebtn");
- secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.MountDogz, curSecondType);
}
else
{
@@ -225,7 +224,7 @@
if (curThirdType == cell.index)
{
icon.SetSprite("ChildListBtn_Select");
- thirdTypelist = composeWinModel.GetThirdTypeModellist(cell.index);
+ thirdTypelist = composeWinModel.GetThirdTypeModellist(compoundModel.firstType, compoundModel.secondType,cell.index);
RefreshUI(compoundModel);
}
else
@@ -240,7 +239,7 @@
private void OnClickSecondType(int secondType)
{
curSecondType = secondType;
- secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.MountDogz, curSecondType);
foreach (var thirdType in secondTypeDict.Keys)
{
@@ -334,14 +333,19 @@
for (i = 0; i < previewItemlist.Count; i++)
{
GameObject gridCell = previewItemlist[i].transform.Find("GridCell").gameObject;
- if (i < composeWinModel.makeIDs.Length)
+ int[] makeIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id,DisplayItemArray.MakeIds);
+ if(makeIds != null)
{
- RefreshGridCellUI(gridCell, false, composeWinModel.makeIDs[i],NeedMatType.MakeItem);
+ if (i < makeIds.Length)
+ {
+ RefreshGridCellUI(gridCell, false, makeIds[i], NeedMatType.MakeItem);
+ }
+ else
+ {
+ RefreshGridCellUI(gridCell, true);
+ }
}
- else
- {
- RefreshGridCellUI(gridCell,true);
- }
+
}
#endregion
@@ -357,34 +361,39 @@
posBtn.RemoveAllListeners();
}
fixedItemIndexDict.Clear();
- for (i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
+ int[] fixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedDisplay);
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
+ int[] unfixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.UnfixedIds);
+ int[] unfixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.UnfixedDisplay);
+ for (i = 0; i < fixedDisplay.Length; i++)
{
- if (composeWinModel.fixedItemDisplay[i] != 0)
+ if (fixedDisplay[i] != 0)
{
- GameObject matPos = sourceItemlist[composeWinModel.fixedItemDisplay[i] - 1];
+ GameObject matPos = sourceItemlist[fixedDisplay[i] - 1];
GameObject gridCell = matPos.transform.Find("GridCell").gameObject;
Text putInText = matPos.transform.Find("PutInText").GetComponent<Text>();
putInText.gameObject.SetActive(false);
- RefreshGridCellUI(gridCell,false,composeWinModel.costfixedItemIDs[i],NeedMatType.fixedItem);
+ RefreshGridCellUI(gridCell,false,fixedIds[i],NeedMatType.fixedItem);
List<int> itemIndexlist = null;
SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
if (singlePack != null)
{
- itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i]);
+ itemIndexlist = singlePack.ItemIndexlist(fixedIds[i],fixedCounts[i]);
}
if (itemIndexlist != null)
{
- fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
+ fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
}
}
}
- for (i = 0; i < composeWinModel.unfixedItemDisplay.Length; i++)
+ for (i = 0; i < unfixedDisplay.Length; i++)
{
- if (composeWinModel.unfixedItemDisplay[i] != 0)
+ if (unfixedDisplay[i] != 0)
{
- GameObject matPos = sourceItemlist[composeWinModel.unfixedItemDisplay[i] - 1];
+ GameObject matPos = sourceItemlist[unfixedDisplay[i] - 1];
GameObject gridCell = matPos.transform.Find("GridCell").gameObject;
Text putInText = matPos.transform.Find("PutInText").GetComponent<Text>();
Button posBtn = matPos.GetComponent<Button>();
@@ -484,22 +493,24 @@
if (matType == NeedMatType.fixedItem)
{
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id,DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
itemCell.countText.gameObject.SetActive(true);
int haveCount = playerPack.GetItemCountByID(PackType.rptItem,itemId);
int i = 0;
- for(i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
+ for(i = 0; i < fixedIds.Length; i++)
{
- if(composeWinModel.costfixedItemIDs[i] == itemId)
+ if(fixedIds[i] == itemId)
{
- if (haveCount >= composeWinModel.costfixedItemCounts[i])
+ if (haveCount >= fixedCounts[i])
{
itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green,haveCount.ToString()),
- "/",composeWinModel.costfixedItemCounts[i].ToString());
+ "/", fixedCounts[i].ToString());
}
else
{
itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red, haveCount.ToString()),
- "/", composeWinModel.costfixedItemCounts[i].ToString());
+ "/", fixedCounts[i].ToString());
}
break;
}
diff --git a/System/Compose/New/ComposeEquipWin.cs b/System/Compose/New/ComposeEquipWin.cs
index 56153c4..69a34fc 100644
--- a/System/Compose/New/ComposeEquipWin.cs
+++ b/System/Compose/New/ComposeEquipWin.cs
@@ -113,8 +113,7 @@
UIEventTrigger.Get(helpBtn.gameObject).OnDown = OnClickHelpBtn;
UIEventTrigger.Get(helpBtn.gameObject).OnUp = OnDownUp;
successRate = 0;
- composeWinModel.funcType = ComposeFuncType.Equip;
- firstTypeDict = composeWinModel.GetFirstTypeModel();
+ firstTypeDict = composeWinModel.GetFirstTypeModel((int)ComposeFuncType.Equip);
CreateCell();
if(curSecondType == 0)
{
@@ -218,7 +217,7 @@
{
arrowIcon.transform.localRotation = Quaternion.Euler(0, 0, -90);
icon.SetSprite("ComposeFirstClassChoosebtn");
- secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Equip, curSecondType);
}
else
{
@@ -235,7 +234,7 @@
if (curThirdType == cell.index)
{
icon.SetSprite("ChildListBtn_Select");
- thirdTypelist = composeWinModel.GetThirdTypeModellist(cell.index);
+ thirdTypelist = composeWinModel.GetThirdTypeModellist(compoundModel.firstType, compoundModel.secondType, cell.index);
CreateEquipTypeLineCell();
}
else
@@ -250,7 +249,7 @@
private void OnClickSecondType(int secondType)
{
curSecondType = secondType;
- secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Equip, curSecondType);
foreach (var thirdType in secondTypeDict.Keys)
{
@@ -425,10 +424,11 @@
#region 鍚堟垚鐗╁搧UI
for (i = 0; i < previewItemlist.Count; i++)
{
+ int[] makeIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.MakeIds);
GameObject gridCell = previewItemlist[i].transform.Find("GridCell").gameObject;
- if (i < composeWinModel.makeIDs.Length)
+ if (i < makeIds.Length)
{
- RefreshGridCellUI(gridCell, false, composeWinModel.makeIDs[i],NeedMatType.MakeItem);
+ RefreshGridCellUI(gridCell, false, makeIds[i],NeedMatType.MakeItem);
}
else
{
@@ -438,8 +438,12 @@
#endregion
#region 鍥哄畾閬撳叿鍜屼笉鍥哄畾閬撳叿UI
-
- for(i = 0;i < sourceItemlist.Count; i++)
+ int[] fixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedDisplay);
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
+ int[] unfixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.UnfixedIds);
+ int[] unfixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.UnfixedDisplay);
+ for (i = 0;i < sourceItemlist.Count; i++)
{
GameObject gridCell = sourceItemlist[i].transform.Find("GridCell").gameObject;
Text putInText = sourceItemlist[i].transform.Find("PutInText").GetComponent<Text>();
@@ -449,34 +453,34 @@
posBtn.RemoveAllListeners();
}
fixedItemIndexDict.Clear();
- for (i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
+ for (i = 0; i < fixedDisplay.Length; i++)
{
- if (composeWinModel.fixedItemDisplay[i] != 0)
+ if (fixedDisplay[i] != 0)
{
- GameObject matPos = sourceItemlist[composeWinModel.fixedItemDisplay[i] - 1];
+ GameObject matPos = sourceItemlist[fixedDisplay[i] - 1];
GameObject gridCell = matPos.transform.Find("GridCell").gameObject;
Text putInText = matPos.transform.Find("PutInText").GetComponent<Text>();
putInText.gameObject.SetActive(false);
- RefreshGridCellUI(gridCell,false,composeWinModel.costfixedItemIDs[i],NeedMatType.fixedItem);
+ RefreshGridCellUI(gridCell,false,fixedIds[i],NeedMatType.fixedItem);
List<int> itemIndexlist = null;
SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
if (singlePack != null)
{
- itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i]);
+ itemIndexlist = singlePack.ItemIndexlist(fixedIds[i],fixedCounts[i]);
}
if (itemIndexlist != null)
{
- fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
+ fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
}
}
}
- for (i = 0; i < composeWinModel.unfixedItemDisplay.Length; i++)
+ for (i = 0; i < unfixedDisplay.Length; i++)
{
- if (composeWinModel.unfixedItemDisplay[i] != 0)
+ if (unfixedDisplay[i] != 0)
{
- GameObject matPos = sourceItemlist[composeWinModel.unfixedItemDisplay[i] - 1];
+ GameObject matPos = sourceItemlist[unfixedDisplay[i] - 1];
GameObject gridCell = matPos.transform.Find("GridCell").gameObject;
Text putInText = matPos.transform.Find("PutInText").GetComponent<Text>();
Button posBtn = matPos.GetComponent<Button>();
@@ -576,22 +580,24 @@
if (matType == NeedMatType.fixedItem)
{
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
itemCell.countText.gameObject.SetActive(true);
int haveCount = playerPack.GetItemCountByID(PackType.rptItem,itemId);
int i = 0;
- for(i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
+ for(i = 0; i < fixedIds.Length; i++)
{
- if(composeWinModel.costfixedItemIDs[i] == itemId)
+ if(fixedIds[i] == itemId)
{
- if (haveCount >= composeWinModel.costfixedItemCounts[i])
+ if (haveCount >= fixedCounts[i])
{
itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green,haveCount.ToString()),
- "/",composeWinModel.costfixedItemCounts[i].ToString());
+ "/",fixedCounts[i].ToString());
}
else
{
itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red, haveCount.ToString()),
- "/", composeWinModel.costfixedItemCounts[i].ToString());
+ "/", fixedCounts[i].ToString());
}
break;
}
diff --git a/System/Compose/New/ComposeTicketWin.cs b/System/Compose/New/ComposeTicketWin.cs
index a2beb65..eb6a3b0 100644
--- a/System/Compose/New/ComposeTicketWin.cs
+++ b/System/Compose/New/ComposeTicketWin.cs
@@ -109,8 +109,7 @@
protected override void OnPreOpen()
{
DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent += OnComposeAnswer;
- composeWinModel.funcType = ComposeFuncType.Ticket;
- firstTypeDict = composeWinModel.GetFirstTypeModel();
+ firstTypeDict = composeWinModel.GetFirstTypeModel((int)ComposeFuncType.Ticket);
bool isJumpTo = false;
if (AchievementGoto.guideAchievementId != 0)
{
@@ -120,7 +119,7 @@
isJumpTo = true;
curSecondType = composeWinModel.secondType;
curThirdType = composeWinModel.thirdType;
- secondTypeDict = composeWinModel.GetSecondTypeModel(composeWinModel.secondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Ticket, composeWinModel.secondType);
ClickSecondTypeUICtrl();
composeWinModel.ResetJumpToModel();
}
@@ -133,7 +132,7 @@
isJumpTo = true;
curSecondType = composeWinModel.secondType;
curThirdType = composeWinModel.thirdType;
- secondTypeDict = composeWinModel.GetSecondTypeModel(composeWinModel.secondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Ticket,composeWinModel.secondType);
ClickSecondTypeUICtrl();
composeWinModel.ResetJumpToModel();
}
@@ -151,7 +150,7 @@
{
isJumpTo = false;
bool isCanCompose = true;
- if (!composeWinModel.IsEnoughFixedMat() || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
+ if (!composeWinModel.IsEnoughFixedMat(compoundModel) || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
{
MessageWin.Inst.ShowFixedTip(Language.Get("Compose101"));
isCanCompose = false;
@@ -256,7 +255,7 @@
{
arrowIcon.transform.localRotation = Quaternion.Euler(0, 0, -90);
icon.SetSprite("ComposeFirstClassChoosebtn");
- secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Ticket, curSecondType);
//ClickSecondTypeUICtrl();
}
else
@@ -274,7 +273,7 @@
if (curThirdType == cell.index)
{
icon.SetSprite("ChildListBtn_Select");
- thirdTypelist = composeWinModel.GetThirdTypeModellist(cell.index);
+ thirdTypelist = composeWinModel.GetThirdTypeModellist(compoundModel.firstType, compoundModel.secondType, cell.index);
RefreshUI(compoundModel);
}
else
@@ -289,7 +288,7 @@
private void OnClickSecondType(int secondType)
{
curSecondType = secondType;
- secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Ticket, curSecondType);
foreach (var thirdType in secondTypeDict.Keys)
{
if (thirdType != 0)
@@ -363,10 +362,11 @@
#region 鍚堟垚鐗╁搧UI
for (i = 0; i < previewItemlist.Count; i++)
{
+ int[] makeIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.MakeIds);
GameObject gridCell = previewItemlist[i].transform.Find("GridCell").gameObject;
- if (i < composeWinModel.makeIDs.Length)
+ if (i < makeIds.Length)
{
- RefreshGridCellUI(gridCell, false, composeWinModel.makeIDs[i],NeedMatType.MakeItem);
+ RefreshGridCellUI(gridCell, false,makeIds[i],NeedMatType.MakeItem);
}
else
{
@@ -376,8 +376,13 @@
#endregion
#region 鍥哄畾閬撳叿鍜屼笉鍥哄畾閬撳叿UI
+ int[] fixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedDisplay);
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
+ int[] unfixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.UnfixedIds);
+ int[] unfixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.UnfixedDisplay);
- for(i = 0;i < sourceItemlist.Count; i++)
+ for (i = 0;i < sourceItemlist.Count; i++)
{
GameObject gridCell = sourceItemlist[i].transform.Find("GridCell").gameObject;
Text putInText = sourceItemlist[i].transform.Find("PutInText").GetComponent<Text>();
@@ -387,36 +392,23 @@
posBtn.RemoveAllListeners();
}
- fixedItemIndexDict.Clear();
- for (i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
+ for (i = 0; i < fixedDisplay.Length; i++)
{
- if (composeWinModel.fixedItemDisplay[i] != 0)
+ if (fixedDisplay[i] != 0)
{
- GameObject matPos = sourceItemlist[composeWinModel.fixedItemDisplay[i] - 1];
+ GameObject matPos = sourceItemlist[fixedDisplay[i] - 1];
GameObject gridCell = matPos.transform.Find("GridCell").gameObject;
Text putInText = matPos.transform.Find("PutInText").GetComponent<Text>();
putInText.gameObject.SetActive(false);
- RefreshGridCellUI(gridCell,false,composeWinModel.costfixedItemIDs[i],NeedMatType.fixedItem);
-
- List<int> itemIndexlist = null;
- SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
- if(singlePack != null)
- {
- itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i]);
- }
-
- if (itemIndexlist != null)
- {
- fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
- }
+ RefreshGridCellUI(gridCell,false,fixedIds[i],NeedMatType.fixedItem);
}
}
- for (i = 0; i < composeWinModel.unfixedItemDisplay.Length; i++)
+ for (i = 0; i < unfixedDisplay.Length; i++)
{
- if (composeWinModel.unfixedItemDisplay[i] != 0)
+ if (unfixedDisplay[i] != 0)
{
- GameObject matPos = sourceItemlist[composeWinModel.unfixedItemDisplay[i] - 1];
+ GameObject matPos = sourceItemlist[unfixedDisplay[i] - 1];
GameObject gridCell = matPos.transform.Find("GridCell").gameObject;
Text putInText = matPos.transform.Find("PutInText").GetComponent<Text>();
Button posBtn = matPos.GetComponent<Button>();
@@ -516,22 +508,24 @@
if(matType == NeedMatType.fixedItem)
{
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
itemCell.countText.gameObject.SetActive(true);
int haveCount = playerPack.GetItemCountByID(PackType.rptItem,itemId);
int i = 0;
- for(i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
+ for(i = 0; i < fixedIds.Length; i++)
{
- if(composeWinModel.costfixedItemIDs[i] == itemId)
+ if(fixedIds[i] == itemId)
{
- if (haveCount >= composeWinModel.costfixedItemCounts[i])
+ if (haveCount >= fixedCounts[i])
{
itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green,haveCount.ToString()),
- "/",composeWinModel.costfixedItemCounts[i].ToString());
+ "/",fixedCounts[i].ToString());
}
else
{
itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red, haveCount.ToString()),
- "/", composeWinModel.costfixedItemCounts[i].ToString());
+ "/", fixedCounts[i].ToString());
}
break;
}
@@ -549,75 +543,79 @@
private void ClickAllComposeBtn()
{
- List<int> composeCountlist = new List<int>();
fixedItemIndexDict.Clear();
- SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
- if(composeWinModel.costfixedItemIDs != null)
- {
- for (int i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
- {
- int haveCount = playerPack.GetItemCountByID(PackType.rptItem, composeWinModel.costfixedItemIDs[i]);
- int canComposeCount = haveCount / composeWinModel.costfixedItemCounts[i];
- composeCountlist.Add(canComposeCount);
- List<int> itemIndexlist = null;
- if (singlePack != null)
- {
- itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i] * canComposeCount);
- }
- fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
- }
+ if (compoundModel == null) return;
- composeCountlist.Sort();
- int composeCnt = 0;
- for (int i = composeCountlist[0]; i > -1; i--)
+ List<int> composeCountlist = new List<int>();
+ SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
+ for (int i = 0; i < fixedIds.Length; i++)
+ {
+ int haveCount = playerPack.GetItemCountByID(PackType.rptItem, fixedIds[i]);
+ int canComposeCount = haveCount / fixedCounts[i];
+ composeCountlist.Add(canComposeCount);
+ List<int> itemIndexlist = null;
+ if (singlePack != null)
{
- ulong needMoney = (ulong)(i * compoundModel.money);
- if (UIHelper.GetMoneyCnt(3) >= needMoney)
- {
- composeCnt = i;
- break;
- }
+ itemIndexlist = singlePack.ItemIndexlist(fixedIds[i], fixedCounts[i] * canComposeCount);
}
- composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict, composeEffect, composeCnt);
+ fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
}
+
+ composeCountlist.Sort();
+ int composeCnt = 0;
+ for (int i = composeCountlist[0]; i > -1; i--)
+ {
+ ulong needMoney = (ulong)(i * compoundModel.money);
+ if (UIHelper.GetMoneyCnt(3) >= needMoney)
+ {
+ composeCnt = i;
+ break;
+ }
+ }
+ composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict, composeEffect, composeCnt);
}
private void OnClickComposeBtn()
{
+ if (compoundModel == null) return;
+
SetFixedItemIndexDic();
composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict,composeEffect,1);
}
private void SetFixedItemIndexDic()
{
+ fixedItemIndexDict.Clear();
SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
- if (singlePack == null) return;
+ if (singlePack == null || compoundModel == null) return;
int minBindCnt = 0;
int minNoBindCnt = 0;
composeWinModel.GetBindOrNoBindMinCnt(out minBindCnt,out minNoBindCnt);
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
- fixedItemIndexDict.Clear();
-
- for (int i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
+ for (int i = 0; i < fixedIds.Length; i++)
{
List<int> itemIndexlist = null;
- if (minBindCnt >= composeWinModel.costfixedItemCounts[i])
+ if (minBindCnt >= fixedCounts[i])
{
- itemIndexlist = singlePack.ItemIndexlistByIsBind(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i], 1);
+ itemIndexlist = singlePack.ItemIndexlistByIsBind(fixedIds[i],fixedCounts[i], 1);
}
- else if(minNoBindCnt >= composeWinModel.costfixedItemCounts[i])
+ else if(minNoBindCnt >= fixedCounts[i])
{
- itemIndexlist = singlePack.ItemIndexlistByIsBind(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i],0);
+ itemIndexlist = singlePack.ItemIndexlistByIsBind(fixedIds[i],fixedCounts[i],0);
}
else
{
- itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i]);
+ itemIndexlist = singlePack.ItemIndexlist(fixedIds[i],fixedCounts[i]);
}
if (itemIndexlist != null)
{
- fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
+ fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
}
}
diff --git a/System/Compose/New/ComposeToolsWin.cs b/System/Compose/New/ComposeToolsWin.cs
index 06e2ebe..2eaf6f7 100644
--- a/System/Compose/New/ComposeToolsWin.cs
+++ b/System/Compose/New/ComposeToolsWin.cs
@@ -96,8 +96,7 @@
protected override void OnPreOpen()
{
DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent += OnComposeAnswer;
- composeWinModel.funcType = ComposeFuncType.Item;
- firstTypeDict = composeWinModel.GetFirstTypeModel();
+ firstTypeDict = composeWinModel.GetFirstTypeModel((int)ComposeFuncType.Item);
bool isJumpTo = false;
if (AchievementGoto.guideAchievementId != 0)
{
@@ -107,7 +106,7 @@
isJumpTo = true;
curSecondType = composeWinModel.secondType;
curThirdType = composeWinModel.thirdType;
- secondTypeDict = composeWinModel.GetSecondTypeModel(composeWinModel.secondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Item,composeWinModel.secondType);
ClickSecondTypeUICtrl();
composeWinModel.ResetJumpToModel();
}
@@ -119,7 +118,7 @@
isJumpTo = true;
curSecondType = composeWinModel.secondType;
curThirdType = composeWinModel.thirdType;
- secondTypeDict = composeWinModel.GetSecondTypeModel(composeWinModel.secondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Item, composeWinModel.secondType);
ClickSecondTypeUICtrl();
composeWinModel.ResetJumpToModel();
}
@@ -138,7 +137,7 @@
isJumpTo = true;
curSecondType = second;
curThirdType = int.Parse(thirdType);
- secondTypeDict = composeWinModel.GetSecondTypeModel(second);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Item, second);
ClickSecondTypeUICtrl();
composeWinModel.ResetJumpToModel();
break;
@@ -163,7 +162,7 @@
{
isJumpTo = false;
bool isCanCompose = true;
- if (!composeWinModel.IsEnoughFixedMat() || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
+ if (!composeWinModel.IsEnoughFixedMat(compoundModel) || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
{
MessageWin.Inst.ShowFixedTip(Language.Get("Compose101"));
isCanCompose = false;
@@ -280,7 +279,7 @@
{
arrowIcon.transform.localRotation = Quaternion.Euler(0, 0, -90);
icon.SetSprite("ComposeFirstClassChoosebtn");
- secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Item, curSecondType);
//ClickSecondTypeUICtrl();
}
else
@@ -302,7 +301,7 @@
if (curThirdType == cell.index)
{
icon.SetSprite("ChildListBtn_Select");
- thirdTypelist = composeWinModel.GetThirdTypeModellist(cell.index);
+ thirdTypelist = composeWinModel.GetThirdTypeModellist(compoundModel.firstType,compoundModel.secondType,cell.index);
RefreshUI(compoundModel);
}
else
@@ -322,7 +321,7 @@
private void OnClickSecondType(int secondType)
{
curSecondType = secondType;
- secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Item, curSecondType);
foreach (var thirdType in secondTypeDict.Keys)
{
if (thirdType != 0)
@@ -399,11 +398,12 @@
#region 鍚堟垚鐗╁搧UI
for (i = 0; i < previewItemlist.Count; i++)
{
+ int[] makeIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.MakeIds);
GameObject gridCell = previewItemlist[i].transform.Find("GridCell").gameObject;
- if (i < composeWinModel.makeIDs.Length)
+ if (i < makeIds.Length)
{
- RefreshGridCellUI(gridCell, false, composeWinModel.makeIDs[i],NeedMatType.MakeItem);
+ RefreshGridCellUI(gridCell, false,makeIds[i],NeedMatType.MakeItem);
}
else
{
@@ -413,8 +413,12 @@
#endregion
#region 鍥哄畾閬撳叿鍜屼笉鍥哄畾閬撳叿UI
-
- for(i = 0;i < sourceItemlist.Count; i++)
+ int[] fixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedDisplay);
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
+ int[] unfixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.UnfixedIds);
+ int[] unfixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.UnfixedDisplay);
+ for (i = 0;i < sourceItemlist.Count; i++)
{
GameObject gridCell = sourceItemlist[i].transform.Find("GridCell").gameObject;
Text putInText = sourceItemlist[i].transform.Find("PutInText").GetComponent<Text>();
@@ -423,32 +427,24 @@
RefreshGridCellUI(gridCell, true);
posBtn.RemoveAllListeners();
}
-
- fixedItemIndexDict.Clear();
- for (i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
+
+ for (i = 0; i < fixedDisplay.Length; i++)
{
- if (composeWinModel.fixedItemDisplay[i] != 0)
+ if (fixedDisplay[i] != 0)
{
- GameObject matPos = sourceItemlist[composeWinModel.fixedItemDisplay[i] - 1];
+ GameObject matPos = sourceItemlist[fixedDisplay[i] - 1];
GameObject gridCell = matPos.transform.Find("GridCell").gameObject;
Text putInText = matPos.transform.Find("PutInText").GetComponent<Text>();
putInText.gameObject.SetActive(false);
- RefreshGridCellUI(gridCell,false,composeWinModel.costfixedItemIDs[i],NeedMatType.fixedItem);
- List<int> itemIndexlist = null;
- SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
- if (singlePack != null)
- {
- itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i]);
- }
- fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
+ RefreshGridCellUI(gridCell,false,fixedIds[i],NeedMatType.fixedItem);
}
}
- for (i = 0; i < composeWinModel.unfixedItemDisplay.Length; i++)
+ for (i = 0; i < unfixedDisplay.Length; i++)
{
- if (composeWinModel.unfixedItemDisplay[i] != 0)
+ if (unfixedDisplay[i] != 0)
{
- GameObject matPos = sourceItemlist[composeWinModel.unfixedItemDisplay[i] - 1];
+ GameObject matPos = sourceItemlist[unfixedDisplay[i] - 1];
GameObject gridCell = matPos.transform.Find("GridCell").gameObject;
Text putInText = matPos.transform.Find("PutInText").GetComponent<Text>();
Button posBtn = matPos.GetComponent<Button>();
@@ -547,22 +543,24 @@
if(matType == NeedMatType.fixedItem)
{
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
itemCell.countText.gameObject.SetActive(true);
int haveCount = playerPack.GetItemCountByID(PackType.rptItem,itemId);
int i = 0;
- for(i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
+ for(i = 0; i < fixedIds.Length; i++)
{
- if(composeWinModel.costfixedItemIDs[i] == itemId)
+ if(fixedIds[i] == itemId)
{
- if (haveCount >= composeWinModel.costfixedItemCounts[i])
+ if (haveCount >= fixedCounts[i])
{
itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green,haveCount.ToString()),
- "/",composeWinModel.costfixedItemCounts[i].ToString());
+ "/",fixedCounts[i].ToString());
}
else
{
itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red, haveCount.ToString()),
- "/", composeWinModel.costfixedItemCounts[i].ToString());
+ "/",fixedCounts[i].ToString());
}
break;
}
@@ -580,67 +578,71 @@
private void OnClickComposeBtn()
{
+ if (compoundModel == null) return;
+
SetFixedItemIndexDic();
composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict,composeEffect,1);
}
private void SetFixedItemIndexDic()
{
+ fixedItemIndexDict.Clear();
SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
- if (singlePack == null) return;
+ if (singlePack == null || compoundModel == null) return;
int minBindCnt = 0;
int minNoBindCnt = 0;
composeWinModel.GetBindOrNoBindMinCnt(out minBindCnt, out minNoBindCnt);
-
- fixedItemIndexDict.Clear();
-
- for (int i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id,DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
+ for (int i = 0; i < fixedIds.Length; i++)
{
List<int> itemIndexlist = null;
- if (minBindCnt >= composeWinModel.costfixedItemCounts[i])
+ if (minBindCnt >= fixedCounts[i])
{
- itemIndexlist = singlePack.ItemIndexlistByIsBind(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i], 1);
+ itemIndexlist = singlePack.ItemIndexlistByIsBind(fixedIds[i],fixedCounts[i], 1);
}
- else if (minNoBindCnt >= composeWinModel.costfixedItemCounts[i])
+ else if (minNoBindCnt >= fixedCounts[i])
{
- itemIndexlist = singlePack.ItemIndexlistByIsBind(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i], 0);
+ itemIndexlist = singlePack.ItemIndexlistByIsBind(fixedIds[i],fixedCounts[i], 0);
}
else
{
- itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i]);
+ itemIndexlist = singlePack.ItemIndexlist(fixedIds[i],fixedCounts[i]);
}
if (itemIndexlist != null)
{
- fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
+ fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
}
}
}
private void OnClickComposeAllBtn()
- {
+ {
+ if (compoundModel == null) return;
+
List<int> composeCountlist = new List<int>();
fixedItemIndexDict.Clear();
SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
- if(composeWinModel.costfixedItemIDs != null)
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
+
+ for (int i = 0; i < fixedIds.Length; i++)
{
- for (int i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
+ int haveCount = playerPack.GetItemCountByID(PackType.rptItem,fixedIds[i]);
+ int canComposeCount = haveCount / fixedCounts[i];
+ composeCountlist.Add(canComposeCount);
+ List<int> itemIndexlist = null;
+ if (singlePack != null)
{
- int haveCount = playerPack.GetItemCountByID(PackType.rptItem, composeWinModel.costfixedItemIDs[i]);
- int canComposeCount = haveCount / composeWinModel.costfixedItemCounts[i];
- composeCountlist.Add(canComposeCount);
- List<int> itemIndexlist = null;
- if (singlePack != null)
- {
- itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i] * canComposeCount);
- }
- fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
+ itemIndexlist = singlePack.ItemIndexlist(fixedIds[i],fixedCounts[i] * canComposeCount);
}
- composeCountlist.Sort();
- composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict, composeEffect,composeCountlist[0]);
- }
+ fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
+ }
+ composeCountlist.Sort();
+ composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict, composeEffect, composeCountlist[0]);
}
private void OnComposeAnswer(HA814_tagMCMakeItemAnswer answer)
diff --git a/System/Compose/New/ComposeWinModel.cs b/System/Compose/New/ComposeWinModel.cs
index c332335..2993978 100644
--- a/System/Compose/New/ComposeWinModel.cs
+++ b/System/Compose/New/ComposeWinModel.cs
@@ -73,7 +73,6 @@
{
SetComposeTypeRed();
RefreshComposeRed();
- funcType = ComposeFuncType.Wings;
playerPack.RefreshItemCountAct -= OnItemCntRefresh;
playerPack.RefreshItemCountAct += OnItemCntRefresh;
PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerLvUpdate;
@@ -109,24 +108,33 @@
}
return false;
}
- public Dictionary<int, Dictionary<int, List<ItemCompoundConfig>>> GetFirstTypeModel()
+
+ public Dictionary<int, Dictionary<int, List<ItemCompoundConfig>>> GetFirstTypeModel(int firstType)
{
firstTypeDict = null;
- firstTypeDict = ItemCompoundConfig.GetFirstComposeTypeDict((int)funcType);
+ firstTypeDict = ItemCompoundConfig.GetFirstComposeTypeDict((int)firstType);
return firstTypeDict;
}
- public Dictionary<int, List<ItemCompoundConfig>> GetSecondTypeModel(int secondType)
+ public Dictionary<int, List<ItemCompoundConfig>> GetSecondTypeModel(int firstType,int secondType)
{
+ GetFirstTypeModel(firstType);
secondTypeDict = null;
- firstTypeDict.TryGetValue(secondType, out secondTypeDict);
+ if (firstTypeDict != null)
+ {
+ firstTypeDict.TryGetValue(secondType, out secondTypeDict);
+ }
return secondTypeDict;
}
- public List<ItemCompoundConfig> GetThirdTypeModellist(int thirdType)
+ public List<ItemCompoundConfig> GetThirdTypeModellist(int firstType,int secondType,int thirdType)
{
List<ItemCompoundConfig> modellist = null;
- secondTypeDict.TryGetValue(thirdType, out modellist);
+ GetSecondTypeModel(firstType, secondType);
+ if(secondTypeDict != null)
+ {
+ secondTypeDict.TryGetValue(thirdType, out modellist);
+ }
return modellist;
}
@@ -148,24 +156,10 @@
return itemId;
}
- public int[] makeIDs { get; private set; }
- public int[] unfixedItemIDs { get; private set; }
- public int[] costfixedItemIDs { get; private set; }
- public int[] costfixedItemCounts { get; private set; }
- public int[] unfixedItemDisplay { get; private set; }
- public int[] fixedItemDisplay { get; private set; }
-
public ItemCompoundConfig CurComposeModel { get; private set; }
-
public void SetCurComposeModel(ItemCompoundConfig compoundModel)
{
CurComposeModel = compoundModel;
- makeIDs = ConfigParse.GetMultipleStr<int>(compoundModel.makeID);
- unfixedItemIDs = ConfigParse.GetMultipleStr<int>(compoundModel.unfixedItemID);
- costfixedItemIDs = ConfigParse.GetMultipleStr<int>(compoundModel.itemID);
- costfixedItemCounts = ConfigParse.GetMultipleStr<int>(compoundModel.itemCount);
- unfixedItemDisplay = ConfigParse.GetMultipleStr<int>(compoundModel.unfixedItemDisplay);
- fixedItemDisplay = ConfigParse.GetMultipleStr<int>(compoundModel.itemDisplay);
}
public bool IsEnoughUnfixedMat(ItemCompoundConfig compoundModel)
@@ -177,12 +171,15 @@
return true;
}
- public bool IsEnoughFixedMat()
+ public bool IsEnoughFixedMat(ItemCompoundConfig config)
{
- for ( int i = 0; i < costfixedItemCounts.Length; i++)
+ if (config == null) return false;
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(config.id,DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(config.id, DisplayItemArray.FixedCounts);
+ for ( int i = 0; i < fixedCounts.Length; i++)
{
- int haveCount = playerPack.GetItemCountByID(PackType.rptItem, costfixedItemIDs[i]);
- if (haveCount < costfixedItemCounts[i])
+ int haveCount = playerPack.GetItemCountByID(PackType.rptItem,fixedIds[i]);
+ if (haveCount < fixedCounts[i])
{
return false;
}
@@ -225,12 +222,14 @@
return;
}
- for (i = 0; i < costfixedItemCounts.Length; i++)
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
+ for (i = 0; i < fixedCounts.Length; i++)
{
- int haveCount = playerPack.GetItemCountByID(PackType.rptItem, costfixedItemIDs[i]);
- if (haveCount < costfixedItemCounts[i])
+ int haveCount = playerPack.GetItemCountByID(PackType.rptItem,fixedIds[i]);
+ if (haveCount < fixedCounts[i])
{
- ItemConfig fixedConfig = Config.Instance.Get<ItemConfig>(costfixedItemIDs[i]);
+ ItemConfig fixedConfig = Config.Instance.Get<ItemConfig>(fixedIds[i]);
if (fixedConfig.GetWay.Length < 1)
{
ItemAttrData attrData = new ItemAttrData(fixedConfig.ID);
@@ -460,10 +459,10 @@
noBindCnt = fixedMatIsBindDict[idlist[0]][0];
}
- int remainBind = bindCnt % costfixedItemCounts[0];
- int remainNOBind = noBindCnt % costfixedItemCounts[0];
- bindCnt = bindCnt / costfixedItemCounts[0];
- noBindCnt = noBindCnt / costfixedItemCounts[0];
+ int remainBind = bindCnt % fixedCounts[0];
+ int remainNOBind = noBindCnt % fixedCounts[0];
+ bindCnt = bindCnt / fixedCounts[0];
+ noBindCnt = noBindCnt / fixedCounts[0];
if (bindCnt + noBindCnt < composeCount)
{
bindCnt = composeCount - noBindCnt;
@@ -618,7 +617,9 @@
private string GetComposeInfoStr(int bindCnt,int noBindCnt)
{
- ItemConfig config = Config.Instance.Get<ItemConfig>(makeIDs[0]);
+ if (CurComposeModel == null) return string.Empty;
+ int[] makeIds = ItemCompoundConfig.GetDisplayArrayByType(CurComposeModel.id,DisplayItemArray.MakeIds);
+ ItemConfig config = Config.Instance.Get<ItemConfig>(makeIds[0]);
StringBuilder stringBuilder = new StringBuilder();
if (bindCnt > 0)
{
@@ -675,15 +676,15 @@
{
minBindCnt = 0;
minNoBindCnt = 0;
- if (costfixedItemIDs == null) return;
+ if (CurComposeModel == null) return;
Dictionary<int, int> bindCntDic = new Dictionary<int, int>();
Dictionary<int, int> noBindCntDic = new Dictionary<int, int>();
-
- for (int i = 0; i < costfixedItemIDs.Length;i++)
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(CurComposeModel.id,DisplayItemArray.FixedIds);
+ for (int i = 0; i < fixedIds.Length;i++)
{
List<ItemModel> list = null;
- playerPack.GetSinglePackModel(PackType.rptItem).GetItemCountByID(costfixedItemIDs[i],out list);
+ playerPack.GetSinglePackModel(PackType.rptItem).GetItemCountByID(fixedIds[i],out list);
if(list != null)
{
int bindCnt = 0;
@@ -700,8 +701,8 @@
noBindCnt += list[j].itemInfo.ItemCount;
}
}
- bindCntDic.Add(costfixedItemIDs[i], bindCnt);
- noBindCntDic.Add(costfixedItemIDs[i], noBindCnt);
+ bindCntDic.Add(fixedIds[i], bindCnt);
+ noBindCntDic.Add(fixedIds[i], noBindCnt);
}
}
@@ -855,8 +856,8 @@
this.secondType = secondType;
this.thirdType = thirdType;
funcType = type;
- GetFirstTypeModel();
- Dictionary<int, List<ItemCompoundConfig>> dict = GetSecondTypeModel(secondType);
+ GetFirstTypeModel((int)type);
+ Dictionary<int, List<ItemCompoundConfig>> dict = GetSecondTypeModel((int)type,secondType);
if(dict == null)
{
SysNotifyMgr.Instance.ShowTip("FuncLimit_Level");
@@ -926,10 +927,9 @@
List<ItemCompoundConfig> compoundlist = firstDict[3][thirdType];
for(int i = 0; i < compoundlist.Count; i++)
{
- SetCurComposeModel(compoundlist[i]);
int makeID = ConfigParse.GetMultipleStr<int>(compoundlist[i].makeID)[i];
string key = StringUtility.Contact(3, 10, thirdType);
- if (IsComposeJobLimit(makeID) && IsEnoughFixedMat())
+ if (IsComposeJobLimit(makeID) && IsEnoughFixedMat(compoundlist[i]))
{
if (thirdTypeRedDict[key].state != RedPointState.Simple)
{
@@ -971,3 +971,13 @@
addItem,
}
+public enum DisplayItemArray
+{
+ MakeIds,
+ UnfixedIds,
+ FixedIds,
+ FixedCounts,
+ UnfixedDisplay,
+ FixedDisplay,
+}
+
diff --git a/System/Compose/New/ComposeWingsWin.cs b/System/Compose/New/ComposeWingsWin.cs
index 503c384..0ac146f 100644
--- a/System/Compose/New/ComposeWingsWin.cs
+++ b/System/Compose/New/ComposeWingsWin.cs
@@ -114,8 +114,7 @@
UIEventTrigger.Get(helpBtn.gameObject).OnDown = OnClickHelpBtn;
UIEventTrigger.Get(helpBtn.gameObject).OnUp = OnDownUp;
- composeWinModel.funcType = ComposeFuncType.Wings;
- firstTypeDict = composeWinModel.GetFirstTypeModel();
+ firstTypeDict = composeWinModel.GetFirstTypeModel((int)ComposeFuncType.Wings);
bool isJumpTo = false;
SuccessConfig successConfig = Config.Instance.Get<SuccessConfig>(AchievementGoto.guideAchievementId);
if (successConfig != null && successConfig.Type == 69)
@@ -123,7 +122,7 @@
isJumpTo = true;
curSecondType = composeWinModel.secondType;
curThirdType = composeWinModel.thirdType;
- secondTypeDict = composeWinModel.GetSecondTypeModel(composeWinModel.secondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Wings,composeWinModel.secondType);
ClickSecondTypeUICtrl();
composeWinModel.ResetJumpToModel();
}
@@ -134,7 +133,7 @@
isJumpTo = true;
curSecondType = composeWinModel.secondType;
curThirdType = composeWinModel.thirdType;
- secondTypeDict = composeWinModel.GetSecondTypeModel(composeWinModel.secondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Wings, composeWinModel.secondType);
ClickSecondTypeUICtrl();
composeWinModel.ResetJumpToModel();
}
@@ -155,7 +154,7 @@
{
isJumpTo = false;
bool isCanCompose = true;
- if(!composeWinModel.IsEnoughFixedMat() || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
+ if(!composeWinModel.IsEnoughFixedMat(compoundModel) || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
{
MessageWin.Inst.ShowFixedTip(Language.Get("Compose101"));
isCanCompose = false;
@@ -260,7 +259,7 @@
{
icon.SetSprite("ComposeFirstClassChoosebtn");
arrowIcon.transform.localRotation = Quaternion.Euler(0,0,-90);
- secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Wings, curSecondType);
//ClickSecondTypeUICtrl();
}
else
@@ -278,7 +277,7 @@
if (curThirdType == cell.index)
{
icon.SetSprite("ChildListBtn_Select");
- thirdTypelist = composeWinModel.GetThirdTypeModellist(cell.index);
+ thirdTypelist = composeWinModel.GetThirdTypeModellist(compoundModel.firstType, compoundModel.secondType, cell.index);
RefreshUI(compoundModel);
}
else
@@ -293,7 +292,7 @@
private void OnClickSecondType(int secondType)
{
curSecondType = secondType;
- secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
+ secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Wings, curSecondType);
foreach(var thirdType in secondTypeDict.Keys)
{
if(thirdType != 0)
@@ -376,10 +375,11 @@
#region 鍚堟垚鐗╁搧UI
for (i = 0; i < previewItemlist.Count; i++)
{
+ int[] makeIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.MakeIds);
GameObject gridCell = previewItemlist[i].transform.Find("GridCell").gameObject;
- if (i < composeWinModel.makeIDs.Length)
+ if (i < makeIds.Length)
{
- RefreshGridCellUI(gridCell, false, composeWinModel.makeIDs[i],NeedMatType.MakeItem);
+ RefreshGridCellUI(gridCell, false, makeIds[i],NeedMatType.MakeItem);
}
else
{
@@ -389,8 +389,12 @@
#endregion
#region 鍥哄畾閬撳叿鍜屼笉鍥哄畾閬撳叿UI
-
- for(i = 0;i < sourceItemlist.Count; i++)
+ int[] fixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedDisplay);
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
+ int[] unfixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.UnfixedIds);
+ int[] unfixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.UnfixedDisplay);
+ for (i = 0;i < sourceItemlist.Count; i++)
{
GameObject gridCell = sourceItemlist[i].transform.Find("GridCell").gameObject;
Text putInText = sourceItemlist[i].transform.Find("PutInText").GetComponent<Text>();
@@ -400,23 +404,23 @@
RefreshGridCellUI(gridCell,true);
}
- for (i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
+ for (i = 0; i < fixedDisplay.Length; i++)
{
- if (composeWinModel.fixedItemDisplay[i] != 0)
+ if (fixedDisplay[i] != 0)
{
- GameObject matPos = sourceItemlist[composeWinModel.fixedItemDisplay[i] - 1];
+ GameObject matPos = sourceItemlist[fixedDisplay[i] - 1];
GameObject gridCell = matPos.transform.Find("GridCell").gameObject;
Text putInText = matPos.transform.Find("PutInText").GetComponent<Text>();
putInText.gameObject.SetActive(false);
- RefreshGridCellUI(gridCell,false,composeWinModel.costfixedItemIDs[i],NeedMatType.fixedItem);
+ RefreshGridCellUI(gridCell,false,fixedIds[i],NeedMatType.fixedItem);
}
}
- for (i = 0; i < composeWinModel.unfixedItemDisplay.Length; i++)
+ for (i = 0; i < unfixedDisplay.Length; i++)
{
- if (composeWinModel.unfixedItemDisplay[i] != 0)
+ if (unfixedDisplay[i] != 0)
{
- GameObject matPos = sourceItemlist[composeWinModel.unfixedItemDisplay[i] - 1];
+ GameObject matPos = sourceItemlist[unfixedDisplay[i] - 1];
GameObject gridCell = matPos.transform.Find("GridCell").gameObject;
Text putInText = matPos.transform.Find("PutInText").GetComponent<Text>();
Button posBtn = matPos.GetComponent<Button>();
@@ -545,22 +549,24 @@
if (matType == NeedMatType.fixedItem)
{
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
itemCell.countText.gameObject.SetActive(true);
int haveCount = playerPack.GetItemCountByID(PackType.rptItem,itemId);
int i = 0;
- for(i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
+ for(i = 0; i < fixedIds.Length; i++)
{
- if(composeWinModel.costfixedItemIDs[i] == itemId)
+ if(fixedIds[i] == itemId)
{
- if (haveCount >= composeWinModel.costfixedItemCounts[i])
+ if (haveCount >= fixedCounts[i])
{
itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green,haveCount.ToString()),
- "/",composeWinModel.costfixedItemCounts[i].ToString());
+ "/",fixedCounts[i].ToString());
}
else
{
itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red, haveCount.ToString()),
- "/", composeWinModel.costfixedItemCounts[i].ToString());
+ "/", fixedCounts[i].ToString());
}
break;
}
@@ -628,7 +634,7 @@
private bool ChangeFixedMatUI()
{
SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
- if (singlePack == null) return false;
+ if (singlePack == null || compoundModel == null) return false;
bool isBind = false;
Dictionary<int,ItemModel> unfixedMatDict = selectModel.GetHaveUnfixedSelectItem();
@@ -640,13 +646,16 @@
break;
}
}
- for (int i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
+ int[] fixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedDisplay);
+ for (int i = 0; i < fixedDisplay.Length; i++)
{
- if (composeWinModel.fixedItemDisplay[i] != 0)
+ if (fixedDisplay[i] != 0)
{
- GameObject matPos = sourceItemlist[composeWinModel.fixedItemDisplay[i] - 1];
+ GameObject matPos = sourceItemlist[fixedDisplay[i] - 1];
ItemCell itemCell = matPos.transform.Find("GridCell/ItemCell").GetComponent<ItemCell>();
- int fixedId = composeWinModel.costfixedItemIDs[i];
+ int fixedId = fixedIds[i];
itemCell.bindIcon.gameObject.SetActive(false);
if (isBind)
{
@@ -743,7 +752,7 @@
{
fixedItemIndexDict.Clear();
SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
- if (singlePack == null) return;
+ if (singlePack == null || compoundModel == null) return;
int isBind = 0;
if(IsComposeBind)
@@ -754,13 +763,14 @@
{
isBind = 0;
}
-
- for(int i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
+ int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
+ for (int i = 0; i < fixedIds.Length; i++)
{
- List<int> itemIndexlist = singlePack.ItemIndexlistByIsBind(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i],isBind);
+ List<int> itemIndexlist = singlePack.ItemIndexlistByIsBind(fixedIds[i], fixedCounts[i],isBind);
if (itemIndexlist != null)
{
- fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
+ fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
}
}
@@ -768,7 +778,10 @@
private UIEffect GetPlayMatEffect()
{
- int matTypeCnt = compoundModel.unfixedItemCount + composeWinModel.costfixedItemIDs.Length;
+ if(compoundModel == null) return null;
+
+ int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id,DisplayItemArray.FixedIds);
+ int matTypeCnt = compoundModel.unfixedItemCount + fixedIds.Length;
switch (matTypeCnt)
{
case 1:
@@ -789,12 +802,13 @@
if (answer.Result == 1)
{
successEffect.Play();
+ int[] makeIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id,DisplayItemArray.MakeIds);
for (int i = 0; i < previewItemlist.Count; i++)
{
UIEffect targetEffect = previewItemlist[i].transform.Find("GridCell/TargetEffect").GetComponent<UIEffect>();
- if (i < composeWinModel.makeIDs.Length)
+ if (i < makeIds.Length)
{
- if(composeWinModel.makeIDs[i] == answer.MakeItemID)
+ if(makeIds[i] == answer.MakeItemID)
{
targetEffect.Play();
break;
diff --git a/System/Compose/New/SelectEquipModel.cs b/System/Compose/New/SelectEquipModel.cs
index 136c51c..4edb59e 100644
--- a/System/Compose/New/SelectEquipModel.cs
+++ b/System/Compose/New/SelectEquipModel.cs
@@ -57,9 +57,10 @@
public Dictionary<int, ItemModel> GetUnfixedItemModel()
{
SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
- if (singlePack == null)
+ if (singlePack == null || composeWinModel.CurComposeModel == null)
return null;
+ int[] unfixedIds = ItemCompoundConfig.GetDisplayArrayByType(composeWinModel.CurComposeModel.id,DisplayItemArray.UnfixedIds);
allBagItemInfo = singlePack.GetPackModelIndexDict();
_unfixedItemDict.Clear();
foreach (int key in allBagItemInfo.Keys)
@@ -67,9 +68,9 @@
if (!haveUnfixedSelectItemDic.ContainsKey(key))
{
int i = 0;
- for (i = 0; i < composeWinModel.unfixedItemIDs.Length; i++)
+ for (i = 0; i < unfixedIds.Length; i++)
{
- if (composeWinModel.unfixedItemIDs[i] == allBagItemInfo[key].itemInfo.ItemID)
+ if (unfixedIds[i] == allBagItemInfo[key].itemInfo.ItemID)
{
_unfixedItemDict.Add(key, allBagItemInfo[key]);
break;
diff --git a/System/FairyAu/PlayerFairyAuTreasureData.cs b/System/FairyAu/PlayerFairyAuTreasureData.cs
index 0568908..4b5060b 100644
--- a/System/FairyAu/PlayerFairyAuTreasureData.cs
+++ b/System/FairyAu/PlayerFairyAuTreasureData.cs
@@ -57,6 +57,7 @@
public static event OnFamilyStoreItemInfo Event_FamilyStoreItemInfo;//浠撳簱淇℃伅鐨勫埛鏂�
public int _FairyAuIntegral = 0;//鑾峰彇浠欑洘绉垎
+ public int JumpItemID = 0;//璺宠浆鑾峰彇ID
public override void Init()
{
diff --git a/System/FairyAu/WarehouseGrid.cs b/System/FairyAu/WarehouseGrid.cs
index 30fee79..bf9306a 100644
--- a/System/FairyAu/WarehouseGrid.cs
+++ b/System/FairyAu/WarehouseGrid.cs
@@ -13,7 +13,7 @@
[SerializeField] GameObject m_ItemBG;
[SerializeField] ItemCell m_ItemCell;
[SerializeField] GameObject m_Lllume;
-
+ [SerializeField] UIEffect m_uieffect;
public GameObject ItemBG
{
get { return m_ItemBG; }
@@ -31,6 +31,11 @@
get { return m_Lllume; }
set { m_Lllume = value; }
}
+ public UIEffect Uieffect
+ {
+ get { return m_uieffect; }
+ set { m_uieffect = value; }
+ }
}
}
diff --git a/System/FairyAu/WarehouseTipsWin.cs b/System/FairyAu/WarehouseTipsWin.cs
index ed2dd5c..6a256ef 100644
--- a/System/FairyAu/WarehouseTipsWin.cs
+++ b/System/FairyAu/WarehouseTipsWin.cs
@@ -80,6 +80,7 @@
int Item_lv = 0;//鏍囪鐗╁搧闃舵暟
int Item_Color = 0;//鏍囪鐗╁搧棰滆壊
private Dictionary<int, bool> _EquipmentArray = new Dictionary<int, bool>();//鐢ㄦ潵瀛樺偍闇�瑕侀攢姣佺殑瑁呭涓嬫爣
+ private Dictionary<int, int> DicHighlight = new Dictionary<int, int>();//闇�瑕侀珮浜殑鐗╁搧
int _indexList = 0;//鏍囪闇�瑕佸厬鎹㈢殑鏁扮粍涓嬫爣
int _WPID = 0;//鐢ㄦ潵鏍囪闇�瑕佸厬鎹㈢殑鐗╁搧ID
private int SpiritPetDan = 0;
@@ -123,6 +124,7 @@
_CleanBtn.gameObject.SetActive(true);
_WarehouseCountBG.SetActive(true);
_CountText.text = playerFairyAuTreasureData._FairyAuIntegral.ToString();
+ SetItemID();//鑾峰彇楂樹寒鐗规晥鐗╁搧ID
base.OnCreateGridLineCell(_GridlineCtrl);
}
@@ -135,6 +137,10 @@
protected override void OnPreClose()
{
+ if (playerFairyAuTreasureData.JumpItemID != 0)
+ {
+ playerFairyAuTreasureData.JumpItemID = 0;
+ }
}
protected override void OnAfterClose()
@@ -159,10 +165,17 @@
WarehouseGrid warehouseGrid = cell.transform.GetChild(childCode).GetComponent<WarehouseGrid>();
int cellCount = (cell.transform.childCount) * gridlineIndex + (childCode + 1);
warehouseGrid.ItemCell.gameObject.SetActive(false);
+ warehouseGrid.Uieffect.gameObject.SetActive(false);
if (cellCount - 1 < playerFairyAuTreasureData._DicfamilyStoreItem.Count)
{
warehouseGrid.ItemCell.gameObject.SetActive(true);
- FamilyStoreItem itemModel = playerFairyAuTreasureData._DicfamilyStoreItem[_listArray[cellCount - 1]];
+ int _IndexKey = _listArray[cellCount - 1];
+ FamilyStoreItem itemModel = playerFairyAuTreasureData._DicfamilyStoreItem[_IndexKey];
+ if (DicHighlight.ContainsKey(_IndexKey))//闇�瑕侀�変腑鐨勭壒鏁�
+ {
+ warehouseGrid.Uieffect.gameObject.SetActive(true);
+ warehouseGrid.Uieffect.Play();
+ }
ItemCellModel cellModel = new ItemCellModel(itemModel.ItemID, false, 0, 0, "", PackType.rptDeleted, true, itemModel._UserData);
warehouseGrid.ItemCell.Init(cellModel);
if (AchievementGoto.achievementType == AchievementGoto.SpiritPetDan)//鍏戞崲鐏靛疇涓癸紙221锛�
@@ -181,12 +194,12 @@
AchievementGuideEffect1.transform.SetParentEx(warehouseGrid.ItemCell.transform, Vector3.zero, Vector3.zero, Vector3.one);
}
}
- int _int = _listArray[cellCount - 1];
- LightUpJudgment(warehouseGrid.Lllume, _bool, playerFairyAuTreasureData._DicfamilyStoreItem[(_listArray[cellCount - 1])].Index);
+
+ LightUpJudgment(warehouseGrid.Lllume, _bool, playerFairyAuTreasureData._DicfamilyStoreItem[_IndexKey].Index);
warehouseGrid.ItemCell.cellBtn.RemoveAllListeners();
warehouseGrid.ItemCell.cellBtn.AddListener(() =>
{
- TypeJudgment(warehouseGrid.Lllume, _bool, (int)itemModel.ItemID, playerFairyAuTreasureData._DicfamilyStoreItem[(_listArray[cellCount - 1])].Index);
+ TypeJudgment(warehouseGrid.Lllume, _bool, (int)itemModel.ItemID, playerFairyAuTreasureData._DicfamilyStoreItem[_IndexKey].Index);
});
}
else
@@ -418,11 +431,11 @@
}
#region//涓�鎺ㄧ殑Toggle
- void IsNoConentA(Toggle toogleA )
+ void IsNoConentA(Toggle toogleA)
{
for (int i = 0; i < _ContentOne.childCount; i++)
{
-
+
if (_ContentOne.GetChild(i).GetComponent<Toggle>().name == toogleA.name)
{
_ContentOne.GetChild(i).GetComponent<Toggle>().isOn = true;
@@ -433,11 +446,11 @@
}
}
}
- void IsNoConentB(Toggle ToogleB )
+ void IsNoConentB(Toggle ToogleB)
{
for (int i = 0; i < _ContentTwo.childCount; i++)
{
-
+
if (_ContentTwo.GetChild(i).GetComponent<Toggle>().name == ToogleB.name)
{
_ContentTwo.GetChild(i).GetComponent<Toggle>().isOn = true;
@@ -895,6 +908,7 @@
{
_listArray.Add(key);
}
+ SetItemID();//鑾峰彇楂樹寒鐗规晥鐗╁搧ID
_GridlineCtrl.m_Scorller.RefreshActiveCellViews();//鍒锋柊褰撳墠鍙
}
void FamilyActionInfo()
@@ -982,6 +996,41 @@
}
return _DicConditions;
}
+
+ private void SetItemID()//鑾峰彇鐗╁搧ID
+ {
+ DicHighlight.Clear();//闇�瑕佷寒鐨勪粨搴撶墿鍝佷笅鏍�
+ int Order = 0;//闃舵暟
+ int Color = 0;//棰滆壊
+ int Star = 0;//棰滆壊
+ if (playerFairyAuTreasureData.JumpItemID == 0)
+ {
+ return;
+ }
+ int ItemId = playerFairyAuTreasureData.JumpItemID;
+ var itemconfig = Config.Instance.Get<ItemConfig>(ItemId);
+ if (itemconfig.EquipPlace == 0 && itemconfig.EquipPlace > 10)
+ {
+ return;
+ }
+ Order = itemconfig.LV;
+ Color = itemconfig.ItemColor;
+ Star = itemconfig.StarLevel;
+ foreach (var key in playerFairyAuTreasureData._DicfamilyStoreItem.Keys)
+ {
+ var item_config = Config.Instance.Get<ItemConfig>(key);
+ if (item_config.EquipPlace == 0 && item_config.EquipPlace > 10)
+ {
+ continue;
+ }
+ if (item_config.LV >= Order && item_config.ItemColor >= Color
+ && item_config.StarLevel >= Star && PlayerDatas.Instance.baseData.Job == item_config.JobLimit / 100)
+ {
+ DicHighlight.Add(key,1);
+ }
+ }
+
+ }
}
}
--
Gitblit v1.8.0