Эх сурвалжийг харах

雅集祈福增加展示奖励徽章

huangxiaoyue 1 жил өмнө
parent
commit
7e8138882e

+ 6 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/League/UI_ComPary.cs

@@ -11,9 +11,10 @@ namespace UI.League
         public GLoader m_LoaIcon;
         public GTextField m_txtName;
         public GComponent m_comGain;
-        public GComponent m_comFirstGain;
+        public GComponent m_comGain2;
         public GTextField m_txtCount;
         public UI_Button20 m_btnPray;
+        public GComponent m_comFirstGain;
         public const string URL = "ui://tw70qm9drv0929";
         public const string PACKAGE_NAME = "League";
         public const string RES_NAME = "ComPary";
@@ -65,9 +66,10 @@ namespace UI.League
             m_LoaIcon = (GLoader)comp.GetChild("LoaIcon");
             m_txtName = (GTextField)comp.GetChild("txtName");
             m_comGain = (GComponent)comp.GetChild("comGain");
-            m_comFirstGain = (GComponent)comp.GetChild("comFirstGain");
+            m_comGain2 = (GComponent)comp.GetChild("comGain2");
             m_txtCount = (GTextField)comp.GetChild("txtCount");
             m_btnPray = (UI_Button20)UI_Button20.Create(comp.GetChild("btnPray"));
+            m_comFirstGain = (GComponent)comp.GetChild("comFirstGain");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -75,10 +77,11 @@ namespace UI.League
             m_LoaIcon = null;
             m_txtName = null;
             m_comGain = null;
-            m_comFirstGain = null;
+            m_comGain2 = null;
             m_txtCount = null;
             m_btnPray.Dispose();
             m_btnPray = null;
+            m_comFirstGain = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

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

@@ -1,5 +1,6 @@
 using ET;
 using FairyGUI;
+using UI.CommonGame;
 using UI.League;
 using UnityEngine;
 
@@ -64,13 +65,25 @@ namespace GFGGame
         }
         private void UpdateComPary(GObject obj, int type)
         {
-
             LeaguePrayCfg prayCfg = LeaguePrayCfgArray.Instance.GetCfg(type);
             UI_ComPary item = UI_ComPary.Proxy(obj);
+            int curTimes = LeagueDataManager.Instance.GetPrayTimesByType(type);
+            int ExtraArrLength = prayCfg.bonusExtraArr.Length;
             ItemUtil.UpdateItemNeedNum(item.m_comGain, prayCfg.bonusArr[0][0], prayCfg.bonusArr[0][1], false, "#B38441");
             ItemUtil.UpdateItemNeedNum(item.m_comFirstGain, prayCfg.bonusOnceArr[0][0], prayCfg.bonusOnceArr[0][1], false, "#B38441");
 
-            int curTimes = LeagueDataManager.Instance.GetPrayTimesByType(type);
+            if(ExtraArrLength > 0)
+                ItemUtil.UpdateItemNeedNum(item.m_comGain2, prayCfg.bonusExtraArr[0][0], prayCfg.bonusExtraArr[0][1], false, "#B38441");
+
+            if (curTimes != 0 && ExtraArrLength <= 0)
+                item.m_c1.selectedIndex = 0;
+            else if(curTimes != 0 && ExtraArrLength > 0)
+                item.m_c1.selectedIndex = 1;
+            else if (curTimes == 0 && ExtraArrLength <= 0)
+                item.m_c1.selectedIndex = 2;
+            else if (curTimes == 0 && ExtraArrLength > 0)
+                item.m_c1.selectedIndex = 3;
+
             if (type == LeaguePrayType.First && curTimes == 0)
             {
                 ItemUtil.UpdateItemNeedNum(item.m_btnPray.m_comCost, prayCfg.consumeArr[0][0], 0);
@@ -79,10 +92,10 @@ namespace GFGGame
             {
                 ItemUtil.UpdateItemNeedNum(item.m_btnPray.m_comCost, prayCfg.consumeArr[0][0], prayCfg.consumeArr[0][1]);
             }
-            item.m_c1.selectedIndex = curTimes == 0 ? 0 : 1;
             item.m_btnPray.target.enabled = curTimes < prayCfg.limit;
             item.m_txtCount.SetVar("value", curTimes.ToString()).FlushVars();
             item.m_txtCount.SetVar("maxValue", prayCfg.limit.ToString()).FlushVars();
+
             if (item.m_btnPray.target.data == null)
             {
                 item.m_btnPray.target.onClick.Add(OnBtnPrayClick);

BIN
GameClient/Assets/ResIn/UI/League/League_fui.bytes