zhaoyang 2 ani în urmă
părinte
comite
10d62322c1

+ 26 - 16
FGUIProject/assets/League/LeagueAnsweringUI.xml

@@ -1,13 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920">
-  <controller name="c1" pages="0,,1," selected="0">
+  <controller name="ctrlHasIcon" pages="0,,1," selected="0">
     <remark page="0" value="有图标"/>
     <remark page="1" value="无图标"/>
   </controller>
-  <controller name="c2" pages="0,,1," selected="0">
+  <controller name="ctrlQuestionState" pages="0,,1," selected="0">
     <remark page="0" value="答题中"/>
     <remark page="1" value="cd中"/>
   </controller>
+  <controller name="ctrlQuestionType" pages="0,,1,,2," selected="1">
+    <remark page="1" value="选择题"/>
+    <remark page="2" value="填空题"/>
+  </controller>
   <displayList>
     <loader id="n4_pvb4" name="loaBg" xy="540,960" pivot="0.5,0.5" anchor="true" size="1080,2400" fill="scaleMatchWidth">
       <relation target="" sidePair="width-width,height-height,center-center,middle-middle"/>
@@ -23,35 +27,41 @@
     <text id="n9_pvb4" name="txtAnswerTime" xy="501,242" pivot="0.5,0" size="78,41" group="n15_pvb4" fontSize="30" align="center" text="00:55"/>
     <text id="n11_pvb4" name="txtAnswerNum" xy="479,288" pivot="0.5,0" size="121,41" group="n15_pvb4" fontSize="30" align="center" text="第1/15题"/>
     <loader id="n12_pvb4" name="loaIocn" xy="231,347" pivot="0.5,0.5" size="134,134" group="n15_pvb4" aspect="true" url="ui://eg2y0ldpm9wm8v" fill="scale">
-      <gearDisplay controller="c1" pages="0"/>
+      <gearDisplay controller="ctrlHasIcon" pages="0"/>
     </loader>
     <text id="n13_pvb4" name="txtContent" xy="407,347" pivot="0.5,0" size="425,142" group="n15_pvb4" fontSize="30" align="center" autoSize="none" text="">
-      <gearXY controller="c1" pages="1" values="282,347" default="407,347"/>
-      <gearSize controller="c1" pages="1" values="515,142,1,1" default="425,142,1,1"/>
+      <gearXY controller="ctrlHasIcon" pages="1" values="282,347" default="407,347"/>
+      <gearSize controller="ctrlHasIcon" pages="1" values="515,142,1,1" default="425,142,1,1"/>
     </text>
-    <list id="n14_pvb4" name="listResult" xy="407,514" pivot="0.5,0" size="449,148" group="n15_pvb4" layout="flow_hz" lineGap="10" lineItemCount="2" defaultItem="ui://tw70qm9dpvb454" autoItemSize="true" align="center" vAlign="middle" autoClearItems="true">
-      <gearXY controller="c1" pages="1" values="253,514" default="407,514"/>
-      <gearSize controller="c1" pages="1" values="573,148,1,1" default="449,148,1,1"/>
+    <list id="n14_pvb4" name="listResult" xy="407,544" pivot="0.5,0" size="449,148" group="n15_pvb4" layout="flow_hz" lineGap="10" lineItemCount="2" defaultItem="ui://tw70qm9dpvb454" autoItemSize="true" align="center" vAlign="middle" autoClearItems="true">
+      <gearDisplay controller="ctrlQuestionType" pages="1"/>
+      <gearXY controller="ctrlHasIcon" pages="0,1" values="407,544|253,544"/>
+      <gearSize controller="ctrlHasIcon" pages="1" values="573,148,1,1" default="449,148,1,1"/>
       <item/>
       <item/>
       <item/>
       <item/>
     </list>
-    <text id="n16_pvb4" name="n16" xy="406,516" size="241,41" group="n19_pvb4" fontSize="30" align="center" text="请填入您的答案:"/>
-    <text id="n17_pvb4" name="txtResult" xy="648,514" size="123,42" group="n19_pvb4" fontSize="30" align="center" autoSize="none" text="" input="true"/>
-    <text id="n18_pvb4" name="n18" xy="649,514" size="124,42" group="n19_pvb4" fontSize="30" align="center" autoSize="none" underline="true" text="                       "/>
-    <group id="n19_pvb4" name="n19" xy="406,514" size="367,44" group="n15_pvb4" advanced="true">
-      <gearXY controller="c1" pages="1" values="282,505" default="406,514"/>
+    <text id="n16_pvb4" name="n16" xy="406,507" size="241,41" group="n19_pvb4" fontSize="30" align="center" text="请选择您的答案:">
+      <gearText controller="ctrlQuestionType" pages="1,2" values="请选择您的答案:|请输入您的答案:" default="请填入您的答案:"/>
+    </text>
+    <text id="n17_pvb4" name="txtResult" xy="648,505" size="123,42" group="n19_pvb4" fontSize="30" align="center" autoSize="none" text="" input="true"/>
+    <text id="n18_pvb4" name="n18" xy="649,505" size="124,42" group="n19_pvb4" fontSize="30" align="center" autoSize="none" underline="true" text="                       ">
+      <gearDisplay controller="ctrlQuestionType" pages="2"/>
+    </text>
+    <group id="n19_pvb4" name="n19" xy="406,505" size="367,43" group="n15_pvb4" advanced="true">
+      <gearDisplay controller="ctrlQuestionType" pages=""/>
+      <gearXY controller="ctrlHasIcon" pages="0,1" values="406,505|282,505"/>
     </group>
-    <group id="n15_pvb4" name="n15" xy="231,242" size="625,420" advanced="true">
-      <gearDisplay controller="c2" pages="0"/>
+    <group id="n15_pvb4" name="n15" xy="231,242" size="625,450" advanced="true">
+      <gearDisplay controller="ctrlQuestionState" pages="0"/>
     </group>
     <component id="n20_pvb4" name="comRightHead" src="o9ghtlp" fileName="components/ComHeadWithLv2.xml" pkg="eg2y0ldp" xy="435,239" group="n24_pvb4"/>
     <image id="n21_pvb4" name="imgFail" src="u2u3tkq" fileName="imgItemIcon/testBig.png" pkg="eg2y0ldp" xy="484,298" group="n24_pvb4"/>
     <text id="n22_pvb4" name="txtInfo" xy="520,469" pivot="0.5,0" size="40,42" group="n24_pvb4" fontSize="30" align="center" underline="true" text=""/>
     <text id="n23_pvb4" name="txtCdTime" xy="520,517" pivot="0.5,0" size="40,42" group="n24_pvb4" fontSize="30" align="center" underline="true" text=""/>
     <group id="n24_pvb4" name="n24" xy="435,239" size="230,320" advanced="true">
-      <gearDisplay controller="c2" pages="1"/>
+      <gearDisplay controller="ctrlQuestionState" pages="1"/>
     </group>
     <text id="n25_pvb4" name="txtJoinNum" xy="55,735" pivot="0.5,0" size="269,41" fontSize="30" align="center" text="当前参与成员:0/30"/>
     <list id="n26_pvb4" name="listJoin" xy="42,808" size="300,865" overflow="scroll" defaultItem="ui://tw70qm9dpvb455" autoClearItems="true">

+ 3 - 2
FGUIProject/assets/League/LeagueUI.xml

@@ -17,6 +17,7 @@
     <component id="n19_u2u3" name="btnConstruct" src="u2u31b" fileName="components/Button3.xml" xy="346,81" controller="c1,0">
       <Button title="雅集建设"/>
     </component>
+    <text id="n30_gfx4" name="txtLowKeep" xy="775,160" pivot="1,0" size="257,42" fontSize="30" align="right" text="已连续低维护:1天"/>
     <text id="n10_u2u3" name="txtUnionName" xy="250,317" pivot="0.5,0" size="212,44" font="ui://eg2y0ldpa0cftks" fontSize="32" color="#fff6dc" align="center" autoClearText="true" text="联盟名字7个字"/>
     <component id="n20_a0cf" name="comLeagueHead" src="a0cf30" fileName="components/ComLeagueHead.xml" xy="109,267"/>
     <text id="n14_u2u3" name="txtLeaderName" xy="850,339" size="162,34" font="ui://eg2y0ldpa0cftkz" fontSize="24" color="#923c1a" autoClearText="true" text="会长名字7个字"/>
@@ -35,9 +36,9 @@
     <text id="n29_o9gh" name="n29" xy="819,260" size="39,26" group="n26_o9gh" font="ui://eg2y0ldpa0cftkz" fontSize="18" color="#fffbed" text="社长"/>
     <group id="n26_o9gh" name="n26" xy="599,246" size="444,230"/>
     <component id="n7_u2u3" name="btnPray" src="u2u314" fileName="components/ButtonModle6.xml" xy="70,446" group="n9_u2u3"/>
-    <component id="n3_u2u3" name="n3" src="u2u3u" fileName="components/ButtonModle2.xml" xy="343,669" group="n9_u2u3"/>
+    <component id="n3_u2u3" name="btnSkill" src="u2u3u" fileName="components/ButtonModle2.xml" xy="343,669" group="n9_u2u3"/>
     <component id="n4_u2u3" name="n4" src="u2u3y" fileName="components/ButtonModle3.xml" xy="755,894" group="n9_u2u3"/>
-    <component id="n5_u2u3" name="n5" src="u2u310" fileName="components/ButtonModle4.xml" xy="663,1582" group="n9_u2u3"/>
+    <component id="n5_u2u3" name="btnAnswer" src="u2u310" fileName="components/ButtonModle4.xml" xy="663,1582" group="n9_u2u3"/>
     <component id="n6_u2u3" name="n6" src="u2u312" fileName="components/ButtonModle5.xml" xy="118,1486" group="n9_u2u3"/>
     <component id="n8_u2u3" name="n8" src="u2u316" fileName="components/ButtonModle7.xml" xy="615,1263" group="n9_u2u3"/>
     <group id="n9_u2u3" name="n9" xy="70,446" size="1012,1496" advanced="true">

+ 2 - 2
FGUIProject/assets/League/components/ButtonModle5.xml

@@ -5,7 +5,7 @@
     <graph id="n2_lki4" name="holder" xy="266,163" size="0,0" touchable="false">
       <relation target="" sidePair="center-center,middle-middle"/>
     </graph>
-    <image id="n11_mzf8" name="n11" src="u2u313" fileName="imageTest/zjm_tptp_6.png" xy="-117,138"/>
+    <image id="n11_mzf8" name="n11" src="u2u313" fileName="images/zjm_tptp_6.png" xy="-117,138"/>
     <graph id="n4_lki4" name="holder1" xy="266,163" size="0,0" touchable="false">
       <relation target="" sidePair="center-center,middle-middle"/>
     </graph>
@@ -19,7 +19,7 @@
     <text id="n13_o9gh" name="n13" xy="15,73" size="39,114" group="n14_o9gh" font="ui://eg2y0ldpa0cftky" fontSize="32" color="#fffcf1" align="center" leading="-4" autoSize="height" text="茶话会"/>
     <group id="n14_o9gh" name="n14" xy="-9,3" size="76,288"/>
     <image id="n15_o9gh" name="n15" src="o9gh49" fileName="images/lm_zjm_djs.png" xy="119,226" group="n17_o9gh"/>
-    <text id="n16_o9gh" name="txtTime" xy="221,226" pivot="0.5,0" size="88,39" group="n17_o9gh" font="ui://eg2y0ldpa0cftky" fontSize="28" color="#fffcf1" align="center" text="进行中"/>
+    <text id="n16_o9gh" name="txtTime" xy="221,226" pivot="0.5,0" size="88,39" group="n17_o9gh" font="ui://eg2y0ldpa0cftky" fontSize="28" color="#fffcf1" align="center" text="未开启"/>
     <group id="n17_o9gh" name="n17" xy="119,226" size="296,40"/>
   </displayList>
   <Button/>

+ 3 - 1
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -107,9 +107,11 @@ namespace GFGGame
         public const string LEAGUE_LOG_CHANGE = "LEAGUE_LOG_CHANGE";//联盟日志变化
         public const string LEAGUE_INFO_CHANGE = "LEAGUE_INFO_CHANGE";//联盟信息变化
         public const string LEAGUE_NUMBERIC_CHANGE = "LEAGUE_NUMBERIC_CHANGE";//联盟数值变化
-        public const string LEAGUE_ANSWER_DATA_CHANGE = "LEAGUE_ANSWER_DATA_CHANGE";//联盟答题数据变化,有人加入退出答对题目(需要刷新玩家答题数据列表)
+        public const string LEAGUE_ANSWER_MEMBER_CHANGE = "LEAGUE_ANSWER_MEMBER_CHANGE";//有人加入退出答对题目
+        public const string LEAGUE_ANSWER_RESULT_CHANGE = "LEAGUE_ANSWER_RESULT_CHANGE";//联盟有人答对题目
         public const string LEAGUE_ANSWER_START = "LEAGUE_ANSWER_START";//联盟新一轮答题开始
         public const string LEAGUE_ANSWER_END = "LEAGUE_ANSWER_END";//联盟本轮答题结束
+        // public const string LEAGUE_ANSWER_STATE_CHANGE = "LEAGUE_ANSWER_STATE_CHANGE";//联盟答题状态更新
         public const string OTHER_ROLE_INFO_CHANGE = "OTHER_ROLE_INFO_CHANGE";//其他玩家信息变化
         public const string NOTICE_CHAT_MESSAGE = "NOTICE_CHAT_MESSAGE";//通知聊天信息
 

+ 15 - 1
GameClient/Assets/Game/HotUpdate/Data/LeagueDataManager.cs

@@ -3,6 +3,12 @@ using System.Collections.Generic;
 using ET;
 namespace GFGGame
 {
+    public class LastQuestionResult
+    {
+        public static int SomeBodyRight = 1;//1:有人答对题目
+        public static int NobodyRight;// 2:无人答对
+        public static int Ending;// 3:答题结束
+    }
     public class LeagueDataManager : SingletonBase<LeagueDataManager>
     {
         public int Type = 2;// 1:已经加入军团 2:未加入军团
@@ -16,7 +22,8 @@ namespace GFGGame
         public Dictionary<long, LeagueListData> ListDatas = new Dictionary<long, LeagueListData>();//联盟列表
         public Dictionary<long, OtherRoleInfoData> ListApplyDatas = new Dictionary<long, OtherRoleInfoData>();//联盟申请列表
         public List<LeagueLogData> ListLogDatas = new List<LeagueLogData>();//日志数据
-        public Dictionary<long, int> ListAnswerintDatas = new Dictionary<long, int>();//当前答题玩家数据,roleId,答题数量。
+        public LeagueLastAnswerRoleData LastAnswerRoleData = new LeagueLastAnswerRoleData();//上题回答数据
+        public Dictionary<long, int> ListAnsweringDatas = new Dictionary<long, int>();//当前答题玩家数据,roleId,答题数量。
         public Dictionary<int, List<LeagueAnswerData>> ListAnswerRankDatas = new Dictionary<int, List<LeagueAnswerData>>();//答题排行榜数据,int:type//1:周排行 2:上周排行
 
 
@@ -27,6 +34,7 @@ namespace GFGGame
             LeagueData = null;
             ListApplyDatas.Clear();
             ListLogDatas.Clear();
+            LastAnswerRoleData = null;
         }
         public void SetNumeric(int type, long value)
         {
@@ -97,6 +105,12 @@ namespace GFGGame
             }
             return curCount;
         }
+        public OtherRoleInfoData GetMemberRoleInfo(long roleId)
+        {
+            LeagueData.LeagueMemberDatas.TryGetValue(roleId, out LeagueMemberData value);
+            if (value == null) return null;
+            return value.RoleInfo;
+        }
         //输入属性类型,获取联盟技能该属性加成总值
         public int GetAllSkillScore(int scoreType)
         {

+ 7 - 1
GameClient/Assets/Game/HotUpdate/Data/VO/LeagueData.cs

@@ -61,7 +61,13 @@ namespace GFGGame
         public long EndTime;//结束时间
         public LeagueWelfareCfg GiftCfg;
     }
-
+    public class LeagueLastAnswerRoleData
+    {
+        public long RightRoleId;//上题答对玩家Id
+        public long LastQuestionResult;//上题回答结果1:有人答对题目 2:无人答对 3:答题结束
+        public int LastQuestionId;//上题id
+        public string MyAnswer;//我上题的答案
+    }
     public class LeagueAnswerData
     {
         public long RoleId;

+ 9 - 6
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/League/UI_LeagueAnsweringUI.cs

@@ -7,8 +7,9 @@ namespace UI.League
     public partial class UI_LeagueAnsweringUI
     {
         public GComponent target;
-        public Controller m_c1;
-        public Controller m_c2;
+        public Controller m_ctrlHasIcon;
+        public Controller m_ctrlQuestionState;
+        public Controller m_ctrlQuestionType;
         public GLoader m_loaBg;
         public GButton m_btnBack;
         public GTextField m_txtTime;
@@ -76,8 +77,9 @@ namespace UI.League
 
         private void Init(GComponent comp)
         {
-            m_c1 = comp.GetController("c1");
-            m_c2 = comp.GetController("c2");
+            m_ctrlHasIcon = comp.GetController("ctrlHasIcon");
+            m_ctrlQuestionState = comp.GetController("ctrlQuestionState");
+            m_ctrlQuestionType = comp.GetController("ctrlQuestionType");
             m_loaBg = (GLoader)comp.GetChild("loaBg");
             m_btnBack = (GButton)comp.GetChild("btnBack");
             m_txtTime = (GTextField)comp.GetChild("txtTime");
@@ -101,8 +103,9 @@ namespace UI.League
         }
         public void Dispose(bool disposeTarget = false)
         {
-            m_c1 = null;
-            m_c2 = null;
+            m_ctrlHasIcon = null;
+            m_ctrlQuestionState = null;
+            m_ctrlQuestionType = null;
             m_loaBg = null;
             m_btnBack = null;
             m_txtTime = null;

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/League/UI_LeagueUI.cs

@@ -12,6 +12,7 @@ namespace UI.League
         public GButton m_btnRule;
         public UI_Button3 m_btnMember;
         public UI_Button3 m_btnConstruct;
+        public GTextField m_txtLowKeep;
         public GTextField m_txtUnionName;
         public UI_ComLeagueHead m_comLeagueHead;
         public GTextField m_txtLeaderName;
@@ -20,6 +21,8 @@ namespace UI.League
         public GTextField m_txtName;
         public GTextField m_txtNotice;
         public UI_ButtonModle6 m_btnPray;
+        public UI_ButtonModle2 m_btnSkill;
+        public UI_ButtonModle4 m_btnAnswer;
         public const string URL = "ui://tw70qm9du2u32";
         public const string PACKAGE_NAME = "League";
         public const string RES_NAME = "LeagueUI";
@@ -72,6 +75,7 @@ namespace UI.League
             m_btnRule = (GButton)comp.GetChild("btnRule");
             m_btnMember = (UI_Button3)UI_Button3.Create(comp.GetChild("btnMember"));
             m_btnConstruct = (UI_Button3)UI_Button3.Create(comp.GetChild("btnConstruct"));
+            m_txtLowKeep = (GTextField)comp.GetChild("txtLowKeep");
             m_txtUnionName = (GTextField)comp.GetChild("txtUnionName");
             m_comLeagueHead = (UI_ComLeagueHead)UI_ComLeagueHead.Create(comp.GetChild("comLeagueHead"));
             m_txtLeaderName = (GTextField)comp.GetChild("txtLeaderName");
@@ -80,6 +84,8 @@ namespace UI.League
             m_txtName = (GTextField)comp.GetChild("txtName");
             m_txtNotice = (GTextField)comp.GetChild("txtNotice");
             m_btnPray = (UI_ButtonModle6)UI_ButtonModle6.Create(comp.GetChild("btnPray"));
+            m_btnSkill = (UI_ButtonModle2)UI_ButtonModle2.Create(comp.GetChild("btnSkill"));
+            m_btnAnswer = (UI_ButtonModle4)UI_ButtonModle4.Create(comp.GetChild("btnAnswer"));
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -90,6 +96,7 @@ namespace UI.League
             m_btnMember = null;
             m_btnConstruct.Dispose();
             m_btnConstruct = null;
+            m_txtLowKeep = null;
             m_txtUnionName = null;
             m_comLeagueHead.Dispose();
             m_comLeagueHead = null;
@@ -100,6 +107,10 @@ namespace UI.League
             m_txtNotice = null;
             m_btnPray.Dispose();
             m_btnPray = null;
+            m_btnSkill.Dispose();
+            m_btnSkill = null;
+            m_btnAnswer.Dispose();
+            m_btnAnswer = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 37 - 12
GameClient/Assets/Game/HotUpdate/ServerProxy/LeagueSproxy.cs

@@ -206,12 +206,22 @@ namespace GFGGame
 
 
     //通知有玩家加入答题
-    public class NoticeNoticeJoinAnswer : AMHandler<L2C_NoticeJoinAnswer>
+    public class NoticeJoinAnswer : AMHandler<L2C_NoticeJoinAnswer>
     {
         protected override async ETTask Run(Session session, L2C_NoticeJoinAnswer message)
         {
-            LeagueDataManager.Instance.ListAnswerintDatas[message.RoleId] = 0;
-            EventAgent.DispatchEvent(ConstMessage.LEAGUE_ANSWER_DATA_CHANGE);
+            LeagueDataManager.Instance.ListAnsweringDatas[message.RoleId] = 0;
+            EventAgent.DispatchEvent(ConstMessage.LEAGUE_ANSWER_MEMBER_CHANGE);
+            await ETTask.CompletedTask;
+        }
+    }
+    //通知有玩家退出答题
+    public class NoticeQuitAnswer : AMHandler<L2C_NoticeQuitAnswer>
+    {
+        protected override async ETTask Run(Session session, L2C_NoticeQuitAnswer message)
+        {
+            LeagueDataManager.Instance.ListAnsweringDatas.Remove(message.RoleId);
+            EventAgent.DispatchEvent(ConstMessage.LEAGUE_ANSWER_MEMBER_CHANGE);
             await ETTask.CompletedTask;
         }
     }
@@ -220,8 +230,10 @@ namespace GFGGame
     {
         protected override async ETTask Run(Session session, S2C_SyncAnswerNum message)
         {
-            LeagueDataManager.Instance.ListAnswerintDatas[message.RoleId] = message.Num;
-            EventAgent.DispatchEvent(ConstMessage.LEAGUE_ANSWER_DATA_CHANGE);
+            LeagueDataManager.Instance.ListAnsweringDatas[message.RoleId] = message.Num;
+            LeagueDataManager.Instance.LastAnswerRoleData.RightRoleId = message.RoleId;
+
+            EventAgent.DispatchEvent(ConstMessage.LEAGUE_ANSWER_RESULT_CHANGE);
             await ETTask.CompletedTask;
         }
     }
@@ -241,9 +253,17 @@ namespace GFGGame
     {
         protected override async ETTask Run(Session session, L2C_NoticeAnswerPause message)
         {
-            LeagueDataManager.Instance.SetNumeric(LeagueNumericType.LeagueQuestionStatus, message.Type);
-            LeagueDataManager.Instance.SetNumeric(LeagueNumericType.LeagueQuestionStatusEndTime, message.Time);
-            EventAgent.DispatchEvent(ConstMessage.LEAGUE_ANSWER_END);
+            if (message.Type == LastQuestionResult.Ending)
+            {
+                LeagueDataManager.Instance.SetNumeric(LeagueNumericType.LeagueQuestionStatus, LeagueQuestionStatus.AnswerEnd);
+            }
+            else
+            {
+                LeagueDataManager.Instance.SetNumeric(LeagueNumericType.LeagueQuestionStatus, LeagueQuestionStatus.WaitNext);
+                LeagueDataManager.Instance.SetNumeric(LeagueNumericType.LeagueQuestionStatusEndTime, message.Time);
+            }
+            LeagueDataManager.Instance.LastAnswerRoleData.LastQuestionResult = message.Type;
+            EventAgent.DispatchEvent(ConstMessage.LEAGUE_ANSWER_END, message.Type);
             await ETTask.CompletedTask;
         }
     }
@@ -553,10 +573,10 @@ namespace GFGGame
             return false;
         }
         //领取联盟福利//LeagueWelfareType
-        public static async ETTask<bool> ReqGetLeagueWelfare(int type)
+        public static async ETTask<bool> ReqGetLeagueWelfare()
         {
             S2C_GetLeagueWelfare response = null;
-            response = (S2C_GetLeagueWelfare)await MessageHelper.SendToServer(new C2S_GetLeagueWelfare() { Type = type });
+            response = (S2C_GetLeagueWelfare)await MessageHelper.SendToServer(new C2S_GetLeagueWelfare());
             if (response != null)
             {
                 if (response.Error == ErrorCode.ERR_Success)
@@ -604,6 +624,8 @@ namespace GFGGame
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
+                    LeagueDataManager.Instance.LastAnswerRoleData.LastQuestionId = questionId;
+                    LeagueDataManager.Instance.LastAnswerRoleData.MyAnswer = answer;
                     return true;
                 }
             }
@@ -620,9 +642,11 @@ namespace GFGGame
                 {
                     for (int i = 0; i < response.RoleInfos.Count; i++)
                     {
-                        LeagueDataManager.Instance.ListAnswerintDatas[response.RoleInfos[i].RoleId] = response.RoleInfos[i].Num;
+                        LeagueDataManager.Instance.ListAnsweringDatas[response.RoleInfos[i].RoleId] = response.RoleInfos[i].Num;
                     }
-
+                    LeagueDataManager.Instance.LastAnswerRoleData.RightRoleId = response.LastRightRoleId;
+                    LeagueDataManager.Instance.LastAnswerRoleData.LastQuestionId = response.QuestionId;
+                    LeagueDataManager.Instance.LastAnswerRoleData.MyAnswer = response.Ans;
                     return true;
                 }
             }
@@ -704,6 +728,7 @@ namespace GFGGame
             leagueData.FlowerNum = 0;
             leagueData.OwnerId = leagueDetailInfo.OwnerId;
             leagueData.SubOwnerId = leagueDetailInfo.SubOwnerId;
+            leagueData.LastWeekAnswerNO1Id = leagueDetailInfo.LastQuestionNo1RoleId;
 
             LeagueDataManager.Instance.SetNumeric(LeagueNumericType.AdEndTime, leagueDetailInfo.AdEndTime);
 

+ 6 - 4
GameClient/Assets/Game/HotUpdate/Views/League/LeagueAnswerView.cs

@@ -63,7 +63,7 @@ namespace GFGGame
         }
         private void OnBtnAnswerClick()
         {
-            ViewManager.Show<LeagueAnsweringView>();
+            ViewManager.Show<LeagueAnsweringView>(null, new object[] { typeof(LeagueAnsweringView).FullName });
         }
 
         private void UpdateView()
@@ -86,14 +86,16 @@ namespace GFGGame
         }
         private void UpdateTime(object param)
         {
-            if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) > LeagueQuestionStatus.End)
+            long curTime = TimeHelper.ServerNow();
+            long endTime = TimeUtil.GetNextTime(GlobalCfgArray.globalCfg.leagueQuestionStartTime);
+            if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) > LeagueQuestionStatus.End
+            || endTime - curTime < 0)
             {
                 Timers.inst.Remove(UpdateTime);
                 return;
             }
-            long curTime = TimeHelper.ServerNow();
-            long endTime = TimeUtil.GetNextTime(GlobalCfgArray.globalCfg.leagueQuestionStartTime);
             _ui.m_txtTime.text = string.Format("{0}后开启", TimeUtil.FormattingTime5((int)(endTime - curTime)));
+
         }
     }
 }

+ 192 - 3
GameClient/Assets/Game/HotUpdate/Views/League/LeagueAnsweringView.cs

@@ -1,3 +1,4 @@
+using System.Collections.Generic;
 using ET;
 using FairyGUI;
 using UI.League;
@@ -9,6 +10,8 @@ namespace GFGGame
     public class LeagueAnsweringView : BaseWindow
     {
         private UI_LeagueAnsweringUI _ui;
+        private LeagueDataManager _dataManager;
+        private List<long> _memberIds;
 
         public override void Dispose()
         {
@@ -29,24 +32,45 @@ namespace GFGGame
             isfullScreen = true;
 
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("lm_beijing");
+
             _ui.m_btnBack.onClick.Add(OnBtnBackClick);
+            _ui.m_btnRule.onClick.Add(OnBtnRuleClick);
+            _ui.m_btnSend.onClick.Add(OnBtnSendClick);
 
+            _ui.m_listResult.itemRenderer = RenderListResultItem;
+            _ui.m_listJoin.itemRenderer = RenderListJoinItem;
+            _ui.m_listChat.itemRenderer = RenderListChatItem;
+            _ui.m_listChat.itemProvider = GetListItemResource;
+            _ui.m_listChat.SetVirtual();
         }
         protected override void AddEventListener()
         {
             base.AddEventListener();
-
+            EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_START, UpdateQuestion);
+            EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_END, UpdateResult);
+            EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_RESULT_CHANGE, UpdateResult);
+            EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_RESULT_CHANGE, UpdateJoinList);
+            EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_MEMBER_CHANGE, UpdateJoinList);
+            EventAgent.AddEventListener(ConstMessage.NOTICE_CHAT_MESSAGE, UpdateChatList);
         }
-        protected override void OnShown()
+        protected override async void OnShown()
         {
             base.OnShown();
+            _dataManager = LeagueDataManager.Instance;
+            _ui.m_listChat.numItems = ChatDataManager.Instance.ChatDatas[ChatType.LeagueQuestion].Count;
+            _ui.m_listChat.scrollPane.ScrollBottom();
 
+            bool result = await LeagueSproxy.ReqJoinAnswer();
+            if (result)
+            {
+                UpdateJoinList();
+            }
         }
 
         protected override void OnHide()
         {
             base.OnHide();
-
+            Timers.inst.Remove(UpdateAnswerTime);
         }
 
         protected override void RemoveEventListener()
@@ -59,6 +83,171 @@ namespace GFGGame
         {
             ViewManager.GoBackFrom(typeof(LeagueAnsweringView).FullName);
         }
+        private void OnBtnRuleClick()
+        {
+            ViewManager.Show<LeagueAnswerRewardView>();
+        }
+        private void OnBtnSendClick()
+        {
+
+        }
+        private void UpdateQuestionState()
+        {
+            if (_dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) == LeagueQuestionStatus.Open)//答题中
+            {
+                UpdateQuestion();
+            }
+            else//cd中、答题结束
+            {
+                UpdateResult();
+            }
+        }
+        private void UpdateQuestion()
+        {
+            _ui.m_txtRightCount.text = string.Format("全员已答对{0}题", _dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionTrueCount));
+            _ui.m_ctrlQuestionState.selectedIndex = 0;
+            int questionId = (int)_dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionId);
+            LeagueQuestionCfg questionCfg = LeagueQuestionCfgArray.Instance.GetCfg(questionId);
+
+            _ui.m_txtAnswerNum.text = string.Format("第{0}/{1}题", _dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionCount), GlobalCfgArray.globalCfg.leagueQuestionNum);
+            _ui.m_ctrlHasIcon.selectedIndex = string.IsNullOrEmpty(questionCfg.res) ? 1 : 0;
+            _ui.m_loaIocn.url = string.IsNullOrEmpty(questionCfg.res) ? "" : ResPathUtil.GetIconPath(questionCfg.res, "png");
+            _ui.m_txtContent.text = questionCfg.question;
+            _ui.m_ctrlQuestionType.selectedIndex = questionCfg.type;
+            if (questionCfg.type == 1)
+            {
+                _ui.m_listResult.numItems = questionCfg.answerArr.Length;
+            }
+            _ui.m_txtTime.text = "";
+
+            Timers.inst.Remove(UpdateAnswerTime);
+            Timers.inst.Add(1, 0, UpdateAnswerTime);
+        }
+        private void UpdateAnswerTime(object param)
+        {
+            long curTime = TimeHelper.ServerNow();
+            long endTime = LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatusEndTime);
+            if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) > LeagueQuestionStatus.End
+            || endTime - curTime < 0)
+            {
+                Timers.inst.Remove(UpdateAnswerTime);
+                return;
+            }
+            _ui.m_txtTime.text = TimeUtil.FormattingTime5((int)(endTime - curTime));
+
+        }
+        private void UpdateResult()
+        {
+            _ui.m_txtRightCount.text = string.Format("全员已答对{0}题", _dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionTrueCount));
+            _ui.m_ctrlQuestionState.selectedIndex = 1;
+            if (_dataManager.LastAnswerRoleData.LastQuestionResult == LastQuestionResult.SomeBodyRight)
+            {
+                _ui.m_comRightHead.visible = true;
+                _ui.m_imgFail.visible = false;
+                OtherRoleInfoData roleInfoData = _dataManager.GetMemberRoleInfo(_dataManager.LastAnswerRoleData.RightRoleId);
+                RoleInfoManager.Instance.UpdateHeadWithLv(_ui.m_comRightHead, roleInfoData.headId, roleInfoData.headBorderId, roleInfoData.roleLv);
+                _ui.m_txtInfo.text = string.Format("{0} 答对了!", roleInfoData.roleName);
+                Timers.inst.Remove(UpdateResultTime);
+                Timers.inst.Add(1, 0, UpdateResultTime);
+            }
+            else if (_dataManager.LastAnswerRoleData.LastQuestionResult == LastQuestionResult.NobodyRight)
+            {
+                _ui.m_comRightHead.visible = false;
+                _ui.m_imgFail.visible = true;
+                _ui.m_txtInfo.text = "哎呀,没人答对呀,大家加油鸭~";
+                Timers.inst.Remove(UpdateResultTime);
+                Timers.inst.Add(1, 0, UpdateResultTime);
+            }
+            else
+            {
+                _ui.m_comRightHead.visible = false;
+                _ui.m_imgFail.visible = false;
+                if (_dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionCount) == GlobalCfgArray.globalCfg.leagueQuestionNum)//全部答完
+                {
+                    _ui.m_txtInfo.text = "全部题目答完啦~";
+                }
+                else//答题时间结束
+                {
+                    _ui.m_txtInfo.text = "活动结束啦~";
+                }
+            }
+        }
+        private void UpdateResultTime(object param)
+        {
+            long curTime = TimeHelper.ServerNow();
+            long endTime = LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatusEndTime);
+            if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) != LeagueQuestionStatus.WaitNext
+            || endTime - curTime < 0)
+            {
+                Timers.inst.Remove(UpdateResultTime);
+                return;
+            }
+            _ui.m_txtTime.text = (endTime - curTime) / 1000 + "秒后开始下一题";
+        }
+        private void UpdateJoinList()
+        {
+            _memberIds = new List<long>(_dataManager.ListAnsweringDatas.Keys);
+            _ui.m_listJoin.numItems = _memberIds.Count;
+        }
+        private void UpdateChatList()
+        {
+            _ui.m_listChat.numItems = ChatDataManager.Instance.ChatDatas[ChatType.LeagueQuestion].Count;
+            _ui.m_listChat.scrollPane.ScrollBottom(true);
+        }
+        private void RenderListResultItem(int index, GObject obj)
+        {
+            LeagueQuestionCfg cfg = LeagueQuestionCfgArray.Instance.dataArray[index];
+            GButton item = obj as GButton;
+            int data = index + 1;
+            item.title = string.Format("{0}.{1}", data, cfg.answerArr[index]);
+            if (item.data == null)
+            {
+                item.onClick.Add(OnBtnChooseClick);
+            }
+            item.data = data;
+        }
+        private async void OnBtnChooseClick(EventContext context)
+        {
+            GObject obj = context.sender as GObject;
+            string answer = obj.data.ToString();
+            ChatSProxy.ReqSendChatMsg(ChatType.LeagueQuestion, answer).Coroutine();
+            int questionId = (int)_dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionId);
+            LeagueQuestionCfg cfg = LeagueQuestionCfgArray.Instance.GetCfg(questionId);
+            bool result = await LeagueSproxy.ReqAnswerQuestion(questionId, answer);
+            if (result
+            && _dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionId) == _dataManager.LastAnswerRoleData.LastQuestionId
+            && _dataManager.LastAnswerRoleData.MyAnswer != cfg.answerCorrect)
+            {
+                _ui.m_listResult.numItems = cfg.answerArr.Length;
+            }
+        }
+        private void RenderListJoinItem(int index, GObject obj)
+        {
+            OtherRoleInfoData roleInfo = _dataManager.LeagueData.LeagueMemberDatas[_memberIds[index]].RoleInfo;
+            UI_ListAnswerJoinItem item = UI_ListAnswerJoinItem.Proxy(obj);
+            RoleInfoManager.Instance.UpdateHead(item.m_comHead, roleInfo.headId, roleInfo.headBorderId);
+            item.m_txtName.text = roleInfo.roleName;
+            item.m_txtAnswerCount.text = string.Format("答对数量:{0}", _dataManager.ListAnsweringDatas[roleInfo.roleId]);
+            UI_ListAnswerJoinItem.ProxyEnd();
+        }
+        private void RenderListChatItem(int index, GObject obj)
+        {
+            ChatData chatData = ChatDataManager.Instance.ChatDatas[ChatType.LeagueQuestion][index];
+            OtherRoleInfoData roleInfo = _dataManager.LeagueData.LeagueMemberDatas[_memberIds[index]].RoleInfo;
+            UI_ListChatItem item = UI_ListChatItem.Proxy(obj);
+
+            RoleInfoManager.Instance.UpdateHeadWithLv(item.m_comHead, roleInfo.headId, roleInfo.headBorderId, roleInfo.roleLv);
+            item.m_txtName.text = roleInfo.roleName;
+            item.m_txtChatContent.text = chatData.Content;
 
+            UI_ListChatItem.ProxyEnd();
+        }
+        private string GetListItemResource(int index)
+        {
+            if (_memberIds[index] == RoleDataManager.roleId)
+                return "ui://League/ListChatItemMine";
+            else
+                return "ui://League/ListChatItem";
+        }
     }
 }

+ 32 - 6
GameClient/Assets/Game/HotUpdate/Views/League/LeagueView.cs

@@ -35,7 +35,8 @@ namespace GFGGame
             _ui.m_comLeagueHead.target.onClick.Add(OnComLeagueHeadClick);
             _ui.m_btnChangeNotice.onClick.Add(OnBtnChangeNoticeClick);
             _ui.m_btnPray.target.onClick.Add(OnBtnPrayClick);
-            // _ui.m_btnRule.onClick.Add(OnBtnRuleClick);
+            _ui.m_btnSkill.target.onClick.Add(OnBtnSkillClick);
+            _ui.m_btnAnswer.target.onClick.Add(OnBtnAnswerClick);
         }
         protected override void AddEventListener()
         {
@@ -54,7 +55,7 @@ namespace GFGGame
         protected override void OnHide()
         {
             base.OnHide();
-
+            Timers.inst.Remove(UpdateTime);
         }
 
         protected override void RemoveEventListener()
@@ -88,10 +89,14 @@ namespace GFGGame
         {
             ViewManager.Show<LeaguePrayView>(null, new object[] { typeof(LeagueView).FullName, null });
         }
-        // private void OnBtnRuleClick()
-        // {
-        //     ViewManager.Show<RuleView>();
-        // }
+        private void OnBtnSkillClick()
+        {
+            ViewManager.Show<LeagueSkillView>(null, new object[] { typeof(LeagueView).FullName, null });
+        }
+        private void OnBtnAnswerClick()
+        {
+            ViewManager.Show<LeagueAnswerView>(null, new object[] { typeof(LeagueView).FullName, null });
+        }
         private void UpdateView()
         {
             UpdateInfo();
@@ -100,6 +105,9 @@ namespace GFGGame
         private void UpdateInfo()
         {
             LeagueData leagueData = LeagueDataManager.Instance.LeagueData;
+            int lowKeepDay = (int)LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LowKeepDay);
+            _ui.m_txtLowKeep.visible = lowKeepDay > 0;
+            _ui.m_txtLowKeep.text = string.Format("已连续低维护:{0}天", lowKeepDay);
             _ui.m_txtUnionName.text = leagueData.Name;
             _ui.m_comLeagueHead.m_loaUnionIcon.url = ResPathUtil.GetLeagueIconPath(leagueData.Icon);
             _ui.m_comLeagueHead.m_txtUnionLv.text = LeagueDataManager.Instance.HallLevel.ToString();
@@ -120,5 +128,23 @@ namespace GFGGame
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(ConstItemID.LEAGUE_COIN);
 
         }
+
+        private void UpdateButton()
+        {
+            Timers.inst.Add(1, 0, UpdateTime);
+        }
+        private void UpdateTime(object param)
+        {
+            if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) == LeagueQuestionStatus.End)
+            {
+                long curTime = TimeHelper.ServerNow();
+                long endTime = TimeUtil.GetNextTime(GlobalCfgArray.globalCfg.leagueQuestionStartTime);
+                _ui.m_btnAnswer.m_txtTime.text = string.Format("{0}后开启", TimeUtil.FormattingTime5((int)(endTime - curTime)));
+            }
+            else
+            {
+                _ui.m_btnAnswer.m_txtTime.text = "进行中";
+            }
+        }
     }
 }

BIN
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes


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