Beispiel #1
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                if (TabControl != null)
                {
                    if (!TabControl.IsDisposed)
                    {
                        TabControl.Dispose();
                    }

                    TabControl = null;
                }

                if (SchoolTabs != null)
                {
                    foreach (KeyValuePair <MagicSchool, MagicTab> pair in SchoolTabs)
                    {
                        if (pair.Value == null)
                        {
                            continue;
                        }
                        if (pair.Value.IsDisposed)
                        {
                            continue;
                        }

                        pair.Value.Dispose();
                    }
                    SchoolTabs.Clear();
                    SchoolTabs = null;
                }

                if (Magics != null)
                {
                    foreach (KeyValuePair <MagicInfo, MagicCell> pair in Magics)
                    {
                        if (pair.Value == null)
                        {
                            continue;
                        }
                        if (pair.Value.IsDisposed)
                        {
                            continue;
                        }

                        pair.Value.Dispose();
                    }
                    Magics.Clear();
                    Magics = null;
                }
            }
        }
Beispiel #2
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                if (TabControl != null)
                {
                    if (!TabControl.IsDisposed)
                    {
                        TabControl.Dispose();
                    }

                    TabControl = null;
                }

                if (AvailableTab != null)
                {
                    if (!AvailableTab.IsDisposed)
                    {
                        AvailableTab.Dispose();
                    }

                    AvailableTab = null;
                }

                if (CurrentTab != null)
                {
                    if (!CurrentTab.IsDisposed)
                    {
                        CurrentTab.Dispose();
                    }

                    CurrentTab = null;
                }

                if (CompletedTab != null)
                {
                    if (!CompletedTab.IsDisposed)
                    {
                        CompletedTab.Dispose();
                    }

                    CompletedTab = null;
                }
            }
        }
Beispiel #3
0
        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;
            }
        }
        public ChatTab AddNewTab(ChatTabPageSetting settings)
        {
            ChatOptionsPanel panel;
            DXListBoxItem    item = new DXListBoxItem
            {
                Parent = ListBox,

                Item = panel = new ChatOptionsPanel
                {
                    Parent           = this,
                    Visible          = false,
                    Location         = new Point(ListBox.Location.X + ListBox.Size.Width + 5, ListBox.Location.Y),
                    LocalCheckBox    = { Checked = true },
                    WhisperCheckBox  = { Checked = true },
                    GroupCheckBox    = { Checked = true },
                    GuildCheckBox    = { Checked = true },
                    ShoutCheckBox    = { Checked = true },
                    GlobalCheckBox   = { Checked = true },
                    ObserverCheckBox = { Checked = true },
                    HintCheckBox     = { Checked = true },
                    SystemCheckBox   = { Checked = true },
                    GainsCheckBox    = { Checked = true },
                    AlertCheckBox    = { Checked = true },
                },
            };

            item.SelectedChanged += (o, e) => panel.Visible = item.Selected;

            DXTabControl tabControl = new DXTabControl
            {
                //    PassThrough = false,
                Size    = new Size(200, 200),
                Parent  = GameScene.Game,
                Movable = true,
            };

            ChatTab tab = new ChatTab
            {
                Parent      = tabControl,
                Panel       = panel,
                Opacity     = 0.5F,
                AllowResize = true,
                TabButton   =
                {
                    Movable = true, AllowDragOut = true,
                    Label   = { Text = $"Window {ListBox.Controls.Count - 1}" }
                }
            };

            tab.Settings = settings;

            tabControl.MouseWheel += (o, e1) => (tabControl.SelectedTab as ChatTab)?.ScrollBar.DoMouseWheel(o, e1);

            panel.TransparentCheckBox.CheckedChanged += (o, e1) => tab.TransparencyChanged();
            panel.AlertCheckBox.CheckedChanged       += (o, e1) => tab.AlertIcon.Visible = false;

            panel.Size = new Size(ClientArea.Width - panel.Location.X, ClientArea.Height);

            panel.TextChanged += (o1, e1) =>
            {
                item.Label.Text          = panel.Text;
                tab.TabButton.Label.Text = panel.Text;
            };


            panel.Text = $"Window {ListBox.Controls.Count - 1}";

            panel.RemoveButton.MouseClick += (o1, e1) =>
            {
                DXListBoxItem nextItem = null;
                bool          found    = false;

                foreach (DXControl control in ListBox.Controls)
                {
                    if (!(control is DXListBoxItem))
                    {
                        continue;
                    }

                    if (control == item)
                    {
                        found = true;
                        continue;
                    }

                    nextItem = control as DXListBoxItem;

                    if (found)
                    {
                        break;
                    }
                }
                ListBox.SelectedItem = nextItem;

                item.Dispose();
                panel.Dispose();
                ListBox.UpdateItems();


                tabControl = tab.Parent as DXTabControl;
                tab.Dispose();

                if (tabControl?.Controls.Count == 0)
                {
                    tabControl.Dispose();
                }
            };

            ListBox.SelectedItem = item;

            return(tab);
        }
        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;
                }
            }
        }