public static void LoginBanned(LoginBanned P) { LoginDialog.LoginButton.Enabled = true; SceneFunctions.ShowMessage(string.Format("This account is banned.\n Reason{0}\n ExpiaryDate:{1}", P.Reason, P.ExpiryDate)); }
public static void StartGame(StartGame P) { SelectScene.StartGameButton.Enabled = true; switch (P.Result) { case 0: SceneFunctions.ShowMessage("An error occured when trying start the game."); break; case 1: SceneFunctions.ShowMessage("Starting the Game is currently disabled."); break; case 2: SceneFunctions.ShowMessage("The character you selected does not exist.\n Contact a GM for assistance."); break; case 3: SceneFunctions.ShowMessage("Server is not ready for Characters to play."); break; case 4: SelectScene.Scene.Enabled = false; GameScene.Scene.Enabled = true; MirScene.ActiveScene.Visible = false; GameScene.Scene.Visible = true; MirScene.ActiveScene = GameScene.Scene; break; } }
public static void ChangePasswordBanned(ChangePasswordBanned P) { ChangePasswordDialog.ConfirmButton.Enabled = true; SceneFunctions.ShowMessage(string.Format("This account is banned.\n Reason{0}\n ExpiaryDate:{1}", P.Reason, P.ExpiryDate)); ChangePasswordDialog.Clear(); }
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 } }
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(); }
static void Scene_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Escape) { SceneFunctions.QuitGame(); } }
public static void ChangePassword(ChangePassword P) { ChangePasswordDialog.ConfirmButton.Enabled = true; switch (P.Result) { case 0: SceneFunctions.ShowMessage("An error occured whilst Changing Password."); ChangePasswordDialog.Hide(); ChangePasswordDialog.Clear(); LoginDialog.Show(); break; case 1: SceneFunctions.ShowMessage("Password Changing is currently disabled."); ChangePasswordDialog.Hide(); ChangePasswordDialog.Clear(); LoginDialog.Show(); break; case 2: SceneFunctions.ShowMessage("Your AccountID is not acceptable."); ChangePasswordDialog.AccountIDTextBox.SetFocus(); break; case 3: SceneFunctions.ShowMessage("The current Password is not acceptable."); ChangePasswordDialog.CurrentPasswordTextBox.SetFocus(); break; case 4: SceneFunctions.ShowMessage("Your new Password is not acceptable."); ChangePasswordDialog.NewPassword1TextBox.SetFocus(); break; case 5: SceneFunctions.ShowMessage("The AccountID does not exist."); ChangePasswordDialog.AccountIDTextBox.SetFocus(); break; case 6: SceneFunctions.ShowMessage("Incorrect Password and AccountID combination."); ChangePasswordDialog.CurrentPasswordTextBox.SetFocus(); ChangePasswordDialog.CurrentPasswordTextBox.Text = string.Empty; break; case 7: SceneFunctions.ShowMessage("Your password was changed successfully."); ChangePasswordDialog.Hide(); ChangePasswordDialog.Clear(); LoginDialog.Show(); break; #if DEBUG default: throw new NotImplementedException(); #endif } }
public static void LogOut() { //If Last Combat < 10 CANCEL MirMessageBox MMBox = new MirMessageBox("Do you want to log out of Legened of Mir?", MessageBoxButtons.YesNo); MMBox.YesButton.Click += (o, e) => SceneFunctions.LogOut(); MMBox.Show(); }
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(); }
public static void NewCharacterSuccess(NewCharacterSuccess P) { NewCharacterDialog.CharacterNameTextBox.Enabled = true; NewCharacterDialog.ConfirmButton.Enabled = true; NewCharacterDialog.Hide(); SceneFunctions.ShowMessage("Your character was created successfully."); SelectScene.CharacterList.Insert(0, P.CharInfo); SelectScene.SelectedIndex = 0; SelectScene.UpdateSelectButtons(); }
public static void LogOutSuccess(LogOutSuccess P) { SceneFunctions.LogOutSuccess(); if (P.CharacterList != null) { P.CharacterList.Sort(delegate(SelectCharacterInfo S1, SelectCharacterInfo S2) { return(S2.LastAccess.CompareTo(S1.LastAccess)); }); } SelectScene.CharacterList = P.CharacterList; SelectScene.UpdateSelectButtons(); }
void Awake() { if(!initialized) { if(Application.platform == RuntimePlatform.OSXPlayer) { PlayerPrefs.DeleteAll(); Screen.SetResolution(1024, 768, FullScreenMode.Windowed); } SceneFunctions.LoadScene("Persistent"); initialized = true; } }
public static void NewCharacter(NewCharacter P) { NewCharacterDialog.CharacterNameTextBox.Enabled = true; NewCharacterDialog.ConfirmButton.Enabled = true; switch (P.Result) { case 0: SceneFunctions.ShowMessage("An error occured when trying create your character."); break; case 1: NewCharacterDialog.Hide(); SceneFunctions.ShowMessage("Creating new characters is currently disabled."); break; case 2: SceneFunctions.ShowMessage("Your Character Name is not acceptable."); NewCharacterDialog.CharacterNameTextBox.SetFocus(); break; case 3: SceneFunctions.ShowMessage("The gender you selected does not exist.\n Contact a GM for assistance."); break; case 4: SceneFunctions.ShowMessage("The class you selected does not exist.\n Contact a GM for assistance."); break; case 5: SceneFunctions.ShowMessage("You cannot make anymore then " + Globals.MaxCharacterCount + " Characters."); NewCharacterDialog.Hide(); break; case 6: SceneFunctions.ShowMessage("A Character with this name already exists."); NewCharacterDialog.CharacterNameTextBox.SetFocus(); break; #if DEBUG default: throw new NotImplementedException(); #endif } }
public static void ClientVersion(ClientVersion P) { switch (P.Result) { case 0: SceneFunctions.WrongVersion(); Network.Disconnect(); break; case 1: LoginScene.Connected(); break; #if DEBUG default: throw new NotImplementedException(); #endif } }
public static void Login(Login P) { LoginDialog.LoginButton.Enabled = true; switch (P.Result) { case 0: SceneFunctions.ShowMessage("An error occured when trying to Log in."); LoginDialog.Clear(); break; case 1: SceneFunctions.ShowMessage("Logging in is currently disabled."); LoginDialog.Clear(); break; case 2: SceneFunctions.ShowMessage("Your AccountID is not acceptable."); LoginDialog.AccountIDTextBox.SetFocus(); break; case 3: SceneFunctions.ShowMessage("Your Password is not acceptable."); LoginDialog.PasswordTextBox.SetFocus(); break; case 4: SceneFunctions.ShowMessage("The AccountID does not exist."); LoginDialog.AccountIDTextBox.SetFocus(); break; case 5: SceneFunctions.ShowMessage("Incorrect Password and AccountID combination."); LoginDialog.PasswordTextBox.Text = string.Empty; LoginDialog.PasswordTextBox.SetFocus(); break; #if DEBUG default: throw new NotImplementedException(); #endif } }
public static void DeleteCharacter(DeleteCharacter P) { switch (P.Result) { case 0: SceneFunctions.ShowMessage("An error occured when trying delete your character."); break; case 1: SceneFunctions.ShowMessage("Deleting characters is currently disabled."); break; case 2: SceneFunctions.ShowMessage("The character you selected does not exist.\n Contact a GM for assistance."); break; case 3: for (int I = 0; I < SelectScene.CharacterList.Count; I++) { if (SelectScene.CharacterList[I].Index == SceneFunctions.DeleteIndex) { SelectScene.CharacterList.RemoveAt(I); break; } } SelectScene.UpdateSelectButtons(); SceneFunctions.ShowMessage("Your character was deleted successfully."); break; #if DEBUG default: throw new NotImplementedException(); #endif } }
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; }
public void OnPressAboutButton() { SceneFunctions.TransitionScene("StartScreen", "AboutScreen"); }
public void OnPressPlay() { GameplayController.Instance.RestartGame(); SceneFunctions.TransitionScene("StartScreen", "Gameplay"); }
static void DeleteCharacterButton_Click(object sender, EventArgs e) { if (SelectedIndex >= CharacterList.Count) return; SceneFunctions.DeleteCharacter(CharacterList[SelectedIndex].CharacterName, CharacterList[SelectedIndex].Index); }
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 } }
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), }; }
public static void StartGameDelay(StartGameDelay P) { SelectScene.StartGameButton.Enabled = true; SceneFunctions.ShowMessage(string.Format("You cannot start the game for another {0} seconds.", P.Seconds)); }
public static void StartGameBanned(StartGameBanned P) { SelectScene.StartGameButton.Enabled = true; SceneFunctions.ShowMessage(string.Format("This character is banned.\n Reason{0}\n ExpiaryDate:{1}", P.Reason, P.ExpiryDate)); }