Ver Fonte

Merge branch 'master' of http://10.108.64.190:3000/gfg/client

guodong há 2 anos atrás
pai
commit
2370ed0793

+ 6 - 1
GameClient/Assets/Game/HotUpdate/Data/LeagueDataManager.cs

@@ -9,6 +9,11 @@ namespace GFGGame
         public static int NobodyRight = 2;// 2:无人答对
         public static int Ending = 3;// 3:答题结束
     }
+    public class LeagueJoinType
+    {
+        public static int Join = 1;//1:已经加入军团
+        public static int UnJoin = 2;//1:未加入军团
+    }
     public class LeagueDataManager : SingletonBase<LeagueDataManager>
     {
         public int Type = 2;// 1:已经加入军团 2:未加入军团
@@ -29,7 +34,7 @@ namespace GFGGame
 
         public void Clear()
         {
-            Type = 2;
+            Type = LeagueJoinType.UnJoin;
             ListDatas.Clear();
             LeagueData = null;
             ListApplyDatas.Clear();

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Data/ShopViewManager.cs

@@ -26,6 +26,7 @@ namespace GFGGame
             com.m_txtLv.text = RoleDataManager.vipLv.ToString();
             int level = RoleDataManager.vipLv;
             ET.Log.Debug("vipLv:" + level);
+            ET.Log.Debug("vipExp:" + RoleDataManager.vipExp);
             VipCfg vipCfg = VipCfgArray.Instance.GetCfg(RoleDataManager.vipLv);
             VipCfg nextVipCfg = VipCfgArray.Instance.GetCfg(RoleDataManager.vipLv + 1);
             com.m_txtTipsFull.visible = RoleDataManager.vipExp >= vipCfg.num && nextVipCfg == null;

+ 5 - 5
GameClient/Assets/Game/HotUpdate/Data/TaskDataManager.cs

@@ -171,9 +171,9 @@ namespace GFGGame
                     return string.Format(activeRewardCfg.desc, taskCfg.paramsArr[0], taskCfg.paramsArr[1]);
                 case ConstTaskType.FinishStory:
                 case ConstTaskType.FinishInstanceZones:
-                {
-                    return string.Format(activeRewardCfg.desc, taskCfg.paramsArr[0]);
-                }
+                    {
+                        return string.Format(activeRewardCfg.desc, taskCfg.paramsArr[0]);
+                    }
                 default: return string.Format(activeRewardCfg.desc, taskCfg.GetTargetCount());
             }
         }
@@ -188,7 +188,7 @@ namespace GFGGame
             {
                 case nameof(LeagueAnswerView):
 
-                    if (LeagueDataManager.Instance.Type == 1)
+                    if (LeagueDataManager.Instance.Type == LeagueJoinType.Join)
                     {
                         ViewManager.Show<LeagueView>(null, goBackDatas, true);
                         ViewManager.Show($"GFGGame.{jumpId}");
@@ -200,7 +200,7 @@ namespace GFGGame
 
                     break;
                 case nameof(LeagueView):
-                    if (LeagueDataManager.Instance.Type == 1)
+                    if (LeagueDataManager.Instance.Type == LeagueJoinType.Join)
                     {
                         ViewManager.Show<LeagueView>(null, goBackDatas, true);
                     }

+ 9 - 6
GameClient/Assets/Game/HotUpdate/ServerProxy/LeagueSproxy.cs

@@ -96,7 +96,7 @@ namespace GFGGame
     {
         protected override async ETTask Run(Session session, L2C_NoticeJoinLeague message)
         {
-            if (LeagueDataManager.Instance.Type == 2)
+            if (LeagueDataManager.Instance.Type == LeagueJoinType.UnJoin)
             {
                 bool result = await LeagueSproxy.ReqGetLeagueInfo();
                 if (result && ViewManager.isViewOpen(typeof(LeagueJoinView).FullName))
@@ -292,7 +292,8 @@ namespace GFGGame
                 if (response.Error == ErrorCode.ERR_Success)
                 {
                     LeagueDataManager.Instance.Type = response.Type;
-                    if (response.Type == 1)//1:已经加入军团
+
+                    if (LeagueDataManager.Instance.Type == LeagueJoinType.Join)//1:已经加入军团
                     {
                         LeagueDataManager.Instance.LeagueData = GetLeagueData(response.LeagueDetailInfo);
                         int myPos = LeagueDataManager.Instance.LeagueData.LeagueMemberDatas[RoleDataManager.roleId].Pos;
@@ -302,7 +303,7 @@ namespace GFGGame
                             ReqLeagueJoinQuitLog().Coroutine();
                         }
                     }
-                    else if (response.Type == 2)//2:未加入军团
+                    else if (LeagueDataManager.Instance.Type == LeagueJoinType.UnJoin)//2:未加入军团
                     {
                         LeagueDataManager.Instance.ListDatas.Clear();
                         for (int i = 0; i < response.list.Count; i++)
@@ -348,6 +349,7 @@ namespace GFGGame
                 if (response.Error == ErrorCode.ERR_Success)
                 {
                     LeagueDataManager.Instance.LeagueData = GetLeagueData(response.LeagueDetailInfo);
+                    LeagueDataManager.Instance.Type = LeagueJoinType.Join;
                     return true;
                 }
             }
@@ -584,15 +586,16 @@ namespace GFGGame
             return false;
         }
         //领取联盟福利//LeagueWelfareType
-        public static async ETTask<bool> ReqGetLeagueWelfare()
+        public static async ETTask<bool> ReqGetLeagueWelfare(int type)
         {
             S2C_GetLeagueWelfare response = null;
-            response = (S2C_GetLeagueWelfare)await MessageHelper.SendToServer(new C2S_GetLeagueWelfare());
+            response = (S2C_GetLeagueWelfare)await MessageHelper.SendToServer(new C2S_GetLeagueWelfare() { LeagueWelfareType = type });
             if (response != null)
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-                    // PromptController.Instance.ShowFloatTextPrompt("购买成功");
+                    List<ItemData> itemDatas = ItemUtil.CreateItemDataList(response.Bonus);
+                    BonusController.TryShowBonusList(itemDatas);
                     return true;
                 }
             }

+ 11 - 6
GameClient/Assets/Game/HotUpdate/Views/Card/CardFosterView.cs

@@ -342,7 +342,7 @@ namespace GFGGame
             _consumeSelectIndex = type;
             if (type == 1)
             {
-                if (IsUpLvLimit()) return;
+                if (IsUpLvLimit(itemId)) return;
 
                 if (ItemDataManager.GetItemNum(itemId) == 0)
                 {
@@ -371,7 +371,9 @@ namespace GFGGame
                 }
                 else
                 {
-                    if (!CommonUtil.Instance.CheckPointIsOnComponent(_consumeSelectItem, CommonUtil.Instance.GetMouseV2Point()) || IsUpLvLimit())
+                    int index = (int)_consumeSelectItem.data;
+                    int itemId = upgradeCardItemsArr[index];
+                    if (!CommonUtil.Instance.CheckPointIsOnComponent(_consumeSelectItem, CommonUtil.Instance.GetMouseV2Point()) || IsUpLvLimit(itemId))
                     {
                         Timers.inst.Remove(OnTimedEvent);
                         return;
@@ -421,7 +423,7 @@ namespace GFGGame
                 }
                 return false;
             }
-            if (IsUpLvLimit(false)) return false;
+            if (IsUpLvLimit(itemId, false)) return false;
             itemsCount[index] = itemsCount[index] + 1;
             listItem.m_txtUseCount.text = itemsCount[index].ToString();
             this.UpdatePreView();
@@ -471,7 +473,7 @@ namespace GFGGame
         {
             for (int i = 0; i < itemsCount.Count; i++)
             {
-                if (IsUpLvLimit()) break;
+                // if (IsUpLvLimit()) break;
                 long itemNum = ItemDataManager.GetItemNum(upgradeCardItemsArr[i]);
                 for (long j = 0; j < itemNum; j++)
                 {
@@ -546,10 +548,13 @@ namespace GFGGame
             }
         }
 
-        private bool IsUpLvLimit(bool showTips = true)
+        private bool IsUpLvLimit(int itemId, bool showTips = true)
         {
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
             int lvLimit = RoleLevelCfgArray.Instance.GetCfg(RoleDataManager.lvl).cardLeverLimit;
-            if (_showLv > lvLimit)
+            int needExp = CardLvlCfgArray.Instance.GetCfgByrarityAndcardLvl(_cardData.itemCfg.rarity, lvLimit).needExp;
+
+            if (_showLv > lvLimit || _showLv == lvLimit && _comFosterBottom.m_barLv.value + itemCfg.cardUpLvExp > needExp)
             {
                 if (!showTips) return true;
 

+ 10 - 7
GameClient/Assets/Game/HotUpdate/Views/League/LeagueGiftView.cs

@@ -38,6 +38,7 @@ namespace GFGGame
 
             _ui.m_btnBack.onClick.Add(OnBtnBackClick);
             _ui.m_btnGet.onClick.Add(OnBtnGetClick);
+            _ui.m_btnGet.data = LeagueWelfareType.ALL;
             _ui.m_btnRule.onClick.Add(RuleController.ShowRuleView);
             _ui.m_btnRule.data = 300003;
             _ui.m_listBuy.itemRenderer = RenderListBuyItem;
@@ -109,6 +110,11 @@ namespace GFGGame
             item.m_comItem.m_loaType.url = string.Format("ui://League/lm_biaoqian_{0}", _getDatas[index].GiftCfg.type);
             item.m_comItem.m_listGift.data = _getDatas[index].GiftCfg.bonusArr;
             item.m_comItem.m_listGift.numItems = _getDatas[index].GiftCfg.bonusArr.Length;
+            if (item.target.data == null)
+            {
+                item.target.onClick.Add(OnBtnGetClick);
+            }
+            item.target.data = _getDatas[index].Type;
             UI_ListGiftGetItemTop.ProxyEnd();
         }
         private void RenderListBuyItem(int index, GObject obj)
@@ -215,14 +221,11 @@ namespace GFGGame
             LeagueSproxy.ReqBuyLeagueWelfare(buyData.GiftCfg.type).Coroutine();
 
         }
-        private void OnBtnGetClick()
+        private void OnBtnGetClick(EventContext context)
         {
-            // bool result = await LeagueSproxy.ReqGetLeagueWelfare();
-            // if (result)
-            // {
-            //     UpdateGetList();
-            // }
-            LeagueSproxy.ReqGetLeagueWelfare().Coroutine();
+            GObject obj = context.sender as GObject;
+            int type = (int)obj.data;
+            LeagueSproxy.ReqGetLeagueWelfare(type).Coroutine();
         }
     }
 }

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

@@ -613,7 +613,7 @@ namespace GFGGame
             //     PromptController.Instance.ShowFloatTextPrompt("数据来的有点慢,稍后再试下吧");
             //     return;
             // }
-            if (LeagueDataManager.Instance.Type == 1) //已加入联盟
+            if (LeagueDataManager.Instance.Type == LeagueJoinType.Join) //已加入联盟
             {
                 ViewManager.Show<LeagueView>();
             }