|
@@ -18,6 +18,10 @@ namespace GFGGame
|
|
|
return _dressUpObj;
|
|
|
}
|
|
|
}
|
|
|
+ private static int _stepIndex = -1;
|
|
|
+ public static int stepIndex { get { return _stepIndex; } }
|
|
|
+ private static List<DressUpData> _dressMemory = new List<DressUpData>();
|
|
|
+ public const int MAX_MEMORY_STEP = 20;//最大记录步数
|
|
|
|
|
|
public static CustomSuitData GetCurSuitDataClone(int index)
|
|
|
{
|
|
@@ -64,7 +68,7 @@ namespace GFGGame
|
|
|
{
|
|
|
isShangYi = true;
|
|
|
}
|
|
|
- if(itemCfg.subType == ConstDressUpItemType.NEI_DA && itemCfg.id != ConstItemID.DEFULT_NEI_DA)
|
|
|
+ if (itemCfg.subType == ConstDressUpItemType.NEI_DA && itemCfg.id != ConstItemID.DEFULT_NEI_DA)
|
|
|
{
|
|
|
isShangYi = true;
|
|
|
}
|
|
@@ -111,113 +115,6 @@ namespace GFGGame
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
- // public static void PutOnRecommendItems()
|
|
|
- // {
|
|
|
- // List<int> recommendList = DressUpMenuItemDataManager.GetRecommendItemList();
|
|
|
- // StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
|
|
|
- // StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
- // int liangyiqunIndex = -1;
|
|
|
- // int shangyiIndex = -1;
|
|
|
- // int xiazhuangIndex = -1;
|
|
|
- // int neidaIndex = -1;
|
|
|
- // for (int i = 0; i < recommendList.Count; i++)
|
|
|
- // {
|
|
|
- // int subType = ItemUtilCS.GetItemSubType(recommendList[i]);
|
|
|
- // if (subType == ConstDressUpItemType.LIAN_YI_QUN)
|
|
|
- // {
|
|
|
- // liangyiqunIndex = i;
|
|
|
- // continue;
|
|
|
- // }
|
|
|
- // if (subType == ConstDressUpItemType.SHANG_YI)
|
|
|
- // {
|
|
|
- // shangyiIndex = i;
|
|
|
- // continue;
|
|
|
- // }
|
|
|
- // if (subType == ConstDressUpItemType.XIA_ZHUANG)
|
|
|
- // {
|
|
|
- // xiazhuangIndex = i;
|
|
|
- // continue;
|
|
|
- // }
|
|
|
- // if (subType == ConstDressUpItemType.NEI_DA)
|
|
|
- // {
|
|
|
- // neidaIndex = i;
|
|
|
- // continue;
|
|
|
-
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // if (liangyiqunIndex >= 0 && (shangyiIndex >= 0 || xiazhuangIndex >= 0))
|
|
|
- // {
|
|
|
- // if (shangyiIndex < 0 && xiazhuangIndex >= 0) recommendList.RemoveAt(xiazhuangIndex);//上衣下装只有一件,则保留连衣裙
|
|
|
- // if (xiazhuangIndex < 0 && shangyiIndex >= 0) recommendList.RemoveAt(shangyiIndex);
|
|
|
-
|
|
|
- // if (shangyiIndex >= 0 && xiazhuangIndex >= 0)//同时拥有上衣、下装、连衣裙
|
|
|
- // {
|
|
|
- // int lianyiqunScore = ItemDataManager.GetItemAdditionScore(recommendList[liangyiqunIndex], InstanceZonesDataManager.currentScoreType);
|
|
|
- // int shangyiScore = ItemDataManager.GetItemAdditionScore(recommendList[shangyiIndex], InstanceZonesDataManager.currentScoreType);
|
|
|
- // int xiazhuangScore = ItemDataManager.GetItemAdditionScore(recommendList[xiazhuangIndex], InstanceZonesDataManager.currentScoreType);
|
|
|
- // int neidaScore = neidaIndex >= 0 ? ItemDataManager.GetItemAdditionScore(recommendList[neidaIndex], InstanceZonesDataManager.currentScoreType) : 0;
|
|
|
- // int subType = ItemUtilCS.GetItemSubType(fightCfg.needItemId);
|
|
|
- // if (fightCfg.needItemId > 0 && recommendList.IndexOf(fightCfg.needItemId) >= 0 && (subType == ConstDressUpItemType.SHANG_YI || subType == ConstDressUpItemType.XIA_ZHUANG || subType == ConstDressUpItemType.NEI_DA || subType == ConstDressUpItemType.LIAN_YI_QUN))//推荐列表里有必需品且,必需品类型为上衣或下装或连衣裙,有先穿戴必须品,其次穿戴高分服装
|
|
|
- // {
|
|
|
- // if (subType == ConstDressUpItemType.LIAN_YI_QUN)
|
|
|
- // {
|
|
|
- // shangyiIndex = CheckIndex(ConstDressUpItemType.SHANG_YI, recommendList);
|
|
|
- // if (shangyiIndex >= 0) recommendList.RemoveAt(shangyiIndex);
|
|
|
- // xiazhuangIndex = CheckIndex(ConstDressUpItemType.XIA_ZHUANG, recommendList);
|
|
|
- // if (xiazhuangIndex >= 0) recommendList.RemoveAt(xiazhuangIndex);
|
|
|
- // neidaIndex = CheckIndex(ConstDressUpItemType.NEI_DA, recommendList);
|
|
|
- // if (neidaIndex >= 0) recommendList.RemoveAt(neidaIndex);
|
|
|
- // }
|
|
|
- // else if (subType == ConstDressUpItemType.SHANG_YI || subType == ConstDressUpItemType.XIA_ZHUANG || subType == ConstDressUpItemType.NEI_DA)
|
|
|
- // {
|
|
|
- // liangyiqunIndex = CheckIndex(ConstDressUpItemType.LIAN_YI_QUN, recommendList);
|
|
|
- // if (liangyiqunIndex >= 0) recommendList.RemoveAt(liangyiqunIndex);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // if (lianyiqunScore > shangyiScore + xiazhuangScore + neidaScore)
|
|
|
- // {
|
|
|
- // shangyiIndex = CheckIndex(ConstDressUpItemType.SHANG_YI, recommendList);
|
|
|
- // if (shangyiIndex >= 0) recommendList.RemoveAt(shangyiIndex);
|
|
|
- // xiazhuangIndex = CheckIndex(ConstDressUpItemType.XIA_ZHUANG, recommendList);
|
|
|
- // if (xiazhuangIndex >= 0) recommendList.RemoveAt(xiazhuangIndex);
|
|
|
- // neidaIndex = CheckIndex(ConstDressUpItemType.NEI_DA, recommendList);
|
|
|
- // if (neidaIndex >= 0) recommendList.RemoveAt(neidaIndex);
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // liangyiqunIndex = CheckIndex(ConstDressUpItemType.LIAN_YI_QUN, recommendList);
|
|
|
- // if (liangyiqunIndex >= 0) recommendList.RemoveAt(liangyiqunIndex);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // //推荐搭配自动穿必穿品
|
|
|
- // if (fightCfg.needItemId > 0 && DressUpMenuItemDataManager.CheckHasItem(fightCfg.needItemId) && recommendList.IndexOf(fightCfg.needItemId) < 0)
|
|
|
- // {
|
|
|
- // int subType = ItemUtilCS.GetItemSubType(fightCfg.needItemId);
|
|
|
- // for (int i = 0; i < recommendList.Count; i++)
|
|
|
- // {
|
|
|
- // int recommendSubType = ItemUtilCS.GetItemSubType(recommendList[i]);
|
|
|
- // if (recommendSubType == subType)
|
|
|
- // {
|
|
|
- // recommendList.RemoveAt(i);
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // recommendList.Add(fightCfg.needItemId);
|
|
|
- // }
|
|
|
- // else if (fightCfg.needSuitId > 0 && DressUpMenuSuitDataManager.CheckHaveSuit(fightCfg.needSuitId))
|
|
|
- // {
|
|
|
- // recommendList.Clear();
|
|
|
- // SuitCfg cfg = SuitCfgArray.Instance.GetCfg(fightCfg.needSuitId);
|
|
|
- // recommendList.AddRange(cfg.partsArr);
|
|
|
- // }
|
|
|
- // dressUpObj.PutOnItemList(recommendList);
|
|
|
- // }
|
|
|
-
|
|
|
public static void PutOnRecommendItems2()
|
|
|
{
|
|
|
Dictionary<int, List<int>> itemsDic = GetRecommendItems();
|
|
@@ -421,19 +318,48 @@ namespace GFGGame
|
|
|
items.AddRange(ornamentItems);
|
|
|
return items;
|
|
|
}
|
|
|
- private static int CheckIndex(int _subType, List<int> recommendList)
|
|
|
+
|
|
|
+
|
|
|
+ public static bool OnClickBtnLastStep()
|
|
|
{
|
|
|
- for (int i = 0; i < recommendList.Count; i++)
|
|
|
- {
|
|
|
- int itemSubType = ItemUtilCS.GetItemSubType(recommendList[i]);
|
|
|
- if (itemSubType == _subType)
|
|
|
- {
|
|
|
- return i;
|
|
|
+ if (_stepIndex - 1 < 0) return false;
|
|
|
+ _stepIndex--;
|
|
|
+ MyDressUpHelper.dressUpObj.PutOnDressUpData(_dressMemory[_stepIndex]);
|
|
|
+ // _ui.m_comboBox.selectedIndex = _dressMemory[_stepIndex].pos;
|
|
|
+ // UpdateStepBtn();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ public static bool OnClickBtnNextStep()
|
|
|
+ {
|
|
|
+ if (_stepIndex + 1 >= MAX_MEMORY_STEP) return false;
|
|
|
+ _stepIndex++;
|
|
|
+ MyDressUpHelper.dressUpObj.PutOnDressUpData(_dressMemory[_stepIndex]);
|
|
|
+ // _ui.m_comboBox.selectedIndex = _dressMemory[_stepIndex].pos;
|
|
|
+ // UpdateStepBtn();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ public static void AddMemoryDressup()
|
|
|
+ {
|
|
|
+ _stepIndex++;
|
|
|
+ if (_stepIndex == MAX_MEMORY_STEP)
|
|
|
+ {
|
|
|
+ _stepIndex = MAX_MEMORY_STEP - 1;
|
|
|
+ _dressMemory.RemoveAt(0);
|
|
|
+ }
|
|
|
+ if (_dressMemory.Count > _stepIndex)
|
|
|
+ {
|
|
|
+ _dressMemory.RemoveRange(_stepIndex, _dressMemory.Count - _stepIndex);
|
|
|
}
|
|
|
- return -1;
|
|
|
+ _dressMemory.Add(MyDressUpHelper.dressUpObj.DressUpDataClone());
|
|
|
+ // UpdateStepBtn();
|
|
|
}
|
|
|
|
|
|
+ public static void ResetMemory()
|
|
|
+ {
|
|
|
+ DressUpMenuItemDataManager.Clear();
|
|
|
+ _stepIndex = -1;
|
|
|
+ _dressMemory.Clear();
|
|
|
+ }
|
|
|
}
|
|
|
}
|