protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (Grid != null) { if (!Grid.IsDisposed) { Grid.Dispose(); } Grid = null; } if (GoldLabel != null) { if (!GoldLabel.IsDisposed) { GoldLabel.Dispose(); } GoldLabel = null; } if (WeightLabel != null) { if (!WeightLabel.IsDisposed) { WeightLabel.Dispose(); } WeightLabel = null; } if (FragmentButton != null) { if (!FragmentButton.IsDisposed) { FragmentButton.Dispose(); } FragmentButton = null; } } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (ExperienceBar != null) { if (!ExperienceBar.IsDisposed) { ExperienceBar.Dispose(); } ExperienceBar = null; } if (NewMailIcon != null) { if (!NewMailIcon.IsDisposed) { NewMailIcon.Dispose(); } NewMailIcon = null; } if (ClassLabel != null) { if (!ClassLabel.IsDisposed) { ClassLabel.Dispose(); } ClassLabel = null; } if (LevelLabel != null) { if (!LevelLabel.IsDisposed) { LevelLabel.Dispose(); } LevelLabel = null; } if (ACLabel != null) { if (!ACLabel.IsDisposed) { ACLabel.Dispose(); } ACLabel = null; } if (MRLabel != null) { if (!MRLabel.IsDisposed) { MRLabel.Dispose(); } MRLabel = null; } if (DCLabel != null) { if (!DCLabel.IsDisposed) { DCLabel.Dispose(); } DCLabel = null; } if (MCLabel != null) { if (!MCLabel.IsDisposed) { MCLabel.Dispose(); } MCLabel = null; } if (SCLabel != null) { if (!SCLabel.IsDisposed) { SCLabel.Dispose(); } SCLabel = null; } if (AccuracyLabel != null) { if (!AccuracyLabel.IsDisposed) { AccuracyLabel.Dispose(); } AccuracyLabel = null; } if (AgilityLabel != null) { if (!AgilityLabel.IsDisposed) { AgilityLabel.Dispose(); } AgilityLabel = null; } if (HealthLabel != null) { if (!HealthLabel.IsDisposed) { HealthLabel.Dispose(); } HealthLabel = null; } if (ManaLabel != null) { if (!ManaLabel.IsDisposed) { ManaLabel.Dispose(); } ManaLabel = null; } if (ExperienceLabel != null) { if (!ExperienceLabel.IsDisposed) { ExperienceLabel.Dispose(); } ExperienceLabel = null; } if (AttackModeLabel != null) { if (!AttackModeLabel.IsDisposed) { AttackModeLabel.Dispose(); } AttackModeLabel = null; } if (PetModeLabel != null) { if (!PetModeLabel.IsDisposed) { PetModeLabel.Dispose(); } PetModeLabel = null; } } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { CheckBoxRightPoint = Point.Empty; if (TypeFilterLabel != null) { if (!TypeFilterLabel.IsDisposed) { TypeFilterLabel.Dispose(); } TypeFilterLabel = null; } if (GradeFilterLabel != null) { if (!GradeFilterLabel.IsDisposed) { GradeFilterLabel.Dispose(); } GradeFilterLabel = null; } if (BookLabel != null) { if (!BookLabel.IsDisposed) { BookLabel.Dispose(); } BookLabel = null; } if (WeaponCheckBox != null) { if (!WeaponCheckBox.IsDisposed) { WeaponCheckBox.Dispose(); } WeaponCheckBox = null; } if (ArmourCheckBox != null) { if (!ArmourCheckBox.IsDisposed) { ArmourCheckBox.Dispose(); } ArmourCheckBox = null; } if (HelmetCheckBox != null) { if (!HelmetCheckBox.IsDisposed) { HelmetCheckBox.Dispose(); } HelmetCheckBox = null; } if (ShieldCheckBox != null) { if (!ShieldCheckBox.IsDisposed) { ShieldCheckBox.Dispose(); } ShieldCheckBox = null; } if (NecklaceCheckBox != null) { if (!NecklaceCheckBox.IsDisposed) { NecklaceCheckBox.Dispose(); } NecklaceCheckBox = null; } if (BraceletCheckBox != null) { if (!BraceletCheckBox.IsDisposed) { BraceletCheckBox.Dispose(); } BraceletCheckBox = null; } if (RingCheckBox != null) { if (!RingCheckBox.IsDisposed) { RingCheckBox.Dispose(); } RingCheckBox = null; } if (ShoesCheckBox != null) { if (!ShoesCheckBox.IsDisposed) { ShoesCheckBox.Dispose(); } ShoesCheckBox = null; } if (BookWarriorCheckBox != null) { if (!BookWarriorCheckBox.IsDisposed) { BookWarriorCheckBox.Dispose(); } BookWarriorCheckBox = null; } if (BookWizardCheckBox != null) { if (!BookWizardCheckBox.IsDisposed) { BookWizardCheckBox.Dispose(); } BookWizardCheckBox = null; } if (BookTaoistCheckBox != null) { if (!BookTaoistCheckBox.IsDisposed) { BookTaoistCheckBox.Dispose(); } BookTaoistCheckBox = null; } if (BookAssassinCheckBox != null) { if (!BookAssassinCheckBox.IsDisposed) { BookAssassinCheckBox.Dispose(); } BookAssassinCheckBox = null; } if (PotionCheckBox != null) { if (!PotionCheckBox.IsDisposed) { PotionCheckBox.Dispose(); } PotionCheckBox = null; } if (OreCheckBox != null) { if (!OreCheckBox.IsDisposed) { OreCheckBox.Dispose(); } OreCheckBox = null; } if (GoldCheckBox != null) { if (!GoldCheckBox.IsDisposed) { GoldCheckBox.Dispose(); } GoldCheckBox = null; } if (CommonCheckBox != null) { if (!CommonCheckBox.IsDisposed) { CommonCheckBox.Dispose(); } CommonCheckBox = null; } if (EliteCheckBox != null) { if (!EliteCheckBox.IsDisposed) { EliteCheckBox.Dispose(); } EliteCheckBox = null; } if (SuperiorCheckBox != null) { if (!SuperiorCheckBox.IsDisposed) { SuperiorCheckBox.Dispose(); } SuperiorCheckBox = null; } } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (Grid != null) { if (!Grid.IsDisposed) { Grid.Dispose(); } Grid = null; } if (TitleLabel != null) { if (!TitleLabel.IsDisposed) { TitleLabel.Dispose(); } TitleLabel = null; } if (GoldLabel != null) { if (!GoldLabel.IsDisposed) { GoldLabel.Dispose(); } GoldLabel = null; } if (GameGoldLabel != null) { if (!GameGoldLabel.IsDisposed) { GameGoldLabel.Dispose(); } GameGoldLabel = null; } if (WeightLabel != null) { if (!WeightLabel.IsDisposed) { WeightLabel.Dispose(); } WeightLabel = null; } if (CurrencyLabel != null) { if (!CurrencyLabel.IsDisposed) { CurrencyLabel.Dispose(); } CurrencyLabel = null; } if (CloseButton != null) { if (!CloseButton.IsDisposed) { CloseButton.Dispose(); } CloseButton = null; } if (SortButton != null) { if (!SortButton.IsDisposed) { SortButton.Dispose(); } SortButton = null; } if (TrashButton != null) { if (!TrashButton.IsDisposed) { TrashButton.Dispose(); } TrashButton = null; } if (GoldTitle != null) { if (!GoldTitle.IsDisposed) { GoldTitle.Dispose(); } GameGoldTitle = null; } if (GameGoldTitle != null) { if (!GameGoldTitle.IsDisposed) { GameGoldTitle.Dispose(); } GameGoldTitle = null; } } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { CompanionDisplay = null; CompanionDisplayPoint = Point.Empty; if (CompanionTabControl != null) { if (!CompanionTabControl.IsDisposed) { CompanionTabControl.Dispose(); } CompanionTabControl = null; } if (CompanionBagTab != null) { if (!CompanionBagTab.IsDisposed) { CompanionBagTab.Dispose(); } CompanionBagTab = null; } if (PickUpFilterTab != null) { if (!PickUpFilterTab.IsDisposed) { PickUpFilterTab.Dispose(); } PickUpFilterTab = null; } if (ItemNameFilterTab != null) { if (!ItemNameFilterTab.IsDisposed) { ItemNameFilterTab.Dispose(); } ItemNameFilterTab = null; } if (EquipmentGrid != null) { for (int i = 0; i < EquipmentGrid.Length; i++) { if (EquipmentGrid[i] != null) { if (!EquipmentGrid[i].IsDisposed) { EquipmentGrid[i].Dispose(); } EquipmentGrid[i] = null; } } EquipmentGrid = null; } if (InventoryGrid != null) { if (!InventoryGrid.IsDisposed) { InventoryGrid.Dispose(); } InventoryGrid = null; } if (WeightLabel != null) { if (!WeightLabel.IsDisposed) { WeightLabel.Dispose(); } WeightLabel = null; } if (HungerLabel != null) { if (!HungerLabel.IsDisposed) { HungerLabel.Dispose(); } HungerLabel = null; } if (NameLabel != null) { if (!NameLabel.IsDisposed) { NameLabel.Dispose(); } NameLabel = null; } if (LevelLabel != null) { if (!LevelLabel.IsDisposed) { LevelLabel.Dispose(); } LevelLabel = null; } if (ExperienceLabel != null) { if (!ExperienceLabel.IsDisposed) { ExperienceLabel.Dispose(); } ExperienceLabel = null; } if (Level3Label != null) { if (!Level3Label.IsDisposed) { Level3Label.Dispose(); } Level3Label = null; } if (Level5Label != null) { if (!Level5Label.IsDisposed) { Level5Label.Dispose(); } Level5Label = null; } if (Level7Label != null) { if (!Level7Label.IsDisposed) { Level7Label.Dispose(); } Level7Label = null; } if (Level10Label != null) { if (!Level10Label.IsDisposed) { Level10Label.Dispose(); } Level10Label = null; } if (ModeComboBox != null) { if (!ModeComboBox.IsDisposed) { ModeComboBox.Dispose(); } ModeComboBox = null; } BagWeight = 0; MaxBagWeight = 0; InventorySize = 0; } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { IsTrading = false; PlayerItems = null; if (UserLabel != null) { if (!UserLabel.IsDisposed) { UserLabel.Dispose(); } UserLabel = null; } if (PlayerLabel != null) { if (!PlayerLabel.IsDisposed) { PlayerLabel.Dispose(); } PlayerLabel = null; } if (UserGrid != null) { if (!UserGrid.IsDisposed) { UserGrid.Dispose(); } UserGrid = null; } if (PlayerGrid != null) { if (!PlayerGrid.IsDisposed) { PlayerGrid.Dispose(); } PlayerGrid = null; } if (UserGoldLabel != null) { if (!UserGoldLabel.IsDisposed) { UserGoldLabel.Dispose(); } UserGoldLabel = null; } if (PlayerGoldLabel != null) { if (!PlayerGoldLabel.IsDisposed) { PlayerGoldLabel.Dispose(); } PlayerGoldLabel = null; } if (ConfirmButton != null) { if (!ConfirmButton.IsDisposed) { ConfirmButton.Dispose(); } ConfirmButton = null; } } }
public void ReceiveChat(MessageAction action, params object[] args) { DXLabel label; switch (action) { case MessageAction.Revive: label = new DXLabel { AutoSize = false, Text = "You have died, Click here to revive in town.", Outline = false, DrawFormat = TextFormatFlags.WordBreak | TextFormatFlags.WordEllipsis, Parent = TextPanel, }; label.MouseClick += (o, e) => { CEnvir.Enqueue(new C.TownRevive()); label.Dispose(); }; label.MouseWheel += ScrollBar.DoMouseWheel; label.Disposing += (o, e) => { if (IsDisposed) { return; } History.Remove(label); UpdateScrollBar(); ScrollBar.Value = ScrollBar.MaxValue - label.Size.Height; }; label.Tag = MessageType.Announcement; break; default: return; } UpdateColours(label); Size size = DXLabel.GetHeight(label, TextPanel.Size.Width); label.Size = new Size(size.Width, size.Height); History.Add(label); while (History.Count > 250) { DXLabel oldLabel = History[0]; History.Remove(oldLabel); oldLabel.Dispose(); } AlertIcon.Visible = !IsVisible && Panel.AlertCheckBox.Checked; bool update = ScrollBar.Value >= ScrollBar.MaxValue - ScrollBar.VisibleSize; UpdateScrollBar(); if (update) { ScrollBar.Value = ScrollBar.MaxValue - label.Size.Height; } else { UpdateItems(); } }
public void ReceiveChat(string message, MessageType type) { if (Panel == null) { return; } switch (type) { case MessageType.Normal: if (!Panel.LocalCheckBox.Checked) { return; } break; case MessageType.Shout: if (!Panel.ShoutCheckBox.Checked) { return; } break; case MessageType.Global: if (!Panel.GlobalCheckBox.Checked) { return; } break; case MessageType.Group: if (!Panel.GroupCheckBox.Checked) { return; } break; case MessageType.Hint: if (!Panel.HintCheckBox.Checked) { return; } break; case MessageType.System: if (!Panel.SystemCheckBox.Checked) { return; } break; case MessageType.WhisperIn: case MessageType.WhisperOut: if (!Panel.WhisperCheckBox.Checked) { return; } break; case MessageType.Combat: if (!Panel.GainsCheckBox.Checked) { return; } break; case MessageType.ObserverChat: if (!Panel.ObserverCheckBox.Checked) { return; } break; case MessageType.Guild: if (!Panel.GuildCheckBox.Checked) { return; } break; } DXLabel label = new DXLabel { AutoSize = false, Text = message, Outline = false, DrawFormat = TextFormatFlags.WordBreak | TextFormatFlags.WordEllipsis, Parent = TextPanel, }; label.MouseWheel += ScrollBar.DoMouseWheel; label.Tag = type; switch (type) { case MessageType.Normal: case MessageType.Shout: case MessageType.Global: case MessageType.WhisperIn: case MessageType.WhisperOut: case MessageType.Group: case MessageType.ObserverChat: case MessageType.Guild: label.MouseUp += (o, e) => { string[] parts = label.Text.Split(':', ' '); if (parts.Length == 0) { return; } GameScene.Game.ChatTextBox.StartPM(Regex.Replace(parts[0], "[^A-Za-z0-9]", "")); }; break; } UpdateColours(label); Size size = DXLabel.GetHeight(label, TextPanel.Size.Width); label.Size = new Size(size.Width, size.Height); History.Add(label); while (History.Count > 250) { DXLabel oldLabel = History[0]; History.Remove(oldLabel); oldLabel.Dispose(); } AlertIcon.Visible = !IsVisible && Panel.AlertCheckBox.Checked; bool update = ScrollBar.Value >= ScrollBar.MaxValue - ScrollBar.VisibleSize; UpdateScrollBar(); if (update) { ScrollBar.Value = ScrollBar.MaxValue - label.Size.Height; } else { UpdateItems(); } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (SupportTabControl != null) { if (!SupportTabControl.IsDisposed) { SupportTabControl.Dispose(); } SupportTabControl = null; } if (AutoPotionTab != null) { if (!AutoPotionTab.IsDisposed) { AutoPotionTab.Dispose(); } AutoPotionTab = null; } if (AutoSkillTab != null) { if (!AutoSkillTab.IsDisposed) { AutoSkillTab.Dispose(); } AutoSkillTab = null; } if (AutoBattleTab != null) { if (!AutoBattleTab.IsDisposed) { AutoBattleTab.Dispose(); } AutoBattleTab = null; } if (WarriorSkillPanel != null) { if (!WarriorSkillPanel.IsDisposed) { WarriorSkillPanel.Dispose(); } WarriorSkillPanel = null; } if (WarriorSkillPanelTitle != null) { if (!WarriorSkillPanelTitle.IsDisposed) { WarriorSkillPanelTitle.Dispose(); } WarriorSkillPanelTitle = null; } if (Links != null) { for (int i = 0; i < Links.Length; i++) { Links[i] = null; } Links = null; } for (int i = 0; i < Rows.Length; i++) { if (Rows[i] == null) { continue; } if (!Rows[i].IsDisposed) { Rows[i].Dispose(); } Rows[i] = null; } Rows = null; if (ScrollBar != null) { if (!ScrollBar.IsDisposed) { ScrollBar.Dispose(); } ScrollBar = null; } } }