zhaoyang 2 years ago
parent
commit
15b043e67c

+ 12 - 15
FGUIProject/assets/League/LeagueAnsweringUI.xml

@@ -1,18 +1,18 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920">
-  <controller name="ctrlHasIcon" pages="0,,1," selected="0">
+  <controller name="ctrlHasIcon" pages="0,,1," selected="1">
     <remark page="0" value="有图标"/>
     <remark page="1" value="无图标"/>
   </controller>
-  <controller name="ctrlQuestionState" pages="0,,1," selected="0">
+  <controller name="ctrlQuestionState" pages="0,,1," selected="1">
     <remark page="0" value="答题中"/>
     <remark page="1" value="cd中"/>
   </controller>
-  <controller name="ctrlQuestionType" pages="0,,1,,2," selected="2">
+  <controller name="ctrlQuestionType" pages="0,,1,,2," selected="0">
     <remark page="1" value="选择题"/>
     <remark page="2" value="填空题"/>
   </controller>
-  <controller name="ctrlResult" pages="0,,1,,2,,3," selected="2">
+  <controller name="ctrlResult" pages="0,,1,,2,,3," selected="3">
     <remark page="1" value="有人答对题目"/>
     <remark page="2" value="没人答对题目"/>
     <remark page="3" value="全部题目答完"/>
@@ -44,11 +44,11 @@
     <image id="n38_9jv6" name="n38" src="9jv66o" fileName="images/lm_djs_db.png" xy="935,0" group="n15_pvb4"/>
     <text id="n9_pvb4" name="txtAnswerTime" xy="959,165" pivot="0.5,0" size="74,44" group="n15_pvb4" font="ui://eg2y0ldpa0cftks" fontSize="32" color="#fffdf8" align="center" text="00:55"/>
     <text id="n11_pvb4" name="txtAnswerNum" xy="478,124" pivot="0.5,0" size="124,41" group="n15_pvb4" font="ui://eg2y0ldpa0cftkz" fontSize="30" color="#8b3510" align="center" text="第1/15题"/>
-    <text id="n13_pvb4" name="txtContent" xy="358,274" size="620,173" group="n15_pvb4" font="ui://eg2y0ldpa0cftks" fontSize="32" color="#915e15" letterSpacing="-2" autoSize="none" text="题目描述题目描述题目描述题目描述题目 描述题目描述题目描述题目描述题目题目 描述述?">
+    <text id="n13_pvb4" name="txtContent" xy="230,274" size="620,142" group="n15_pvb4" font="ui://eg2y0ldpa0cftks" fontSize="32" color="#915e15" letterSpacing="-2" autoSize="none" text="题目描述题目描述题目描述题目描述题目 描述题目描述题目描述题目描述题目题目 描述述?">
       <gearXY controller="ctrlHasIcon" pages="0,1" values="358,274|230,274"/>
       <gearSize controller="ctrlHasIcon" pages="0,1" values="620,173,1,1|620,142,1,1"/>
     </text>
-    <list id="n14_pvb4" name="listResult" xy="359,515" pivot="0.5,0" size="625,148" group="n15_pvb4" layout="flow_hz" lineGap="20" lineItemCount="2" defaultItem="ui://tw70qm9d9jv67c" autoItemSize="true" align="center" vAlign="middle" autoClearItems="true">
+    <list id="n14_pvb4" name="listResult" xy="227,515" pivot="0.5,0" size="625,148" group="n15_pvb4" layout="flow_hz" lineGap="20" lineItemCount="2" defaultItem="ui://tw70qm9d9jv67c" autoItemSize="true" align="center" vAlign="middle" autoClearItems="true">
       <gearDisplay controller="ctrlQuestionType" pages="1"/>
       <gearXY controller="ctrlHasIcon" pages="0,1" values="359,515|227,515"/>
       <gearSize controller="ctrlHasIcon" pages="0,1" values="625,148,1,1|625,148,1,1"/>
@@ -57,16 +57,16 @@
       <item/>
       <item/>
     </list>
-    <text id="n16_pvb4" name="n16" xy="360,472" size="241,41" group="n19_pvb4" font="ui://eg2y0ldpa0cftks" fontSize="30" color="#b68f52" align="center" text="请入您的答案:">
+    <text id="n16_pvb4" name="n16" xy="229,472" size="241,41" group="n19_pvb4" font="ui://eg2y0ldpa0cftks" fontSize="30" color="#b68f52" align="center" text="请入您的答案:">
       <gearText controller="ctrlQuestionType" pages="1,2" values="请选择您的答案:|请输入您的答案:" default="请填入您的答案:"/>
     </text>
-    <text id="n17_pvb4" name="txtResult" xy="602,470" size="123,42" group="n19_pvb4" fontSize="30" color="#b68f52" align="center" autoSize="none" text="" input="true">
+    <text id="n17_pvb4" name="txtResult" xy="471,470" size="123,42" group="n19_pvb4" font="ui://eg2y0ldpa0cftks" fontSize="30" color="#b68f52" align="center" autoSize="none" text="亚索" input="true">
       <gearDisplay controller="ctrlQuestionType" pages="2"/>
     </text>
-    <text id="n18_pvb4" name="n18" xy="603,470" size="124,42" group="n19_pvb4" fontSize="30" color="#b68f52" align="center" autoSize="none" underline="true" text="                       ">
+    <text id="n18_pvb4" name="n18" xy="472,470" size="124,42" group="n19_pvb4" fontSize="30" color="#b68f52" align="center" autoSize="none" underline="true" text="                       ">
       <gearDisplay controller="ctrlQuestionType" pages="2"/>
     </text>
-    <group id="n19_pvb4" name="n19" xy="360,470" size="367,43" group="n15_pvb4" advanced="true">
+    <group id="n19_pvb4" name="n19" xy="229,470" size="367,43" group="n15_pvb4" advanced="true">
       <gearDisplay controller="ctrlQuestionType" pages=""/>
       <gearXY controller="ctrlHasIcon" pages="0,1" values="360,470|229,470"/>
     </group>
@@ -81,9 +81,7 @@
     <group id="n15_pvb4" name="n15" xy="15,0" size="1065,751" advanced="true">
       <gearDisplay controller="ctrlQuestionState" pages="0"/>
     </group>
-    <component id="n50_miy3" name="comRightHead" src="wm603r" fileName="components/ComHeadIcon.xml" xy="539,369" pivot="0.5,0.5" anchor="true" size="167,166" group="n52_miy3" aspect="true" scale="1.125,1.125">
-      <relation target="" sidePair="width-width,height-height"/>
-    </component>
+    <component id="n50_miy3" name="comRightHead" src="wm603r" fileName="components/ComHeadIcon.xml" xy="539,369" pivot="0.5,0.5" anchor="true" size="167,166" group="n52_miy3" aspect="true" scale="1.125,1.125"/>
     <image id="n51_miy3" name="n51" src="wm6037" fileName="images/lm_db_touxiang.png" xy="382,185" group="n52_miy3"/>
     <group id="n52_miy3" name="n52" xy="382,185" size="316,355" group="n24_pvb4" advanced="true">
       <gearDisplay controller="ctrlResult" pages="1"/>
@@ -94,8 +92,7 @@
     <image id="n55_miy3" name="n55" src="9jv65l" fileName="images/lm_dt_tsdk.png" xy="162,424" group="n24_pvb4">
       <gearDisplay controller="ctrlResult" pages="3"/>
     </image>
-    <text id="n22_pvb4" name="txtInfo" xy="305,514" pivot="0.5,0" size="469,44" group="n24_pvb4" font="ui://eg2y0ldpa0cftks" fontSize="32" color="#915e15" align="center" text="哎呀,没人答对呀,大家加油鸭~">
-      <gearDisplay controller="ctrlResult" pages=""/>
+    <text id="n22_pvb4" name="txtInfo" xy="305,417" pivot="0.5,0" size="469,44" group="n24_pvb4" font="ui://eg2y0ldpa0cftks" fontSize="32" color="#915e15" align="center" text="哎呀,没人答对呀,大家加油鸭~">
       <gearXY controller="ctrlResult" pages="3" values="305,417" default="305,514"/>
     </text>
     <image id="n53_miy3" name="n53" src="9jv65l" fileName="images/lm_dt_tsdk.png" xy="162,568" group="n54_miy3"/>

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

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

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/League/LeagueAnswerView.cs

@@ -29,7 +29,7 @@ namespace GFGGame
 
             this.viewCom = _ui.target;
             this.viewCom.Center();
-            // this.modal = true;
+            this.modal = true;
             viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
 
             _ui.m_btnClose.onClick.Add(Hide);
@@ -64,6 +64,7 @@ namespace GFGGame
         }
         private void OnBtnAnswerClick()
         {
+            Hide();
             ViewManager.Show<LeagueAnsweringView>(null, new object[] { typeof(LeagueAnswerView).FullName });
         }
 

+ 15 - 13
GameClient/Assets/Game/HotUpdate/Views/League/LeagueAnsweringView.cs

@@ -29,6 +29,7 @@ namespace GFGGame
             packageName = UI_LeagueAnsweringUI.PACKAGE_NAME;
             _ui = UI_LeagueAnsweringUI.Create();
             this.viewCom = _ui.target;
+            // this.modal = true;
             isfullScreen = true;
 
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("lm_beijing2");
@@ -47,12 +48,12 @@ namespace GFGGame
         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.LEAGUE_NUMBERIC_CHANGE, UpdateQuestionState);
+            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.LEAGUE_NUMBERIC_CHANGE, UpdateQuestionState);
             EventAgent.AddEventListener(ConstMessage.NOTICE_CHAT_MESSAGE, UpdateChatList);
         }
         protected override async void OnShown()
@@ -158,10 +159,11 @@ namespace GFGGame
             _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_txtResult.enabled =
-            !(!string.IsNullOrEmpty(_dataManager.LastAnswerRoleData.MyAnswer) &&
-            _dataManager.LastAnswerRoleData.LastQuestionId == _dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionId)
-            && _dataManager.LastAnswerRoleData.MyAnswer != questionCfg.answerCorrect);
+
+            bool isAnswer = !string.IsNullOrEmpty(_dataManager.LastAnswerRoleData.MyAnswer) && _dataManager.LastAnswerRoleData.LastQuestionId == _dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionId);
+            _ui.m_txtResult.text = isAnswer ? _dataManager.LastAnswerRoleData.MyAnswer : "";
+            _ui.m_txtResult.enabled = !(isAnswer && _dataManager.LastAnswerRoleData.MyAnswer != questionCfg.answerCorrect);
+
             _ui.m_ctrlQuestionType.selectedIndex = questionCfg.type;
             if (questionCfg.type == 1)
             {
@@ -193,7 +195,7 @@ namespace GFGGame
             _ui.m_txtRightCount.SetVar("value", _dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionTrueCount).ToString());
             _ui.m_txtRightCount1.SetVar("value", _dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionTrueCount).ToString());
             _ui.m_ctrlQuestionState.selectedIndex = 1;
-            _ui.m_ctrlResult.selectedIndex = LastQuestionResult.SomeBodyRight;
+            _ui.m_ctrlResult.selectedIndex = _dataManager.LastAnswerRoleData.LastQuestionResult;
             if (_dataManager.LastAnswerRoleData.LastQuestionResult == LastQuestionResult.SomeBodyRight)
             {
 
@@ -260,10 +262,10 @@ namespace GFGGame
             int data = index + 1;
             item.target.title = string.Format("{0}.{1}", data, cfg.answerArr[index]);
             string myAnswer = _dataManager.LastAnswerRoleData.MyAnswer;
-            bool isAnswer = !string.IsNullOrEmpty(myAnswer);
+            bool isAnswer = !string.IsNullOrEmpty(_dataManager.LastAnswerRoleData.MyAnswer) && _dataManager.LastAnswerRoleData.LastQuestionId == _dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionId);
             // item.m_c1.selectedIndex= !isAnswer;
             item.target.touchable = !isAnswer;
-            item.m_c1.selectedIndex = myAnswer == data.ToString() && myAnswer != cfg.answerCorrect.ToString() ? 0 : 1;
+            item.m_c1.selectedIndex = isAnswer && myAnswer == data.ToString() && myAnswer != cfg.answerCorrect.ToString() ? 0 : 1;
             if (item.target.data == null)
             {
                 item.target.onClick.Add(OnBtnChooseClick);

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