public void DisplayItemGridEffect(ulong id, int type = 0) { MirItemCell cell = GetCell(id); if (cell.Item == null) { return; } MirAnimatedControl animEffect = null; switch (type) { case 0: animEffect = new MirAnimatedControl { Animated = true, AnimationCount = 9, AnimationDelay = 150, Index = 410, Library = Libraries.Prguse, Location = cell.Location, Parent = this, Loop = false, NotControl = true, UseOffSet = true, Blending = true, BlendingRate = 1F }; animEffect.AfterAnimation += (o, e) => animEffect.Dispose(); SoundManager.PlaySound(20000 + (ushort)Spell.MagicShield * 10); break; } }
static LoginScene() { Scene = new MirScene { Size = Settings.ScreenSize, }; Scene.Shown += Scene_Shown; Scene.VisibleChanged += Scene_VisibleChanged; Scene.KeyPress += Scene_KeyPress; Background = new MirAnimatedControl { Animated = false, AnimationCount = 19, AnimationDelay = 100, Index = 0, Library = Libraries.ChrSel, Loop = false, Parent = Scene, }; Background.AfterAnimation += new EventHandler(Background_AfterAnimation); VersionLabel = new MirLabel { AutoSize = true, BackColor = Color.FromArgb(200, 50, 50, 50), Border = true, BorderColor = Color.Black, Location = new Point(5, 580), Parent = Background, Text = "Version: " + Application.ProductVersion }; }
public static void CharacterDisplay_GlowEffect(object sender, EventArgs e) { MirAnimatedControl C = null; if ((C = sender as MirAnimatedControl) == null || Libraries.ChrSel == null) return; Libraries.ChrSel.DrawBlend(C.Index + 560, C.DisplayLocationWithoutOffSet, Color.White, true); }
public void StartGame() { if (!Libraries.Loaded) { MirAnimatedControl loadProgress = new MirAnimatedControl { Library = Libraries.Prguse, Index = 940, Visible = true, Parent = this, Location = new Point(470, 680), Animated = true, AnimationCount = 9, AnimationDelay = 100, Loop = true, }; loadProgress.AfterDraw += (o, e) => { if (!Libraries.Loaded) { return; } loadProgress.Dispose(); StartGame(); }; return; } StartGameButton.Enabled = false; Network.Enqueue(new C.StartGame { CharacterIndex = Characters[_selected].Index }); }
private void ProcessSkillDelay() { if (!Visible) { return; } int offset = BarIndex * 8; for (int i = 0; i < Cells.Length; i++) { foreach (var magic in GameScene.User.Magics) { if (magic.Key != i + offset + 1) { continue; } int totalFrames = 22; long timeLeft = magic.CastTime + magic.Delay - CMain.Time; if (timeLeft < 100 || (CoolDowns[i] != null && CoolDowns[i].Animated)) { if (timeLeft > 0) { CoolDowns[i].Dispose(); } else { continue; } } int delayPerFrame = (int)(magic.Delay / totalFrames); int startFrame = totalFrames - (int)(timeLeft / delayPerFrame); if ((CMain.Time <= magic.CastTime + magic.Delay) && magic.CastTime > 0) { CoolDowns[i].Dispose(); CoolDowns[i] = new MirAnimatedControl { Index = 1260 + startFrame, AnimationCount = (totalFrames - startFrame), AnimationDelay = delayPerFrame, Library = Libraries.Prguse2, Parent = this, Location = new Point(i * 25 + 15, 3), NotControl = true, UseOffSet = true, Loop = false, Animated = true, Opacity = 0.6F }; } } } }
public RollDialog() { Movable = false; Sort = true; _animation = new MirAnimatedControl { Parent = this, Index = 0, Library = Libraries.Prguse2, UseOffSet = true, Location = new Point(0, 0), Visible = true }; _animation.AfterAnimation += (o, e) => { switch (_type) { case 0: //Die { if (_currentLoop < 5) { _currentLoop++; return; } _image.Visible = true; _animation.Visible = false; _animation.Animated = false; ReturnResult(); } break; case 1: //Yut { _image.Visible = true; _animation.Visible = false; _animation.Animated = false; ReturnResult(); } break; } }; _image = new MirImageControl { Parent = this, Index = 0, Library = Libraries.Prguse2, UseOffSet = true, Location = new Point(0, 0), Visible = false }; _image.Click += _image_Click; }
public ItemObject(uint objectID) : base(objectID) { _effect = new MirAnimatedControl() { Animated = true, AnimationCount = 25, AnimationDelay = 100, Index = 680, Library = Libraries.StateEffect, Loop = true, Blending = true, }; }
protected override void Dispose(bool disposing) { if (disposing) { Background = null; _character = null; ServerLabel = null; CharacterDisplay = null; StartGameButton = null; NewCharacterButton = null; DeleteCharacterButton = null; CreditsButton = null; ExitGame = null; CharacterButtons = null; LastAccessLabel = null; LastAccessLabelLabel = null; Characters = null; _selected = 0; } base.Dispose(disposing); }
public void SetDelay() { if (Magic == null) { return; } int totalFrames = 34; long timeLeft = Magic.CastTime + Magic.Delay - CMain.Time; if (timeLeft < 100 || (CoolDown != null && CoolDown.Animated)) { return; } int delayPerFrame = (int)(Magic.Delay / totalFrames); int startFrame = totalFrames - (int)(timeLeft / delayPerFrame); if ((CMain.Time <= Magic.CastTime + Magic.Delay) && Magic.CastTime > 0) { CoolDown.Dispose(); CoolDown = new MirAnimatedControl { Index = 1290 + startFrame, AnimationCount = (totalFrames - startFrame), AnimationDelay = delayPerFrame, Library = Libraries.Prguse2, Parent = this, Location = new Point(36, 0), NotControl = true, UseOffSet = true, Loop = false, Animated = true, Opacity = 0.6F }; } }
//public void StartGame() //{ // if (!Libraries.Loaded) // { // MirMessageBox message = new MirMessageBox(string.Format("Please wait, The game is still loading... {0:##0}%", Libraries.Progress / (double)Libraries.Count * 100), MirMessageBoxButtons.Cancel); // message.BeforeDraw += (o, e) => message.Label.Text = string.Format("Please wait, The game is still loading... {0:##0}%", Libraries.Progress / (double)Libraries.Count * 100); // message.AfterDraw += (o, e) => // { // if (!Libraries.Loaded) return; // message.Dispose(); // StartGame(); // }; // message.Show(); // return; // } // StartGameButton.Enabled = false; // Network.Enqueue(new C.StartGame // { // CharacterIndex = Characters[_selected].Index // }); //} public void StartGame() { if (StartGameButton.Enabled = true) { Random random = new Random(); MirImageControl loadingOverlay = new MirImageControl { Library = Libraries.Prguse, Index = 930 + random.Next(0, 10), Visible = true, Parent = this }; MirAnimatedControl loadProgress = new MirAnimatedControl { Library = Libraries.Prguse, Index = 940, Visible = true, Parent = loadingOverlay, Location = new Point(400, 300), Animated = true, AnimationCount = 9, AnimationDelay = 10000, Loop = true, }; } if (!Libraries.Loaded) { Random random = new Random(); MirImageControl loadingOverlay = new MirImageControl { Library = Libraries.Prguse, Index = 930 + random.Next(0, 10), Visible = true, Parent = this }; MirAnimatedControl loadProgress = new MirAnimatedControl { Library = Libraries.Prguse, Index = 940, Visible = true, Parent = loadingOverlay, Location = new Point(400, 300), Animated = true, AnimationCount = 9, AnimationDelay = 100, Loop = true, }; loadProgress.AfterDraw += (o, e) => { if (!Libraries.Loaded) { return; } loadProgress.Dispose(); StartGame(); }; return; } StartGameButton.Enabled = false; Network.Enqueue(new C.StartGame { CharacterIndex = Characters[_selected].Index }); }
public SelectScene(List <SelectInfo> characters) { SoundManager.PlaySound(SoundList.SelectMusic, true); Disposing += (o, e) => SoundManager.StopSound(SoundList.SelectMusic); Characters = characters; SortList(); KeyPress += SelectScene_KeyPress; Background = new MirImageControl { Index = 64, Library = Libraries.Prguse, Parent = this, }; Title = new MirImageControl { Index = 40, Library = Libraries.Title, Parent = this, Location = new Point(364, 12) }; ServerLabel = new MirLabel { Location = new Point(322, 44), Parent = Background, Size = new Size(155, 17), Text = GameLanguage.GameName, DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter }; StartGameButton = new MirButton { Enabled = false, HoverIndex = 341, Index = 340, Library = Libraries.Title, Location = new Point(110, 568), Parent = Background, PressedIndex = 342, GrayScale = true }; StartGameButton.Click += (o, e) => StartGame(); NewCharacterButton = new MirButton { HoverIndex = 344, Index = 343, Library = Libraries.Title, Location = new Point(230, 568), Parent = Background, PressedIndex = 345, }; NewCharacterButton.Click += (o, e) => _character = new NewCharacterDialog { Parent = this }; DeleteCharacterButton = new MirButton { HoverIndex = 347, Index = 346, Library = Libraries.Title, Location = new Point(350, 568), Parent = Background, PressedIndex = 348 }; DeleteCharacterButton.Click += (o, e) => DeleteCharacter(); 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) => Program.Form.Close(); CharacterDisplay = new MirAnimatedControl { Animated = true, AnimationCount = 16, AnimationDelay = 250, FadeIn = true, FadeInDelay = 75, FadeInRate = 0.1F, Index = 220, Library = Libraries.ChrSel, Location = new Point(200, 300), Parent = Background, UseOffSet = true, Visible = false }; CharacterDisplay.AfterDraw += (o, e) => { // if (_selected >= 0 && _selected < Characters.Count && characters[_selected].Class == MirClass.Wizard) Libraries.ChrSel.DrawBlend(CharacterDisplay.Index + 560, CharacterDisplay.DisplayLocationWithoutOffSet, Color.White, true); }; CharacterButtons = new CharacterButton[4]; CharacterButtons[0] = new CharacterButton { Location = new Point(447, 122), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[0].Click += (o, e) => { if (characters.Count <= 0) { return; } _selected = 0; UpdateInterface(); }; CharacterButtons[1] = new CharacterButton { Location = new Point(447, 226), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[1].Click += (o, e) => { if (characters.Count <= 1) { return; } _selected = 1; UpdateInterface(); }; CharacterButtons[2] = new CharacterButton { Location = new Point(447, 330), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[2].Click += (o, e) => { if (characters.Count <= 2) { return; } _selected = 2; UpdateInterface(); }; CharacterButtons[3] = new CharacterButton { Location = new Point(447, 434), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[3].Click += (o, e) => { if (characters.Count <= 3) { return; } _selected = 3; UpdateInterface(); }; LastAccessLabel = new MirLabel { Location = new Point(140, 509), Parent = Background, Size = new Size(180, 21), DrawFormat = TextFormatFlags.Left | TextFormatFlags.VerticalCenter, Border = true, }; LastAccessLabelLabel = new MirLabel { Location = new Point(-80, -1), Parent = LastAccessLabel, Text = GameLanguage.LastOnline, Size = new Size(100, 21), DrawFormat = TextFormatFlags.Left | TextFormatFlags.VerticalCenter, Border = true, }; UpdateInterface(); }
public SkillBarDialog() { Index = 2190; Library = Libraries.Prguse; Movable = true; Sort = true; Location = new Point(0, BarIndex * 20); Visible = true; BeforeDraw += MagicKeyDialog_BeforeDraw; _switchBindsButton = new MirButton { Index = 2247, Library = Libraries.Prguse, Parent = this, Sound = SoundList.ButtonA, Size = new Size(16, 28), Location = new Point(0, 0) }; _switchBindsButton.Click += (o, e) => { //Settings.SkillSet = !Settings.SkillSet; Update(); }; for (var i = 0; i < Cells.Length; i++) { Cells[i] = new MirImageControl { Index = -1, Library = Libraries.MagIcon, Parent = this, Location = new Point(i * 25 + 15, 3), }; int j = i + 1; Cells[i].Click += (o, e) => { GameScene.Scene.UseSpell(j + (8 * BarIndex)); }; CoolDowns[i] = new MirAnimatedControl { Library = Libraries.Prguse2, Parent = this, Location = new Point(i * 25 + 15, 3), NotControl = true, UseOffSet = true, Loop = false, Animated = false, Opacity = 0.6F }; } BindNumberLabel = new MirLabel { Text = "1", Font = new Font(Settings.FontName, 8F), ForeColour = Color.White, Parent = this, Location = new Point(0, 1), Size = new Size(10, 25), NotControl = true }; for (var i = 0; i < KeyNameLabels.Length; i++) { KeyNameLabels[i] = new MirLabel { Text = "F" + (i + 1), Font = new Font(Settings.FontName, 8F), ForeColour = Color.White, Parent = this, Location = new Point(i * 25 + 13, 0), Size = new Size(25, 25), NotControl = true }; } OnMoving += SkillBar_OnMoving; }
public MagicButton() { Size = new Size(231, 33); SkillButton = new MirButton { Index = 0, PressedIndex = 1, Library = Libraries.MagIcon2, Parent = this, Location = new Point(36, 0), Sound = SoundList.ButtonA, }; SkillButton.Click += (o, e) => new AssignKeyPanel(Magic); LevelImage = new MirImageControl { Index = 516, Library = Libraries.Title, Location = new Point(73, 7), Parent = this, NotControl = true, }; ExpImage = new MirImageControl { Index = 517, Library = Libraries.Title, Location = new Point(73, 19), Parent = this, NotControl = true, }; LevelLabel = new MirLabel { AutoSize = true, Parent = this, Location = new Point(88, 2), NotControl = true, }; NameLabel = new MirLabel { AutoSize = true, Parent = this, Location = new Point(109, 2), NotControl = true, }; ExpLabel = new MirLabel { AutoSize = true, Parent = this, Location = new Point(109, 15), NotControl = true, }; KeyLabel = new MirLabel { AutoSize = true, Parent = this, Location = new Point(2, 2), NotControl = true, }; CoolDown = new MirAnimatedControl { Library = Libraries.Prguse2, Parent = this, Location = new Point(36, 0), NotControl = true, UseOffSet = true, Loop = false, Animated = false, Opacity = 0.6F }; }
public SelectScene(List <SelectInfo> characters) { SoundManager.PlaySound(SoundList.SelectMusic, true); Disposing += (o, e) => SoundManager.StopSound(SoundList.SelectMusic); Characters = characters; SortList(); KeyPress += SelectScene_KeyPress; Background = new MirImageControl { Index = 65, Library = Libraries.Prguse, Parent = this, }; Title = new MirImageControl { Index = 40, Library = Libraries.Title, Parent = this, Location = new Point(468, 20) }; ServerLabel = new MirLabel { Location = new Point(432, 60), // Location = new Point(322, 44), Parent = Background, Size = new Size(155, 17), Text = "Legend of Mir 2", DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter }; var xPoint = ((Settings.ScreenWidth - 200) / 5); StartGameButton = new MirButton { Enabled = false, HoverIndex = 341, Index = 340, Library = Libraries.Title, Location = new Point(100 + (xPoint * 1) - (xPoint / 2) - 50, Settings.ScreenHeight - 32), Parent = Background, PressedIndex = 342 }; StartGameButton.Click += (o, e) => StartGame(); NewCharacterButton = new MirButton { HoverIndex = 344, Index = 343, Library = Libraries.Title, Location = new Point(100 + (xPoint * 2) - (xPoint / 2) - 50, Settings.ScreenHeight - 32), Parent = Background, PressedIndex = 345, }; NewCharacterButton.Click += (o, e) => _character = new NewCharacterDialog { Parent = this }; DeleteCharacterButton = new MirButton { HoverIndex = 347, Index = 346, Library = Libraries.Title, Location = new Point(100 + (xPoint * 3) - (xPoint / 2) - 50, Settings.ScreenHeight - 32), Parent = Background, PressedIndex = 348 }; DeleteCharacterButton.Click += (o, e) => DeleteCharacter(); CreditsButton = new MirButton { HoverIndex = 350, Index = 349, Library = Libraries.Title, Location = new Point(100 + (xPoint * 4) - (xPoint / 2) - 50, Settings.ScreenHeight - 32), Parent = Background, PressedIndex = 351 }; CreditsButton.Click += (o, e) => { }; ExitGame = new MirButton { HoverIndex = 353, Index = 352, Library = Libraries.Title, Location = new Point(100 + (xPoint * 5) - (xPoint / 2) - 50, Settings.ScreenHeight - 32), Parent = Background, PressedIndex = 354 }; ExitGame.Click += (o, e) => Program.Form.Close(); CharacterDisplay = new MirAnimatedControl { Animated = true, AnimationCount = 16, AnimationDelay = 250, FadeIn = true, FadeInDelay = 75, FadeInRate = 0.1F, Index = 220, Library = Libraries.ChrSel, Location = new Point(260, 420), Parent = Background, UseOffSet = true, Visible = false }; CharacterDisplay.AfterDraw += (o, e) => { // if (_selected >= 0 && _selected < Characters.Count && characters[_selected].Class == MirClass.Wizard) Libraries.ChrSel.DrawBlend(CharacterDisplay.Index + 560, CharacterDisplay.DisplayLocationWithoutOffSet, Color.White, true); }; CharacterButtons = new CharacterButton[4]; CharacterButtons[0] = new CharacterButton { Location = new Point(637, 194), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[0].Click += (o, e) => { if (characters.Count <= 0) { return; } _selected = 0; UpdateInterface(); }; CharacterButtons[1] = new CharacterButton { Location = new Point(637, 298), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[1].Click += (o, e) => { if (characters.Count <= 1) { return; } _selected = 1; UpdateInterface(); }; CharacterButtons[2] = new CharacterButton { Location = new Point(637, 402), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[2].Click += (o, e) => { if (characters.Count <= 2) { return; } _selected = 2; UpdateInterface(); }; CharacterButtons[3] = new CharacterButton { Location = new Point(637, 506), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[3].Click += (o, e) => { if (characters.Count <= 3) { return; } _selected = 3; UpdateInterface(); }; LastAccessLabel = new MirLabel { Location = new Point(265, 609), Parent = Background, Size = new Size(180, 21), DrawFormat = TextFormatFlags.Left | TextFormatFlags.VerticalCenter, Border = true, }; LastAccessLabelLabel = new MirLabel { Location = new Point(-65, 0), Parent = LastAccessLabel, Text = "Last Online:", Size = new Size(100, 21), DrawFormat = TextFormatFlags.Left | TextFormatFlags.VerticalCenter, Border = true, }; UpdateInterface(); Program.discord.UpdateStage(StatusType.GameState, GameState.SelectingCharacter); Program.discord.UpdateActivity(); }
public TimerDialog() { Location = new Point(Settings.ScreenWidth - 120, Settings.ScreenHeight - 230); NotControl = true; Size = new Size(120, 100); Movable = false; Sort = true; _eggTimer = new MirAnimatedControl { Index = 960, AnimationCount = 6, AnimationDelay = 333, Library = Libraries.Prguse2, Parent = this, Location = new Point(23, 0), NotControl = true, UseOffSet = true, Animated = true, Loop = false, Opacity = 1F }; _1000 = new MirImageControl { Parent = this, Index = _libraryOffset + 0, Library = Libraries.Prguse2, NotControl = true, UseOffSet = true, Location = new Point(0, 70), Visible = false }; _100 = new MirImageControl { Parent = this, Index = _libraryOffset + 0, Library = Libraries.Prguse2, NotControl = true, UseOffSet = true, Location = new Point(22, 70), Visible = false }; _colon = new MirImageControl { Parent = this, Index = _libraryOffset + 10, Library = Libraries.Prguse2, NotControl = true, UseOffSet = true, Location = new Point(44, 70), Visible = false }; _10 = new MirImageControl { Parent = this, Index = _libraryOffset + 0, Library = Libraries.Prguse2, NotControl = true, UseOffSet = true, Location = new Point(58, 70), Visible = false }; _1 = new MirImageControl { Parent = this, Index = _libraryOffset + 0, Library = Libraries.Prguse2, NotControl = true, UseOffSet = true, Location = new Point(80, 70), Visible = false }; }
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 NewCharacterDialog() { Index = 73; Library = Libraries.Prguse; Location = new Point((Settings.ScreenWidth - Size.Width) / 2, (Settings.ScreenHeight - Size.Height) / 2); Modal = true; TitleLabel = new MirImageControl { Index = 20, Library = Libraries.Title, Location = new Point(206, 11), Parent = this, }; CancelButton = new MirButton { HoverIndex = 281, Index = 280, Library = Libraries.Title, Location = new Point(425, 425), Parent = this, PressedIndex = 282 }; CancelButton.Click += (o, e) => Dispose(); OKButton = new MirButton { Enabled = false, HoverIndex = 361, Index = 360, Library = Libraries.Title, Location = new Point(160, 425), Parent = this, PressedIndex = 362, }; OKButton.Click += (o, e) => CreateCharacter(); NameTextBox = new MirTextBox { Location = new Point(325, 268), Parent = this, Size = new Size(240, 20), MaxLength = Globals.MaxCharacterNameLength }; NameTextBox.TextBox.KeyPress += TextBox_KeyPress; NameTextBox.TextBox.TextChanged += CharacterNameTextBox_TextChanged; NameTextBox.SetFocus(); CharacterDisplay = new MirAnimatedControl { Animated = true, AnimationCount = 16, AnimationDelay = 250, Index = 20, Library = Libraries.ChrSel, Location = new Point(120, 250), Parent = this, UseOffSet = true, }; CharacterDisplay.AfterDraw += (o, e) => { if (_class == MirClass.Wizard) { Libraries.ChrSel.DrawBlend(CharacterDisplay.Index + 560, CharacterDisplay.DisplayLocationWithoutOffSet, Color.White, true); } }; WarriorButton = new MirButton { HoverIndex = 2427, Index = 2427, Library = Libraries.Prguse, Location = new Point(323, 296), Parent = this, PressedIndex = 2428, Sound = SoundList.ButtonA, }; WarriorButton.Click += (o, e) => { _class = MirClass.Warrior; UpdateInterface(); }; WizardButton = new MirButton { HoverIndex = 2430, Index = 2429, Library = Libraries.Prguse, Location = new Point(373, 296), Parent = this, PressedIndex = 2431, Sound = SoundList.ButtonA, }; WizardButton.Click += (o, e) => { _class = MirClass.Wizard; UpdateInterface(); }; TaoistButton = new MirButton { HoverIndex = 2433, Index = 2432, Library = Libraries.Prguse, Location = new Point(423, 296), Parent = this, PressedIndex = 2434, Sound = SoundList.ButtonA, }; TaoistButton.Click += (o, e) => { _class = MirClass.Taoist; UpdateInterface(); }; AssassinButton = new MirButton { HoverIndex = 2436, Index = 2435, Library = Libraries.Prguse, Location = new Point(473, 296), Parent = this, PressedIndex = 2437, Sound = SoundList.ButtonA, }; AssassinButton.Click += (o, e) => { _class = MirClass.Assassin; UpdateInterface(); }; ArcherButton = new MirButton { HoverIndex = 2439, Index = 2438, Library = Libraries.Prguse, Location = new Point(523, 296), Parent = this, PressedIndex = 2440, Sound = SoundList.ButtonA, }; ArcherButton.Click += (o, e) => { _class = MirClass.Archer; UpdateInterface(); }; MaleButton = new MirButton { HoverIndex = 2421, Index = 2421, Library = Libraries.Prguse, Location = new Point(323, 343), Parent = this, PressedIndex = 2422, Sound = SoundList.ButtonA, }; MaleButton.Click += (o, e) => { _gender = MirGender.Male; UpdateInterface(); }; FemaleButton = new MirButton { HoverIndex = 2424, Index = 2423, Library = Libraries.Prguse, Location = new Point(373, 343), Parent = this, PressedIndex = 2425, Sound = SoundList.ButtonA, }; FemaleButton.Click += (o, e) => { _gender = MirGender.Female; UpdateInterface(); }; Description = new MirLabel { Border = true, Location = new Point(279, 70), Parent = this, Size = new Size(278, 170), Text = WarriorDescription, }; }
public SelectScene(List <SelectInfo> characters) { SoundManager.PlaySound(SoundList.SelectMusic, true); Disposing += (o, e) => SoundManager.StopSound(SoundList.SelectMusic); Characters = characters; SortList(); KeyPress += SelectScene_KeyPress; Background = new MirImageControl { Index = 65, Library = Libraries.Prguse, Parent = this, }; Title = new MirImageControl { Index = 40, Library = Libraries.Title, Parent = this, Location = new Point(600, 20) //标题栏图片左侧边缘距离左侧边框位置 }; ServerLabel = new MirLabel { Location = new Point(560, 60), //选择人物界面上方标题栏位置1280X768位置 // Location = new Point(432, 60),//选择人物界面上方标题栏位置1024X768大小时位置(432, 60)为左右中心.公式=分辨率宽度/2-80 Parent = Background, Size = new Size(155, 17), Text = "热血无限国际传奇Ⅱ", //人物创建选择界面上方游戏标题 DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter }; var xPoint = ((Settings.ScreenWidth - 200) / 5); //底部按钮左右均分位置 StartGameButton = new MirButton { Enabled = false, HoverIndex = 341, Index = 340, Library = Libraries.Title, Location = new Point(100 + (xPoint * 1) - (xPoint / 2) - 50, Settings.ScreenHeight - 32), Parent = Background, PressedIndex = 342 }; StartGameButton.Click += (o, e) => StartGame(); NewCharacterButton = new MirButton { HoverIndex = 344, Index = 343, Library = Libraries.Title, Location = new Point(100 + (xPoint * 2) - (xPoint / 2) - 50, Settings.ScreenHeight - 32), Parent = Background, PressedIndex = 345, }; NewCharacterButton.Click += (o, e) => _character = new NewCharacterDialog { Parent = this }; DeleteCharacterButton = new MirButton { HoverIndex = 347, Index = 346, Library = Libraries.Title, Location = new Point(100 + (xPoint * 3) - (xPoint / 2) - 50, Settings.ScreenHeight - 32), Parent = Background, PressedIndex = 348 }; DeleteCharacterButton.Click += (o, e) => DeleteCharacter(); CreditsButton = new MirButton { HoverIndex = 350, Index = 349, Library = Libraries.Title, Location = new Point(100 + (xPoint * 4) - (xPoint / 2) - 50, Settings.ScreenHeight - 32), Parent = Background, PressedIndex = 351 }; CreditsButton.Click += (o, e) => { }; ExitGame = new MirButton { HoverIndex = 353, Index = 352, Library = Libraries.Title, Location = new Point(100 + (xPoint * 5) - (xPoint / 2) - 50, Settings.ScreenHeight - 32), Parent = Background, PressedIndex = 354 }; ExitGame.Click += (o, e) => Program.Form.Close(); CharacterDisplay = new MirAnimatedControl //选择人物展示动画 { Animated = true, AnimationCount = 16, //动画图片数量 AnimationDelay = 150, //动画延时250默认 FadeIn = true, FadeInDelay = 275, //淡入淡出延时75默认 FadeInRate = 0.1F, Index = 220, Library = Libraries.ChrSel, Location = new Point(360, 450), //动画位置(距离左侧距离260, 距离顶部距离420)默认(260, 420) Parent = Background, UseOffSet = true, Visible = false }; CharacterDisplay.AfterDraw += (o, e) => { // if (_selected >= 0 && _selected < Characters.Count && characters[_selected].Class == MirClass.Wizard) Libraries.ChrSel.DrawBlend(CharacterDisplay.Index + 560, CharacterDisplay.DisplayLocationWithoutOffSet, Color.White, true); }; CharacterButtons = new CharacterButton[4];//人物选择按钮创建4个 CharacterButton[4] CharacterButtons[0] = new CharacterButton { Location = new Point(637, 194), //人物选择按钮位置 Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[0].Click += (o, e) => { if (characters.Count <= 0) { return; } _selected = 0; UpdateInterface(); }; CharacterButtons[1] = new CharacterButton { Location = new Point(637, 298), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[1].Click += (o, e) => { if (characters.Count <= 1) { return; } _selected = 1; UpdateInterface(); }; CharacterButtons[2] = new CharacterButton { Location = new Point(637, 402), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[2].Click += (o, e) => { if (characters.Count <= 2) { return; } _selected = 2; UpdateInterface(); }; CharacterButtons[3] = new CharacterButton { Location = new Point(637, 506), Parent = Background, Sound = SoundList.ButtonA, }; CharacterButtons[3].Click += (o, e) => { if (characters.Count <= 3) { return; } _selected = 3; UpdateInterface(); }; LastAccessLabel = new MirLabel //205行起始 { Location = new Point(265, 609), Parent = Background, Size = new Size(180, 21), DrawFormat = TextFormatFlags.Left | TextFormatFlags.VerticalCenter, Border = true, }; LastAccessLabelLabel = new MirLabel { Location = new Point(-65, 0), Parent = LastAccessLabel, Text = "上次在线:", Size = new Size(100, 21), DrawFormat = TextFormatFlags.Left | TextFormatFlags.VerticalCenter, Border = true, }; UpdateInterface(); }
public MountDialog() { Index = 167; Library = Libraries.Prguse; Movable = true; Sort = true; Location = new Point(10, 30); BeforeDraw += MountDialog_BeforeDraw; MountName = new MirLabel { Location = new Point(30, 10), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Parent = this, NotControl = true, }; MountLoyalty = new MirLabel { Location = new Point(30, 30), DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter, Parent = this, NotControl = true, }; MountButton = new MirButton { Library = Libraries.Prguse, Parent = this, Sound = SoundList.ButtonA, Location = new Point(262, 70) }; MountButton.Click += (o, e) => { if (CanRide()) { Ride(); } }; CloseButton = new MirButton { HoverIndex = 361, Index = 360, Library = Libraries.Prguse2, Parent = this, PressedIndex = 362, Sound = SoundList.ButtonA, }; CloseButton.Click += (o, e) => Hide(); HelpButton = new MirButton { Index = 257, HoverIndex = 258, PressedIndex = 259, Library = Libraries.Prguse2, Parent = this, Sound = SoundList.ButtonA, }; HelpButton.Click += (o, e) => GameScene.Scene.HelpDialog.DisplayPage("Mounts"); MountImage = new MirAnimatedControl { Animated = false, AnimationCount = 16, AnimationDelay = 100, Index = 0, Library = Libraries.Prguse, Loop = true, Parent = this, NotControl = true, UseOffSet = true }; Grid = new MirItemCell[Enum.GetNames(typeof(MountSlot)).Length]; Grid[(int)MountSlot.Reins] = new MirItemCell { ItemSlot = (int)MountSlot.Reins, GridType = MirGridType.Mount, Parent = this, Size = new Size(34, 30) }; Grid[(int)MountSlot.Bells] = new MirItemCell { ItemSlot = (int)MountSlot.Bells, GridType = MirGridType.Mount, Parent = this, Size = new Size(34, 30) }; Grid[(int)MountSlot.Saddle] = new MirItemCell { ItemSlot = (int)MountSlot.Saddle, GridType = MirGridType.Mount, Parent = this, Size = new Size(34, 30) }; Grid[(int)MountSlot.Ribbon] = new MirItemCell { ItemSlot = (int)MountSlot.Ribbon, GridType = MirGridType.Mount, Parent = this, Size = new Size(34, 30) }; Grid[(int)MountSlot.Mask] = new MirItemCell { ItemSlot = (int)MountSlot.Mask, GridType = MirGridType.Mount, Parent = this, Size = new Size(34, 30) }; }
static NewCharacterDialog() { Reg = new Regex(@"^[A-Za-z0-9]{" + Globals.MinCharacterNameLength + "," + Globals.MaxCharacterNameLength + "}$"); NewCharacterWindow = new MirImageControl { Index = 73, Library = Libraries.Prguse, Parent = SelectScene.Background, Visible = false, }; NewCharacterWindow.Location = new Point((Settings.ScreenSize.Width - NewCharacterWindow.Size.Width) / 2, (Settings.ScreenSize.Height - NewCharacterWindow.Size.Height) / 2); NewCharacterTitle = new MirImageControl { Index = 20, Library = Libraries.Title, Location = new Point(193, 7), Parent = NewCharacterWindow, }; CancelButton = new MirButton { HoverIndex = 364, Index = 363, Library = Libraries.Title, Location = new Point(425, 425), Parent = NewCharacterWindow, PressedIndex = 365 }; CancelButton.Click += CancelButton_Click; ConfirmButton = new MirButton { Enabled = false, HoverIndex = 361, Index = 360, Library = Libraries.Title, Location = new Point(160, 425), Parent = NewCharacterWindow, PressedIndex = 362, }; ConfirmButton.Click += new EventHandler(ConfirmButton_Click); CharacterNameTextBox = new MirTextBox { Location = new Point(357, 269), Parent = NewCharacterWindow, Size = new Size(190, 15), MaxLength = Globals.MaxCharacterNameLength }; CharacterNameTextBox.TextBox.KeyPress += TextBox_KeyPress; CharacterNameTextBox.TextBox.TextChanged += CharacterNameTextBox_TextChanged; CharacterNameTextBox.SetFocus(); CharacterDisplay = new MirAnimatedControl { Animated = true, AnimationCount = 16, AnimationDelay = 250, Index = 20, Library = Libraries.ChrSel, Location = new Point(120, 250), Parent = NewCharacterWindow, UseOffSet = true, }; CharacterDisplay.AfterDraw += SelectScene.CharacterDisplay_GlowEffect; WarriorButton = new MirButton { HoverIndex = 2427, Index = 2427, Library = Libraries.Prguse, Location = new Point(355, 296), Parent = NewCharacterWindow, PressedIndex = 2428, Sound = SoundList.ClickA, }; WarriorButton.Click += new EventHandler(WarriorButton_Click); WizardButton = new MirButton { HoverIndex = 2430, Index = 2429, Library = Libraries.Prguse, Location = new Point(405, 296), Parent = NewCharacterWindow, PressedIndex = 2431, Sound = SoundList.ClickA, }; WizardButton.Click += new EventHandler(WizardButton_Click); TaoistButton = new MirButton { HoverIndex = 2433, Index = 2432, Library = Libraries.Prguse, Location = new Point(455, 296), Parent = NewCharacterWindow, PressedIndex = 2434, Sound = SoundList.ClickA, }; TaoistButton.Click += new EventHandler(TaoistButton_Click); AssassinButton = new MirButton { HoverIndex = 2436, Index = 2435, Library = Libraries.Prguse, Location = new Point(505, 296), Parent = NewCharacterWindow, PressedIndex = 2437, Sound = SoundList.ClickA, }; AssassinButton.Click += new EventHandler(AssassinButton_Click); MaleButton = new MirButton { HoverIndex = 2421, Index = 2421, Library = Libraries.Prguse, Location = new Point(355, 343), Parent = NewCharacterWindow, PressedIndex = 2422, Sound = SoundList.ClickA, }; MaleButton.Click += new EventHandler(MaleButton_Click); FemaleButton = new MirButton { HoverIndex = 2424, Index = 2423, Library = Libraries.Prguse, Location = new Point(405, 343), Parent = NewCharacterWindow, PressedIndex = 2425, Sound = SoundList.ClickA, }; FemaleButton.Click += new EventHandler(FemaleButton_Click); Description = new MirLabel { Border = true, BorderColor = Color.FromArgb(53, 49, 41), DrawFormat = DrawTextFormat.WordBreak, Location = new Point(279, 70), Parent = NewCharacterWindow, Size = new Size(278, 170), Text = Settings.WarriorDescription, }; }