|
@@ -40,7 +40,7 @@ namespace GFGGame
|
|
_ui.m_listResult.itemRenderer = RenderListResultItem;
|
|
_ui.m_listResult.itemRenderer = RenderListResultItem;
|
|
_ui.m_listJoin.itemRenderer = RenderListJoinItem;
|
|
_ui.m_listJoin.itemRenderer = RenderListJoinItem;
|
|
_ui.m_listChat.itemRenderer = RenderListChatItem;
|
|
_ui.m_listChat.itemRenderer = RenderListChatItem;
|
|
- _ui.m_listChat.itemProvider = GetListItemResource;
|
|
|
|
|
|
+ _ui.m_listChat.itemProvider = GetListChatItemResource;
|
|
_ui.m_listChat.SetVirtual();
|
|
_ui.m_listChat.SetVirtual();
|
|
_ui.m_txtResult.onFocusOut.Add(OnFocuseOut);
|
|
_ui.m_txtResult.onFocusOut.Add(OnFocuseOut);
|
|
}
|
|
}
|
|
@@ -58,15 +58,16 @@ namespace GFGGame
|
|
{
|
|
{
|
|
base.OnShown();
|
|
base.OnShown();
|
|
_dataManager = LeagueDataManager.Instance;
|
|
_dataManager = LeagueDataManager.Instance;
|
|
- _ui.m_listChat.numItems = ChatDataManager.Instance.GetChatDatas(ChatType.LeagueQuestion).Count;
|
|
|
|
- _ui.m_listChat.scrollPane.ScrollBottom();
|
|
|
|
|
|
+ // _ui.m_listChat.numItems = ChatDataManager.Instance.GetChatDatas(ChatType.LeagueQuestion).Count;
|
|
|
|
+ // _ui.m_listChat.scrollPane.ScrollBottom();
|
|
UpdateQuestionState();
|
|
UpdateQuestionState();
|
|
|
|
+ UpdateChatList();
|
|
bool result = await LeagueSproxy.ReqJoinAnswer();
|
|
bool result = await LeagueSproxy.ReqJoinAnswer();
|
|
if (result)
|
|
if (result)
|
|
{
|
|
{
|
|
UpdateJoinList();
|
|
UpdateJoinList();
|
|
- UpdateChatList();
|
|
|
|
}
|
|
}
|
|
|
|
+ UpdateChatList();
|
|
Timers.inst.Add(1, 0, UpdateActiveTime);
|
|
Timers.inst.Add(1, 0, UpdateActiveTime);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -86,7 +87,13 @@ namespace GFGGame
|
|
|
|
|
|
private void OnBtnBackClick()
|
|
private void OnBtnBackClick()
|
|
{
|
|
{
|
|
- ViewManager.GoBackFrom(typeof(LeagueAnsweringView).FullName);
|
|
|
|
|
|
+ AlertUI.Show("退出活动会损失奖励哦,是否仍要退出?")
|
|
|
|
+ .SetLeftButton(true, "否")
|
|
|
|
+ .SetRightButton(true, "是", (object data) =>
|
|
|
|
+ {
|
|
|
|
+ LeagueSproxy.ReqQuitAnswer().Coroutine();
|
|
|
|
+ ViewManager.GoBackFrom(typeof(LeagueAnsweringView).FullName);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
private void OnBtnRuleClick()
|
|
private void OnBtnRuleClick()
|
|
{
|
|
{
|
|
@@ -173,7 +180,7 @@ namespace GFGGame
|
|
Timers.inst.Remove(UpdateAnswerTime);
|
|
Timers.inst.Remove(UpdateAnswerTime);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- _ui.m_txtAnswerTime.text = TimeUtil.FormattingTime5((int)(endTime - curTime));
|
|
|
|
|
|
+ _ui.m_txtAnswerTime.text = TimeUtil.FormattingTime7((int)(endTime - curTime));
|
|
}
|
|
}
|
|
private void UpdateResult()
|
|
private void UpdateResult()
|
|
{
|
|
{
|
|
@@ -250,7 +257,8 @@ namespace GFGGame
|
|
item.target.title = string.Format("{0}.{1}", data, cfg.answerArr[index]);
|
|
item.target.title = string.Format("{0}.{1}", data, cfg.answerArr[index]);
|
|
string myAnswer = _dataManager.LastAnswerRoleData.MyAnswer;
|
|
string myAnswer = _dataManager.LastAnswerRoleData.MyAnswer;
|
|
bool isAnswer = !string.IsNullOrEmpty(myAnswer);
|
|
bool isAnswer = !string.IsNullOrEmpty(myAnswer);
|
|
- item.target.enabled = !isAnswer;
|
|
|
|
|
|
+ // 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 = myAnswer == data.ToString() && myAnswer != cfg.answerCorrect.ToString() ? 0 : 1;
|
|
if (item.target.data == null)
|
|
if (item.target.data == null)
|
|
{
|
|
{
|
|
@@ -268,8 +276,9 @@ namespace GFGGame
|
|
LeagueQuestionCfg cfg = LeagueQuestionCfgArray.Instance.GetCfg(questionId);
|
|
LeagueQuestionCfg cfg = LeagueQuestionCfgArray.Instance.GetCfg(questionId);
|
|
bool result = await LeagueSproxy.ReqAnswerQuestion(questionId, answer);
|
|
bool result = await LeagueSproxy.ReqAnswerQuestion(questionId, answer);
|
|
if (result
|
|
if (result
|
|
- && _dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionId) == _dataManager.LastAnswerRoleData.LastQuestionId
|
|
|
|
- && _dataManager.LastAnswerRoleData.MyAnswer != cfg.answerCorrect)
|
|
|
|
|
|
+ // && _dataManager.GetNumeriValue(LeagueNumericType.LeagueQuestionId) == _dataManager.LastAnswerRoleData.LastQuestionId
|
|
|
|
+ // && _dataManager.LastAnswerRoleData.MyAnswer != cfg.answerCorrect
|
|
|
|
+ )
|
|
{
|
|
{
|
|
_ui.m_listResult.numItems = cfg.answerArr.Length;
|
|
_ui.m_listResult.numItems = cfg.answerArr.Length;
|
|
}
|
|
}
|
|
@@ -285,7 +294,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
private void RenderListJoinItem(int index, GObject obj)
|
|
private void RenderListJoinItem(int index, GObject obj)
|
|
{
|
|
{
|
|
- OtherRoleInfoData roleInfo = _dataManager.LeagueData.LeagueMemberDatas[_memberIds[index]].RoleInfo;
|
|
|
|
|
|
+ OtherRoleInfoData roleInfo = _dataManager.GetMemberRoleInfo(_memberIds[index]);
|
|
UI_ListAnswerJoinItem item = UI_ListAnswerJoinItem.Proxy(obj);
|
|
UI_ListAnswerJoinItem item = UI_ListAnswerJoinItem.Proxy(obj);
|
|
RoleInfoManager.Instance.UpdateHead(item.m_comHead, roleInfo.headId, roleInfo.headBorderId);
|
|
RoleInfoManager.Instance.UpdateHead(item.m_comHead, roleInfo.headId, roleInfo.headBorderId);
|
|
item.m_txtName.text = roleInfo.roleName;
|
|
item.m_txtName.text = roleInfo.roleName;
|
|
@@ -295,7 +304,7 @@ namespace GFGGame
|
|
private void RenderListChatItem(int index, GObject obj)
|
|
private void RenderListChatItem(int index, GObject obj)
|
|
{
|
|
{
|
|
ChatData chatData = ChatDataManager.Instance.ChatDatas[ChatType.LeagueQuestion][index];
|
|
ChatData chatData = ChatDataManager.Instance.ChatDatas[ChatType.LeagueQuestion][index];
|
|
- OtherRoleInfoData roleInfo = _dataManager.LeagueData.LeagueMemberDatas[_memberIds[index]].RoleInfo;
|
|
|
|
|
|
+ OtherRoleInfoData roleInfo = chatData.RoleInfo;
|
|
UI_ListChatItem item = UI_ListChatItem.Proxy(obj);
|
|
UI_ListChatItem item = UI_ListChatItem.Proxy(obj);
|
|
|
|
|
|
RoleInfoManager.Instance.UpdateHeadWithLv(item.m_comHead, roleInfo.headId, roleInfo.headBorderId, roleInfo.roleLv);
|
|
RoleInfoManager.Instance.UpdateHeadWithLv(item.m_comHead, roleInfo.headId, roleInfo.headBorderId, roleInfo.roleLv);
|
|
@@ -310,9 +319,9 @@ namespace GFGGame
|
|
|
|
|
|
UI_ListChatItem.ProxyEnd();
|
|
UI_ListChatItem.ProxyEnd();
|
|
}
|
|
}
|
|
- private string GetListItemResource(int index)
|
|
|
|
|
|
+ private string GetListChatItemResource(int index)
|
|
{
|
|
{
|
|
- if (_memberIds[index] == RoleDataManager.roleId)
|
|
|
|
|
|
+ if (ChatDataManager.Instance.GetChatDatas(ChatType.LeagueQuestion)[index].RoleInfo.roleId == RoleDataManager.roleId)
|
|
return "ui://League/ListChatItemMine";
|
|
return "ui://League/ListChatItemMine";
|
|
else
|
|
else
|
|
return "ui://League/ListChatItem";
|
|
return "ui://League/ListChatItem";
|