Explorar o código

补充服装合成的红点

leiyasi hai 1 ano
pai
achega
a8088dc2ee

+ 35 - 1
GameClient/Assets/Game/HotUpdate/Data/RedDotDataManager.cs

@@ -495,6 +495,7 @@ namespace GFGGame
         {
             return GetClothingSyntheticTabRed(1) || GetClothingSyntheticTabRed(2) || GetClothingSyntheticTabRed(3);
         }
+
         /// <summary>
         /// 服装合成页签红点
         /// </summary>
@@ -507,10 +508,11 @@ namespace GFGGame
             {
                 bool isLevelPass = InstanceZonesDataManager.CheckLevelPass(suitCfgs[i].syntheticStoryLevelId);
                 if (!isLevelPass) continue;
-                if (GetClothingSyntheticRed(suitCfgs[i].id)) return true;
+                if (GetClothingSyntheticRed(suitCfgs[i].id) || GetClothingSyntheticBonusRed(suitCfgs[i].id)) return true;
             }
             return false;
         }
+
         /// <summary>
         /// 服装合成红点
         /// </summary>
@@ -518,6 +520,7 @@ namespace GFGGame
         /// <returns></returns>
         public bool GetClothingSyntheticRed(int suitId)
         {
+            int status = DressUpMenuSuitDataManager.GetSuitSyntheticBonusStatus(suitId);
             SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId);
             if (suitCfg == null) return false;
             for (int i = 0; i < suitCfg.partsArr.Length; i++)
@@ -526,6 +529,37 @@ namespace GFGGame
             }
             return false;
         }
+
+        /// <summary>
+        /// 服装合成奖励红点
+        /// </summary>
+        /// <param name="suitId"></param>
+        /// <returns></returns>
+        public bool GetClothingSyntheticBonusRed(int suitId)
+        {
+            bool isLock = false;
+            int status = DressUpMenuSuitDataManager.GetSuitSyntheticBonusStatus(suitId);
+
+            SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId);
+            if (suitCfg.syntheticStoryLevelId > 0)
+            {
+                bool isLevelPass = InstanceZonesDataManager.CheckLevelPass(suitCfg.syntheticStoryLevelId);
+                if (!isLevelPass)
+                {
+                    isLock = true;
+                }
+            }
+            if (suitCfg.syntheticPreSuitId > 0)
+            {
+                bool hasPreSuit = DressUpMenuSuitDataManager.CheckHaveSuit(suitCfg.syntheticPreSuitId);
+                if (!hasPreSuit)
+                {
+                    isLock = true;
+                }
+            }
+            return status == ConstBonusStatus.CAN_GET && !isLock;
+        }
+
         /// <summary>
         /// 合成-服装部件红点
         /// </summary>

+ 74 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ClothingSynthetic/UI_BonusGift.cs

@@ -0,0 +1,74 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.ClothingSynthetic
+{
+    public partial class UI_BonusGift
+    {
+        public GComponent target;
+        public GLoader m_loaderBonusBox;
+        public GImage m_iconGot;
+        public const string URL = "ui://4f294tdk7fgk2l";
+        public const string PACKAGE_NAME = "ClothingSynthetic";
+        public const string RES_NAME = "BonusGift";
+        private static UI_BonusGift _proxy;
+
+        public static UI_BonusGift Create(GObject gObject = null)
+        {
+            var ui = new UI_BonusGift();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_BonusGift Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_BonusGift();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_loaderBonusBox = (GLoader)comp.GetChild("loaderBonusBox");
+            m_iconGot = (GImage)comp.GetChild("iconGot");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_loaderBonusBox = null;
+            m_iconGot = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ClothingSynthetic/UI_BonusGift.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d61951e2eb66bd746a3595ec383084a2
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 4 - 6
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ClothingSynthetic/UI_SuitListItem.cs

@@ -12,8 +12,7 @@ namespace UI.ClothingSynthetic
         public GTextField m_txtName;
         public GProgressBar m_progBar;
         public GLoader m_rarity;
-        public GLoader m_loaderBonusBox;
-        public GImage m_iconGot;
+        public UI_BonusGift m_bonusGift;
         public GImage m_imgLockBg;
         public GImage m_imgLock;
         public GTextField m_txtLockDesc;
@@ -70,8 +69,7 @@ namespace UI.ClothingSynthetic
             m_txtName = (GTextField)comp.GetChild("txtName");
             m_progBar = (GProgressBar)comp.GetChild("progBar");
             m_rarity = (GLoader)comp.GetChild("rarity");
-            m_loaderBonusBox = (GLoader)comp.GetChild("loaderBonusBox");
-            m_iconGot = (GImage)comp.GetChild("iconGot");
+            m_bonusGift = (UI_BonusGift)UI_BonusGift.Create(comp.GetChild("bonusGift"));
             m_imgLockBg = (GImage)comp.GetChild("imgLockBg");
             m_imgLock = (GImage)comp.GetChild("imgLock");
             m_txtLockDesc = (GTextField)comp.GetChild("txtLockDesc");
@@ -84,8 +82,8 @@ namespace UI.ClothingSynthetic
             m_txtName = null;
             m_progBar = null;
             m_rarity = null;
-            m_loaderBonusBox = null;
-            m_iconGot = null;
+            m_bonusGift.Dispose();
+            m_bonusGift = null;
             m_imgLockBg = null;
             m_imgLock = null;
             m_txtLockDesc = null;

+ 16 - 11
GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/SuitSyntheticView.cs

@@ -160,9 +160,9 @@ namespace GFGGame
             listItem.target.data = suitId;
             UpdateSuitBoxStatusView(listItem);
             int status = DressUpMenuSuitDataManager.GetSuitSyntheticBonusStatus(suitId);
-            RedDotController.Instance.SetComRedDot(listItem.target, status == ConstBonusStatus.CAN_GET && !isLock, "", -20, 670);
-            listItem.m_loaderBonusBox.onClick.Clear();
-            listItem.m_loaderBonusBox.onClick.Add(() =>
+
+            listItem.m_bonusGift.m_loaderBonusBox.onClick.Clear();
+            listItem.m_bonusGift.m_loaderBonusBox.onClick.Add(() =>
             {
                 SuitUtil.ShowSuitSyntheticBonus(suitId);
             });
@@ -174,7 +174,10 @@ namespace GFGGame
                     ViewManager.Show<ClothingSyntheticView>(new object[] { suitId }, new object[] { typeof(SuitSyntheticView).FullName, suitId });
                 }
             });
+            // 提示合成物品的红点
             RedDotController.Instance.SetComRedDot(listItem.target, RedDotDataManager.Instance.GetClothingSyntheticRed(suitId), "", 0, 0);
+            // 奖励红点
+            RedDotController.Instance.SetComRedDot(listItem.m_bonusGift.target, status == ConstBonusStatus.CAN_GET && !isLock, "", -13, -7);
             UI_SuitListItem.ProxyEnd();
         }
 
@@ -196,29 +199,31 @@ namespace GFGGame
 
         private void UpdateSuitBoxStatusView(UI_SuitListItem listItem)
         {
-            listItem.m_iconGot.visible = false;
+            UI_BonusGift bonusGift = UI_BonusGift.Proxy(listItem.m_bonusGift.target);
+            bonusGift.m_iconGot.visible = false;
             int suitId = (int)listItem.target.data;
             int status = DressUpMenuSuitDataManager.GetSuitSyntheticBonusStatus(suitId);
             if (status == ConstBonusStatus.CAN_GET)
             {
-                listItem.m_loaderBonusBox.grayed = false;
+                bonusGift.m_loaderBonusBox.grayed = false;
             }
             else
             {
-                listItem.m_loaderBonusBox.grayed = true;
+                bonusGift.m_loaderBonusBox.grayed = true;
                 if (status == ConstBonusStatus.GOT)
                 {
-                    listItem.m_iconGot.visible = true;
+                    bonusGift.m_iconGot.visible = true;
                 }
-                RedDotController.Instance.SetComRedDot(listItem.target, false, "", -20, 670);
+                RedDotController.Instance.SetComRedDot(listItem.m_bonusGift.target, false, "");
             }
+            UI_BonusGift.ProxyEnd();
         }
 
         private void UpdateRedDot()
         {
-            RedDotController.Instance.SetComRedDot(_ui.m_listMenu.GetChildAt(0).asCom, RedDotDataManager.Instance.GetClothingSyntheticTabRed(1), "", 0, 0);
-            RedDotController.Instance.SetComRedDot(_ui.m_listMenu.GetChildAt(1).asCom, RedDotDataManager.Instance.GetClothingSyntheticTabRed(2), "", 0, 0);
-            RedDotController.Instance.SetComRedDot(_ui.m_listMenu.GetChildAt(2).asCom, RedDotDataManager.Instance.GetClothingSyntheticTabRed(3), "", 0, 0);
+            RedDotController.Instance.SetComRedDot(_ui.m_listMenu.GetChildAt(0).asCom, RedDotDataManager.Instance.GetClothingSyntheticTabRed(1), "", 0, -6);
+            RedDotController.Instance.SetComRedDot(_ui.m_listMenu.GetChildAt(1).asCom, RedDotDataManager.Instance.GetClothingSyntheticTabRed(2), "", 0, -6);
+            RedDotController.Instance.SetComRedDot(_ui.m_listMenu.GetChildAt(2).asCom, RedDotDataManager.Instance.GetClothingSyntheticTabRed(3), "", 0, -6);
         }
 
         private void CheckGuide(object param)

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryDialogView.cs

@@ -447,7 +447,7 @@ namespace GFGGame
             if (effectInfo.Length > 0)
             {
                 // 等待CG播放完毕直接进入下一段
-                Timers.inst.StartCoroutine(WaitCGAnimFinish(int.Parse(effectInfo[1])));
+                Timers.inst.StartCoroutine(WaitCGAnimFinish(effectInfo[0], int.Parse(effectInfo[1])));
             }
 
             // 有对话
@@ -826,9 +826,9 @@ namespace GFGGame
             Timers.inst.Remove(ShowNextWords);
         }
 
-        private IEnumerator WaitCGAnimFinish(int times = 1)
+        private IEnumerator WaitCGAnimFinish(string resName, int times = 1)
         {
-            GameObject cg = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetStoryDialogCGPath("cg_libeihe"));
+            GameObject cg = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetStoryDialogCGPath(resName));
             Animator animator = cg.GetComponentInChildren<Animator>();
             AnimatorStateInfo info = animator.GetCurrentAnimatorStateInfo(0);
 

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/XiuFang/XiuFangView.cs

@@ -123,7 +123,7 @@ namespace GFGGame
         private void UpdateRedDot()
         {
             RedDotController.Instance.SetComRedDot(_ui.m_component.m_btnClothingUpgrade.target, RedDotDataManager.Instance.GetClothingFosterRed(), "", 0, 30);
-            RedDotController.Instance.SetComRedDot(_ui.m_component.m_btnSuitSynthetic.target, RedDotDataManager.Instance.GetClothingSyntheticRed(), "", -20, 25);
+            RedDotController.Instance.SetComRedDot(_ui.m_component.m_btnSuitSynthetic.target, RedDotDataManager.Instance.GetClothingSyntheticRed(), "", -54, 45);
         }
 
         protected override void UpdateToCheckGuide(object param)

BIN=BIN
GameClient/Assets/ResIn/UI/ClothingSynthetic/ClothingSynthetic_atlas0!a.png


BIN=BIN
GameClient/Assets/ResIn/UI/ClothingSynthetic/ClothingSynthetic_atlas0.png


BIN=BIN
GameClient/Assets/ResIn/UI/ClothingSynthetic/ClothingSynthetic_fui.bytes