Browse Source

月卡套装位置

zhaoyang 2 years ago
parent
commit
09ddcf57c3

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Data/CustomSuitDataManager.cs

@@ -52,13 +52,13 @@ namespace GFGGame
             return GetSuitList(currentIndex);
         }
 
-        public static void SaveCurrentSuit(int index)
+        public static void SaveCurrentSuit(int index, bool showTips = true)
         {
             if (currentIndex != index)
             {
                 currentIndex = index;
             }
-            CustomSuitSProxy.UpdateCustomSuit(index, MyDressUpHelper.dressUpObj.DressUpDataClone()).Coroutine();
+            CustomSuitSProxy.UpdateCustomSuit(index, MyDressUpHelper.dressUpObj.DressUpDataClone(), showTips).Coroutine();
         }
 
         public static void InitServerData(List<CustomSuitProto> list)

+ 2 - 2
GameClient/Assets/Game/HotUpdate/ServerProxy/CustomSuitSProxy.cs

@@ -9,7 +9,7 @@ namespace GFGGame
 {
     public class CustomSuitSProxy
     {
-        public static async ETTask UpdateCustomSuit(int index, DressUpData dressUpData)
+        public static async ETTask UpdateCustomSuit(int index, DressUpData dressUpData, bool showTipe = true)
         {
             CustomSuitProto suitProto = new CustomSuitProto();
             suitProto.Pos = index;
@@ -29,7 +29,7 @@ namespace GFGGame
                 if (response.Error == ErrorCode.ERR_Success)
                 {
                     CustomSuitDataManager.SaveSuit(index, dressUpData);
-                    PromptController.Instance.ShowFloatTextPrompt("保存成功", MessageType.SUCCESS);
+                    if (showTipe) PromptController.Instance.ShowFloatTextPrompt("保存成功", MessageType.SUCCESS);
 
                 }
             }

+ 5 - 1
GameClient/Assets/Game/HotUpdate/ServerProxy/ItemProxy.cs

@@ -27,6 +27,10 @@ namespace GFGGame
                     //自定义套装
                     CustomSuitDataManager.InitServerData(response.CustomSuits);
                     CustomSuitDataManager.currentIndex = response.CustomSuitPos;
+                    if (!RoleDataManager.CheckIsMonthCardOpenByType(CustomSuitDataManager.GetPosType(CustomSuitDataManager.currentIndex)))
+                    {
+                        CustomSuitDataManager.currentIndex = 0;
+                    }
                     for (int i = 0; i < response.NewItems.Count; i++)
                     {
                         ItemCfg cfg = ItemCfgArray.Instance.GetCfg(response.NewItems[i]);
@@ -96,7 +100,7 @@ namespace GFGGame
         {
             M2C_GiftBoxSelConsumption response = null;
             response = (M2C_GiftBoxSelConsumption)await MessageHelper.SendToServer(new C2M_GiftBoxSelConsumption()
-                { ItemId = itemID, GiftBoxSelChildItems = giftBoxSelChildItems });
+            { ItemId = itemID, GiftBoxSelChildItems = giftBoxSelChildItems });
             if (response != null)
             {
                 if (response.Error == ErrorCode.ERR_Success)

+ 5 - 7
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpView.cs

@@ -136,12 +136,10 @@ namespace GFGGame
             }
             MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject);
 
+            currentIndex = CustomSuitDataManager.currentIndex;
             _ui.m_comboBox.items = CustomSuitDataManager.GetSuitPosItems();
-            _ui.m_comboBox.selectedIndex = CustomSuitDataManager.currentIndex;
-            currentIndex = _ui.m_comboBox.selectedIndex;
-            MyDressUpHelper.PutOnSuitSavedByPos(CustomSuitDataManager.currentIndex);
-            // UpdateStepBtn();
-            // AddMemoryDressup();
+            _ui.m_comboBox.selectedIndex = currentIndex;
+            MyDressUpHelper.PutOnSuitSavedByPos(currentIndex);
             Timers.inst.AddUpdate(CheckGuide);
         }
 
@@ -209,13 +207,13 @@ namespace GFGGame
             if (_ui.m_comboBox.selectedIndex == currentIndex) return;
             if (CustomSuitDataManager.GetPosType(_ui.m_comboBox.selectedIndex) == MonthCardType.Gold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.Gold))
             {
-                PromptController.Instance.ShowFloatTextPrompt("开通金卡开启");
+                ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_GLOAD_CARD });
                 _ui.m_comboBox.selectedIndex = currentIndex;
                 return;
             }
             if (CustomSuitDataManager.GetPosType(_ui.m_comboBox.selectedIndex) == MonthCardType.BlackGold && !RoleDataManager.CheckIsMonthCardOpenByType(MonthCardType.BlackGold))
             {
-                PromptController.Instance.ShowFloatTextPrompt("开通黑金卡开启");
+                ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_BLACK_CARD });
                 _ui.m_comboBox.selectedIndex = currentIndex;
                 return;
             }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Store/StoreView.cs

@@ -100,7 +100,7 @@ namespace GFGGame
         private void OnClickBtnBack()
         {
             ViewManager.Hide(_curViewName);
-            ViewManager.GoBackFrom(typeof(StoreView).FullName, false);
+            this.Hide();
         }
 
         private void OnTabChange()