Пример #1
0
        public LoginScene()
        {
            SoundManager.PlaySound(SoundList.IntroMusic, true);
            Disposing += (o, e) => SoundManager.StopSound(SoundList.IntroMusic);

            _background = new MirAnimatedControl
                {
                    Animated = false,
                    AnimationCount = 19,
                    AnimationDelay = 100,
                    Index = 0,
                    Library = Libraries.ChrSel,
                    Loop = false,
                    Parent = this,
                };

            _login = new LoginDialog {Parent = _background, Visible = false};
            _login.AccountButton.Click += (o, e) =>
                {
                    _login.Hide();
                    _account = new NewAccountDialog { Parent = _background };
                    _account.Disposing += (o1, e1) => _login.Show();
                };
            _login.PassButton.Click += (o, e) =>
                {
                    _login.Hide();
                    _password = new ChangePasswordDialog { Parent = _background };
                    _password.Disposing += (o1, e1) => _login.Show();
                };

            Version = new MirLabel
                {
                    AutoSize = true,
                    BackColour = Color.FromArgb(200, 50, 50, 50),
                    Border = true,
                    BorderColour = Color.Black,
                    Location = new Point(5, 580),
                    Parent = _background,
                    Text = string.Format("Version: {0}", Application.ProductVersion),
                };

            _connectBox = new MirMessageBox("Attempting to connect to the server.", MirMessageBoxButtons.Cancel);
            _connectBox.CancelButton.Click += (o, e) => Program.Form.Close();
            Shown += (sender, args) =>
                {
                    Network.Connect();
                    _connectBox.Show();
                };
        }
Пример #2
0
        public LoginScene()
        {
            SoundManager.PlaySound(SoundList.IntroMusic, true);
            Disposing += (o, e) => SoundManager.StopSound(SoundList.IntroMusic);

            _background = new MirAnimatedControl
                {
                    Animated = false,
                    AnimationCount = 19,
                    AnimationDelay = 100,
                    Index = 0,
                    Library = Libraries.ChrSel,
                    Loop = false,
                    Parent = this,
                };

            _login = new LoginDialog {Parent = _background, Visible = false};
            _login.AccountButton.Click += (o, e) =>
                {
                    _login.Hide();
                    if(_ViewKey != null && !_ViewKey.IsDisposed) _ViewKey.Dispose();
                    _account = new NewAccountDialog { Parent = _background };
                    _account.Disposing += (o1, e1) => _login.Show();
                };
            _login.PassButton.Click += (o, e) =>
                {
                    _login.Hide();
                    if (_ViewKey != null && !_ViewKey.IsDisposed) _ViewKey.Dispose();
                    _password = new ChangePasswordDialog { Parent = _background };
                    _password.Disposing += (o1, e1) => _login.Show();
                };

            _login.ViewKeyButton.Click += (o, e) =>     //ADD
            {
                if (_ViewKey != null && !_ViewKey.IsDisposed) return;

                _ViewKey = new InputKeyDialog(_login) { Parent = _background };
            };

            Version = new MirLabel
                {
                    AutoSize = true,
                    BackColour = Color.FromArgb(200, 50, 50, 50),
                    Border = true,
                    BorderColour = Color.Black,
                    Location = new Point(5, 580),
                    Parent = _background,
                    Text = string.Format("Version: {0}", Application.ProductVersion),
                };

            //ViolenceLabel = new MirImageControl
            //{
            //    Index = 89,
            //    Library = Libraries.Prguse,
            //    Parent = this,
            //    Location = new Point(471, 10)
            //};

            //MinorLabel = new MirImageControl
            //{
            //    Index = 87,
            //    Library = Libraries.Prguse,
            //    Parent = this,
            //    Location = new Point(578, 10)
            //};

            //YouthLabel = new MirImageControl
            //{
            //    Index = 88,
            //    Library = Libraries.Prguse,
            //    Parent = this,
            //    Location = new Point(684, 10)
            //};

            _connectBox = new MirMessageBox("Attempting to connect to the server.", MirMessageBoxButtons.Cancel);
            _connectBox.CancelButton.Click += (o, e) => Program.Form.Close();
            Shown += (sender, args) =>
                {
                    Network.Connect();
                    _connectBox.Show();
                };
        }
Пример #3
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                _background = null;
                Version = null;

                _login = null;
                _account = null;
                _password = null;

                _connectBox = null;
            }

            base.Dispose(disposing);
        }
Пример #4
0
        public static void NewAccount(NewAccount P)
        {
            NewAccountDialog.ConfirmButton.Enabled = true;
            switch (P.Result)
            {
            case 0:
                SceneFunctions.ShowMessage("An error occured whilst creating the account.");
                NewAccountDialog.Hide();
                NewAccountDialog.Clear();
                LoginDialog.Show();
                break;

            case 1:
                SceneFunctions.ShowMessage("Account creation is currently disabled.");
                NewAccountDialog.Hide();
                NewAccountDialog.Clear();
                LoginDialog.Show();
                break;

            case 2:
                SceneFunctions.ShowMessage("Your AccountID is not acceptable.");
                NewAccountDialog.AccountIDTextBox.SetFocus();
                break;

            case 3:
                SceneFunctions.ShowMessage("Your Password is not acceptable.");
                NewAccountDialog.Password1TextBox.SetFocus();
                break;

            case 4:
                SceneFunctions.ShowMessage("Your E-Mail Address is not acceptable.");
                NewAccountDialog.EMailTextBox.SetFocus();
                break;

            case 5:
                SceneFunctions.ShowMessage("Your User Name is not acceptable.");
                NewAccountDialog.UserNameTextBox.SetFocus();
                break;

            case 6:
                SceneFunctions.ShowMessage("Your Secret Question is not acceptable.");
                NewAccountDialog.QuestionTextBox.SetFocus();
                break;

            case 7:
                SceneFunctions.ShowMessage("Your Secret Answer is not acceptable.");
                NewAccountDialog.AnswerTextBox.SetFocus();
                break;

            case 8:
                SceneFunctions.ShowMessage("An Account with this ID already exists.");
                NewAccountDialog.AccountIDTextBox.SetFocus();
                NewAccountDialog.AccountIDTextBox.Text = string.Empty;
                break;

            case 9:
                SceneFunctions.ShowMessage("Your account was created successfully.");
                NewAccountDialog.Hide();
                NewAccountDialog.Clear();
                LoginDialog.Show();
                break;

#if DEBUG
            default:
                throw new NotImplementedException();
#endif
            }
        }