Browse Source

Merge remote-tracking branch 'remotes/origin/master' into xiaojie

何晓捷 2 năm trước cách đây
mục cha
commit
a74cb86987

+ 14 - 22
FGUIProject/assets/LuckyBox/combox/ComBox.xml

@@ -4,42 +4,34 @@
     <component id="n44_mbf1" name="comModel" src="mbf1tah" fileName="combox/ComModel.xml" xy="0,0">
       <relation target="" sidePair="width-width,height-height"/>
     </component>
-    <component id="n32_njmn" name="btnPreview" src="ga16d" fileName="components/Button3.xml" xy="920,177" group="n36_njmn" controller="c1,0">
+    <component id="n32_njmn" name="btnPreview" src="ga16d" fileName="components/Button3.xml" xy="925,240" group="n36_njmn">
       <Button icon="ui://drx9d1usvek8v"/>
     </component>
-    <component id="n33_njmn" name="btnExchange" src="ga16d" fileName="components/Button3.xml" xy="966,177" group="n36_njmn" visible="false">
-      <Button icon="ui://drx9d1usvek8t"/>
-    </component>
-    <image id="n34_njmn" name="n34" src="fka75" fileName="images/cj_dikuangtw.png" xy="854,290" group="n36_njmn"/>
-    <text id="n35_njmn" name="txtOwned" xy="891,289" size="143,36" group="n36_njmn" fontSize="26" color="#fff7ea" align="center" vars="true" text="已拥有:{v1=0}/{v2=0}">
+    <image id="n34_njmn" name="n34" src="idkdtar" fileName="imagesNews/zx_jindu_bg.png" xy="911,343" group="n36_njmn"/>
+    <text id="n35_njmn" name="txtOwned" xy="940,372" pivot="0.5,0" size="44,39" group="n36_njmn" fontSize="28" color="#faf6e6" align="center" vars="true" text="{v1=0}/{v2=0}">
       <relation target="n34_njmn" sidePair="center-center,middle-middle"/>
     </text>
-    <group id="n36_njmn" name="n36" xy="854,177" size="226,148" advanced="true">
+    <group id="n36_njmn" name="n36" xy="911,240" size="108,203" advanced="true">
       <relation target="" sidePair="right-right,top-top"/>
     </group>
-    <graph id="n39_dhoa" name="holder" xy="280,910" size="100,100"/>
-    <graph id="n40_dhoa" name="holder1" xy="869,1097" size="100,100"/>
-    <image id="n41_dhoa" name="n41" src="qi041j" fileName="images/cj_zizi_2.png" xy="390,548" group="n42_dhoa"/>
-    <image id="n43_mzf8" name="n43" src="mzf8tac" fileName="images/cj_zizi_3.png" xy="674,703" group="n42_dhoa"/>
-    <text id="n38_dhoa" name="txtTime" xy="641,952" size="62,237" group="n42_dhoa" font="ui://eg2y0ldpwonotj9" fontSize="46" color="#fffbdd" align="center" vAlign="middle" autoSize="height" strokeColor="#a98538" strokeSize="2" text="剩余80天"/>
-    <group id="n42_dhoa" name="n42" xy="390,548" size="387,700" advanced="true">
-      <relation target="" sidePair="middle-middle"/>
-    </group>
-    <component id="n26_njmn" name="comCostOne" src="vek812" fileName="components/ComCost.xml" xy="256,1635" pivot="0.5,0" anchor="true" group="n31_njmn">
+    <image id="n46_idkd" name="n46" src="idkdtar" fileName="imagesNews/zx_jindu_bg.png" xy="637,1632" group="n31_njmn"/>
+    <image id="n45_idkd" name="n45" src="idkdtar" fileName="imagesNews/zx_jindu_bg.png" xy="154,1563" group="n31_njmn"/>
+    <component id="n26_njmn" name="comCostOne" src="n3xha1" fileName="components/ComCostCurrency.xml" pkg="eg2y0ldp" xy="256,1597" pivot="0.5,0" anchor="true" group="n31_njmn">
       <relation target="" sidePair="left-left"/>
     </component>
-    <component id="n27_njmn" name="comCostTen" src="vek812" fileName="components/ComCost.xml" xy="741,1635" pivot="0.5,0" anchor="true" group="n31_njmn">
+    <component id="n27_njmn" name="comCostTen" src="n3xha1" fileName="components/ComCostCurrency.xml" pkg="eg2y0ldp" xy="741,1597" pivot="0.5,0" anchor="true" group="n31_njmn">
       <relation target="" sidePair="left-left"/>
     </component>
-    <component id="n28_njmn" name="btnBuyOne" src="ga16b" fileName="components/Button1.xml" xy="45,1688" group="n31_njmn"/>
-    <component id="n29_njmn" name="btnBuyTen" src="ga16c" fileName="components/Button2.xml" xy="531,1688" group="n31_njmn"/>
-    <image id="n30_njmn" name="imgSpecial" src="ga16i" fileName="images/cj_anniu_ts.png" xy="873,1603" group="n31_njmn">
+    <image id="n30_njmn" name="imgSpecial" src="ga16i" fileName="images/cj_anniu_ts.png" xy="873,1565" group="n31_njmn">
       <relation target="n29_njmn" sidePair="left-left,top-top"/>
     </image>
-    <text id="n37_njmn" name="txtRemainTimes" xy="540,1809" pivot="0.5,0" anchor="true" size="244,44" group="n31_njmn" fontSize="32" color="#fff7d4" align="center" vars="true" strokeColor="#c89c5d" text="今日剩余次数:{v1=0}">
+    <text id="n37_njmn" name="txtRemainTimes" xy="540,1464" pivot="0.5,0" anchor="true" size="303,54" group="n31_njmn" fontSize="40" color="#915e15" align="center" vars="true" text="今日剩余次数:{v1=0}">
       <relation target="" sidePair="center-center"/>
     </text>
-    <group id="n31_njmn" name="n31" xy="45,1603" size="989,250" advanced="true">
+    <component id="n28_njmn" name="btnBuyOne" src="idkdtnh" fileName="components/BtnStyle006.xml" pkg="eg2y0ldp" xy="45,1650" group="n47_idkd"/>
+    <component id="n29_njmn" name="btnBuyTen" src="idkdtnh" fileName="components/BtnStyle006.xml" pkg="eg2y0ldp" xy="531,1650" group="n47_idkd"/>
+    <group id="n47_idkd" name="n47" xy="45,1650" size="802,102" group="n31_njmn" advanced="true"/>
+    <group id="n31_njmn" name="n31" xy="45,1464" size="989,288" advanced="true">
       <relation target="" sidePair="center-center,bottom-bottom"/>
     </group>
   </displayList>

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -129,5 +129,7 @@ namespace GFGGame
         public const string ACTIVITY_REMOVE = "ACTIVITY_REMOVE";
         //通知活动添加
         public const string ACTIVITY_ADD = "ACTIVITY_ADD";
+        // ACTIVITY_REWARD_ADD
+        public const string ACTIVITY_REWARD_ADD = "ACTIVITY_REWARD_ADD";
     }
 }

+ 23 - 2
GameClient/Assets/Game/HotUpdate/Data/ActivityGlobalDataManager.cs

@@ -12,6 +12,9 @@ namespace GFGGame
         public long startTime;
 
         public long endTime;
+
+        //已经领取的奖励
+        public List<int> GetRewards = new List<int>();
     }
 
     public class ActivityGlobalDataManager : SingletonBase<ActivityGlobalDataManager>
@@ -34,8 +37,16 @@ namespace GFGGame
             //ACTIVITY_ADD
             EventAgent.DispatchEvent(ConstMessage.ACTIVITY_ADD, activityInfo.activityId);
             //TODO 判断下时间非法情况
-            Timers.inst.Add(activityInfo.endTime - TimeHelper.ServerNow(), 0, ClientRemoveActivityInfo,
-                activityInfo.activityId);
+            var remainTime = activityInfo.endTime - TimeHelper.ServerNow();
+            if(remainTime > 0)
+            {
+                Timers.inst.Add(activityInfo.endTime - TimeHelper.ServerNow(), 1, ClientRemoveActivityInfo,
+                    activityInfo.activityId);
+            }
+            else
+            {
+                ClientRemoveActivityInfo(activityInfo.activityId);
+            }
         }
 
         private static void ClientRemoveActivityInfo(object param)
@@ -74,5 +85,15 @@ namespace GFGGame
             var activityInfoIds = GetActivityInfoIdsByType(activityType);
             return activityInfoIds.Select(GetActivityInfo).Where(activityInfo => activityInfo != null).ToList();
         }
+
+        //添加活动奖励获取数据
+        public void AddActivityRewardInfo(int activityId, int rewardId)
+        {
+            if (!activityInfos.ContainsKey(activityId)) return;
+            var activityInfo = activityInfos[activityId];
+            if (activityInfo.GetRewards.Contains(rewardId)) return;
+            activityInfo.GetRewards.Add(rewardId);
+            EventAgent.DispatchEvent(ConstMessage.ACTIVITY_REWARD_ADD, activityId);
+        }
     }
 }

+ 4 - 9
GameClient/Assets/Game/HotUpdate/Data/DressUpMenuItemDataManager.cs

@@ -132,15 +132,10 @@ namespace GFGGame
                 }
                 int scoreA = ItemDataManager.GetItemAdditionScore(a, InstanceZonesDataManager.currentScoreType, InstanceZonesDataManager.currentFightTags); ;
                 int scoreB = ItemDataManager.GetItemAdditionScore(b, InstanceZonesDataManager.currentScoreType, InstanceZonesDataManager.currentFightTags); ;
-                if (scoreB > scoreA)
-                {
-                    return 1;
-                }
-                else if (scoreB < scoreA)
-                {
-                    return -1;
-                }
-                return 0;
+                if (scoreB > scoreA) return 1;
+                if (scoreB < scoreA) return -1;
+
+                return a - b;
             });
             return arrayList;
         }

+ 17 - 3
GameClient/Assets/Game/HotUpdate/ServerProxy/ActivityGlobalSProxy.cs

@@ -17,7 +17,7 @@ namespace ET
             await ETTask.CompletedTask;
         }
     }
-    
+
     //S2C_NoticeActivityClose
     public class S2C_NoticeActivityCloseHandler : AMHandler<S2C_NoticeActivityClose>
     {
@@ -50,7 +50,8 @@ namespace GFGGame
                 {
                     activityId = activityInfo.ActivityId,
                     startTime = activityInfo.StartTime,
-                    endTime = activityInfo.EndTime
+                    endTime = activityInfo.EndTime,
+                    GetRewards = activityInfo.GetRewards
                 });
             });
         }
@@ -60,7 +61,7 @@ namespace GFGGame
         {
             var response =
                 (S2C_CloseActivity)await MessageHelper.SendToServer(new C2S_CloseActivity()
-                    { ActivityId = activityId });
+                { ActivityId = activityId });
             if (!(response is { Error: ErrorCode.ERR_Success }))
             {
                 Log.Error("ReqCloseActivity error");
@@ -68,5 +69,18 @@ namespace GFGGame
             }
             return true;
         }
+
+        //C2S_GetActivityBonus
+        public static async ETTask<bool> ReqGetActivityBonus(int activityId, int bonusId)
+        {
+            var response =
+                (S2C_GetActivityBonus)await MessageHelper.SendToServer(new C2S_GetActivityBonus()
+                { ActivityId = activityId, BonusId = bonusId });
+            if (!(response is { Error: ErrorCode.ERR_Success })) return false;
+            //奖励弹窗
+            BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.itemList));
+            ActivityGlobalDataManager.Instance.AddActivityRewardInfo(activityId, bonusId);
+            return false;
+        }
     }
 }

+ 28 - 28
GameClient/Assets/Game/HotUpdate/ServerProxy/ActivitySProxy.cs

@@ -128,34 +128,34 @@ namespace GFGGame
         }
 
         /*************************************************************限时累充*****************************************************/
-        /// <summary>
-        /// 领取累充奖励
-        /// </summary>
-        /// <param name="activityId"></param>
-        /// <param name="bonusKey">奖励key,这里对应抽奖次数</param>
-        /// <returns></returns>
-        public static async ETTask<bool> ReqGetLimitChargeBonus(int activityId, int bonusKey)
-        {
-            S2C_GetTimeLimitLuckyBoxBonus response = null;
-            response = (S2C_GetTimeLimitLuckyBoxBonus)await MessageHelper.SendToServer(new C2S_GetTimeLimitLuckyBoxBonus() { ActivityId = activityId, BonusKey = bonusKey });
-            if (response != null)
-            {
-                if (response.Error == ErrorCode.ERR_Success)
-                {
-                    if (ActivityDataManager.Instance.actLuckyBoxId != response.ActivityId)
-                    {
-                        return false;
-                    }
-                    ActivityDataManager.Instance.luckyBoxActBonusState[response.BonusKey] = response.BonusStatus;
-
-                    int[][] bonus = ActivityLuckybonusCfgArray.Instance.GetCfgByidAndnum(response.ActivityId, response.BonusKey).bonusArr;
-                    BonusController.TryShowBonusList(bonus);
-
-                    return true;
-                }
-            }
-            return false;
-        }
+        // /// <summary>
+        // /// 领取累充奖励
+        // /// </summary>
+        // /// <param name="activityId"></param>
+        // /// <param name="bonusKey">奖励key,这里对应抽奖次数</param>
+        // /// <returns></returns>
+        // public static async ETTask<bool> ReqGetLimitChargeBonus(int activityId, int bonusKey)
+        // {
+        //     S2C_GetTimeLimitLuckyBoxBonus response = null;
+        //     response = (S2C_GetTimeLimitLuckyBoxBonus)await MessageHelper.SendToServer(new C2S_GetTimeLimitLuckyBoxBonus() { ActivityId = activityId, BonusKey = bonusKey });
+        //     if (response != null)
+        //     {
+        //         if (response.Error == ErrorCode.ERR_Success)
+        //         {
+        //             if (ActivityDataManager.Instance.actLuckyBoxId != response.ActivityId)
+        //             {
+        //                 return false;
+        //             }
+        //             ActivityDataManager.Instance.luckyBoxActBonusState[response.BonusKey] = response.BonusStatus;
+
+        //             int[][] bonus = ActivityLuckybonusCfgArray.Instance.GetCfgByidAndnum(response.ActivityId, response.BonusKey).bonusArr;
+        //             BonusController.TryShowBonusList(bonus);
+
+        //             return true;
+        //         }
+        //     }
+        //     return false;
+        // }
     }
 }
 

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/ClothingDecompose/ClothingDecomposeView.cs

@@ -76,8 +76,8 @@ namespace GFGGame
             OnClickBtnRarity(ConstDressRarity.Rarity_FANPIN);
             if (GuideDataManager.currentGuideId == GuideCfgArray.Instance.GetCfg(ConstGuideId.CLOTHING_DECOMPOSE).id)
             {
-                _ui.m_listTab.selectedIndex = 1;
-                OnClickBtnRarity(ConstDressRarity.Rarity_ZHENXI);
+                _ui.m_listTab.selectedIndex = 0;
+                OnClickBtnRarity(ConstDressRarity.Rarity_FANPIN);
             }
             Timers.inst.AddUpdate(CheckGuide);
         }

+ 29 - 14
GameClient/Assets/Game/HotUpdate/Views/DailyWelfare/LimitChargeView.cs

@@ -13,6 +13,8 @@ namespace GFGGame
         private UI_LimitChargeUI _ui;
         private List<ActivityRechargeCfg> _rechargeCfgs;
 
+        private ActivityInfo _activityInfo;
+
         public override void Dispose()
         {
 
@@ -31,15 +33,19 @@ namespace GFGGame
             _ui = UI_LimitChargeUI.Create();
             this.viewCom = _ui.target;
             isfullScreen = true;
-
             _ui.m_list.itemRenderer = RenderListItem;
 
             _ui.m_btnBack.onClick.Add(OnBtnBackClick);
             _ui.m_btnCharge.onClick.Add(OnBtnChargeClick);
             ActivityOpenCfg openCfg = ActivityOpenCfgArray.Instance.GetCfg(ActivityDataManager.Instance.actLimitChargeId);
-            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath(openCfg.res);
+            // _ui.m_loaBg.url = ResPathUtil.GetBgImgPath(openCfg.res);
 
         }
+        protected override void AddEventListener()
+        {
+            base.AddEventListener();
+            EventAgent.AddEventListener(ConstMessage.ACTIVITY_REWARD_ADD, UpdateView);
+        }
 
         protected override void OnShown()
         {
@@ -54,7 +60,11 @@ namespace GFGGame
             if (_ui.m_list.numItems > 0) _ui.m_list.ScrollToView(0);
             Timers.inst.Remove(UpdateTime);
         }
-
+        protected override void RemoveEventListener()
+        {
+            base.RemoveEventListener();
+            EventAgent.RemoveEventListener(ConstMessage.ACTIVITY_REWARD_ADD, UpdateView);
+        }
         private void OnBtnBackClick()
         {
             ViewManager.GoBackFrom(typeof(LimitChargeView).FullName);
@@ -74,6 +84,7 @@ namespace GFGGame
 
         private void UpdateView()
         {
+            _activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(ActivityDataManager.Instance.actLimitChargeId);
             _ui.m_list.numItems = _rechargeCfgs.Count;
         }
         private void RenderListItem(int index, GObject obj)
@@ -81,13 +92,22 @@ namespace GFGGame
 
             UI_ListChargeItem item = UI_ListChargeItem.Proxy(obj);
 
-            item.m_txtTitle.text = string.Format("活动期间累计获得{0}会员积分({1}/{2})", _rechargeCfgs[index].value, RoleDataManager.vipExp, _rechargeCfgs[index].value);
+            int limitChargeExp = GameGlobal.myNumericComponent.GetAsInt(NumericType.TotalRechargeScore);
+            item.m_txtTitle.text = string.Format("活动期间累计获得{0}会员积分({1}/{2})", _rechargeCfgs[index].value, limitChargeExp, _rechargeCfgs[index].value);
+            if (limitChargeExp >= _rechargeCfgs[index].value)
+            {
+                item.m_c1.selectedIndex = _activityInfo.GetRewards.IndexOf(_rechargeCfgs[index].id) > 0 ? 2 : 1;
+            }
+            else
+            {
+                item.m_c1.selectedIndex = 0;
+            }
 
             if (item.m_btnGet.data == null)
             {
                 item.m_btnGet.onClick.Add(OnBtnGetClick);
             }
-            item.m_btnGet.data = _rechargeCfgs[index].value;
+            item.m_btnGet.data = _rechargeCfgs[index].id;
 
             if (item.m_listRewards.data == null)
             {
@@ -107,20 +127,15 @@ namespace GFGGame
             {
                 obj.data = new ItemView(obj as GComponent);
             }
-                   (obj.data as ItemView).SetData(itemData);
+            (obj.data as ItemView).SetData(itemData);
             UI_ComItem.ProxyEnd();
         }
 
-        private async void OnBtnGetClick(EventContext context)
+        private void OnBtnGetClick(EventContext context)
         {
             GObject obj = context.sender as GObject;
-            int value = (int)obj.data;
-
-            bool result = await ActivitySProxy.ReqGetLimitChargeBonus(ActivityDataManager.Instance.actLimitChargeId, value);
-            if (result)
-            {
-                UpdateView();
-            }
+            int id = (int)obj.data;
+            ActivityGlobalSProxy.ReqGetActivityBonus(id, ActivityDataManager.Instance.actLimitChargeId).Coroutine();
         }
     }
 }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/League/LeaguePrayView.cs

@@ -99,7 +99,7 @@ namespace GFGGame
             int curTimes = LeagueDataManager.Instance.GetPrayTimesByType(type);
             long hasCount = ItemDataManager.GetItemNum(prayCfg.consumeArr[0][0]);
             long needCount = prayCfg.consumeArr[0][1];
-            if (type != LeaguePrayType.First && curTimes != 0 && hasCount < needCount)
+            if (type == LeaguePrayType.First && curTimes != 0 && hasCount < needCount || type != LeaguePrayType.First && hasCount < needCount)
             {
                 PromptController.Instance.ShowFloatTextPrompt("消耗不足");
                 return;

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightSingleScoreView.cs

@@ -374,7 +374,7 @@ namespace GFGGame
             _partId++;
             if (_partId > FightScoreCfgArray.Instance.dataArray.Length)
             {
-                if (_partId == FightScoreCfgArray.Instance.dataArray.Length + 1 && _prefectCount >= 0)// FightScoreCfgArray.Instance.dataArray.Length)//
+                if (_partId == FightScoreCfgArray.Instance.dataArray.Length + 1 && _prefectCount >= FightScoreCfgArray.Instance.dataArray.Length)//0)// 
                 {
                     AllCirclePlayStart();//完美八连击
                 }

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

@@ -455,7 +455,7 @@ namespace GFGGame
         }
         private void PartScoreEnd()
         {
-            if (_partId > FightScoreCfgArray.Instance.dataArray.Length) return;
+            if (_partId <= 0 || _partId > FightScoreCfgArray.Instance.dataArray.Length) return;
 
             _ui.m_comClick.target.touchable = false;
             int clickType = FightDataManager.Instance.GetClickType(_ui.m_comClick.m_comResult.m_holderCircle.scale.x);
@@ -714,7 +714,8 @@ namespace GFGGame
             //    
             // }
             // GuideController.TryGuide(_ui.m_btnSkill0.target, ConstGuideId.TARGET_FIGHT, 2, "使用技能,可以增加胜出的几率哦,长按查看技能说明。");
-            GuideController.TryGuide(_ui.m_proScore.target, ConstGuideId.TARGET_FIGHT, 1, "这里可以观察双方的分数计算。");
+            GuideController.TryGuide(null, ConstGuideId.TARGET_FIGHT, 1, "这里可以观察双方的分数计算。", -1, true, _ui.m_proScore.target.height + 250);
+            // GuideController.TryGuide(_ui.m_proScore.target, ConstGuideId.TARGET_FIGHT, 1, "这里可以观察双方的分数计算。");
             GuideController.TryCompleteGuide(ConstGuideId.TARGET_FIGHT, 1);
 
         }

+ 4 - 8
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -796,16 +796,12 @@ namespace GFGGame
             if (!ViewManager.CheckIsTopView(this.viewCom)) return;
             if (MainDataManager.Instance.ViewType == 0)
             {
-                GuideController.TryGuide(_ui.m_btnHuanZhuang.target, ConstGuideId.FREEDOM_DRESS, 2, "在这里,自由搭配服饰和分享哦~",
-                    -1, false);
-                GuideController.TryGuide(_ui.m_btnMain.target, ConstGuideId.ENTER_CHAPTER, 3, "海市蜃楼,镜花水月,是所有故事开始的地方。",
-                    -1, false);
+                GuideController.TryGuide(_ui.m_btnHuanZhuang.target, ConstGuideId.FREEDOM_DRESS, 2, "在这里,自由搭配服饰和分享哦~", -1, false);
+                GuideController.TryGuide(_ui.m_btnMain.target, ConstGuideId.ENTER_CHAPTER, 3, "海市蜃楼,镜花水月,是所有故事开始的地方。", -1, false);
 
-                GuideController.TryGuide(_ui.m_btnXiuFang.target, ConstGuideId.CLOTHING_DECOMPOSE, 2, "绣坊里增添了新功能。", -1,
-                    false);
+                GuideController.TryGuide(_ui.m_btnXiuFang.target, ConstGuideId.CLOTHING_DECOMPOSE, 2, "绣坊里增添了新功能。", -1, false);
 
-                GuideController.TryGuide(_ui.m_btnXiuFang.target, ConstGuideId.CLOTHING_SYNTHETIC, 1, "进入绣坊界面。", -1,
-                    false);
+                GuideController.TryGuide(_ui.m_btnXiuFang.target, ConstGuideId.CLOTHING_SYNTHETIC, 1, "进入绣坊界面。", -1, false);
                 GuideController.TryCompleteGuide(ConstGuideId.CLOTHING_SYNTHETIC, 7);
 
                 GuideController.TryGuide(_ui.m_btnCiPai.target, ConstGuideId.UP_CARD_LV, 2, "“词牌”可进行升级和管理。", -1, false);