Browse Source

换装部件标记新获得

zhaoyang 3 years ago
parent
commit
8a5f9e0b8b

+ 1 - 1
FGUIProject/assets/CommonGame/package.xml

@@ -147,7 +147,7 @@
     <image id="uo1t9n" name="tctc_anniu_1.png" path="/images/"/>
     <image id="uo1t9o" name="tctc_anniu_2.png" path="/images/"/>
     <component id="ojlzh" name="ComStar.xml" path="/components/" exported="true"/>
-    <image id="pzq19p" name="cj_hd_xin.png" path="/imagesExport/"/>
+    <image id="pzq19p" name="cj_hd_xin.png" path="/imagesExport/" exported="true"/>
     <image id="g3nf9q" name="jinbi_1.png" path="/imgItemIcon/"/>
     <component id="g3nf9r" name="FunctionOpenUI.xml" path="/" exported="true"/>
     <image id="g3nf9t" name="js_icon_.png" path="/imgFunIcon/" exported="true"/>

+ 1 - 0
FGUIProject/assets/DressUp/components/PartsListItem.xml

@@ -12,5 +12,6 @@
     <loader id="n5_8xpg" name="ScoreType" xy="19,125" size="50,50" touchable="false" url="ui://eg2y0ldp842s6h" fill="scale"/>
     <text id="n6_8xpg" name="txtScore" xy="66,128" pivot="0.5,0" size="77,41" fontSize="30" color="#fcf7e6" align="center" strokeColor="#a7854a" strokeSize="2" autoClearText="true" text="3500"/>
     <image id="n8_pjip" name="imgNeed" src="pjip2z" fileName="images/hz_bcbc_1.png" xy="2,63"/>
+    <image id="n10_ovm4" name="imgNew" src="pzq19p" fileName="imagesExport/cj_hd_xin.png" pkg="eg2y0ldp" xy="142,107" alpha="0"/>
   </displayList>
 </component>

+ 1 - 0
FGUIProject/assets/DressUp/components/TypeItem.xml

@@ -3,5 +3,6 @@
   <displayList>
     <loader id="n0_k6he" name="icon" xy="14,0" size="128,161" url="ui://mbo439wbq08x9" align="center" vAlign="middle" autoSize="true" playing="false" clearOnPublish="true"/>
     <image id="n3_pjip" name="imgNeed" src="pjip2z" fileName="images/hz_bcbc_1.png" xy="0,0"/>
+    <image id="n4_ovm4" name="imgNew" src="pzq19p" fileName="imagesExport/cj_hd_xin.png" pkg="eg2y0ldp" xy="-6,63" alpha="0"/>
   </displayList>
 </component>

+ 59 - 3
GameClient/Assets/Game/HotUpdate/Data/DressUpMenuItemDataManager.cs

@@ -21,6 +21,8 @@ namespace GFGGame
 
         private static List<int> _itemDatas = new List<int>();
 
+        private static Dictionary<int, List<int>> _newItemdata = new Dictionary<int, List<int>>();
+
         public static void InitData()
         {
             _itemDatas.Clear();
@@ -30,6 +32,7 @@ namespace GFGGame
             selectRarityList.Clear();
             selectScoreList.Clear();
             selectTagList.Clear();
+            _newItemdata.Clear();
         }
         public static void Add(int value)
         {
@@ -43,12 +46,14 @@ namespace GFGGame
                 if (!_itemDatas.Contains(value))
                 {
                     _itemDatas.Add(value);
+                    if (GameGlobal.DataInited)
+                    {
+                        AddNewDressItem(value);
+                    }
                     DressUpMenuSuitDataManager.CheckItemInSuit(value);
                 }
             }
-
         }
-
         public static bool CheckHasItem(int itemID)
         {
             return _itemDatas.Contains(itemID);
@@ -157,6 +162,10 @@ namespace GFGGame
             {
                 ItemCfg itemCfgA = ItemCfgArray.Instance.GetCfg(a);
                 ItemCfg itemCfgB = ItemCfgArray.Instance.GetCfg(b);
+                if (CheckIsDressItemNew(b) && !CheckIsDressItemNew(a))
+                {
+                    return 1;
+                }
                 if (itemCfgB.rarity > itemCfgA.rarity)
                 {
                     return 1;
@@ -176,6 +185,10 @@ namespace GFGGame
             {
                 ItemCfg itemCfgA = ItemCfgArray.Instance.GetCfg(a);
                 ItemCfg itemCfgB = ItemCfgArray.Instance.GetCfg(b);
+                if (CheckIsDressItemNew(b) && !CheckIsDressItemNew(a))
+                {
+                    return 1;
+                }
                 if (itemCfgB.rarity < itemCfgA.rarity)
                 {
                     return 1;
@@ -287,7 +300,6 @@ namespace GFGGame
             return score;
         }
 
-
         public static List<int> DressSearch(List<int> list, bool isTaoZhuang)
         {
             List<int> searchList = new List<int>();
@@ -442,5 +454,49 @@ namespace GFGGame
             }
             return isTag;
         }
+
+
+        private static void AddNewDressItem(int value)
+        {
+            int subType = ItemUtilCS.GetItemSubType(value);
+            if (!_newItemdata.ContainsKey(subType))
+            {
+                _newItemdata.Add(subType, new List<int>());
+            }
+            _newItemdata[subType].Add(value);
+        }
+        public static void RemoveNewDressItem(int subType, int itemId)
+        {
+            if (_newItemdata.ContainsKey(subType) && _newItemdata[subType].IndexOf(itemId) >= 0)
+            {
+                _newItemdata[subType].Remove(itemId);
+            }
+        }
+        public static bool CheckIsSubtypeNew(int subType)
+        {
+            DressUpMenuItemCfg1 cfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(subType);
+
+            if (_newItemdata.ContainsKey(subType) && _newItemdata.Count > 0)
+            {
+                return true;
+            }
+            else 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;
+                    }
+                }
+            }
+            return false;
+        }
+        public static bool CheckIsDressItemNew(int itemId)
+        {
+            int subType = ItemUtilCS.GetItemSubType(itemId);
+            return _newItemdata.ContainsKey(subType) && _newItemdata[subType].IndexOf(itemId) >= 0;
+        }
     }
 }

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DressUp/UI_PartsListItem.cs

@@ -15,6 +15,7 @@ namespace UI.DressUp
         public GLoader m_ScoreType;
         public GTextField m_txtScore;
         public GImage m_imgNeed;
+        public GImage m_imgNew;
         public const string URL = "ui://mbo439wbk6he26";
         public const string PACKAGE_NAME = "DressUp";
         public const string RES_NAME = "PartsListItem";
@@ -70,6 +71,7 @@ namespace UI.DressUp
             m_ScoreType = (GLoader)comp.GetChild("ScoreType");
             m_txtScore = (GTextField)comp.GetChild("txtScore");
             m_imgNeed = (GImage)comp.GetChild("imgNeed");
+            m_imgNew = (GImage)comp.GetChild("imgNew");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -81,6 +83,7 @@ namespace UI.DressUp
             m_ScoreType = null;
             m_txtScore = null;
             m_imgNeed = null;
+            m_imgNew = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DressUp/UI_TypeItem.cs

@@ -9,6 +9,7 @@ namespace UI.DressUp
         public GComponent target;
         public GLoader m_icon;
         public GImage m_imgNeed;
+        public GImage m_imgNew;
         public const string URL = "ui://mbo439wbk6he16";
         public const string PACKAGE_NAME = "DressUp";
         public const string RES_NAME = "TypeItem";
@@ -58,11 +59,13 @@ namespace UI.DressUp
         {
             m_icon = (GLoader)comp.GetChild("icon");
             m_imgNeed = (GImage)comp.GetChild("imgNeed");
+            m_imgNew = (GImage)comp.GetChild("imgNew");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_icon = null;
             m_imgNeed = null;
+            m_imgNew = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 5 - 0
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -693,6 +693,7 @@ namespace GFGGame
             //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
             typeItem.target.data = item1.id;
             typeItem.m_imgNeed.visible = ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, item1.id);
+            typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSubtypeNew(item1.id);
             UI_TypeItem.ProxyEnd();
         }
 
@@ -705,6 +706,8 @@ namespace GFGGame
             typeItem.target.data = item2.id;
             var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
             typeItem.m_imgNeed.visible = subType == item2.type;
+            typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSubtypeNew(item2.id);
+
             UI_TypeItem.ProxyEnd();
         }
 
@@ -734,6 +737,8 @@ namespace GFGGame
                 listItem.m_iconSelected.visible = EquipDataCache.cacher.CheckDressUpItemIsOn(id);
                 listItem.m_txtScore.text = "" + DressUpMenuItemDataManager.GetItemScore(id);
                 listItem.m_loaBorder.url = "ui://DressUp/hz_kuangk_" + itemCfg.rarity;
+                listItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsDressItemNew(id);
+                DressUpMenuItemDataManager.RemoveNewDressItem(_currentMenuType, id);
 
                 RarityIconController.UpdateRarityIcon(listItem.m_rarity, id, false);
                 ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType);

+ 6 - 0
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpView.cs

@@ -499,6 +499,8 @@ namespace GFGGame
             //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
             typeItem.target.data = item1.id;
             typeItem.m_imgNeed.visible = false;
+            typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSubtypeNew(item1.id);
+
             UI_TypeItem.ProxyEnd();
         }
 
@@ -510,6 +512,8 @@ namespace GFGGame
             //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
             typeItem.target.data = item2.id;
             typeItem.m_imgNeed.visible = false;
+            typeItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsSubtypeNew(item2.id);
+
             UI_TypeItem.ProxyEnd();
 
         }
@@ -550,6 +554,8 @@ namespace GFGGame
                 ItemDataManager.GetMainScore(id, out mainScore, out mainValuel);
                 listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + mainScore);
 
+                listItem.m_imgNew.visible = DressUpMenuItemDataManager.CheckIsDressItemNew(id);
+                DressUpMenuItemDataManager.RemoveNewDressItem(_currentMenuType, id);
             }
             if (listItem.target.data == null)
             {

BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0.png


BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes


BIN
GameClient/Assets/ResIn/UI/DressUp/DressUp_fui.bytes