浏览代码

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

guodong 1 年之前
父节点
当前提交
0529f65b42

+ 16 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/LeagueSproxy.cs

@@ -1014,5 +1014,21 @@ namespace GFGGame
             }
             return false;
         }
+
+        //提交临时搭配
+        public static async ETTask<bool> ChangeTempCollocation(List<int> tempEquipIds)
+        {
+            S2C_ChangeTempCollocation response = null;
+
+            response = (S2C_ChangeTempCollocation)await MessageHelper.SendToServer(new C2S_ChangeTempCollocation() { TempEquipIds = tempEquipIds });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
     }
 }

+ 45 - 37
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -33,7 +33,7 @@ namespace GFGGame
         private StoryLevelCfg _levelCfg;
         private StoryFightCfg _fightCfg;
         private int scoreType = 0;  //目标分数类型保存
-        private bool _IsTeaPart = false;
+        private bool _IsTeaParty = false;
 
         private const int SORT_BY_HIGH_SCORE = 0;
         private const int SORT_BY_LOW_SCORE = 1;
@@ -152,14 +152,14 @@ namespace GFGGame
             var objData = (DressUpFightType)this.viewData;
 
             if (objData.teaPartID > 0) {
-                _IsTeaPart = true;
+                _IsTeaParty = true;
                 _TeaPartyID = objData.teaPartID;
             }
             else
-                _IsTeaPart = false;
+                _IsTeaParty = false;
 
             _levelID = objData.levelID;
-            if (!_IsTeaPart)
+            if (!_IsTeaParty)
                 _ui.m_c1.selectedIndex = 0;
             else
                 _ui.m_c1.selectedIndex = 2;
@@ -175,7 +175,7 @@ namespace GFGGame
             _ui.m_btnAutoPlay.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false);
             _ui.m_btnRecommend.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(ConstFunctionId.FUNCTION_AUTOPLAY_FIGHT, false);
 
-            if (!_IsTeaPart) { 
+            if (!_IsTeaParty) { 
                 InstanceZonesDataManager.currentLevelCfgId = _levelID;
                 _levelCfg = StoryLevelCfgArray.Instance.GetCfg(_levelID);
                 _fightCfg = StoryFightCfgArray.Instance.GetCfg(_levelCfg.fightID);
@@ -234,14 +234,21 @@ namespace GFGGame
             {
                 _sceneObject = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("SceneDressUpFight"));
                 MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject, false, false);
-                MyDressUpHelper.dressUpObj.PutOnDefaultDressUpData(_IsTeaPart);
+                MyDressUpHelper.dressUpObj.PutOnDefaultDressUpData(_IsTeaParty);
+
+                if (_IsTeaParty) {
+                    foreach (var id in LeagueDataManager.Instance.RoleTeapartyInfo.TempEquipIds)
+                    {
+                        MyDressUpHelper.dressUpObj.AddOrRemove(id, true);
+                    }
+                }
             }
             _ui.m_txtDressLimit.text = string.Format("饰品穿戴限制:{0}/{1}", MyDressUpHelper.GetCurrentOrnamentCount(), GlobalCfgArray.globalCfg.dressLimitCount);
 
             UpdateStepBtn(true);
             UpdateScore();
 
-            if (!_IsTeaPart)
+            if (!_IsTeaParty)
                 SendLog();
             else
             {
@@ -303,7 +310,7 @@ namespace GFGGame
 
         private void backView()
         {
-            if (_IsTeaPart)
+            if (_IsTeaParty)
             {
                 ViewManager.Show<LeagueTeaPartyView>();
             }
@@ -337,7 +344,7 @@ namespace GFGGame
 
         private void OnClickBtnBack()
         {
-            if (!_IsTeaPart) {
+            if (!_IsTeaParty) {
                 AlertUI.Show("是否确定退出?")
                 .SetLeftButton(true, "否").SetRightButton(true, "是", (object data) =>
                 {
@@ -345,19 +352,20 @@ namespace GFGGame
                 });
             }
             else {
-                AlertUI.Show("当期搭配未保存,是否放弃提交搭配?")
-                .SetLeftButton(true, "放弃搭配", (object data) =>
-                {
-                    backView();
-                }).SetRightButton(true, "提交搭配", (object data) =>
-                {
-                    ChangeTeapartyDressup();
-                });
+                DressUpData dressUpData = MyDressUpHelper.dressUpObj.DressUpDataClone();
+                ChangeTempCollocation(dressUpData.itemList);
+                backView();
             }
-           
+            //ViewManager.Show<StoryChapterView>(StoryDataManager.currentChapter);
+        }
 
-        //ViewManager.Show<StoryChapterView>(StoryDataManager.currentChapter);
-    }
+        private async void ChangeTempCollocation(List<int> tempEquipIds)
+        {
+            bool result = await LeagueSproxy.ChangeTempCollocation(tempEquipIds);
+            if (result)
+            {
+            }
+        }
 
         private void OnClickBtnHome()
         {
@@ -817,14 +825,14 @@ namespace GFGGame
                 _currentList3 = DressUpMenuSuitDataManager.GetSuitIDList();
                 if (_scoreIndex == SORT_BY_HIGH_SCORE)
                 {
-                    if (!_IsTeaPart)
+                    if (!_IsTeaParty)
                         _currentList3 = SuitUtil.SortSuitListByHighScore(_currentList3);
                     else
                         _currentList3 = SuitUtil.SortTeaPartySuitByHighScore(_currentList3);
                 }
                 else if (_scoreIndex == SORT_BY_LOW_SCORE)
                 {
-                    if (!_IsTeaPart)
+                    if (!_IsTeaParty)
                         _currentList3 = SuitUtil.SortSuitListByLowScore(_currentList3);
                     else
                         _currentList3 = SuitUtil.SortTeaPartySuitByLowScore(_currentList3);
@@ -839,14 +847,14 @@ namespace GFGGame
                 _currentList3 = DressUpMenuItemDataManager.getItemDatasByType(_currentMenuType);
                 if (_scoreIndex == SORT_BY_HIGH_SCORE)
                 {
-                    if (!_IsTeaPart)
+                    if (!_IsTeaParty)
                         _currentList3 = DressUpMenuItemDataManager.SortItemListByHighScore(_currentList3, true);
                     else
                         _currentList3 = DressUpMenuItemDataManager.SortItemTeaPartyByHighScore(_currentList3);
                 }
                 else if (_scoreIndex == SORT_BY_LOW_SCORE)
                 {
-                    if (!_IsTeaPart)
+                    if (!_IsTeaParty)
                         _currentList3 = DressUpMenuItemDataManager.SortItemListByLowScore(_currentList3, true);
                     else
                         _currentList3 = DressUpMenuItemDataManager.SortItemTeaPartyByLowsore(_currentList3);
@@ -1009,14 +1017,14 @@ namespace GFGGame
         {
             if (_scoreIndex == SORT_BY_HIGH_SCORE)
             {
-                if (!_IsTeaPart)
+                if (!_IsTeaParty)
                     _currentList3 = DressUpMenuItemDataManager.SortItemListByHighScore(_currentList3, true);
                 else
                     _currentList3 = DressUpMenuItemDataManager.SortItemTeaPartyByHighScore(_currentList3);
             }
             else if (_scoreIndex == SORT_BY_LOW_SCORE)
             {
-                if (!_IsTeaPart)
+                if (!_IsTeaParty)
                     _currentList3 = DressUpMenuItemDataManager.SortItemListByLowScore(_currentList3, true);
                 else
                     _currentList3 = DressUpMenuItemDataManager.SortItemTeaPartyByLowsore(_currentList3);
@@ -1032,7 +1040,7 @@ namespace GFGGame
             typeItem.m_txtname.text = item1.name;
             //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconzi_" + item1.id;
             typeItem.target.data = item1.id;
-            if (!_IsTeaPart)
+            if (!_IsTeaParty)
             {
                 typeItem.m_imgNeed.visible = ItemUtil.CheckMenuType1(_fightCfg.needItemId, _fightCfg.needSuitId, item1.id);
                 typeItem.m_itemType.selectedIndex = 0;
@@ -1053,7 +1061,7 @@ namespace GFGGame
             typeItem.m_txtname.text = item2.name;
             //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
             typeItem.target.data = item2.id;
-            if (!_IsTeaPart) { 
+            if (!_IsTeaParty) { 
                 typeItem.m_itemType.selectedIndex = 0;
                 var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
                 typeItem.m_imgNeed.visible = subType == item2.type;
@@ -1092,7 +1100,7 @@ namespace GFGGame
                 iconRes = suitCfg.res;
                 partName = suitCfg.name;
                 listItem.m_iconSelected.visible = false;
-                if (!_IsTeaPart)
+                if (!_IsTeaParty)
                 {
                     listItem.m_txtScore.text = "" + SuitUtil.GetSuitScore(id);
                     listItem.m_itemType.selectedIndex = 0;
@@ -1117,7 +1125,7 @@ namespace GFGGame
                 iconRes = itemCfg.res;
                 partName = itemCfg.name;
                 listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
-                if (!_IsTeaPart) {
+                if (!_IsTeaParty) {
                     listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
                     listItem.m_itemType.selectedIndex = 0;
                 }
@@ -1177,7 +1185,7 @@ namespace GFGGame
             partName = itemCfg.name;
             listItem.m_iconSelected.visible = MyDressUpHelper.dressUpObj.CheckDressUpItemIsOn(id);
 
-            if (!_IsTeaPart) { 
+            if (!_IsTeaParty) { 
                 listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
                 listItem.m_itemType.selectedIndex = 0;
             }
@@ -1200,7 +1208,7 @@ namespace GFGGame
             // int mainValuel;
             // ItemDataManager.GetMainScore(id, out mainScore, out mainValuel);
             listItem.m_ScoreType.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + scoreType);
-            if (!_IsTeaPart) {
+            if (!_IsTeaParty) {
                 listItem.m_txtScore.text = "" + ItemDataManager.GetItemAdditionScore(id, InstanceZonesDataManager.currentScoreType, _fightCfg.needTagsArr);
                 listItem.m_itemType.selectedIndex = 0;
             }
@@ -1316,7 +1324,7 @@ namespace GFGGame
             _ui.m_btnClose.visible = true;
             _ui.m_grpTips.visible = true;
             string str = "";
-            if (!_IsTeaPart)
+            if (!_IsTeaParty)
                 str = _levelCfg.hint;
             else { 
                 var teapartyRoleCfg = TeapartyRoleCfgArray.Instance.GetCfgsByid(LeagueDataManager.Instance.TeaPartyId);
@@ -1336,7 +1344,7 @@ namespace GFGGame
 
         private void UpdateScore()
         {
-            if (!_IsTeaPart)
+            if (!_IsTeaParty)
                 _ui.m_txtScore.text = "" + FightDataManager.Instance.GetScore(InstanceZonesDataManager.roleData).ToString();
             // GuideController.TryGuideDressUpFightViewBtnNext(_ui.m_btnNext);
             else
@@ -1346,7 +1354,7 @@ namespace GFGGame
         private void OnClickBtnSearch()
         {
             int type = 0;
-            if (_IsTeaPart)
+            if (_IsTeaParty)
                 type = 1;
             ViewManager.Show<DressFilterView>(new object[] { 0, 0, type}, new object[] { typeof(DressUpView).FullName});
         }
@@ -1439,7 +1447,7 @@ namespace GFGGame
         }
         protected override void UpdateToCheckGuide(object param)
         {
-            if (!ViewManager.CheckIsTopView(this.viewCom) || _IsTeaPart) return;
+            if (!ViewManager.CheckIsTopView(this.viewCom) || _IsTeaParty) return;
 
             int buyClothingIndex = 0;
             int buyClothingSubIndex = 0;
@@ -1496,7 +1504,7 @@ namespace GFGGame
 
         private void TeaPartyStatuChange()
         {
-            if (_IsTeaPart && LeagueDataManager.Instance.TeaPartyStatus == LeagueTeaPartyStatus.YesGo)
+            if (_IsTeaParty && LeagueDataManager.Instance.TeaPartyStatus == LeagueTeaPartyStatus.YesGo)
             {
                 AlertUI.Show("管理员已开启茶会,请前往挑战!")
                 .SetLeftButton(false).SetRightButton(true, "确定", (object data) =>

+ 13 - 11
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxStarView.cs

@@ -56,6 +56,18 @@ namespace GFGGame
         }
         protected override void OnHide()
         {
+            base.OnHide();
+            for (int i = 0; i < dicEffect.Count; i++)
+            {
+                EffectUIPool.Recycle(dicEffect[i]);
+                dicEffect[i] = null;
+            }
+            for (int i = 0; i < effObj.Count; i++)
+            {
+                EffectUIPool.Recycle(effObj[i]);
+                effObj[i] = null;
+            }
+
             int index = 0;
             GObject star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
             while (star != null && star.visible == true)
@@ -71,16 +83,6 @@ namespace GFGGame
                 star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
                 UI_ComStar.ProxyEnd();
             }
-            for (int i = 0; i < dicEffect.Count; i++)
-            {
-                EffectUIPool.Recycle(dicEffect[i]);
-                dicEffect[i] = null;
-            }
-            for (int i = 0; i < effObj.Count; i++)
-            {
-                EffectUIPool.Recycle(effObj[i]);
-                effObj[i] = null;
-            }
             notClickComStars.Clear();
             clickComStars.Clear();
             dicEffect.Clear();
@@ -94,7 +96,7 @@ namespace GFGGame
             base.OnInit();
             _ui = UI_LuckyBoxStarUI.Create();
             this.viewCom = _ui.target;
-            isfullScreen = true;
+            //isfullScreen = true;
 
             _ui.m_btnBack.visible = false;
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);