zhaoyang 2 роки тому
батько
коміт
8063dc6b18

+ 9 - 2
FGUIProject/assets/League/components/ComPary.xml

@@ -1,16 +1,23 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="196,594">
+  <controller name="c1" pages="0,,1," selected="0">
+    <remark page="0" value="首次"/>
+    <remark page="1" value="非首次"/>
+  </controller>
   <displayList>
     <loader id="n2_rv09" name="LoaIcon" xy="27,0" pivot="0.5,0" size="142,142" aspect="true" url="ui://eg2y0ldpu2u3tkq" align="center" fill="scale"/>
     <text id="n3_rv09" name="txtName" xy="51,162" pivot="0.5,0" size="93,41" fontSize="30" text="白檀香"/>
     <text id="n9_a0cf" name="n9" xy="37,227" pivot="0.5,0" size="122,42" fontSize="30" align="center" text="每次祈福"/>
     <component id="n4_rv09" name="comGain" src="n3xha1" fileName="components/ComCostCurrency.xml" pkg="eg2y0ldp" xy="33,273"/>
-    <component id="n6_rv09" name="comFirstGain" src="n3xha1" fileName="components/ComCostCurrency.xml" pkg="eg2y0ldp" xy="37,376"/>
+    <text id="n10_a0cf" name="n10" xy="7,336" pivot="0.5,0" size="182,42" group="n11_a0cf" fontSize="30" align="center" text="每日首次祈福"/>
+    <component id="n6_rv09" name="comFirstGain" src="n3xha1" fileName="components/ComCostCurrency.xml" pkg="eg2y0ldp" xy="37,376" group="n11_a0cf"/>
+    <group id="n11_a0cf" name="n11" xy="7,336" size="182,86" advanced="true">
+      <gearDisplay controller="c1" pages="0"/>
+    </group>
     <component id="n7_rv09" name="btnPray" src="rv0928" fileName="components/Button19.xml" xy="0,460">
       <Button title="祈福"/>
     </component>
     <component id="n8_rv09" name="comCurrency" src="n3xha1" fileName="components/ComCostCurrency.xml" pkg="eg2y0ldp" xy="31,534"/>
-    <text id="n10_a0cf" name="n10" xy="7,322" pivot="0.5,0" size="182,42" fontSize="30" align="center" text="每日首次祈福"/>
   </displayList>
   <customProperty target="LoaIcon" propertyId="1"/>
   <customProperty target="txtName" propertyId="0"/>

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Data/LeagueDataManager.cs

@@ -53,13 +53,13 @@ namespace GFGGame
             switch (pos)
             {
                 case LeaguePos.Owner:
-                    title = "长";
+                    title = "长";
                     break;
                 case LeaguePos.SubOwner:
-                    title = "副长";
+                    title = "副长";
                     break;
                 case LeaguePos.Flower:
-                    title = "会花";
+                    title = "御史";
                     break;
                 case LeaguePos.Member:
                     title = "成员";

+ 33 - 0
GameClient/Assets/Game/HotUpdate/Data/RoleDataManager.cs

@@ -135,6 +135,39 @@ namespace GFGGame
                 return GameGlobal.myNumericComponent.GetAsInt(NumericType.ArenaTimesBonusSpecial);
             }
         }
+        /// <summary>
+        ///类型一今日祈福次数
+        /// </summary>
+        /// <value></value>
+        public static int LeagueType1PrayTimes
+        {
+            get
+            {
+                return GameGlobal.myNumericComponent.GetAsInt(NumericType.LeagueType1PrayTimes);
+            }
+        }
+        /// <summary>
+        ///类型二今日祈福次数
+        /// </summary>
+        /// <value></value>
+        public static int LeagueType2PrayTimes
+        {
+            get
+            {
+                return GameGlobal.myNumericComponent.GetAsInt(NumericType.LeagueType2PrayTimes);
+            }
+        }
+        /// <summary>
+        ///类型三今日祈福次数
+        /// </summary>
+        /// <value></value>
+        public static int LeagueType3PrayTimes
+        {
+            get
+            {
+                return GameGlobal.myNumericComponent.GetAsInt(NumericType.LeagueType3PrayTimes);
+            }
+        }
 
         public static bool CheckPowerFull()
         {

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

@@ -7,6 +7,7 @@ namespace UI.League
     public partial class UI_ComPary
     {
         public GComponent target;
+        public Controller m_c1;
         public GLoader m_LoaIcon;
         public GTextField m_txtName;
         public GComponent m_comGain;
@@ -60,6 +61,7 @@ namespace UI.League
 
         private void Init(GComponent comp)
         {
+            m_c1 = comp.GetController("c1");
             m_LoaIcon = (GLoader)comp.GetChild("LoaIcon");
             m_txtName = (GTextField)comp.GetChild("txtName");
             m_comGain = (GComponent)comp.GetChild("comGain");
@@ -69,6 +71,7 @@ namespace UI.League
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_c1 = null;
             m_LoaIcon = null;
             m_txtName = null;
             m_comGain = null;

+ 15 - 5
GameClient/Assets/Game/HotUpdate/ServerProxy/LeagueSproxy.cs

@@ -187,13 +187,23 @@ namespace GFGGame
                 {
                     LeagueDataManager.Instance.Type = response.Type;
                     LeagueDataManager.Instance.LeagueData = GetLeagueData(response.LeagueDetailInfo);
-                    LeagueDataManager.Instance.ListDatas.Clear();
-                    for (int i = 0; i < response.list.Count; i++)
+
+                    if (response.Type == 2)
                     {
-                        LeagueListData leagueListData = GetLeagueListData(response.list[i]);
-                        LeagueDataManager.Instance.ListDatas[leagueListData.LeagueId] = leagueListData;
+                        LeagueDataManager.Instance.ListDatas.Clear();
+                        for (int i = 0; i < response.list.Count; i++)
+                        {
+                            LeagueListData leagueListData = GetLeagueListData(response.list[i]);
+                            LeagueDataManager.Instance.ListDatas[leagueListData.LeagueId] = leagueListData;
+                        }
                     }
 
+                    int myPos = LeagueDataManager.Instance.LeagueData.LeagueMemberDatas[RoleDataManager.roleId].Pos;
+                    if (response.Type == 1 && (myPos == LeaguePos.Owner || myPos == LeaguePos.SubOwner))
+                    {
+                        ReqGetApplyJoinLeagueList().Coroutine();
+                        ReqLeagueJoinQuitLog().Coroutine();
+                    }
                     return true;
                 }
             }
@@ -447,7 +457,7 @@ namespace GFGGame
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-
+                    PromptController.Instance.ShowFloatTextPrompt("祈福完成");
                     return true;
                 }
             }

+ 39 - 1
GameClient/Assets/Game/HotUpdate/Views/League/LeaguePrayView.cs

@@ -34,12 +34,13 @@ namespace GFGGame
         protected override void AddEventListener()
         {
             base.AddEventListener();
+            EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateView);
 
         }
         protected override void OnShown()
         {
             base.OnShown();
-
+            UpdateView();
         }
 
         protected override void OnHide()
@@ -51,7 +52,44 @@ namespace GFGGame
         protected override void RemoveEventListener()
         {
             base.RemoveEventListener();
+            EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateView);
+        }
+        private void UpdateView()
+        {
+            UpdateComPary(_ui.m_comPary0.target, 1);
+            UpdateComPary(_ui.m_comPary1.target, 2);
+            UpdateComPary(_ui.m_comPary2.target, 3);
+        }
+        private void UpdateComPary(GObject obj, int type)
+        {
+
+            LeaguePrayCfg prayCfg = LeaguePrayCfgArray.Instance.GetCfg(type);
+            UI_ComPary item = UI_ComPary.Proxy(obj);
+            ItemUtil.UpdateItemNeedNum(item.m_comGain, prayCfg.bonusArr[0][0], prayCfg.bonusArr[0][1]);
+            ItemUtil.UpdateItemNeedNum(item.m_comFirstGain, prayCfg.bonusOnceArr[0][0], prayCfg.bonusOnceArr[0][1]);
+
+            if (type == 1 && RoleDataManager.LeagueType1PrayTimes == 0)
+            {
+                ItemUtil.UpdateItemNeedNum(item.m_comCurrency, prayCfg.consumeArr[0][0], 0);
+            }
+            else
+            {
+                ItemUtil.UpdateItemNeedNum(item.m_comCurrency, prayCfg.consumeArr[0][0], prayCfg.consumeArr[0][1]);
+            }
+            item.m_btnPray.touchable = type == 1 && RoleDataManager.LeagueType1PrayTimes < prayCfg.limit || type == 2 && RoleDataManager.LeagueType2PrayTimes < prayCfg.limit || type == 1 && RoleDataManager.LeagueType3PrayTimes < prayCfg.limit;
+            if (item.m_btnPray.data == null)
+            {
+                item.m_btnPray.onClick.Add(OnBtnPrayClick);
+            }
+            item.m_btnPray.data = type;
+
+            UI_ComPary.ProxyEnd();
+        }
 
+        private void OnBtnPrayClick(EventContext context)
+        {
+            int type = (int)(context.sender as GObject).data;
+            LeagueSproxy.ReqPrayLeague(type).Coroutine();
         }
     }
 }

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