|
@@ -280,26 +280,29 @@ namespace GFGGame
|
|
|
private void UpdateConsume()
|
|
|
{
|
|
|
int consumeId;
|
|
|
- int[][] itemsArr;
|
|
|
+ int arrLength = 0;
|
|
|
int consumeCount;
|
|
|
DecomposeCfg cfg = DecomposeCfgArray.Instance.GetCfg(_curRarity);
|
|
|
if (_ui.m_c1.selectedIndex == 0)
|
|
|
{
|
|
|
DecomposeCfg decomposeCfg = DecomposeCfgArray.Instance.GetCfg(_curRarity);
|
|
|
consumeId = decomposeCfg.consumeId;
|
|
|
- itemsArr = decomposeCfg.itemsArr;
|
|
|
+ if(_decomposeCount > 0)
|
|
|
+ arrLength = decomposeCfg.itemsArr.Length;
|
|
|
+ else if(_decoNormalCount > 0)
|
|
|
+ arrLength = decomposeCfg.items2Arr.Length;
|
|
|
consumeCount = decomposeCfg.consumeCount;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
DecomposeSkillCfg decomposeSkillCfg = DecomposeSkillCfgArray.Instance.GetCfg(_curRarity);
|
|
|
consumeId = decomposeSkillCfg.consumeId;
|
|
|
- itemsArr = decomposeSkillCfg.itemsArr;
|
|
|
+ arrLength = decomposeSkillCfg.itemsArr.Length;
|
|
|
consumeCount = decomposeSkillCfg.consumeCount;
|
|
|
}
|
|
|
|
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(consumeId);
|
|
|
- _ui.m_listReward.numItems = (_decomposeCount + _decoNormalCount) > 0 ? itemsArr.Length : 0;
|
|
|
+ _ui.m_listReward.numItems = (_decomposeCount + _decoNormalCount) > 0 ? arrLength : 0;
|
|
|
_ui.m_txtShow.text = string.Format("* 分解{0}件{1}可获得 *", StringUtil.GetColorText((_decomposeCount + _decoNormalCount).ToString(), "#DA826E"), ConstDressRarity.DressRarityList()[_curRarity]);
|
|
|
ET.Log.Debug("分解消耗: " + consumeId + " 找不到物品配置");
|
|
|
if (itemCfg == null)
|
|
@@ -313,26 +316,39 @@ namespace GFGGame
|
|
|
private void ListRewardItemRander(int index, GObject obj)
|
|
|
{
|
|
|
UI_ListRewardItem item = UI_ListRewardItem.Proxy(obj);
|
|
|
- int[][] itemsArr;
|
|
|
+ int itemId = 0;
|
|
|
+ long itemNum = 0;
|
|
|
if (_ui.m_c1.selectedIndex == 0)
|
|
|
{
|
|
|
DecomposeCfg decomposeCfg = DecomposeCfgArray.Instance.GetCfg(_curRarity);
|
|
|
-
|
|
|
- if (index + 1 <= _decomposeCount)
|
|
|
- itemsArr = decomposeCfg.itemsArr;
|
|
|
- else
|
|
|
- itemsArr = decomposeCfg.items2Arr;
|
|
|
+ if (_decomposeCount > 0) {
|
|
|
+ itemId = decomposeCfg.itemsArr[index][0];
|
|
|
+ }
|
|
|
+ itemNum = decomposeCfg.itemsArr[index][1] * _decomposeCount;
|
|
|
+ if (_decoNormalCount > 0) {
|
|
|
+ if (itemId == 0) {
|
|
|
+ itemId = decomposeCfg.items2Arr[index][0];
|
|
|
+ itemNum = decomposeCfg.items2Arr[index][1] * _decoNormalCount;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ for (int i = 0; i < decomposeCfg.items2Arr.Length; i++) {
|
|
|
+ if (itemId == decomposeCfg.items2Arr[i][0])
|
|
|
+ {
|
|
|
+ itemNum = itemNum + decomposeCfg.items2Arr[i][1] * _decoNormalCount;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
DecomposeSkillCfg decomposeSkillCfg = DecomposeSkillCfgArray.Instance.GetCfg(_curRarity);
|
|
|
- itemsArr = decomposeSkillCfg.itemsArr;
|
|
|
+ itemId = decomposeSkillCfg.itemsArr[index][0];
|
|
|
+ itemNum = decomposeSkillCfg.itemsArr[index][1] * _decomposeCount;
|
|
|
}
|
|
|
- ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemsArr[index][0]);
|
|
|
- if (_ui.m_c1.selectedIndex == 0 && index + 1 > _decomposeCount)
|
|
|
- item.m_txtCount.text = (itemsArr[index][1] * _decoNormalCount).ToString();
|
|
|
- else
|
|
|
- item.m_txtCount.text = (itemsArr[index][1] * _decomposeCount).ToString();
|
|
|
+ ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
+ item.m_txtCount.text = itemNum.ToString();
|
|
|
string ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
|
|
|
item.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg.res, ext);
|
|
|
item.target.data = itemCfg;
|