Browse Source

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

zhaoyang 2 years ago
parent
commit
a0fc9954be

+ 3 - 3
FGUIProject/assets/EnduringGiftBox/RushSaleGiftBoxUI.xml

@@ -8,7 +8,7 @@
     <component id="n21_droi" name="btnBack" src="qqhz26" fileName="components/BnBack.xml" xy="498,940" group="n22_droi"/>
     <group id="n22_droi" name="n22" xy="1,-72" size="1077,1231"/>
     <image id="n5_yjmk" name="n5" src="yjmk2m" fileName="images/xsqg_nr_db.png" xy="193,215" group="n23_droi"/>
-    <text id="n4_yjmk" name="txtBoxItemName" xy="363,207" size="283,65" group="n23_droi" fontSize="40" color="#fffbf5" align="center" autoSize="none" strokeColor="#d69546" text="体力限时礼包"/>
+    <text id="n4_yjmk" name="txtBoxItemName" xy="363,207" pivot="1,0" size="244,54" group="n23_droi" fontSize="40" color="#fffbf5" align="right" vAlign="middle" strokeColor="#d69546" text="体力限时礼包"/>
     <image id="n6_yjmk" name="n6" src="yjmk2n" fileName="images/xsqg_sj_db.png" xy="639,216" group="n23_droi"/>
     <text id="n8_yjmk" name="txtBoxResidueTime" xy="683,214" size="207,48" group="n23_droi" fontSize="35" color="#fffbf5" align="center" autoSize="none" text="6天23分23秒"/>
     <list id="n11_yjmk" name="list" xy="344,377" size="425,203" group="n23_droi" alpha="0" layout="flow_vt" overflow="scroll" scroll="horizontal" scrollBarFlags="32" colGap="50" defaultItem="ui://bdi1qe15yjmk2p" align="center">
@@ -53,8 +53,8 @@
     <item time="0" type="XY" target="n15_yjmk" tween="true" startValue="422,693" endValue="408,693" duration="17" ease="Linear"/>
     <item time="0" type="XY" target="n19_droi" tween="true" startValue="70,380" endValue="63,380" duration="10" ease="Linear"/>
     <item time="0" type="XY" target="n20_droi" tween="true" startValue="863,386" endValue="877,386" duration="12" ease="Linear"/>
-    <item time="0" type="XY" target="n24_droi" tween="true" startValue="247,293" endValue="247,293" duration="0" ease="Custom" customEase="2,0,0,0.21,0.49,0.755,0.985,1,0,1,1"/>
-    <item time="0" type="XY" target="n24_droi" tween="true" startValue="247,293" endValue="247,293" duration="0"/>
+    <item time="0" type="XY" target="n24_droi" value="247,293"/>
+    <item time="0" type="XY" target="n24_droi" value="247,293"/>
     <item time="0" type="XY" target="n24_droi" tween="true" startValue="247,293" endValue="234,283" duration="13"/>
     <item time="0" type="XY" target="n2_yjmk" tween="true" startValue="335,20" endValue="335,20" duration="5" ease="Linear"/>
     <item time="3" type="Alpha" target="n24_droi" tween="true" startValue="0" endValue="1" duration="11" ease="Custom" customEase="2,0,0,0.23,0.37,0.77,0.9325,1,0,1,1"/>

+ 56 - 18
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryCardChoose.cs

@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Linq;
 using System.Threading.Tasks;
 using FairyGUI;
 using UI.CommonGame;
@@ -9,12 +10,11 @@ namespace GFGGame
 {
     public class StoryCardChoose : BaseWindow
     {
-
         private UI_StoryCardChooseUI _ui;
         private List<CardData> cardList = new List<CardData>();
         private static int _scoreType;
         private int _selectedIndex = 0;
-        private int _cardId = 0;//记录打开界面时的竞技场卡牌id
+        private int _cardId = 0; //记录打开界面时的竞技场卡牌id
         private int _skillId = 0;
 
         private List<GameObject> _effects = new List<GameObject>();
@@ -22,6 +22,7 @@ namespace GFGGame
         private GameObject gameObject0;
         private GoWrapper wrapper0;
         private GComponent _comSelected;
+
         public override void Dispose()
         {
             base.Dispose();
@@ -30,6 +31,7 @@ namespace GFGGame
                 _comSelected.RemoveFromParent();
                 _comSelected.Dispose();
             }
+
             for (int i = 0; i < _effects.Count; i++)
             {
                 SceneController.DestroyObjectFromView(_effects[i], _wrappers[i]);
@@ -67,20 +69,38 @@ namespace GFGGame
 
             // SceneController.AddObjectToView(gameObject0, null, _comSelected.GetChild("holder").asGraph, resPath, out gameObject0, out wrapper0);
         }
+
         protected override void OnShown()
         {
             base.OnShown();
             _scoreType = (int)viewData;
+            ArenaDataManager dataManager = ArenaDataManager.Instance;
+            //其他主题带的cardIds
+            var otherThemeCardIds = new HashSet<int>();
+            for (int i = 0; i < dataManager.DressupList.Count; i++)
+            {
+                if (dataManager.SelectThemeIndex == i)
+                {
+                    continue;
+                }
+
+                otherThemeCardIds.Add(dataManager.DressupList[i].cardId);
+            }
+
             cardList = CardDataManager.GetCardListByRarity(0);
-            float dressListAllAcore = FightDataManager.Instance.GetDressListAllScore(MyDressUpHelper.dressUpObj.itemList, _scoreType);
+            //去掉已经在其他主题装配的cardList
+            cardList = cardList.Where(a => !otherThemeCardIds.Contains(a.id)).ToList();
+
+            float dressListAllAcore =
+                FightDataManager.Instance.GetDressListAllScore(MyDressUpHelper.dressUpObj.itemList, _scoreType);
             cardList = FightDataManager.Instance.SortCardList(cardList, dressListAllAcore, _scoreType);
             _ui.m_listCard.numItems = cardList.Count;
             _ui.m_listCard.selectedIndex = 0;
             if (InstanceZonesDataManager.FightScene == ConstInstanceZonesType.Arena)
             {
-                ArenaDataManager dataManager = ArenaDataManager.Instance;
                 _cardId = dataManager.DressupList[dataManager.SelectThemeIndex].cardId;
             }
+
             OnCardSelected(cardList[0].id);
             UpdateView(0);
 
@@ -107,24 +127,29 @@ namespace GFGGame
             int childIndex = _ui.m_listCard.ItemIndexToChildIndex(index);
             _ui.m_listCard.GetChildAt(childIndex).asCom.AddChild(_comSelected);
         }
+
         private void RenderListSkillItem(int index, GObject obj)
         {
             List<PassivitySkillCfg> skillCfgs = obj.parent.data as List<PassivitySkillCfg>;
             UI_ListCardSkillItem item = UI_ListCardSkillItem.Proxy(obj);
             item.m_loaSkill.url = ResPathUtil.GetCardSkillPath(skillCfgs[index].res);
-            item.m_txtLv.text = SkillDataManager.Instance.GetCardSkillLv(skillCfgs[index].cardId, skillCfgs[index].skillId).ToString();
+            item.m_txtLv.text = SkillDataManager.Instance
+                .GetCardSkillLv(skillCfgs[index].cardId, skillCfgs[index].skillId).ToString();
             if (item.target.data == null)
             {
                 item.target.onClick.Add(OnSkillItemClick);
             }
-            item.target.data = index;// skillCfgs[index];
+
+            item.target.data = index; // skillCfgs[index];
             UI_ListCardSkillItem.ProxyEnd();
         }
+
         private void OnSkillItemClick(EventContext context)
         {
             GObject gObject = context.sender as GObject;
             int index = (int)gObject.data;
-            List<PassivitySkillCfg> skillCfgs = PassivitySkillCfgArray.Instance.GetCfgsBycardId(cardList[_selectedIndex].id);
+            List<PassivitySkillCfg> skillCfgs =
+                PassivitySkillCfgArray.Instance.GetCfgsBycardId(cardList[_selectedIndex].id);
 
             PassivitySkillCfg skillCfg = skillCfgs[index];
             _ui.m_comSkillTips.target.visible = _skillId != skillCfg.skillId;
@@ -135,22 +160,25 @@ namespace GFGGame
 
             _ui.m_comSkillTips.m_txtName.text = skillCfg.name;
             int skillLv = SkillDataManager.Instance.GetCardSkillLv(skillCfg.cardId, skillCfg.skillId);
-            PassivitySkillLvlCfg skillLvlCfg = PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(skillLv, skillCfg.skillId);
+            PassivitySkillLvlCfg skillLvlCfg =
+                PassivitySkillLvlCfgArray.Instance.GetCfgByskilllvlAndskillId(skillLv, skillCfg.skillId);
             _ui.m_comSkillTips.m_txtSkillTips.text = skillLvlCfg.describe;
 
             _skillId = skillCfg.skillId;
-
         }
+
         private void RenderListCardItem(int index, GObject obj)
         {
             CardData cardData = cardList[index];
-            UI_ListCardItem item = UI_ListCardItem.Proxy(obj);// obj as GButton;
+            UI_ListCardItem item = UI_ListCardItem.Proxy(obj); // obj as GButton;
 
             item.m_txtName.text = cardData.itemCfg.name;
-            item.m_comCardMask.m_loaCard.asLoader.url = ResPathUtil.GetCardIconPath(cardData.resources[cardData.resIndex]);
+            item.m_comCardMask.m_loaCard.asLoader.url =
+                ResPathUtil.GetCardIconPath(cardData.resources[cardData.resIndex]);
             item.m_txtLv.text = string.Format("{0}级", cardData.lv);
             // item.m_loaRarity.url = ResPathUtil.GetCommonGameResPath("kp_sxing_x_" + cardData.itemCfg.rarity);
-            RarityIconController.UpdateRarityIcon(item.m_loaRarity, cardData.itemCfg.id, false);// ResPathUtil.GetCommonGameResPath("kp_sxing_x_" + data.itemCfg.rarity);
+            RarityIconController.UpdateRarityIcon(item.m_loaRarity, cardData.itemCfg.id,
+                false); // ResPathUtil.GetCommonGameResPath("kp_sxing_x_" + data.itemCfg.rarity);
             item.m_loaMainScore.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + (cardData.itemCfg.mainScore));
             item.m_loaBorder.url = "ui://CommonGame/kp_kuang_" + cardData.itemCfg.rarity;
             // UI_ComStar comStar = UI_ComStar.Proxy(item.m_comStar);
@@ -165,15 +193,16 @@ namespace GFGGame
                 // _effects.Add(gameObject0);
                 // _wrappers.Add(wrapper0);
             }
+
             UI_ListCardItem.ProxyEnd();
             // UI_ComStar.ProxyEnd();
         }
+
         private void OnListCardItemClick(EventContext context)
         {
             UpdateView(_ui.m_listCard.selectedIndex);
 
             OnCardSelected(cardList[_ui.m_listCard.selectedIndex].id);
-
         }
 
         private void OnCardSelected(int cardId)
@@ -182,15 +211,19 @@ namespace GFGGame
             {
                 ArenaDataManager dataManager = ArenaDataManager.Instance;
                 dataManager.DressupList[dataManager.SelectThemeIndex].cardId = cardId;
-                dataManager.SetMineFightAttr(dataManager.DressupList[dataManager.SelectThemeIndex], dataManager.SelectThemeIndex);
+                dataManager.SetMineFightAttr(dataManager.DressupList[dataManager.SelectThemeIndex],
+                    dataManager.SelectThemeIndex);
                 EventAgent.DispatchEvent(ConstMessage.CARD_SELECTED);
             }
         }
+
         private void OnBtnUpCardClikc()
         {
-            ViewManager.Show<CardFosterView>(cardList[_ui.m_listCard.selectedIndex], new object[] { typeof(StoryCardChoose).FullName, _scoreType });
+            ViewManager.Show<CardFosterView>(cardList[_ui.m_listCard.selectedIndex],
+                new object[] { typeof(StoryCardChoose).FullName, _scoreType });
             this.Hide();
         }
+
         private void OnBtnComfirmClick()
         {
             int cardId = cardList[_ui.m_listCard.selectedIndex].id;
@@ -198,7 +231,8 @@ namespace GFGGame
             if (InstanceZonesDataManager.FightScene == ConstInstanceZonesType.Arena)
             {
                 ArenaDataManager dataManager = ArenaDataManager.Instance;
-                ArenaSproxy.ReqChangeArenaDressup(dataManager.SelectThemeIndex, cardId, MyDressUpHelper.dressUpObj.itemList).Coroutine();
+                ArenaSproxy.ReqChangeArenaDressup(dataManager.SelectThemeIndex, cardId,
+                    MyDressUpHelper.dressUpObj.itemList).Coroutine();
                 if (InstanceZonesDataManager.FightScene == ConstInstanceZonesType.Arena)
                 {
                     ViewManager.GoBackFrom(typeof(ArenaDressUpFightView).FullName);
@@ -210,6 +244,7 @@ namespace GFGGame
                 InstanceZonesDataManager.currentCardId = cfgs.Count > 0 ? cardId : -1;
                 EventAgent.DispatchEvent(ConstMessage.CARD_CHOOSE);
             }
+
             this.Hide();
         }
 
@@ -219,14 +254,15 @@ namespace GFGGame
             OnCardSelected(_cardId);
             this.Hide();
         }
+
         protected override void OnHide()
         {
             base.OnHide();
             _skillId = 0;
             _ui.m_listCard.ScrollToView(0);
             Timers.inst.Remove(CheckGuide);
-
         }
+
         private void CheckGuide(object param)
         {
             if (GuideDataManager.IsGuideFinish(ConstGuideId.SKILL_CARD_FIGHT) <= 0)
@@ -238,11 +274,13 @@ namespace GFGGame
                 Timers.inst.Remove(CheckGuide);
             }
         }
+
         protected override void UpdateToCheckGuide(object param)
         {
             if (!ViewManager.CheckIsTopView(this.viewCom)) return;
 
-            GuideController.TryGuide(null, ConstGuideId.SKILL_CARD_FIGHT, 1, "词牌可以辅助战斗,增加过关概率哦。", -1, true, _ui.m_btnCancel.y + _ui.m_btnCancel.height);
+            GuideController.TryGuide(null, ConstGuideId.SKILL_CARD_FIGHT, 1, "词牌可以辅助战斗,增加过关概率哦。", -1, true,
+                _ui.m_btnCancel.y + _ui.m_btnCancel.height);
             GuideController.TryGuide(_ui.m_listCard, ConstGuideId.SKILL_CARD_FIGHT, 2, "选择一张合适的词牌,增加过关战斗力。", 0);
             GuideController.TryCompleteGuide(ConstGuideId.SKILL_CARD_FIGHT, 2);
         }

BIN
GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_fui.bytes