Browse Source

月卡单品领取

zhaoyang 2 years ago
parent
commit
43aa671512

+ 4 - 1
GameClient/Assets/Game/HotUpdate/ServerProxy/ShopSProxy.cs

@@ -102,7 +102,7 @@ namespace GFGGame
             return false;
         }
         //领取专属单品
-        public static async ETTask<bool> ReqGetMonthCardItem(int monthCardType)
+        public static async ETTask<bool> ReqGetMonthCardItem(int month)
         {
             S2C_GetMonthCardItem response = null;
             response = (S2C_GetMonthCardItem)await MessageHelper.SendToServer(new C2S_GetMonthCardItem());
@@ -110,6 +110,9 @@ namespace GFGGame
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
+                    MonthlyCardClothesCfg clothesCfg = MonthlyCardClothesCfgArray.Instance.GetCfgByyearAndmonth(TimeUtil.GetCurYear(), month);
+                    List<ItemData> itemDatas = ItemUtil.CreateItemDataList(clothesCfg.clothesArr[0], clothesCfg.clothesArr[1]);
+                    BonusController.TryShowBonusList(itemDatas);
                     return true;
                 }
             }

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

@@ -72,7 +72,7 @@ namespace GFGGame
             item.m_imgMask.visible = !isCurMonth;
             item.m_grpMonth.visible = isCurMonth;
             item.m_grpName.visible = isCurMonth;
-
+            item.m_imggot.visible = MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardExclusiveClothesMouth), clothesCfg.month);
             if (item.target.data == null)
             {
                 item.target.onClick.Add(OnBtnGetClick);
@@ -87,6 +87,18 @@ namespace GFGGame
             GObject obj = context.sender as GObject;
 
             int month = (int)obj.data;
+            if (month != _month)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("奖励不可领");
+                return;
+            }
+
+            if (MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardExclusiveClothesMouth), month))
+            {
+                PromptController.Instance.ShowFloatTextPrompt("奖励已领取");
+                return;
+            }
+            ShopSProxy.ReqGetMonthCardItem(month).Coroutine();
 
         }
     }