Пример #1
0
        public static void Disconnect(Disconnect P)
        {
            Network.Disconnect();

            SceneFunctions.ConClosed = true;
            MirMessageBox MMBox;

            switch (P.Reason)
            {
            case 0:
                MMBox = new MirMessageBox("You have been disconnected from the game.");
                MMBox.OKButton.Click += (o, e) => SceneFunctions.QuitGame();
                MMBox.Show();
                break;

            case 1:
                MMBox = new MirMessageBox("You have been disconnected from the game,\nAnother user logged onto your account.");
                MMBox.OKButton.Click += (o, e) => SceneFunctions.QuitGame();
                MMBox.Show();
                break;

#if DEBUG
            default:
                throw new NotImplementedException();
#endif
            }
        }
Пример #2
0
        public static void ConnectionFailed()
        {
            MirMessageBox MMBox = new MirMessageBox("Failed to connect to the server...", MessageBoxButtons.RetryCancel);

            MMBox.CancelButton.Click += (o, e) => SceneFunctions.QuitGame();
            MMBox.Show();
        }
Пример #3
0
 static void Scene_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Escape)
     {
         SceneFunctions.QuitGame();
     }
 }
Пример #4
0
        public static void QuitGame()
        {
            //If Last Combat < 10 CANCEL
            MirMessageBox MMBox = new MirMessageBox("Do you want to quit Legened of Mir?", MessageBoxButtons.YesNo);

            MMBox.YesButton.Click += (o, e) => SceneFunctions.QuitGame();
            MMBox.Show();
        }
Пример #5
0
        static LoginDialog()
        {
            LoginWindow = new MirImageControl
            {
                Index   = 1084,
                Library = Libraries.Prguse,
                Parent  = LoginScene.Background,
            };
            LoginWindow.Location = new Point((Settings.ScreenSize.Width - LoginWindow.Size.Width) / 2,
                                             (Settings.ScreenSize.Height - LoginWindow.Size.Height) / 2);

            Title = new MirImageControl
            {
                Index   = 30,
                Library = Libraries.Title,
                Parent  = LoginWindow,
            };
            Title.Location = new Point((LoginWindow.Size.Width - Title.Size.Width) / 2, 5);

            NewAccountButton = new MirButton
            {
                HoverIndex   = 324,
                Index        = 323,
                Library      = Libraries.Title,
                Location     = new Point(60, 163),
                Parent       = LoginWindow,
                PressedIndex = 325
            };
            NewAccountButton.Click += NewAccountButton_Click;

            LoginButton = new MirButton
            {
                Enabled      = false,
                HoverIndex   = 321,
                Index        = 320,
                Library      = Libraries.Title,
                Location     = new Point(227, 83),
                Parent       = LoginWindow,
                PressedIndex = 322,
            };
            LoginButton.Click += new EventHandler(LoginButton_Click);

            ChangePasswordButton = new MirButton
            {
                HoverIndex   = 327,
                Index        = 326,
                Library      = Libraries.Title,
                Location     = new Point(166, 163),
                Parent       = LoginWindow,
                PressedIndex = 328
            };
            ChangePasswordButton.Click += ChangePasswordButton_Click;

            CloseButton = new MirButton
            {
                HoverIndex   = 330,
                Index        = 329,
                Library      = Libraries.Title,
                Location     = new Point(166, 189),
                Parent       = LoginWindow,
                PressedIndex = 331,
                Size         = new Size(100, 24)
            };
            CloseButton.Click += (o, e) => SceneFunctions.QuitGame();

            AccountIDTextBox = new MirTextBox
            {
                Location = new Point(85, 85),
                Parent   = LoginWindow,
                Size     = new Size(136, 15)
            };
            AccountIDTextBox.TextBox.TextChanged += AccountIDTextBox_TextChanged;
            AccountIDTextBox.TextBox.KeyPress    += TextBox_KeyPress;
            AccountIDTextBox.SetFocus();

            PasswordTextBox = new MirTextBox
            {
                Location = new Point(85, 108),
                Parent   = LoginWindow,
                Password = true,
                Size     = new Size(136, 15)
            };
            PasswordTextBox.TextBox.TextChanged += PasswordTextBox_TextChanged;
            PasswordTextBox.TextBox.KeyPress    += TextBox_KeyPress;
        }
Пример #6
0
        static SelectScene()
        {
            SelectedIndex = -1;

            Scene = new MirScene
            {
                Size = Settings.ScreenSize,
                Visible = false,
            };
            Scene.KeyPress += Scene_KeyPress;
            Scene.Shown += Scene_Shown;
            Scene.VisibleChanged += Scene_VisibleChanged;

            Background = new MirImageControl
            {
                Index = 64,
                Library = Libraries.Prguse,
                Parent = Scene,
            };

            ServerLabel = new MirLabel()
            {
                Location = new Point(322, 44),
                DrawFormat = DrawTextFormat.Center | DrawTextFormat.VerticalCenter,
                Parent = Background,
                Size = new Size(155, 17),
                Text = "Legend of Mir 2",
            };

            StartGameButton = new MirButton
            {
                Enabled = false,
                HoverIndex = 341,
                Index = 340,
                Library = Libraries.Title,
                Location = new Point(110, 568),
                Parent = Background,
                PressedIndex = 342
            };
            StartGameButton.Click += new EventHandler(StartGameButton_Click);

            NewCharacterButton = new MirButton
            {
                HoverIndex = 344,
                Index = 343,
                Library = Libraries.Title,
                Location = new Point(230, 568),
                Parent = Background,
                PressedIndex = 345
            };
            NewCharacterButton.Click += NewCharacterButton_Click;

            DeleteCharacterButton = new MirButton
            {
                HoverIndex = 347,
                Index = 346,
                Library = Libraries.Title,
                Location = new Point(350, 568),
                Parent = Background,
                PressedIndex = 348
            };
            DeleteCharacterButton.Click += new EventHandler(DeleteCharacterButton_Click);
            /*
            CreditsButton = new MirButton
            {
                HoverIndex = 350,
                Index = 349,
                Library = Libraries.Title,
                Location = new Point(470, 568),
                Parent = Background,
                PressedIndex = 351
            };*/

            ExitGame = new MirButton
            {
                HoverIndex = 353,
                Index = 352,
                Library = Libraries.Title,
                Location = new Point(590, 568),
                Parent = Background,
                PressedIndex = 354
            };
            ExitGame.Click += (o, e) => SceneFunctions.QuitGame();


            CharacterDisplay = new MirAnimatedControl
            {
                Animated = true,
                AnimationCount = 16,
                AnimationDelay = 250,
                FadeIn = true,
                FadeInDelay = 75,
                FadeInRate = 0.1F,
                Index = 20,
                Library = Libraries.ChrSel,
                Location = new Point(200, 300),
                Parent = Background,
                UseOffSet = true,
                // Visible = false
            };
            CharacterDisplay.BeforeDraw += new EventHandler(CharacterDisplay_BeforeDraw);
            CharacterDisplay.AfterDraw += new EventHandler(CharacterDisplay_GlowEffect);

            Character1Button = new MirImageControl
            {
                Index = 45,
                Library = Libraries.Prguse,
                Location = new Point(447, 122),
                Parent = Background,
                Sound = SoundList.ClickA,
            };
            Character1Button.Click += Character1Button_Click;

            Character2Button = new MirImageControl
            {
                Index = 45,
                Library = Libraries.Prguse,
                Location = new Point(447, 226),
                Parent = Background,
                Sound = SoundList.ClickA,
            };
            Character2Button.Click += new EventHandler(Character2Button_Click);

            Character3Button = new MirImageControl
            {
                Index = 45,
                Library = Libraries.Prguse,
                Location = new Point(447, 330),
                Parent = Background,
                Sound = SoundList.ClickA,
            };
            Character3Button.Click += new EventHandler(Character3Button_Click);

            Character4Button = new MirImageControl
            {
                Index = 45,
                Library = Libraries.Prguse,
                Location = new Point(447, 434),
                Parent = Background,
                Sound = SoundList.ClickA,
            };
            Character4Button.Click += new EventHandler(Character4Button_Click);

            Character1Name = new MirLabel
            {
                Location = new Point(107, 9),
                Parent = Character1Button,
                NotControl = true,
                Size = new Size(170, 18),
                Visible = false
            };

            Character1Level = new MirLabel
            {
                Location = new Point(107, 28),
                Parent = Character1Button,
                NotControl = true,
                Size = new Size(30, 18),
                Visible = false
            };

            Character1Class = new MirLabel
            {
                Location = new Point(178, 28),
                Parent = Character1Button,
                NotControl = true,
                Size = new Size(100, 18),
                Visible = false
            };

            Character2Name = new MirLabel
            {
                Location = new Point(107, 9),
                Parent = Character2Button,
                NotControl = true,
                Size = new Size(170, 18),
                Visible = false
            };

            Character2Level = new MirLabel
            {
                Location = new Point(107, 28),
                Parent = Character2Button,
                NotControl = true,
                Size = new Size(30, 18),
                Visible = false
            };

            Character2Class = new MirLabel
            {
                Location = new Point(178, 28),
                Parent = Character2Button,
                NotControl = true,
                Size = new Size(100, 18),
                Visible = false
            };
            Character3Name = new MirLabel
            {
                Location = new Point(107, 9),
                Parent = Character3Button,
                NotControl = true,
                Size = new Size(170, 18),
                Visible = false
            };

            Character3Level = new MirLabel
            {
                Location = new Point(107, 28),
                Parent = Character3Button,
                NotControl = true,
                Size = new Size(30, 18),
                Visible = false
            };

            Character3Class = new MirLabel
            {
                Location = new Point(178, 28),
                Parent = Character3Button,
                NotControl = true,
                Size = new Size(100, 18),
                Visible = false
            };
            Character4Name = new MirLabel
            {
                Location = new Point(107, 9),
                Parent = Character4Button,
                NotControl = true,
                Size = new Size(170, 18),
                Visible = false
            };

            Character4Level = new MirLabel
            {
                Location = new Point(107, 28),
                Parent = Character4Button,
                NotControl = true,
                Size = new Size(30, 18),
                Visible = false
            };

            Character4Class = new MirLabel
            {
                Location = new Point(178, 28),
                Parent = Character4Button,
                NotControl = true,
                Size = new Size(100, 18),
                Visible = false
            };
            LastAccessLabel = new MirLabel
            {
                DrawFormat = DrawTextFormat.VerticalCenter,
                Location = new Point(140, 510),
                Parent = Background,
                Size = new Size(189, 21),
            };
            LastAccessLabelLabel = new MirLabel
            {
                DrawFormat = DrawTextFormat.VerticalCenter,
                Location = new Point(-80, 0),
                Parent = LastAccessLabel,
                Text = "Last Online:",
                Size = new Size(100, 21),
            };
        }