Esempio n. 1
0
 protected override void OnDragBegin(int x, int y)
 {
     if (Skill.IsClickable && Mouse.LButtonPressed)
     {
         GameScene currentGameScene = SceneManager.GetScene <GameScene>();
         if (currentGameScene.SkillButtonGumpStack.Contains(Skill))
         {
             UIManager.Remove <SkillButtonGump>(World.Player);
         }
         SkillButtonGump skillButtonGump = new SkillButtonGump(Skill, Mouse.Position.X, Mouse.Position.Y);
         UIManager.Add(skillButtonGump);
         currentGameScene.SkillButtonGumpStack.Add(Skill);
         Rectangle rect = IO.Resources.Gumps.GetGumpTexture(0x24B8).Bounds;
         UIManager.AttemptDragControl(skillButtonGump, new Point(Mouse.Position.X + (rect.Width >> 1), Mouse.Position.Y + (rect.Height >> 1)), true);
     }
 }
Esempio n. 2
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 = IO.Resources.Gumps.GetGumpTexture(0x24B8).Bounds;
                Engine.UI.AttemptDragControl(skillButtonGump, new Point(Mouse.Position.X + (rect.Width >> 1), Mouse.Position.Y + (rect.Height >> 1)), true);
            }
        }