Beispiel #1
0
    private void FindServerSucc(string ip)
    {
        UIManager.I.CloseUI <WaitingUIMgr>();
        MsgBoxInfo info = new MsgBoxInfo();

        if (string.IsNullOrEmpty(ip))
        {
            info.Content   = LanguageData.GetContent(6);
            info.BtnOkText = LanguageData.GetContent(5);
            info.okAction  = () =>
            {
                UIManager.I.CloseUI <MsgBoxUILogic>();
                UIManager.I.ShowUI <WaitingUIMgr>();
                EventDispatcher.TriggerEvent(FindServerEvent.FindServerStart);
            };
            info.cancelAction = () => { UIManager.I.CloseUI <MsgBoxUILogic>(); };
        }
        else
        {
            info.Content   = LanguageData.GetContent(7, ip);
            info.BtnOkText = LanguageData.GetContent(3);
            info.okAction  = () =>
            {
                Close();
                MogoWorld.ConnectServer(ip, 43998);
                MogoWorld.Login();
            };
            info.cancelAction = () => { UIManager.I.CloseUI <MsgBoxUILogic>(); };
        }
        UIManager.I.ShowUI <MsgBoxUILogic>(info);

        MogoWorld.ServerIP = ip;
    }
Beispiel #2
0
    public void ShowRebornNotice()
    {
        int        seconds = 5;
        uint       timerId = 0;
        MsgBoxInfo info    = new MsgBoxInfo();

        info.Content = LanguageData.GetContent(122, seconds);
        info.ShowBtn = false;
        UIManager.I.ShowUI <MsgBoxUILogic>(info, delegate()
        {
            BattleUI.gameObject.SetActive(false);
            var mgr = UIManager.I.GetUILogic <MsgBoxUILogic>();
            timerId = TimerHeap.AddTimer(1000, 1000, delegate()
            {
                LoggerHelper.Debug("seconds=" + seconds);
                if (seconds < 0)
                {
                    TimerHeap.DelTimer(timerId);
                    mgr.Close();
                    BattleUI.gameObject.SetActive(true);
                    MogoWorld.thePlayer.RpcCall("Reborn", MogoWorld.thePlayer.ID);
                    return;
                }
                mgr.UpdateContent(LanguageData.GetContent(122, seconds));
                seconds--;
            });
        });
    }
Beispiel #3
0
    private bool CheckNameError()
    {
        string str = m_inputPlayerName.text;

        if (str.Length > 0 && str.Length <= NAME_MAX_LENGTH)
        {
            MogoWorld.TmpPlayerName = m_inputPlayerName.text;
            return(false);
        }
        else
        {
            MsgBoxInfo info = new MsgBoxInfo();
            info.Content   = LanguageData.GetContent(123, NAME_MAX_LENGTH);
            info.BtnOkText = LanguageData.GetContent(3);
            UIManager.I.ShowUI <MsgBoxUILogic>(info);
            return(true);
        }
    }