ソースを参照

Merge branch 'yujie' of http://10.108.64.190:3000/gfg/Client into yujie

# Conflicts:
#	GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes
yj 2 年 前
コミット
ed5e142d0a

+ 2 - 2
FGUIProject/assets/RoleInfo/components/ComBtn.xml

@@ -25,8 +25,8 @@
       <Button title="设置玩家章节" titleFontSize="30"/>
     </component>
     <text id="n18_lqp0" name="txtChapter" xy="333,245" size="44,42" group="n27_ysx9" fontSize="30" autoSize="none" text="5" input="true" prompt="[color=#B6A688]章[/color]"/>
-    <text id="n24_lqp0" name="n24" xy="454,246" size="34,41" group="n27_ysx9" fontSize="30" text="关"/>
-    <text id="n21_lqp0" name="n21" xy="377,245" size="34,41" group="n27_ysx9" fontSize="30" text="章"/>
+    <text id="n24_lqp0" name="n24" xy="454,246" size="34,42" group="n27_ysx9" fontSize="30" text="关"/>
+    <text id="n21_lqp0" name="n21" xy="377,245" size="34,42" group="n27_ysx9" fontSize="30" text="章"/>
     <text id="n19_lqp0" name="txtChapterLv" xy="411,245" size="42,42" group="n27_ysx9" fontSize="30" autoSize="none" text="1" input="true" prompt="[color=#B6A688]关[/color]"/>
     <group id="n27_ysx9" name="n27" xy="1,244" size="487,46" group="n28_ysx9" advanced="true">
       <gearDisplay controller="c1" pages="0,1"/>

+ 2 - 2
FGUIProject/assets/Task/BattlePassRewardUI.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920" opaque="false">
-  <controller name="c1" pages="0,打开购买通行证,1,关闭购买通行证" selected="1"/>
+  <controller name="c1" pages="0,打开购买通行证,1,关闭购买通行证" selected="0"/>
   <displayList>
     <image id="n15_nd17" name="n15" src="uxxstmf" fileName="images/sj_dk.png" xy="0,240">
       <relation target="" sidePair="left-right"/>
@@ -49,7 +49,7 @@
     <component id="n51_nd17" name="btnGetAll" src="rv091o" fileName="components/Button11.xml" pkg="eg2y0ldp" xy="408,1781" size="266,70">
       <Button title="一键领取"/>
     </component>
-    <component id="n52_or80" name="n52" src="or80tlw" fileName="components/BattlePassReward.xml" xy="5,1577"/>
+    <component id="n52_or80" name="SpecialReward" src="or80tlw" fileName="components/BattlePassReward.xml" xy="5,1577"/>
     <image id="n53_or80" name="n53" src="9jv66j" fileName="imagesNew/lm_zsx0.png" pkg="eg2y0ldp" xy="139,1548"/>
     <text id="n54_or80" name="n54" xy="412,1549" size="196,44" fontSize="32" color="#915e15" text="下个特别大奖"/>
   </displayList>

+ 6 - 3
FGUIProject/assets/Task/BuyBattlePassLevelUI.xml

@@ -8,7 +8,7 @@
     <image id="n3_or80" name="n3" src="uxxstms" fileName="images/lm_biaotizi_13.png" xy="248,83"/>
     <text id="n4_or80" name="n4" xy="186,130" size="228,39" fontSize="28" color="#b79f7d" text="立即获得以下奖励"/>
     <image id="n5_or80" name="n5" src="wm603t" fileName="imagesNew/lm_zhuangshixian_duan.png" pkg="eg2y0ldp" xy="148,488"/>
-    <list id="n6_or80" name="n6" xy="183,173" size="724,309" layout="flow_hz" overflow="scroll" lineGap="4" colGap="26" defaultItem="ui://5mpsibzznd1743">
+    <list id="n6_or80" name="Rewards" xy="183,173" size="724,309" layout="flow_hz" overflow="scroll" lineGap="4" colGap="26" defaultItem="ui://5mpsibzznd1743" autoClearItems="true">
       <item/>
       <item/>
       <item/>
@@ -22,7 +22,10 @@
       <item/>
       <item/>
     </list>
-    <text id="n9_or80" name="n9" xy="447,558" size="171,39" fontSize="28" color="#b79f7d" vars="true" text="{startLeve=0}级提升至{endLevel=1}级"/>
-    <component id="n10_itts" name="n10" src="uxxstm2" fileName="components/AddReduceButton.xml" xy="367,498"/>
+    <text id="n9_or80" name="Tip" xy="447,558" size="171,39" fontSize="28" color="#b79f7d" vars="true" text="{startLeve=0}级提升至{endLevel=1}级"/>
+    <image id="n17_itts" name="Add" src="uxxstm6" fileName="images/an_jia.png" xy="674,490" group="n21_itts"/>
+    <image id="n18_itts" name="Reduce" src="uxxstmz" fileName="images/an_jian.png" xy="329,492" group="n21_itts"/>
+    <component id="n22_itts" name="n22" src="ittstnk" fileName="components/BuyBattlePassLevelBt.xml" xy="402,490" group="n21_itts"/>
+    <group id="n21_itts" name="n21" xy="329,490" size="406,62"/>
   </displayList>
 </component>

+ 1 - 1
FGUIProject/assets/Task/OpenBattlePassUI.xml

@@ -8,7 +8,7 @@
     <image id="n3_or80" name="n3" src="uxxstmv" fileName="images/lm_biaotizi_12.png" xy="248,83"/>
     <text id="n4_or80" name="n4" xy="186,130" size="228,39" fontSize="28" color="#b79f7d" text="解锁特别制造奖励"/>
     <image id="n5_or80" name="n5" src="wm603t" fileName="imagesNew/lm_zhuangshixian_duan.png" pkg="eg2y0ldp" xy="148,488"/>
-    <list id="n6_or80" name="n6" xy="183,173" size="724,309" layout="flow_hz" overflow="scroll" lineGap="4" colGap="26" defaultItem="ui://5mpsibzznd1743">
+    <list id="n6_or80" name="Rewards" xy="183,173" size="724,309" layout="flow_hz" overflow="scroll" lineGap="4" colGap="26" defaultItem="ui://5mpsibzznd1743" autoClearItems="true">
       <item/>
       <item/>
       <item/>

+ 0 - 10
FGUIProject/assets/Task/components/AddReduceButton.xml

@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<component size="348,63" designImageOffsetX="-366" designImageOffsetY="-1020">
-  <displayList>
-    <image id="n1_uxxs" name="n1" src="uxxstm9" fileName="images/db_jiajian.png" xy="24,2"/>
-    <text id="n0_uxxs" name="n0" xy="145,8" size="123,48" fontSize="35" autoSize="none" text="" input="true"/>
-    <image id="n2_uxxs" name="n2" src="uxxstm6" fileName="images/an_jia.png" xy="287,2"/>
-    <image id="n3_uxxs" name="n3" src="uxxstmz" fileName="images/an_jian.png" xy="-4,3"/>
-    <image id="n4_uxxs" name="n4" src="a0cf2h" fileName="imagesNew/lm_tb.png" pkg="eg2y0ldp" xy="106,17"/>
-  </displayList>
-</component>

+ 12 - 0
FGUIProject/assets/Task/components/BuyBattlePassLevelBt.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="260,62" extention="Button">
+  <controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
+  <displayList>
+    <image id="n0_itts" name="n0" src="a0cf2d" fileName="imagesExport/lm_an.png" pkg="mk0fwx0x" xy="0,0">
+      <relation target="" sidePair="width-width,height-height"/>
+    </image>
+    <image id="n1_itts" name="n1" src="a0cf2h" fileName="imagesNew/lm_tb.png" pkg="eg2y0ldp" xy="68,15"/>
+    <text id="n2_itts" name="title" xy="111,6" size="110,48" fontSize="35" color="#915e15" align="center" vAlign="middle" autoSize="none" text=""/>
+  </displayList>
+  <Button/>
+</component>

+ 1 - 1
FGUIProject/assets/Task/package.xml

@@ -17,7 +17,6 @@
     <component id="or80tlw" name="BattlePassReward.xml" path="/components/"/>
     <component id="or80tlx" name="OpenBattlePassUI.xml" path="/" exported="true"/>
     <component id="or80tm1" name="BuyBattlePassLevelUI.xml" path="/" exported="true"/>
-    <component id="uxxstm2" name="AddReduceButton.xml" path="/components/"/>
     <image id="uxxstm3" name="bt_db_ptzz.png" path="/images/"/>
     <image id="uxxstm4" name="wz_kqjlzz.png" path="/images/"/>
     <image id="uxxstm5" name="wpk_sz_db2.png" path="/images/"/>
@@ -70,6 +69,7 @@
     <image id="ittstng" name="mrqd_xian.png" path="/images/"/>
     <image id="ittstni" name="wz_gmzzdj.png" path="/images/"/>
     <component id="ittstnj" name="ButtonBuyBattlePassLevel.xml" path="/components/"/>
+    <component id="ittstnk" name="BuyBattlePassLevelBt.xml" path="/components/"/>
   </resources>
   <publish name="" path="../GameClient/Assets/ResIn/UI/Task" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 72 - 0
GameClient/Assets/Game/HotUpdate/Data/BattlePassTaskDataManager.cs

@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Linq;
 using ET;
 
 namespace GFGGame
@@ -14,6 +15,8 @@ namespace GFGGame
 
         private long SeasonEndTime = 0;
 
+        private SelectionCache<int, int> selectionCache;
+
 
         //已经领奖levelId
         private HashSet<int> NormalRewards = new HashSet<int>();
@@ -21,6 +24,8 @@ namespace GFGGame
         //已经高级领奖levelId
         private HashSet<int> SuperRewards = new HashSet<int>();
 
+        private List<KeyValuePair<int, long>> tempItems = new List<KeyValuePair<int, long>>();
+
         public int GetSeasonId()
         {
             return SeasonId;
@@ -44,6 +49,8 @@ namespace GFGGame
             var seasonCfg = BattlePassOpenCfgArray.Instance.GetCfg(seasonId);
             if (seasonCfg == null) return;
             SeasonEndTime = TimeUtil.GetResetTimeSec(seasonCfg.endTime);
+            SetSpecialCfgCache();
+            InitItemTemp();
         }
 
         public void SetIsBuy(bool isBuy)
@@ -51,6 +58,21 @@ namespace GFGGame
             IsBuy = isBuy;
         }
 
+        public bool GetIsBuy()
+        {
+            return IsBuy;
+        }
+
+        //0:未完成 1:可领取 2:已领取 3:继续领取
+        public int GetRewardState(int level)
+        {
+            var battlePassLevel = GetBattlePassLevel();
+            if (level > battlePassLevel) return 0;
+            if (!NormalRewards.Contains(level)) return 1;
+            if (!IsBuy) return 2;
+            return !SuperRewards.Contains(level) ? 3 : 2;
+        }
+
         //检查普通领取状态
         public bool CheckLevelRewardGet(int levelId)
         {
@@ -74,5 +96,55 @@ namespace GFGGame
         {
             return GameGlobal.myNumericComponent.GetAsInt(NumericType.PassLevel);
         }
+
+        //获取通行证当前经验
+        public long GetBattlePassExp()
+        {
+            return ItemDataManager.GetItemNum(ConstItemID.BATTLE_PASS_CURRENCY);
+        }
+
+        public BattlePassCfg GetSpecialCfg(int level)
+        {
+            var targetLevel = selectionCache.GetValueNoCache(level);
+            return BattlePassCfgArray.Instance.GetCfgByidAndlevel(SeasonId, targetLevel);
+        }
+
+        private void SetSpecialCfgCache()
+        {
+            var battlePassCfgs = BattlePassCfgArray.Instance.GetCfgsByisGood(1);
+            var minIndex = 0;
+            var selections = new List<Selection<int, int>>();
+            foreach (var battlePassCfg in battlePassCfgs)
+            {
+                selections.Add(new Selection<int, int>(minIndex, battlePassCfg.level, battlePassCfg.level,
+                    Selection<int, int>.SelectionModel.AllInclude));
+                minIndex = battlePassCfg.level + 1;
+            }
+            selectionCache = new SelectionCache<int, int>(battlePassCfgs[0].level);
+            selectionCache.AddSelection(selections);
+        }
+
+        //获取所有特别奖励
+        public List<KeyValuePair<int, long>> GetAllSpecialCfg()
+        {
+            return tempItems;
+        }
+
+        private void InitItemTemp()
+        {
+            tempItems.Clear();
+            var battlePassCfgs = BattlePassCfgArray.Instance.GetCfgsByisGood(GetSeasonId());
+            var items = new Dictionary<int, long>();
+            foreach (var itemsInfo in battlePassCfgs.SelectMany(battlePassCfg => battlePassCfg.bonusSpecialArr))
+            {
+                items.TryGetValue(itemsInfo[0], out var num);
+                items[itemsInfo[0]] = num + itemsInfo[1];
+            }
+            // items 装成 KeyValuePair<int,long> 
+            foreach (var item in items)
+            {
+                tempItems.Add(item);
+            }
+        }
     }
 }

+ 4 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Task/UI_BattlePassRewardUI.cs

@@ -14,6 +14,7 @@ namespace UI.Task
         public GButton m_btnOpen;
         public GList m_RewardList;
         public GButton m_btnGetAll;
+        public UI_BattlePassReward m_SpecialReward;
         public const string URL = "ui://5mpsibzznd173r";
         public const string PACKAGE_NAME = "Task";
         public const string RES_NAME = "BattlePassRewardUI";
@@ -68,6 +69,7 @@ namespace UI.Task
             m_btnOpen = (GButton)comp.GetChild("btnOpen");
             m_RewardList = (GList)comp.GetChild("RewardList");
             m_btnGetAll = (GButton)comp.GetChild("btnGetAll");
+            m_SpecialReward = (UI_BattlePassReward)UI_BattlePassReward.Create(comp.GetChild("SpecialReward"));
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -79,6 +81,8 @@ namespace UI.Task
             m_btnOpen = null;
             m_RewardList = null;
             m_btnGetAll = null;
+            m_SpecialReward.Dispose();
+            m_SpecialReward = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 12 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Task/UI_BuyBattlePassLevelUI.cs

@@ -8,6 +8,10 @@ namespace UI.Task
     {
         public GComponent target;
         public GButton m_CloseBtn;
+        public GList m_Rewards;
+        public GTextField m_Tip;
+        public GImage m_Add;
+        public GImage m_Reduce;
         public const string URL = "ui://5mpsibzzor80tm1";
         public const string PACKAGE_NAME = "Task";
         public const string RES_NAME = "BuyBattlePassLevelUI";
@@ -56,10 +60,18 @@ namespace UI.Task
         private void Init(GComponent comp)
         {
             m_CloseBtn = (GButton)comp.GetChild("CloseBtn");
+            m_Rewards = (GList)comp.GetChild("Rewards");
+            m_Tip = (GTextField)comp.GetChild("Tip");
+            m_Add = (GImage)comp.GetChild("Add");
+            m_Reduce = (GImage)comp.GetChild("Reduce");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_CloseBtn = null;
+            m_Rewards = null;
+            m_Tip = null;
+            m_Add = null;
+            m_Reduce = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Task/UI_OpenBattlePassUI.cs

@@ -8,6 +8,7 @@ namespace UI.Task
     {
         public GComponent target;
         public GButton m_CloseBtn;
+        public GList m_Rewards;
         public GButton m_OpenBtn;
         public const string URL = "ui://5mpsibzzor80tlx";
         public const string PACKAGE_NAME = "Task";
@@ -57,11 +58,13 @@ namespace UI.Task
         private void Init(GComponent comp)
         {
             m_CloseBtn = (GButton)comp.GetChild("CloseBtn");
+            m_Rewards = (GList)comp.GetChild("Rewards");
             m_OpenBtn = (GButton)comp.GetChild("OpenBtn");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_CloseBtn = null;
+            m_Rewards = null;
             m_OpenBtn = null;
             if(disposeTarget && target != null)
             {

+ 46 - 11
GameClient/Assets/Game/HotUpdate/Views/Task/BattlePassTaskView.cs

@@ -1,8 +1,8 @@
 using System.Collections.Generic;
-using System.Linq;
 using ET;
 using FairyGUI;
 using UI.Task;
+using UnityEngine;
 
 namespace GFGGame
 {
@@ -12,8 +12,11 @@ namespace GFGGame
 
         private List<BattlePassCfg> _rewardCfgs;
 
+        private int maxShowIndex;
+
         public override void Dispose()
         {
+            maxShowIndex = 0;
             if (_ui != null)
             {
                 _ui.Dispose();
@@ -33,12 +36,10 @@ namespace GFGGame
             clickBlankToClose = false;
 
             _ui.m_btnOpen.onClick.Add(OnBtnOpenClick);
-            // _ui.m_btnGet.onClick.Add(OnBtnGetClick);
-            // _ui.m_btnContinue.onClick.Add(OnBtnContinueClick);
-            // _ui.m_btnGetAll.onClick.Add(OnBtnGetAllClick);
-            // _ui.m_btnGo.onClick.Add(OnBtnGoClick);
+            _ui.m_btnBuyLevel.onClick.Add(OnBtnBuyLevel);
             _ui.m_btnGetAll.onClick.Add(OnBtnGetAllClick);
             _ui.m_RewardList.itemRenderer = ListBoxRewardItemRender;
+            _ui.m_SpecialReward.m_RewardList.itemRenderer = SpecialRewardRender;
         }
 
 
@@ -52,16 +53,20 @@ namespace GFGGame
             _ui.m_RewardList.numItems = _rewardCfgs.Count - 1;
             SetSeasonLeftTime();
             SetBattlePassLevel();
+            SetOpenBattlePassBtnStatus();
+            FreshSpecialReward();
         }
 
 
         //开启通行证
         private void OnBtnOpenClick(EventContext context)
         {
+            ViewManager.Show<OpenBattlePassView>(null, new object[] { typeof(BattlePassTaskView).FullName, null });
         }
 
         private void OnBtnBuyLevel(EventContext context)
         {
+            ViewManager.Show<BuyBattlePassLevelView>(null, new object[] { typeof(BattlePassTaskView).FullName, null });
         }
 
         //领取奖励
@@ -97,8 +102,9 @@ namespace GFGGame
         private void ListBoxRewardItemRender(int index, GObject obj)
         {
             var item = UI_BattlePassRewardItem.Proxy(obj);
+            var level = index + 1;
             //这里跳过为0的第一个配置
-            var battlePassCfg = _rewardCfgs[index + 1];
+            var battlePassCfg = _rewardCfgs[level];
             //设置等级
             item.m_Level.text = battlePassCfg.level.ToString();
             //设置奖励
@@ -121,11 +127,11 @@ namespace GFGGame
             item.m_RewardList.data = battlePassCfg.bonusSpecialArr;
             item.m_RewardList.numItems = battlePassCfg.bonusSpecialArr.Length;
             //获取玩家当前的通行证等级
-            var dataManager = BattlePassTaskDataManager.Instance;
-            var state = 1;
+            var state = BattlePassTaskDataManager.Instance.GetRewardState(level);
             //设置按钮状态
             SetBtnState(item, battlePassCfg.id, state);
             item.target.data = battlePassCfg;
+            maxShowIndex = Mathf.Max(maxShowIndex, level);
             UI_BattlePassRewardItem.ProxyEnd();
         }
 
@@ -148,7 +154,6 @@ namespace GFGGame
                 item.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(itemCfg.res);
                 item.m_num.text = num.ToString();
             }
-
             UI_RewardIconYellow.ProxyEnd();
         }
 
@@ -200,7 +205,6 @@ namespace GFGGame
             _ui.m_LeftTime.text = TimeUtil.FormattingTime(TimeHelper.ServerNow(), seasonEndTime);
         }
 
-
         private void SetBattlePassLevel()
         {
             //获取玩家当前的通行证等级
@@ -213,12 +217,43 @@ namespace GFGGame
                 BattlePassCfgArray.Instance.GetCfgByidAndlevel(dataManager.GetSeasonId(),
                     dataManager.GetBattlePassLevel());
             uiExpProcess.target.max = battlePassCfg.value;
-            uiExpProcess.target.value = 50;
+            uiExpProcess.target.value = dataManager.GetBattlePassExp();
+            uiExpProcess.m_NumProcess.SetVar("value", dataManager.GetBattlePassExp().ToString())
+                .SetVar("maxValue", battlePassCfg.value.ToString()).FlushVars();
+        }
+
+        private void SetOpenBattlePassBtnStatus()
+        {
+            //通行证是否购买
+            var isBuy = BattlePassTaskDataManager.Instance.GetIsBuy();
+            _ui.m_c1.selectedIndex = isBuy ? 0 : 1;
         }
 
         //刷新特别大奖展示
         private void FreshSpecialReward()
         {
+            var battlePassCfg = BattlePassTaskDataManager.Instance.GetSpecialCfg(maxShowIndex);
+            var uiBattlePassReward = _ui.m_SpecialReward;
+            if (battlePassCfg == null)
+            {
+                uiBattlePassReward.target.visible = false;
+                return;
+            }
+            uiBattlePassReward.target.visible = true;
+            uiBattlePassReward.m_Level.text = battlePassCfg.level.ToString();
+            //设置奖励
+            var bonusNormalArr = battlePassCfg.bonusNormalArr;
+            if (bonusNormalArr != null && bonusNormalArr.Length > 0)
+            {
+                var itemCfg = ItemCfgArray.Instance.GetCfg(bonusNormalArr[0][0]);
+                if (itemCfg != null)
+                {
+                    uiBattlePassReward.m_NormalReward.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(itemCfg.res);
+                    uiBattlePassReward.m_NormalReward.m_num.text = bonusNormalArr[0][1].ToString();
+                }
+            }
+            uiBattlePassReward.m_RewardList.data = battlePassCfg.bonusSpecialArr;
+            uiBattlePassReward.m_RewardList.numItems = battlePassCfg.bonusSpecialArr.Length;
         }
     }
 }

+ 82 - 0
GameClient/Assets/Game/HotUpdate/Views/Task/BuyBattlePassLevelView.cs

@@ -0,0 +1,82 @@
+using System.Collections.Generic;
+using FairyGUI;
+using UI.Task;
+
+namespace GFGGame
+{
+    public class BuyBattlePassLevelView : BaseWindow
+    {
+        private UI_BuyBattlePassLevelUI _ui;
+
+        private int addLevel = 1;
+
+        public override void Dispose()
+        {
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+            base.Dispose();
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_OpenBattlePassUI.PACKAGE_NAME;
+            _ui = UI_BuyBattlePassLevelUI.Create();
+            viewCom = _ui.target;
+            viewCom.Center();
+            _ui.m_CloseBtn.onClick.Add(Hide);
+            // clickBlankToClose = false;
+            _ui.m_Rewards.itemRenderer = SpecialRewardRender;
+            _ui.m_Add.onClick.Add(OnAddLevel);
+            _ui.m_Reduce.onClick.Add(OnReduceLevel);
+        }
+
+        protected override void OnShown()
+        {
+            setLevel();
+            base.OnShown();
+        }
+
+        private static void SpecialRewardRender(int index, GObject obj)
+        {
+            var item = UI_RewardIconYellow.Proxy(obj);
+            var itemInfos = (List<KeyValuePair<int, long>>)obj.parent.data;
+            // if (!(obj.parent.data is int[][] parentData))
+            // {
+            //     UI_RewardIconYellow.ClearProxy();
+            //     return;
+            // }
+            var itemInfo = itemInfos[index];
+            var itemId = itemInfo.Key;
+            var num = itemInfo.Value;
+            var itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
+            if (itemCfg != null)
+            {
+                item.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(itemCfg.res);
+                item.m_num.text = num.ToString();
+            }
+            UI_RewardIconYellow.ProxyEnd();
+        }
+
+        private void setLevel()
+        {
+            var battlePassLevel = BattlePassTaskDataManager.Instance.GetBattlePassLevel();
+            _ui.m_Tip.SetVar("StartLevel", battlePassLevel.ToString())
+                .SetVar("EndLevel", (battlePassLevel + addLevel).ToString()).FlushVars();
+            GlobalCfgArray.globalCfg.
+            _ui.m_Value.text = (addLevel * BattlePassTaskDataManager.Instance.GetBattlePassLevelPrice()).ToString();
+        }
+
+
+        private void OnReduceLevel(EventContext context)
+        {
+        }
+
+        private void OnAddLevel(EventContext context)
+        {
+        }
+    }
+}

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Views/Task/BuyBattlePassLevelView.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 254054006d324e17a8d863110779b991
+timeCreated: 1684829497

+ 38 - 3
GameClient/Assets/Game/HotUpdate/Views/Task/OpenBattlePassView.cs

@@ -1,3 +1,5 @@
+using System.Collections.Generic;
+using FairyGUI;
 using UI.Task;
 
 namespace GFGGame
@@ -23,8 +25,16 @@ namespace GFGGame
             packageName = UI_OpenBattlePassUI.PACKAGE_NAME;
             _ui = UI_OpenBattlePassUI.Create();
             viewCom = _ui.target;
-            // isfullScreen = true;
-            clickBlankToClose = false;
+            viewCom.Center();
+            _ui.m_CloseBtn.onClick.Add(Hide);
+            // clickBlankToClose = false;
+            _ui.m_Rewards.itemRenderer = SpecialRewardRender;
+            _ui.m_OpenBtn.onClick.Add(OnBtnOpenClick);
+        }
+
+        private void OnBtnOpenClick(EventContext context)
+        {
+            //TODO:打开购买界面
         }
 
 
@@ -33,10 +43,35 @@ namespace GFGGame
             base.OnShown();
             SetPrizeData();
         }
+        
+        
 
+        private static void SpecialRewardRender(int index, GObject obj)
+        {
+            var item = UI_RewardIconYellow.Proxy(obj);
+            var itemInfo = (KeyValuePair<int, long>)obj.parent.data;
+            // if (!(obj.parent.data is int[][] parentData))
+            // {
+            //     UI_RewardIconYellow.ClearProxy();
+            //     return;
+            // }
+            var itemId = itemInfo.Key;
+            var num = itemInfo.Value;
+            var itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
+            if (itemCfg != null)
+            {
+                item.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(itemCfg.res);
+                item.m_num.text = num.ToString();
+            }
+            UI_RewardIconYellow.ProxyEnd();
+        }
         private void SetPrizeData()
         {
-            
+            //获取所有特别奖励数据
+            var dataManager = BattlePassTaskDataManager.Instance;
+            var allSpecialCfg = dataManager.GetAllSpecialCfg();
+            _ui.m_Rewards.numItems = allSpecialCfg.Count;
+            _ui.m_Rewards.data = allSpecialCfg;
         }
     }
 }

BIN
GameClient/Assets/ResIn/UI/Task/Task_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/Task/Task_atlas0.png


BIN
GameClient/Assets/ResIn/UI/Task/Task_fui.bytes