|
@@ -26,13 +26,13 @@ namespace GFGGame
|
|
|
public static void InitData()
|
|
|
{
|
|
|
_itemDatas.Clear();
|
|
|
+ _newItemdata.Clear();
|
|
|
}
|
|
|
public static void Clear()
|
|
|
{
|
|
|
selectRarityList.Clear();
|
|
|
selectScoreList.Clear();
|
|
|
selectTagList.Clear();
|
|
|
- _newItemdata.Clear();
|
|
|
}
|
|
|
public static void Add(int value)
|
|
|
{
|
|
@@ -94,6 +94,13 @@ namespace GFGGame
|
|
|
{
|
|
|
arrayList.Sort((int a, int b) =>
|
|
|
{
|
|
|
+ bool isNewA = CheckIsDressUpItemNew(a);
|
|
|
+ bool isNewB = CheckIsDressUpItemNew(b);
|
|
|
+ if (isNewA != isNewB)
|
|
|
+ {
|
|
|
+ if (isNewA) return -1;
|
|
|
+ if (isNewB) return 1;
|
|
|
+ }
|
|
|
int scoreA = GetItemScore(a);
|
|
|
int scoreB = GetItemScore(b);
|
|
|
if (scoreB > scoreA)
|
|
@@ -112,6 +119,13 @@ namespace GFGGame
|
|
|
{
|
|
|
arrayList.Sort((int a, int b) =>
|
|
|
{
|
|
|
+ bool isNewA = CheckIsDressUpItemNew(a);
|
|
|
+ bool isNewB = CheckIsDressUpItemNew(b);
|
|
|
+ if (isNewA != isNewB)
|
|
|
+ {
|
|
|
+ if (isNewA) return -1;
|
|
|
+ if (isNewB) return 1;
|
|
|
+ }
|
|
|
int scoreA = GetItemScore(a);
|
|
|
int scoreB = GetItemScore(b);
|
|
|
if (scoreB < scoreA)
|
|
@@ -133,6 +147,7 @@ namespace GFGGame
|
|
|
{
|
|
|
int typeA = ItemUtilCS.GetItemSubType(a);
|
|
|
int typeB = ItemUtilCS.GetItemSubType(b);
|
|
|
+
|
|
|
int scoreA = GetItemScore(a);
|
|
|
int scoreB = GetItemScore(b);
|
|
|
if (typeB < typeA)
|
|
@@ -162,10 +177,14 @@ namespace GFGGame
|
|
|
{
|
|
|
ItemCfg itemCfgA = ItemCfgArray.Instance.GetCfg(a);
|
|
|
ItemCfg itemCfgB = ItemCfgArray.Instance.GetCfg(b);
|
|
|
- if (CheckIsDressItemNew(b) && !CheckIsDressItemNew(a))
|
|
|
+ bool isNewA = CheckIsDressUpItemNew(a);
|
|
|
+ bool isNewB = CheckIsDressUpItemNew(b);
|
|
|
+ if (isNewA != isNewB)
|
|
|
{
|
|
|
- return 1;
|
|
|
+ if (isNewA) return -1;
|
|
|
+ if (isNewB) return 1;
|
|
|
}
|
|
|
+
|
|
|
if (itemCfgB.rarity > itemCfgA.rarity)
|
|
|
{
|
|
|
return 1;
|
|
@@ -185,10 +204,14 @@ namespace GFGGame
|
|
|
{
|
|
|
ItemCfg itemCfgA = ItemCfgArray.Instance.GetCfg(a);
|
|
|
ItemCfg itemCfgB = ItemCfgArray.Instance.GetCfg(b);
|
|
|
- if (CheckIsDressItemNew(b) && !CheckIsDressItemNew(a))
|
|
|
+ bool isNewA = CheckIsDressUpItemNew(a);
|
|
|
+ bool isNewB = CheckIsDressUpItemNew(b);
|
|
|
+ if (isNewA != isNewB)
|
|
|
{
|
|
|
- return 1;
|
|
|
+ if (isNewA) return -1;
|
|
|
+ if (isNewB) return 1;
|
|
|
}
|
|
|
+
|
|
|
if (itemCfgB.rarity < itemCfgA.rarity)
|
|
|
{
|
|
|
return 1;
|
|
@@ -465,7 +488,7 @@ namespace GFGGame
|
|
|
}
|
|
|
|
|
|
|
|
|
- private static void AddNewDressItem(int value)
|
|
|
+ public static void AddNewDressItem(int value)
|
|
|
{
|
|
|
int subType = ItemUtilCS.GetItemSubType(value);
|
|
|
if (!_newItemdata.ContainsKey(subType))
|
|
@@ -474,36 +497,51 @@ namespace GFGGame
|
|
|
}
|
|
|
_newItemdata[subType].Add(value);
|
|
|
}
|
|
|
- public static void RemoveNewDressItem(int subType, int itemId)
|
|
|
+ public static void RemoveNewDressItem(int itemId)
|
|
|
{
|
|
|
+ int subType = ItemCfgArray.Instance.GetCfg(itemId).subType;
|
|
|
if (_newItemdata.ContainsKey(subType) && _newItemdata[subType].IndexOf(itemId) >= 0)
|
|
|
{
|
|
|
_newItemdata[subType].Remove(itemId);
|
|
|
}
|
|
|
}
|
|
|
- public static bool CheckIsSubtypeNew(int subType)
|
|
|
+ //检测一级菜单是否有展示新增
|
|
|
+ public static bool CheckIsFirstMenuNew(int menuId)
|
|
|
{
|
|
|
- DressUpMenuItemCfg1 cfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(subType);
|
|
|
+ if (_newItemdata.Count == 0) return false;
|
|
|
|
|
|
- if (_newItemdata.ContainsKey(subType) && _newItemdata.Count > 0)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- else if (cfg1.subMenusArr.Length > 0)
|
|
|
+ DressUpMenuItemCfg1 cfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuId);
|
|
|
+ if (cfg1.subMenusArr.Length > 0)//有二级菜单
|
|
|
{
|
|
|
foreach (int id2 in cfg1.subMenusArr)
|
|
|
{
|
|
|
- DressUpMenuItemCfg2 cfg2 = DressUpMenuItemCfg2Array.Instance.GetCfg(id2);
|
|
|
- if (cfg2.type == subType && _newItemdata.ContainsKey(subType) && _newItemdata.Count > 0)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ if (CheckIsSecondMenuNew(id2)) return true;
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (_newItemdata.ContainsKey(cfg1.type) && _newItemdata[cfg1.type].Count > 0) return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //检测二级菜单是否有展示新增
|
|
|
+ public static bool CheckIsSecondMenuNew(int subMenuId)
|
|
|
+ {
|
|
|
+ if (_newItemdata.Count == 0) return false;
|
|
|
+ DressUpMenuItemCfg2 cfg2 = DressUpMenuItemCfg2Array.Instance.GetCfg(subMenuId);
|
|
|
+
|
|
|
+ if (_newItemdata.ContainsKey(cfg2.type) && _newItemdata[cfg2.type].Count > 0)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
return false;
|
|
|
}
|
|
|
- public static bool CheckIsDressItemNew(int itemId)
|
|
|
+
|
|
|
+ //检测服装部件是否为新增
|
|
|
+ public static bool CheckIsDressUpItemNew(int itemId)
|
|
|
{
|
|
|
+ if (_newItemdata.Count == 0) return false;
|
|
|
int subType = ItemUtilCS.GetItemSubType(itemId);
|
|
|
return _newItemdata.ContainsKey(subType) && _newItemdata[subType].IndexOf(itemId) >= 0;
|
|
|
}
|