Sfoglia il codice sorgente

新年签到接协议

huangxiaoyue 1 anno fa
parent
commit
8020f077cc

+ 8 - 1
GameClient/Assets/Game/HotUpdate/Data/ActivityDataManager.cs

@@ -274,6 +274,13 @@ namespace GFGGame
         /// </summary>
         /// <value></value>
         public Dictionary<int,int> NewYearLoginInfoDic = new Dictionary<int, int>();
-
+        public bool CanGetNewYearLoginRed()
+        {
+            foreach (var a in NewYearLoginInfoDic)
+            {
+                if (a.Value == 1) return true;
+            }
+            return false;
+        }
     }
 }

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

@@ -823,7 +823,7 @@ namespace GFGGame
         /// <returns></returns>
         public bool GetOpenServerRed()
         {
-           if (GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitStlyc) || GetGiftBagRewardRed() || GetMeiRiTeHuiRed() || GetOpenServerStoryRed())
+           if (GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitStlyc) || GetGiftBagRewardRed() || GetMeiRiTeHuiRed() || GetOpenServerStoryRed() || ActivityDataManager.Instance.CanGetNewYearLoginRed())
                 return true;
 
             return false;

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/NewYearLogin/UI_ComLoginItem.cs

@@ -9,6 +9,7 @@ namespace UI.NewYearLogin
         public GComponent target;
         public Controller m_bgType;
         public GLoader m_loaIcon;
+        public GTextField m_txtDay;
         public GTextField m_txtNum;
         public GTextField m_txtName;
         public GImage m_imgGot;
@@ -61,6 +62,7 @@ namespace UI.NewYearLogin
         {
             m_bgType = comp.GetController("bgType");
             m_loaIcon = (GLoader)comp.GetChild("loaIcon");
+            m_txtDay = (GTextField)comp.GetChild("txtDay");
             m_txtNum = (GTextField)comp.GetChild("txtNum");
             m_txtName = (GTextField)comp.GetChild("txtName");
             m_imgGot = (GImage)comp.GetChild("imgGot");
@@ -69,6 +71,7 @@ namespace UI.NewYearLogin
         {
             m_bgType = null;
             m_loaIcon = null;
+            m_txtDay = null;
             m_txtNum = null;
             m_txtName = null;
             m_imgGot = null;

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/OpenServerActivity/UI_OpenServerActivityUI.cs

@@ -21,6 +21,7 @@ namespace UI.OpenServerActivity
         public GTextField m_txtHour;
         public GTextField m_txtMinute;
         public GGraph m_holderSmallBgTx;
+        public GButton m_buttonNewYearLogin;
         public Transition m_openEff;
         public const string URL = "ui://b8ha2mnsdedg0";
         public const string PACKAGE_NAME = "OpenServerActivity";
@@ -83,6 +84,7 @@ namespace UI.OpenServerActivity
             m_txtHour = (GTextField)comp.GetChild("txtHour");
             m_txtMinute = (GTextField)comp.GetChild("txtMinute");
             m_holderSmallBgTx = (GGraph)comp.GetChild("holderSmallBgTx");
+            m_buttonNewYearLogin = (GButton)comp.GetChild("buttonNewYearLogin");
             m_openEff = comp.GetTransition("openEff");
         }
         public void Dispose(bool disposeTarget = false)
@@ -101,6 +103,7 @@ namespace UI.OpenServerActivity
             m_txtHour = null;
             m_txtMinute = null;
             m_holderSmallBgTx = null;
+            m_buttonNewYearLogin = null;
             m_openEff = null;
             if(disposeTarget && target != null)
             {

+ 4 - 9
GameClient/Assets/Game/HotUpdate/ServerProxy/ActivitySProxy.cs

@@ -279,21 +279,17 @@ namespace GFGGame
         public static async ETTask<bool> ReqGetActivitySignInfos()
         {
             int activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.ShenDuChenYou);
-            ET.Log.Debug("打印测试=========新年签到收到协议返回======="+ activityId +"=="+ ActivitySignCfgArray.Instance.GetCfgsByactivityId(activityId).Count);
-
             if (activityId < 0 || ActivitySignCfgArray.Instance.GetCfgsByactivityId(activityId).Count <= 0 )
                 return false;
-            ET.Log.Debug("打印测试=========新年签到收到协议返回===888====");
 
             S2C_GetActivitySignInfos response = null;
             response = (S2C_GetActivitySignInfos)await MessageHelper.SendToServer(new C2S_GetActivitySignInfos() { ActivityId = activityId });
             if (response != null)
             {
-                ET.Log.Debug("打印测试=========新年签到收到协议返回===6666====");
-
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-                    ET.Log.Debug("打印测试=========新年签到收到协议返回=======");
+                    ActivityDataManager.Instance.NewYearLoginInfoDic.Clear();
+
                     for(int i = 0;i< response.ksDay.Count; i++) { 
                         ActivityDataManager.Instance.NewYearLoginInfoDic.Add(response.ksDay[i], response.vsStatus[i]);
                     }
@@ -303,15 +299,14 @@ namespace GFGGame
             return false;
         }
 
-        public static async ETTask<bool> ReqGetAcitivitySignBonus(int activityId)
+        public static async ETTask<bool> ReqGetAcitivitySignBonus(int activityId,int day)
         {
             S2C_ReqGetAcitivitySignBonus response = null;
-            response = (S2C_ReqGetAcitivitySignBonus)await MessageHelper.SendToServer(new C2S_ReqGetAcitivitySignBonus() { ActivityId = activityId });
+            response = (S2C_ReqGetAcitivitySignBonus)await MessageHelper.SendToServer(new C2S_ReqGetAcitivitySignBonus() { ActivityId = activityId, Day = day });
             if (response != null)
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-                    ET.Log.Debug("打印测试=========领取新年签到收到协议返回======="+ response.Day);
                     ActivityDataManager.Instance.NewYearLoginInfoDic[response.Day] = ConstBonusStatus.GOT;
                     int[][] rewards = ActivitySignCfgArray.Instance.GetCfgByactivityIdAndday(activityId,response.Day).bonusArr;
                     BonusController.TryShowBonusList(rewards);

+ 6 - 9
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -353,15 +353,12 @@ namespace GFGGame
 
         private void OnClickBtnXiuFang()
         {
-            ViewManager.Show<NewYearLoginView>();
-
-
-            //if (isOpen) return;
-            //isOpen = true;
-            //_ui.m_btnXiuFang.m_holder1.visible = true;
-            //_ui.m_btnXiuFang.m_holder1.visible = false;
-            //ViewManager.Show<XiuFangView>();
-            //isOpen = false;
+            if (isOpen) return;
+            isOpen = true;
+            _ui.m_btnXiuFang.m_holder1.visible = true;
+            _ui.m_btnXiuFang.m_holder1.visible = false;
+            ViewManager.Show<XiuFangView>();
+            isOpen = false;
         }
 
         private void OnClickBtnDailyLogin()

+ 12 - 15
GameClient/Assets/Game/HotUpdate/Views/NewYearLogin/NewYearLoginView.cs

@@ -36,8 +36,6 @@ namespace GFGGame
         {
             base.OnShown();
             _activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.ShenDuChenYou);
-            ET.Log.Debug("´òÓ¡²âÊÔ============6666666666666===="+ _activityId);
-
             RefreshViewInfo();
         }
 
@@ -53,21 +51,21 @@ namespace GFGGame
 
         private void RefreshViewInfo()
         {
-            ET.Log.Debug("´òÓ¡²âÊÔ====fsdfafd============" + ActivitySignCfgArray.Instance.GetCfgsByactivityId(_activityId).Count);
             _ui.m_listLogin.numItems = ActivitySignCfgArray.Instance.GetCfgsByactivityId(_activityId).Count;
         }
 
         private void RenderListLogin(int index, GObject obj)
         {
             UI_ComLoginItem item = UI_ComLoginItem.Proxy(obj);
-            var data = ActivitySignCfgArray.Instance.GetCfgsByactivityId(_activityId);
-            var cfg = data[index].bonusArr;
+            var data = ActivitySignCfgArray.Instance.GetCfgByactivityIdAndday(_activityId,index + 1);
+            var cfg = data;
+            var cfgBonus = data.bonusArr;
             item.m_bgType.selectedIndex = index % 2;
-
-            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg[0][0]);
+            item.m_txtDay.text = "µÚ" + GameConst.CHINESE_NUMBER[index] + "Ìì";
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfgBonus[0][0]);
             item.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
             item.m_txtName.text = itemCfg.name;
-            item.m_txtNum.text = "x" + NumberUtil.ChangeNumberUnit(cfg[0][1], 10000);
+            item.m_txtNum.text = "x" + NumberUtil.ChangeNumberUnit(cfgBonus[0][1], 10000);
             ActivityDataManager.Instance.NewYearLoginInfoDic.TryGetValue(index + 1, out var state);
             item.m_imgGot.visible = state == ConstBonusStatus.GOT;
             RedDotController.Instance.SetComRedDot(item.target, state == ConstBonusStatus.CAN_GET);
@@ -82,13 +80,12 @@ namespace GFGGame
 
         private async void OnListItemClick(EventContext context)
         {
-            DailyLoginCfg cfg = (context.sender as GObject).data as DailyLoginCfg;
-
-            if (ActivityDataManager.Instance.sevenDayLoginBonusStatusList[cfg.id - 1] == ConstBonusStatus.CAN_GET)
+            ActivitySignCfg cfg = (context.sender as GObject).data as ActivitySignCfg;
+            ActivityDataManager.Instance.NewYearLoginInfoDic.TryGetValue(cfg.day, out var state);
+            if (state == ConstBonusStatus.CAN_GET)
             {
-                int actRedPacketId = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.NewYearRedPacket);
-
-                bool result = await ActivitySProxy.ReqGetAcitivitySignBonus(actRedPacketId);
+                int actRedPacketId = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.ShenDuChenYou);
+                bool result = await ActivitySProxy.ReqGetAcitivitySignBonus(actRedPacketId, cfg.day);
                 if (result)
                 {
                     //LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.MEI_RI_DNEG_LU, 2);
@@ -97,7 +94,7 @@ namespace GFGGame
             }
             else
             {
-                GoodsItemTipsController.ShowItemTips(cfg.rewardsArr[0][0]);
+                GoodsItemTipsController.ShowItemTips(cfg.bonusArr[0][0]);
             }
         }
 

+ 0 - 2
GameClient/Assets/Game/HotUpdate/Views/NewYearRedEnvelope/NewYearRedEnvelopeView.cs

@@ -40,7 +40,6 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            ET.Log.Debug("´òÓ¡²âÊÔ========9999999========" + NewYearRedEnvelopeDataManager.Status);
             if (NewYearRedEnvelopeDataManager.Status == RedPacketStatus.None)
             {
                 _ui.m_openType.selectedIndex = 0;
@@ -83,7 +82,6 @@ namespace GFGGame
 
         private void RefreshViewInfo()
         {
-            ET.Log.Debug("´òÓ¡²âÊÔ========yyyyyy========" + NewYearRedEnvelopeDataManager.Status);
             _ui.m_btnDoubleGet.target.visible = NewYearRedEnvelopeDataManager.Status != RedPacketStatus.Double;
         }
 

+ 8 - 0
GameClient/Assets/Game/HotUpdate/Views/OpenServerActivity/OpenServerActivityView.cs

@@ -50,6 +50,7 @@ namespace GFGGame
             _ui.m_btnAnswerTianmen.onClick.Add(OnClickBtnAnswerTianmen);
             _ui.m_btnTenShu.onClick.Add(OnClickBtnTenShu);
             _ui.m_btnNineZhouPool.onClick.Add(OnClickBtnNineZhouPool);
+            _ui.m_buttonNewYearLogin.onClick.Add(OnClickButtonNewYearLogin);
             AddEffect();
         }
 
@@ -66,6 +67,7 @@ namespace GFGGame
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("Tx_bg");
             RefreshTimeText();
             UpdateRedDot();
+            //RefreshButtonNewYearLogin();
             Timers.inst.Add(1, 0, UpdateTime);
             Timers.inst.Add(0.2f, 1, ShowEffTime);
         }
@@ -103,6 +105,7 @@ namespace GFGGame
             RedDotController.Instance.SetComRedDot(_ui.m_btnTenShu, (RedDotDataManager.Instance.GetActLuckyBoxRewardRed(ConstLimitTimeActivityType.ActLimitStlyc) || RedDotDataManager.Instance.GetGiftBagRewardRed() || RedDotDataManager.Instance.GetMeiRiTeHuiRed()), "", -100, 11);
             RedDotController.Instance.SetComRedDot(_ui.m_btnHeaven, MiniGameDateManager.Instance.GetRewardRot());
             RedDotController.Instance.SetComRedDot(_ui.m_btnAnswerTianmen, RedDotDataManager.Instance.GetOpenServerStoryRed(), "", -80, 100);
+            RedDotController.Instance.SetComRedDot(_ui.m_buttonNewYearLogin, ActivityDataManager.Instance.CanGetNewYearLoginRed(), "", 0, 0);
         }
 
         private void UpdateTime(object param)
@@ -160,5 +163,10 @@ namespace GFGGame
         {
             ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_EXCHANGE, ConstStoreSubId.STORE_ACTIVITY_EXCHANGE });
         }
+
+        private void OnClickButtonNewYearLogin()
+        {
+            ViewManager.Show<NewYearLoginView>();
+        }
     }
 }

BIN
GameClient/Assets/ResIn/UI/NewYearLogin/NewYearLogin_fui.bytes


BIN
GameClient/Assets/ResIn/UI/OpenServerActivity/OpenServerActivity_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/OpenServerActivity/OpenServerActivity_atlas0.png


BIN
GameClient/Assets/ResIn/UI/OpenServerActivity/OpenServerActivity_atlas0_1!a.png


BIN
GameClient/Assets/ResIn/UI/OpenServerActivity/OpenServerActivity_atlas0_1.png


BIN
GameClient/Assets/ResIn/UI/OpenServerActivity/OpenServerActivity_fui.bytes