Beispiel #1
0
        public void OnClickConfirmBtn()
        {
            // 未选择裁决结果
            if (NodeResult.SelectedIndex < 0)
            {
                UIUtil.ShowSystemMessage(EMChatTipID.CHAT_TIP_LEGENDCUP_NOT_SELECT_CANT_JUDGE_WAR);
                return;
            }

            EJudgeNodeWar byJudgeFlag = EJudgeNodeWar.JUDGE_NONE;
            int           nWinID      = 0;
            string        strResult   = null;

            switch (NodeResult.SelectedIndex)
            {
            case 0:
            {
                byJudgeFlag = EJudgeNodeWar.JUDGE_SelectWinner;
                nWinID      = m_judegeData.nKin1ID;
                strResult   = m_judegeData.szKin1Name + ULocalizationService.Instance.Get("UIView", "LegendCupWarRecord", "Win");
            }
            break;

            case 1:
            {
                byJudgeFlag = EJudgeNodeWar.JUDGE_SelectWinner;
                nWinID      = m_judegeData.nKin2ID;
                strResult   = m_judegeData.szKin2Name + ULocalizationService.Instance.Get("UIView", "LegendCupWarRecord", "Win");
            }
            break;

            case 2:
            {
                byJudgeFlag = EJudgeNodeWar.JUDGE_AllKnockOut;
                nWinID      = 0;
                strResult   = ULocalizationService.Instance.Get("UIView", "LegendCupWarRecord", "Abstain");
            }
            break;

            default:
                break;
            }

            TooltipAndDialog.UIDialogData data = new TooltipAndDialog.UIDialogData(
                title: ULocalizationService.Instance.Get("UIView", "LegendCupWarRecord", "ConfirmTitle"),
                message: string.Format(ULocalizationService.Instance.Get("UIView", "LegendCupWarRecord", "ConfirmContent"), m_judegeData.szKin1Name, m_judegeData.szKin2Name, strResult),
                buttons: new UIWidgets.DialogActions()
            {
                { ULocalizationService.Instance.Get("UIView", "LegendCupWarRecord", "Confirm"), () => { DoJudgeCup(byJudgeFlag, nWinID); return(true); } }, { ULocalizationService.Instance.Get("UIView", "LegendCupWarRecord", "Cancel"), null }
            }
                );
            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_DIALOG, data);
        }
Beispiel #2
0
        private bool DoJudgeCup(EJudgeNodeWar judgeResult, int nWinID)
        {
            cmd_legendcup_judge_competition_node node = new cmd_legendcup_judge_competition_node();

            node.nLegendCupID  = m_judegeData.nLegendCupID; // 杯赛ID
            node.nRoundID      = m_judegeData.nRoundID;     // 轮次ID
            node.nSearchID     = m_judegeData.nSearchID;    // 节点ID
            node.nBoCount      = m_judegeData.nBoCount;     // 第几场
            node.llWarID       = m_judegeData.nWarID;       // 比赛ID
            node.byJudgeFlag   = (byte)judgeResult;         // EJudgeNodeWar
            node.dwWinnerKinID = nWinID;
            ViewEventHelper.Instance.SendCommand <cmd_legendcup_judge_competition_node>(GameLogicDef.GVIEWCMD_LEGENDCUP_JUDGE_COMPETITION_NODE, ref node);

            m_wnd.UnloadView();

            return(true);
        }