Пример #1
0
        protected override void OnDragBegin(int x, int y)
        {
            if (_skill.IsClickable && Mouse.LButtonPressed)
            {
                GetSpellFloatingButton(_skill.Index)?.Dispose();

                SkillButtonGump skillButtonGump = new SkillButtonGump(_skill, Mouse.LDropPosition.X, Mouse.LDropPosition.Y);
                UIManager.Add(skillButtonGump);
                Rectangle rect = GumpsLoader.Instance.GetTexture(0x24B8).Bounds;
                UIManager.AttemptDragControl(skillButtonGump, new Point(Mouse.Position.X + (rect.Width >> 1), Mouse.Position.Y + (rect.Height >> 1)), true);
            }
        }
Пример #2
0
        protected override void OnDragBegin(int x, int y)
        {
            if (_skill.IsClickable && Mouse.LButtonPressed)
            {
                uint serial = (uint)(World.Player + _skill.Index + 1);

                UIManager.GetGump <SkillButtonGump>(serial)?.Dispose();

                SkillButtonGump skillButtonGump = new SkillButtonGump(_skill, Mouse.Position.X, Mouse.Position.Y);
                UIManager.Add(skillButtonGump);
                Rectangle rect = GumpsLoader.Instance.GetTexture(0x24B8).Bounds;
                UIManager.AttemptDragControl(skillButtonGump, new Point(Mouse.Position.X + (rect.Width >> 1), Mouse.Position.Y + (rect.Height >> 1)), true);
            }
        }
Пример #3
0
        protected override void OnDragBegin(int x, int y)
        {
            if (_skill.IsClickable && Mouse.LButtonPressed)
            {
                GetSpellFloatingButton(_skill.Index)?.Dispose();

                _ = GumpsLoader.Instance.GetGumpTexture(0x24B8, out var bounds);

                SkillButtonGump skillButtonGump = new SkillButtonGump(_skill, Mouse.LClickPosition.X + (bounds.Width >> 1), Mouse.LClickPosition.Y + (bounds.Height >> 1));

                UIManager.Add(skillButtonGump);
                UIManager.AttemptDragControl(skillButtonGump, true);
            }
        }
Пример #4
0
        protected override void OnDragBegin(int x, int y)
        {
            if (_skill.IsClickable && Mouse.LButtonPressed)
            {
                uint serial = (uint)(World.Player + _skill.Index + 1);

                if (Engine.UI.GetByLocalSerial <SkillButtonGump>(serial) != null)
                {
                    Engine.UI.Remove <SkillButtonGump>(serial);
                }

                SkillButtonGump skillButtonGump = new SkillButtonGump(_skill, Mouse.Position.X, Mouse.Position.Y);
                Engine.UI.Add(skillButtonGump);
                Rectangle rect = FileManager.Gumps.GetTexture(0x24B8).Bounds;
                Engine.UI.AttemptDragControl(skillButtonGump, new Point(Mouse.Position.X + (rect.Width >> 1), Mouse.Position.Y + (rect.Height >> 1)), true);
            }
        }
Пример #5
0
            protected override void OnMouseOver(int x, int y)
            {
                if (CanMove)
                {
                    return;
                }

                var c = Engine.UI.MouseOverControl;

                if (c != null && c != this)
                {
                    var p = c.Parent;

                    while (p != null)
                    {
                        if (p is MultiSelectionShrinkbox box)
                        {
                            if (box.LabelText != Group)
                            {
                                SkillsGroupManager.MoveSkillToGroup(Group, box.LabelText, _skillIndex);

                                int index = -1;

                                foreach (SkillControl skillControl in box.Items.OfType <SkillControl>())
                                {
                                    index++;

                                    if (skillControl._skillIndex > _skillIndex)
                                    {
                                        break;
                                    }
                                }

                                _parent.Remove(this);
                                box.AddItem(this, index);

                                _parent = box;
                                Group   = box.LabelText;
                            }

                            break;
                        }

                        p = p.Parent;
                    }
                }

                if (!(c?.RootParent is StandardSkillsGump))
                {
                    uint serial = (uint)(World.Player + _skillIndex + 1);

                    if (Engine.UI.GetGump <SkillButtonGump>(serial) != null)
                    {
                        Engine.UI.Remove <SkillButtonGump>(serial);
                    }

                    SkillButtonGump skillButtonGump = new SkillButtonGump(World.Player.Skills[_skillIndex], Mouse.Position.X, Mouse.Position.Y);
                    Engine.UI.Add(skillButtonGump);
                    Rectangle rect = FileManager.Gumps.GetTexture(0x24B8).Bounds;
                    Engine.UI.AttemptDragControl(skillButtonGump, new Point(Mouse.Position.X + (rect.Width >> 1), Mouse.Position.Y + (rect.Height >> 1)), true);
                }

                base.OnMouseOver(x, y);
            }