public void OnClickAddCupListBtn() { if (LogicDataCenter.kinDataManager.KinBaseData.dwShaikhID != nSelfPDBID) { UIUtil.ShowSystemMessage(EMChatTipID.CHAT_TIP_LEGENDCUP_NOT_SHAIKH_CANT_REQUEST); return; } cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(nLegendCupID); if (cupBaseData.nLegendCupID == 0) { return; } TooltipAndDialog.UIDialogData data = new TooltipAndDialog.UIDialogData( title: ULocalizationService.Instance.Get("UIView", "LegendCupRegist", "AddCupTitle"), message: String.Format(ULocalizationService.Instance.Get("UIView", "LegendCupRegist", "AddCupContent"), cupBaseData.nRegistGold), buttons: new UIWidgets.DialogActions() { { ULocalizationService.Instance.Get("UIView", "LegendCupRegist", "ConfirmBtn"), OnConfirmAddCup }, { ULocalizationService.Instance.Get("UIView", "LegendCupRegist", "CancelBtn"), null } } ); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_DIALOG, data); }
private bool DoOnlienResetCup() { DateTime newDateTime; if (CheckInputTime(out newDateTime) == false) { return(false); } cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(m_dataInfo.nLegendCupID); if (cupBaseData.nLegendCupID == 0) { return(false); } cmd_legendcup_judge_competition_node judgedInfo = new cmd_legendcup_judge_competition_node(); judgedInfo.nLegendCupID = m_dataInfo.nLegendCupID; // 杯赛ID judgedInfo.nRoundID = m_dataInfo.nRoundID; // 轮次ID judgedInfo.nSearchID = m_dataInfo.nSearchID; // 节点ID judgedInfo.byJudgeFlag = (byte)EJudgeNodeWar.JUDGE_Reset; // EJudgeNodeWar // 获取重置比赛的时间 System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); judgedInfo.lResetNewTime = (long)(newDateTime - startTime).TotalSeconds; judgedInfo.nKin1 = m_dataInfo.nKin1ID; // 队伍1 judgedInfo.nKin1Score = Convert.ToInt32(Kin1ScoreInputField.text == string.Empty ? Kin1ScoreInputField.placeholder.GetComponent <Text>().text : Kin1ScoreInputField.text); judgedInfo.nKin2 = m_dataInfo.nKin2ID; // 队伍2 judgedInfo.nKin2Score = Convert.ToInt32(Kin2ScoreInputField.text == string.Empty ? Kin2ScoreInputField.placeholder.GetComponent <Text>().text : Kin2ScoreInputField.text); // 队伍2得分 ViewEventHelper.Instance.SendCommand <cmd_legendcup_judge_competition_node>(GameLogicDef.GVIEWCMD_LEGENDCUP_JUDGE_COMPETITION_NODE, ref judgedInfo); return(true); }
private bool OnConfirmAddCup() { cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(nLegendCupID); if (cupBaseData.nLegendCupID == 0) { return(false); } if (cupBaseData.nIsLock > 0) { LegendCupIDData uiData = new LegendCupIDData(); uiData.nLegendCupID = nLegendCupID; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_LEGENDCUP_PASSWORD_SHOW, uiData); } else { cmd_legendcup_add_regist_kinlist addcup = new cmd_legendcup_add_regist_kinlist(); addcup.nLegendCupID = nLegendCupID; addcup.nKinID = LogicDataCenter.kinDataManager.KinBaseData.nKinID; addcup.nActorID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); addcup.byCreateCupType = cupBaseData.byCreateCupType; addcup.szPassword = ""; ViewEventHelper.Instance.SendCommand <cmd_legendcup_add_regist_kinlist>(GameLogicDef.GVIEWCMD_LEGENDCUP_ADD_REGIST_KINLIST, ref addcup); } return(true); }
public void OnShowBigKnockoutWnd(long nCupID) { m_LegendCupID = nCupID; SingleCompetitionInfo competitionInfo = LogicDataCenter.legendCupDataManager.GetSingleCompetitionInfo(m_LegendCupID); if (competitionInfo == null) { return; } cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(m_LegendCupID); if (cupBaseData.nLegendCupID == 0) { return; } // 数据赋值部分 CompetitionBonus.text = ULocalizationService.Instance.Get("UIView", "LegendCupGroup", "CompetitionBonus") + ":" + cupBaseData.nCompetitionBonus; m_RoundID = competitionInfo.headInfo.nRoundID; TitleDes.text = cupBaseData.szCupName; KinNum.text = cupBaseData.nCurrentKinNum + "/" + cupBaseData.nMaxKinNum; itemList = new List <UListItemLegendCupBigKnockout>(competitionInfo.headInfo.nGroupCount); for (int i = 0; i < competitionInfo.headInfo.nGroupCount; i++) { UListItemLegendCupBigKnockout item = new UListItemLegendCupBigKnockout(); item.nLegendCupID = nCupID; if (i >= 0 && i < m_GroupIndex.Count) { item.strGroupIndex = m_GroupIndex[i]; } item.kinVsInfoList = new List <legendcup_kinvsinfo>(); item.competitionNodeList = new List <cmd_legendcup_recv_competition_node>(); foreach (cmd_legendcup_recv_competition_node node in competitionInfo.nodeInfo) { if (node.nRoundID == competitionInfo.headInfo.nRoundID && node.nGroupID == (i + 1)) { legendcup_kinvsinfo info = new legendcup_kinvsinfo(); info.nKin1ID = node.nKin1ID; info.nKin2ID = node.nKin2ID; info.szKin1Name = node.szKin1Name; info.szKin2Name = node.szKin2Name; item.kinVsInfoList.Add(info); item.competitionNodeList.Add(node); } } itemList.Add(item); } LegendCupBigKnockList.OnSelect.RemoveListener(OnSelectCupBigKnockoutItem); LegendCupBigKnockList.DataSource.Clear(); ObservableList <UListItemLegendCupBigKnockout> dataSource = new ObservableList <UListItemLegendCupBigKnockout>(); foreach (UListItemLegendCupBigKnockout item in itemList) { dataSource.Add(item); } LegendCupBigKnockList.DataSource = dataSource; LegendCupBigKnockList.OnSelect.AddListener(OnSelectCupBigKnockoutItem); }
public void OnShowLegndCupPrizeWnd(long lLegendCupID) { cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(lLegendCupID); if (cupBaseData.nLegendCupID == 0) { return; } TotalBonusCount.text = cupBaseData.nCompetitionBonus.ToString(); // 清空DetailPrizeFrame int nCount = DetailPrizeFrame.childCount; for (int j = nCount - 1; j >= 0; j--) { Transform childTrans = DetailPrizeFrame.GetChild(j); if (childTrans) { var temp = childTrans.gameObject; ResNode.DestroyRes(ref temp); } } SSchemeLegendCupConfig cupConfig = LegendCupConfig.Instance.GetCupConfig(cupBaseData.nCupConfigID); if (cupConfig == null) { return; } List <SSchemeLegendCupPrizeConfig> prizeConfigList = LegendCupConfig.Instance.GetCupPrizeConfig(cupConfig.nPrizeConfigID); if (prizeConfigList == null) { return; } m_DetailPrizeItems = new LegendCupDetailPrizeItem[prizeConfigList.Count]; for (int i = 0; i < prizeConfigList.Count; i++) { GameObject detailPrizeObj = ResNode.InstantiateRes(DetailPrizeTemplate); if (!detailPrizeObj) { return; } RectTransform rectTrans = detailPrizeObj.transform as RectTransform; rectTrans.SetParent(DetailPrizeFrame, false); m_DetailPrizeItems[i] = detailPrizeObj.GetComponent <LegendCupDetailPrizeItem>(); if (!m_DetailPrizeItems[i]) { return; } m_DetailPrizeItems[i].SetData(prizeConfigList[i], cupBaseData.nCompetitionBonus); } DetailPrizeTemplate.SetActive(false); }
public void UpdateCupCompetitionInfo(IntPtr ptrParam, int nPtrLen) { IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen); long llegendCupId = helper.get <long>(); cmd_legendcup_recv_competition_node node = helper.get <cmd_legendcup_recv_competition_node>(); // 自己战队dida相关 if (!(CheckIsSelfInCompetitionMember(node.nKin1ID) == false && CheckIsSelfInCompetitionMember(node.nKin2ID) == false)) { bool bDida = (node.byCompetitionNodeState == (byte)ECompetitionNodeState.emNodeState_CanEnter); SetLegendCupDIDA(bDida, llegendCupId, node.nRoundID, node.nSearchID); } // 更新节点信息 cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(llegendCupId); if (cupBaseData.nLegendCupID == 0) { return; } if (!m_legendCupCompetitionDic.ContainsKey(llegendCupId)) { return; } SingleCompetitionInfo competitionInfo = m_legendCupCompetitionDic[llegendCupId]; if (competitionInfo == null || competitionInfo.nodeInfo == null) { return; } for (int i = 0; i < competitionInfo.nodeInfo.Count; i++) { if (competitionInfo.nodeInfo[i].nSearchID == node.nSearchID) { competitionInfo.nodeInfo[i] = node; break; } } // 通知相应界面 LegendCupIDData uiData = new LegendCupIDData(); uiData.nLegendCupID = competitionInfo.headInfo.nLegendCupID; if (competitionInfo.headInfo.byCompetitionType == (int)ERoundCompetitionType.emType_GroupCompetition) { UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_LEGENDCUP_GROUP_UPDATE, uiData); } else if (competitionInfo.headInfo.byCompetitionType == (int)ERoundCompetitionType.emType_KnockoutCompetition) { // 大淘汰赛、小淘汰赛界面合并 UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_LEGENDCUP_SMALLKNOCKOUT_UPDATE, uiData); } }
public cmd_legendcup_recv_cuplist_node GetSingleLegendCupNode(long nCupID) { cmd_legendcup_recv_cuplist_node cupBaseData = new cmd_legendcup_recv_cuplist_node(); foreach (cmd_legendcup_recv_cuplist_node item in m_legendCupNodeList) { if (item.nLegendCupID == nCupID) { cupBaseData = item; break; } } return(cupBaseData); }
// DIDA移除有三处:1、时间到2、点DIDA3、点参加 设置DIDA:该位置、线上赛 public void SetLegendCupDIDA(bool bActive, long nLegendCupID, int nRoundID, int nSearchID) { cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(nLegendCupID); if (cupBaseData.nLegendCupID == 0 || cupBaseData.nIsOnline <= 0) { return; } SideButtonLegendBuildingSN dataInfo = new SideButtonLegendBuildingSN(); dataInfo.nLegendCupID = (uint)nLegendCupID; dataInfo.nSearchID = nSearchID; if (bActive) { DIDAAddData addMsg = new DIDAAddData(); addMsg.nItemID = (int)EDIDAType.EDIDA_LegendCup; addMsg.bAllowRepeatItem = true; addMsg.nButtonIconID = (int)EDIDAType.EDIDA_LegendCup; addMsg.strButtonText = ULocalizationService.Instance.Get("UIView", "LegendCupGroup", "JoinCupRoom"); addMsg.strTooltip = ULocalizationService.Instance.Get("UIView", "LegendCupGroup", "JoinCupRoom"); addMsg.sCustomData = dataInfo; addMsg.callBack = (CustomerData) => { SideButtonDataBuildingSN customerData = CustomerData as SideButtonDataBuildingSN; UIDialogData tooltipData = new UIDialogData( title: cupBaseData.szCupName, message: "[" + cupBaseData.szCupName + "]" + ULocalizationService.Instance.Get("UIView", "LegendCupGroup", "JoinCupRoomContent"), buttons: new UIWidgets.DialogActions() { { ULocalizationService.Instance.Get("UIView", "Team", "AgreeButtonDes"), () => { RequestDIDACallBack(true, nLegendCupID, nRoundID, nSearchID); return(true); } }, { ULocalizationService.Instance.Get("UIView", "Team", "DisAgreeButtonDes"), () => { RequestDIDACallBack(false, nLegendCupID, nRoundID, nSearchID); return(true); } } }); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_DIALOG, tooltipData); }; LogicDataCenter.didaDataManager.AddItem(addMsg); } else { DIDARemoveData rmMsg = new DIDARemoveData(); rmMsg.nItemID = (int)EDIDAType.EDIDA_LegendCup; rmMsg.sCustomData = dataInfo; LogicDataCenter.didaDataManager.RemoveItem(rmMsg); } }
private bool OnConfirmQuitCup() { cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(nLegendCupID); if (cupBaseData.nLegendCupID == 0) { return(false); } cmd_legendcup_quit_regist_kinlist deletecup = new cmd_legendcup_quit_regist_kinlist(); deletecup.nLegendCupID = nLegendCupID; deletecup.nKinID = LogicDataCenter.kinDataManager.KinBaseData.nKinID; deletecup.nActorID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); deletecup.byCreateCupType = cupBaseData.byCreateCupType; ViewEventHelper.Instance.SendCommand <cmd_legendcup_quit_regist_kinlist>(GameLogicDef.GVIEWCMD_LEGENDCUP_QUIT_REGIST_KINLIST, ref deletecup); return(true); }
//private void ClearKinMemberFrame() //{ // // 清空KinMemberFrame // int nCount = KinMemberListFrame.childCount; // for (int i = nCount - 1; i >= 0; --i) // { // Transform childTrans = KinMemberListFrame.GetChild(i); // if (childTrans) // { // var temp = childTrans.gameObject; // ResNode.DestroyRes(ref temp); // } // } //} public void OnClickInviteLegendCupBtn() { cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(nLegendCupID); if (cupBaseData.nLegendCupID == 0) { return; } string strContent = ""; if (cupBaseData.nRegistGold > 0) { strContent = String.Format("杯赛【{0}】({1}/{2})正在火热进行中,报名费用金币{3},{4}[clickinvitelegendcup color=255+255+255 cupid={5}]点击报名[/clickinvitelegendcup]", cupBaseData.szCupName, cupBaseData.nCurrentKinNum, cupBaseData.nMaxKinNum, cupBaseData.nRegistGold, ChatMessageManager.ChatItemFlag, cupBaseData.nLegendCupID ); } else { strContent = String.Format("杯赛【{0}】({1}/{2})正在火热进行中,{3}[clickinvitelegendcup color=255+255+255 cupid={4}]点击报名[/clickinvitelegendcup]", cupBaseData.szCupName, cupBaseData.nCurrentKinNum, cupBaseData.nMaxKinNum, ChatMessageManager.ChatItemFlag, cupBaseData.nLegendCupID ); } EMChatChannelType channelType = EMChatChannelType.CHAT_CHANNEL_WORLD; if (cupBaseData.byCreateCupType == (int)ELegendCupType.emCupType_Clan) { channelType = EMChatChannelType.CHAT_CHANNEL_CLAN; } UIUtil.SendChatMessage(channelType, strContent); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_CHATBOX_TOGGLE, null); }
public void OnClickReleaseCupBtn() { if (bIsRegistState || bIsOnline) { return; } cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(nLegendCupID); if (cupBaseData.nLegendCupID == 0) { return; } cmd_legendcup_release_single_cup cupdata = new cmd_legendcup_release_single_cup(); cupdata.nLegendCupID = nLegendCupID; cupdata.nOperatorID = nSelfPDBID; cupdata.byCreateCupType = cupBaseData.byCreateCupType; ViewEventHelper.Instance.SendCommand <cmd_legendcup_release_single_cup>(GameLogicDef.GVIEWCMD_LEGENDCUP_RELEASE_SINGLE_CUP, ref cupdata); }
public void UpdateSingleCup(IntPtr ptrParam, int nPtrLen) { IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen); cmd_legendcup_recv_cuplist_node data = helper.get <cmd_legendcup_recv_cuplist_node>(); if (m_legendCupListType == (int)ELegendCupListType.ELCLT_Clan && data.nIsClanLimit <= 0) { return; } List <cmd_legendcup_recv_cuplist_node> tempList = new List <cmd_legendcup_recv_cuplist_node>(m_legendCupNodeList); bool bIsIn = false; for (int i = 0; i < tempList.Count; i++) { if (tempList[i].nLegendCupID == data.nLegendCupID) { tempList[i] = data; bIsIn = true; break; } } if (!bIsIn) { tempList.Add(data); } SetLegendCupListBySequence(tempList); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_LEGENDCUP_CUPLIST_UPDATELIST, null); if (data.nIsNewCreate > 0) { // 关闭创建界面 UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_LEGENDCUP_MSGBOXCREATE_CLOSE, null); // 打开详细界面 cmd_legendcup_view_single_cup cupdata = new cmd_legendcup_view_single_cup(); cupdata.nLegendCupID = data.nLegendCupID; ViewEventHelper.Instance.SendCommand <cmd_legendcup_view_single_cup>(GameLogicDef.GVIEWCMD_LEGENDCUP_VIEW_SINGLE_CUP, ref cupdata); } }
// LegendCupListWnd public void RecvTotalLegendCup(IntPtr ptrParam, int nPtrLen) { IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen); cmd_legendcup_recv_cuplist_head head = helper.get <cmd_legendcup_recv_cuplist_head>(); List <cmd_legendcup_recv_cuplist_node> tempList = new List <cmd_legendcup_recv_cuplist_node>(); for (int i = 0; i < head.nCount; ++i) { cmd_legendcup_recv_cuplist_node data = helper.get <cmd_legendcup_recv_cuplist_node>(); // 如果是请求联盟杯赛,客户端做一次筛选 if (m_legendCupListType == (int)ELegendCupListType.ELCLT_Clan && data.nIsClanLimit <= 0) { continue; } tempList.Add(data); } SetLegendCupListBySequence(tempList); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_LEGENDCUP_CUPLIST_RECVLIST, null); }
public void OnClickCupGroupRT(string eventName) { if (eventName == "CupGroupTip") { cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(m_LegendCupID); if (cupBaseData.nLegendCupID == 0) { return; } UIMsgCmdData uiCupTipData = null; if (cupBaseData.nIsOnline > 0) { uiCupTipData = new UIMsgCmdData((int)WndMsgID.WND_MSG_LEGENDCUP_MSGBOXTIP_SHOW, (int)LegendCupTipType.LCTT_OnLine_Cup32In, "", IntPtr.Zero, 0); } else { uiCupTipData = new UIMsgCmdData((int)WndMsgID.WND_MSG_LEGENDCUP_MSGBOXTIP_SHOW, (int)LegendCupTipType.LCTT_OffLine_Cup32In, "", IntPtr.Zero, 0); } UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_LEGENDCUP_MSGBOXTIP_SHOW, uiCupTipData); } }
public void OnClickAddBlackListBtn() { if (m_CurSelectItem == null) { UIUtil.ShowSystemMessage(EMChatTipID.CHAT_TIP_LEGENDCUP_SELECT_RIGHT_KINID); return; } cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(nLegendCupID); if (cupBaseData.nLegendCupID == 0) { return; } cmd_legendcup_add_regist_blacklist addblacklist = new cmd_legendcup_add_regist_blacklist(); addblacklist.nLegendCupID = nLegendCupID; addblacklist.nKinID = m_CurSelectItem.data.nKinID; addblacklist.nOperatorID = nSelfPDBID; addblacklist.byCreateCupType = cupBaseData.byCreateCupType; ViewEventHelper.Instance.SendCommand <cmd_legendcup_add_regist_blacklist>(GameLogicDef.GVIEWCMD_LEGENDCUP_ADD_REGIST_BLACKLIST, ref addblacklist); }
public void OnClickConfirmBtn() { if (PasswordIF.text == null) { UIUtil.ShowSystemMessage(EMChatTipID.CHAT_TIP_LEGENDCUP_NOT_ENTER_ANY_PASSWORD); return; } cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(nLegendCupID); if (cupBaseData.nLegendCupID == 0) { return; } cmd_legendcup_add_regist_kinlist addcup = new cmd_legendcup_add_regist_kinlist(); addcup.nLegendCupID = nLegendCupID; addcup.nKinID = LogicDataCenter.kinDataManager.KinBaseData.nKinID; addcup.nActorID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); addcup.byCreateCupType = cupBaseData.byCreateCupType; addcup.szPassword = PasswordIF.text; ViewEventHelper.Instance.SendCommand <cmd_legendcup_add_regist_kinlist>(GameLogicDef.GVIEWCMD_LEGENDCUP_ADD_REGIST_KINLIST, ref addcup); }
public void OnRecvKinList(long nCupID) { kinlist = LogicDataCenter.legendCupDataManager.GetSingleRegistKinInfo(nCupID); if (kinlist == null) { return; } nLegendCupID = nCupID; nSelfKinID = LogicDataCenter.kinDataManager.KinBaseData.nKinID; // 控制按钮状态 if (EntityFactory.MainHeroView != null) { nSelfPDBID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); } cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(nLegendCupID); if (cupBaseData.nLegendCupID == 0) { return; } SysTitleDes.text = cupBaseData.szCupName; CreaterDes.gameObject.SetActive(!String.IsNullOrEmpty(cupBaseData.szCreateActorName)); CreaterDes.text = string.Format("举办人:{0}", cupBaseData.szCreateActorName); bIsCupCreater = (cupBaseData.nCreaterPDBID == nSelfPDBID); bIsSelfIn = (cupBaseData.nIsSelfIn > 0); bIsOnline = (cupBaseData.nIsOnline > 0); bIsRegistState = (kinlist.headInfo.nRegistLeftTime > 0); bIsKinShaikh = (LogicDataCenter.kinDataManager.KinBaseData.dwShaikhID == nSelfPDBID); RegistKinNum.text = kinlist.headInfo.nCurKinCount + "/" + kinlist.headInfo.nMaxKinNum; if (bIsRegistState) { // 设置报名阶段按钮、倒计时 SetRegistStateButtons(); } else { // 设置确认比赛名单阶段按钮、倒计时 SetReleaseStateButtons(); } LegendCupRegistList.onRightClick.RemoveListener(OnSelectCupItem); LegendCupRegistList.OnSelect.RemoveListener(OnSelectCupItem); LegendCupRegistList.DataSource.Clear(); ObservableList <UListItemLegendCupRegist> dataSource = new ObservableList <UListItemLegendCupRegist>(); int nIndex = 1; foreach (cmd_legendcup_recv_regist_kinlistnode node in kinlist.nodeInfo) { UListItemLegendCupRegist item = new UListItemLegendCupRegist(); item.nIndex = nIndex; item.data = node; dataSource.Add(item); nIndex++; } m_AllDataSource = new ObservableList <UListItemLegendCupRegist>(dataSource); LegendCupRegistList.DataSource = dataSource; LegendCupRegistList.OnSelect.AddListener(OnSelectCupItem); LegendCupRegistList.onRightClick.AddListener(OnSelectCupItem); //// 默认选择第一条 //ClearKinMemberFrame(); //if (dataSource.Count > 0) //{ // LegendCupRegistList.Select(0); //} TotalBonusCount.text = cupBaseData.nCompetitionBonus.ToString(); // 清空DetailPrizeFrame int nCount = DetailPrizeFrame.childCount; for (int j = nCount - 1; j >= 0; j--) { Transform childTrans = DetailPrizeFrame.GetChild(j); if (childTrans) { var temp = childTrans.gameObject; ResNode.DestroyRes(ref temp); } } SSchemeLegendCupConfig cupConfig = LegendCupConfig.Instance.GetCupConfig(cupBaseData.nCupConfigID); if (cupConfig == null) { return; } List <SSchemeLegendCupPrizeConfig> prizeConfigList = LegendCupConfig.Instance.GetCupPrizeConfig(cupConfig.nPrizeConfigID); if (prizeConfigList == null) { return; } DetailPrizeTemplate.SetActive(true); for (int i = 0; i < prizeConfigList.Count; i++) { GameObject detailPrizeObj = ResNode.InstantiateRes(DetailPrizeTemplate); if (!detailPrizeObj) { return; } RectTransform rectTrans = detailPrizeObj.transform as RectTransform; rectTrans.SetParent(DetailPrizeFrame, false); LegendCupDetailPrizeItem detailPrizeItems = detailPrizeObj.GetComponent <LegendCupDetailPrizeItem>(); if (!detailPrizeItems) { return; } detailPrizeItems.SetData(prizeConfigList[i], cupBaseData.nCompetitionBonus); } if (prizeConfigList.Count < SinglePagePrizeMaxCount) { for (int j = prizeConfigList.Count; j < SinglePagePrizeMaxCount; ++j) { GameObject detailPrizeObj = ResNode.InstantiateRes(DetailPrizeTemplate); if (!detailPrizeObj) { return; } RectTransform rectTrans = detailPrizeObj.transform as RectTransform; rectTrans.SetParent(DetailPrizeFrame, false); LegendCupDetailPrizeItem tempItems = detailPrizeObj.GetComponent <LegendCupDetailPrizeItem>(); if (!tempItems) { return; } tempItems.ClearData(); } } DetailPrizeTemplate.SetActive(false); CupConfigName.text = cupConfig.sCupConfigName; LockIconTip.SetText(UTooltipParamName.BodyText, ULocalizationService.Instance.Get("UIView", "LegendCupList", "LockIconTip")); OnlineIconTip.SetText(UTooltipParamName.BodyText, ULocalizationService.Instance.Get("UIView", "LegendCupList", "OnlineIconTip")); LockIcon.gameObject.SetActive(cupBaseData.nIsLock > 0); OnlineIcon.gameObject.SetActive(cupBaseData.nIsOnline > 0); }
public void OnShowGroupWnd(long nCupID) { m_LegendCupID = nCupID; SingleCompetitionInfo competitionInfo = LogicDataCenter.legendCupDataManager.GetSingleCompetitionInfo(m_LegendCupID); if (competitionInfo == null) { return; } cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(m_LegendCupID); if (cupBaseData.nLegendCupID == 0) { return; } // 数据赋值部分 SysTitleDes.text = cupBaseData.szCupName; CreaterDes.gameObject.SetActive(!String.IsNullOrEmpty(cupBaseData.szCreateActorName)); CreaterDes.text = string.Format("举办人:{0}", cupBaseData.szCreateActorName); CompetitionBonus.text = ULocalizationService.Instance.Get("UIView", "LegendCupGroup", "CompetitionBonus") + ":" + cupBaseData.nCompetitionBonus; m_RoundID = competitionInfo.headInfo.nRoundID; TitleDes.text = cupBaseData.szCupName; KinNum.text = cupBaseData.nCurrentKinNum + "/" + cupBaseData.nMaxKinNum; itemList = new List <UListItemLegendCupGroup>(competitionInfo.headInfo.nGroupCount); for (int i = 0; i < competitionInfo.headInfo.nGroupCount; i++) { UListItemLegendCupGroup item = new UListItemLegendCupGroup(); item.nLegendCupID = nCupID; if (i >= 0 && i < m_GroupIndex.Count) { item.strGroupIndex = m_GroupIndex[i]; } item.kinInfoList = new List <legendcup_kininfo>(); for (int j = 0; j < competitionInfo.headInfo.nGroupMaxKin; j++) { legendcup_kininfo info = new legendcup_kininfo(); info.nKinID = competitionInfo.headInfo.kinInfos[i * competitionInfo.headInfo.nGroupMaxKin + j].nKinID; info.szKinName = competitionInfo.headInfo.kinInfos[i * competitionInfo.headInfo.nGroupMaxKin + j].szKinName; item.kinInfoList.Add(info); } item.competitionNodeList = new List <cmd_legendcup_recv_competition_node>(); foreach (cmd_legendcup_recv_competition_node node in competitionInfo.nodeInfo) { if (node.nRoundID == competitionInfo.headInfo.nRoundID && node.nGroupID == (i + 1)) { item.competitionNodeList.Add(node); } } itemList.Add(item); } LegendCupGroupList.onDoubleClick.RemoveListener(OnDoubleClickGroupItem); LegendCupGroupList.OnSelect.RemoveListener(OnSelectCupGroupItem); LegendCupGroupList.DataSource.Clear(); ObservableList <UListItemLegendCupGroup> dataSource = new ObservableList <UListItemLegendCupGroup>(); foreach (UListItemLegendCupGroup item in itemList) { dataSource.Add(item); } LegendCupGroupList.DataSource = dataSource; LegendCupGroupList.OnSelect.AddListener(OnSelectCupGroupItem); LegendCupGroupList.onDoubleClick.AddListener(OnDoubleClickGroupItem); // 状态 string strMonth = ULocalizationService.Instance.Get("UIView", "LegendCupSmallKnockout", "Month"); string strDay = ULocalizationService.Instance.Get("UIView", "LegendCupSmallKnockout", "Day"); int nRoundEndTime = 0; if (competitionInfo.roundInfo.Count > m_RoundID - 1) { nRoundEndTime = competitionInfo.roundInfo[m_RoundID - 1].nRoundEndTime; } DateTime roundEndTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified).AddSeconds(nRoundEndTime); roundEndTime = roundEndTime.ToLocalTime(); RoundTimeDesc.text = String.Format("{0}:{1}{2}{3}{4}{5:D2}:{6:D2}", ULocalizationService.Instance.Get("UIView", "LegendCupGroup", "GroupEndTime"), roundEndTime.Month, strMonth, roundEndTime.Day, strDay, roundEndTime.Hour, roundEndTime.Minute); foreach (var item1 in competitionInfo.nodeInfo) { if (LogicDataCenter.legendCupDataManager.CheckIsSelfInCompetitionMember(item1.nKin1ID) || LogicDataCenter.legendCupDataManager.CheckIsSelfInCompetitionMember(item1.nKin2ID)) { if (item1.byCompetitionNodeState <= (int)ECompetitionNodeState.emNodeState_Competition)//进行中 { DateTime enterTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified).AddSeconds(item1.nEnterTime); enterTime = enterTime.ToLocalTime(); DateTime beginTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified).AddSeconds(item1.nBeginTime); beginTime = beginTime.ToLocalTime(); RoundTimeDesc.text = ULocalizationService.Instance.Get("UIView", "LegendCupSmallKnockout", "YourNextCup") + enterTime.Month + strMonth + enterTime.Day + strDay + String.Format("{0:D2}:{1:D2} - {2:D2}:{3:D2}", enterTime.Hour, enterTime.Minute, beginTime.Hour, beginTime.Minute); break; } } } // 按钮 GotoBtn.interactable = false; GotoBtnDes.color = UDefines.CommomColor(ECommonColor.ECC_Gray); CatchBtnEffect.color = Color.clear; if (CatchBtnEffectSequence != null) { CatchBtnEffectSequence.Kill(true); } foreach (var item2 in competitionInfo.nodeInfo) { if (LogicDataCenter.legendCupDataManager.CheckIsSelfInCompetitionMember(item2.nKin1ID) || LogicDataCenter.legendCupDataManager.CheckIsSelfInCompetitionMember(item2.nKin2ID)) { if (item2.byCompetitionNodeState == (byte)ECompetitionNodeState.emNodeState_CanEnter) { GotoBtn.interactable = true; GotoBtnDes.color = UDefines.CommomColor(ECommonColor.ECC_White); m_GotoSearchID = item2.nSearchID; Color baseColor = Color.white; baseColor.a = 0f; CatchBtnEffect.color = baseColor; CatchBtnEffectSequence = DOTween.Sequence(); CatchBtnEffectSequence.Append(DOTween.ToAlpha(() => CatchBtnEffect.color, x => CatchBtnEffect.color = x, 1f, 0.5f)); CatchBtnEffectSequence.Append(DOTween.ToAlpha(() => CatchBtnEffect.color, x => CatchBtnEffect.color = x, 0f, 0.5f).SetDelay(0.2f)); CatchBtnEffectSequence.SetLoops(-1, LoopType.Restart); CatchBtnEffectSequence.OnKill(() => CatchBtnEffectSequence = null); DateTime beginTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified).AddSeconds(item2.nBeginTime); beginTime = beginTime.ToLocalTime(); RoundTimeDesc.text = String.Format(ULocalizationService.Instance.Get("UIView", "LegendCupSmallKnockout", "NodeCanEnter"), beginTime.Hour, beginTime.Minute); break; } } } }
public void SetData(long nCupID, cmd_legendcup_recv_competition_node nodeInfo, int nNodeType) { m_legendCupID = nCupID; m_roundID = nodeInfo.nRoundID; m_searchID = nodeInfo.nSearchID; m_nodeInfo = nodeInfo; bInThisNode = LogicDataCenter.legendCupDataManager.CheckIsSelfInCompetitionMember(nodeInfo.nKin1ID) || LogicDataCenter.legendCupDataManager.CheckIsSelfInCompetitionMember(nodeInfo.nKin2ID); cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(m_legendCupID); if (cupBaseData.nLegendCupID == 0) { return; } // 基本设置 ViewItem.SetActive(true); BgIcon.raycastTarget = true; DateTime enterTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified).AddSeconds(nodeInfo.nEnterTime); enterTime = enterTime.ToLocalTime(); DateTime beginTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified).AddSeconds(nodeInfo.nBeginTime); beginTime = beginTime.ToLocalTime(); Data.text = enterTime.Month.ToString("D2") + strMonth + enterTime.Day.ToString("D2") + strDay; Time.text = String.Format("{0:D2}:{1:D2} - {2:D2}:{3:D2}", enterTime.Hour, enterTime.Minute, beginTime.Hour, beginTime.Minute); Kin1Name.text = nodeInfo.szKin1Name; VSDes.text = "VS"; Kin2Name.text = nodeInfo.szKin2Name; //GotoBtnDes.text = strGotoBtn; // 考虑到排版,只改变透明度不隐藏,弃权的不显示比分 bool bKin1Win = nodeInfo.nKin1ID == nodeInfo.nWinnerKinID && nodeInfo.nKin1Score > nodeInfo.nKin2Score; bool bKin2Win = nodeInfo.nKin2ID == nodeInfo.nWinnerKinID && nodeInfo.nKin2Score > nodeInfo.nKin1Score; Kin1WinIcon.color = bKin1Win ? new Color(1, 1, 1, 1) : new Color(1, 1, 1, 0); Kin2WinIcon.color = bKin2Win ? new Color(1, 1, 1, 1) : new Color(1, 1, 1, 0); // 设置GotoBtn //bool bCanJoin = bInThisNode && (nodeInfo.byCompetitionNodeState == (byte)ECompetitionNodeState.emNodeState_CanEnter); //Color clr = new Color(); //if (bCanJoin) //{ // SetEnterBtnState(true); // ColorUtility.TryParseHtmlString("#ffffff", out clr); //} //else //{ // SetEnterBtnState(false); // ColorUtility.TryParseHtmlString("#bebebe", out clr); //} //GotoBtnDes.color = clr; // 设置NodeState NodeState.gameObject.SetActive(true); switch (nodeInfo.byCompetitionNodeState) { case (byte)ECompetitionNodeState.emNodeState_WaitStart: // 等待开始 case (byte)ECompetitionNodeState.emNodeState_CanEnter: // 等待进入 { NodeState.text = ULocalizationService.Instance.Get("UIView", "LegendCupGroup", "NoCompetition"); } break; case (byte)ECompetitionNodeState.emNodeState_Competition: // 进行中 { NodeState.text = ULocalizationService.Instance.Get("UIView", "LegendCupGroup", "Competitioning"); } break; case (byte)ECompetitionNodeState.emNodeState_WaitJudge: // 等待裁定 { NodeState.text = ULocalizationService.Instance.Get("UIView", "LegendCupGroup", "WaitJudge"); } break; case (byte)ECompetitionNodeState.emNodeState_End: // 比赛已结束 { NodeState.text = ULocalizationService.Instance.Get("UIView", "LegendCupGroup", "CompetitionEnd"); } break; default: break; } // 设置颜色 Color clrState = UDefines.CommomColor(ECommonColor.ECC_White); if (bInThisNode && nodeInfo.nWinnerKinID <= 0) { clrState = UDefines.CommomColor(ECommonColor.ECC_Gold1); } Data.color = clrState; Time.color = clrState; Kin1Name.color = clrState; VSDes.color = clrState; Kin2Name.color = clrState; // 完成态显示红色 NodeState.color = nodeInfo.byCompetitionNodeState == (byte)ECompetitionNodeState.emNodeState_End ? UDefines.CommomColor(ECommonColor.ECC_Red1) : clrState; }