Example #1
0
        public void RemoveShortcut(ShortcutBarEnum barType, int slot)
        {
            var shortcut = GetShortcut(barType, slot);

            if (shortcut == null)
            {
                return;
            }

            switch (barType)
            {
            case ShortcutBarEnum.SPELL_SHORTCUT_BAR:
                m_spellShortcuts.Remove(slot);
                break;

            case ShortcutBarEnum.GENERAL_SHORTCUT_BAR:
            {
                if (shortcut is ItemShortcut)
                {
                    m_itemShortcuts.Remove(slot);
                }
                else if (shortcut is PresetShortcut)
                {
                    m_presetShortcuts.Remove(slot);
                }
            }

            break;
            }
            m_shortcutsToDelete.Enqueue(shortcut);

            ShortcutHandler.SendShortcutBarRemovedMessage(Owner.Client, barType, slot);
        }
Example #2
0
        public void SwapShortcuts(ShortcutBarEnum barType, int slot, int newSlot)
        {
            if (IsSlotFree(slot, barType))
            {
                return;
            }

            var shortcutToSwitch    = GetShortcut(barType, slot);
            var shortcutDestination = GetShortcut(barType, newSlot);

            RemoveInternal(shortcutToSwitch);
            RemoveInternal(shortcutDestination);

            if (shortcutDestination != null)
            {
                shortcutDestination.Slot = slot;
                AddInternal(shortcutDestination);
                ShortcutHandler.SendShortcutBarRefreshMessage(Owner.Client, barType, shortcutDestination);
            }
            else
            {
                ShortcutHandler.SendShortcutBarRemovedMessage(Owner.Client, barType, slot);
            }

            shortcutToSwitch.Slot = newSlot;
            AddInternal(shortcutToSwitch);
            ShortcutHandler.SendShortcutBarRefreshMessage(Owner.Client, barType, shortcutToSwitch);
        }
 public void RemoveShortcut(ShortcutBarEnum barType, int slot)
 {
     Stump.Server.WorldServer.Database.Shortcuts.Shortcut shortcut = this.GetShortcut(barType, slot);
     if (shortcut != null)
     {
         if (barType == ShortcutBarEnum.SPELL_SHORTCUT_BAR)
         {
             this.m_spellShortcuts.Remove(slot);
         }
         else
         {
             if (barType == ShortcutBarEnum.GENERAL_SHORTCUT_BAR)
             {
                 this.m_itemShortcuts.Remove(slot);
             }
         }
         this.m_shortcutsToDelete.Enqueue(shortcut);
         ShortcutHandler.SendShortcutBarRemovedMessage(this.Owner.Client, barType, slot);
     }
 }
 public void SwapShortcuts(ShortcutBarEnum barType, int slot, int newSlot)
 {
     if (!this.IsSlotFree(slot, barType))
     {
         Stump.Server.WorldServer.Database.Shortcuts.Shortcut shortcut  = this.GetShortcut(barType, slot);
         Stump.Server.WorldServer.Database.Shortcuts.Shortcut shortcut2 = this.GetShortcut(barType, newSlot);
         this.RemoveInternal(shortcut);
         this.RemoveInternal(shortcut2);
         if (shortcut2 != null)
         {
             shortcut2.Slot = slot;
             this.AddInternal(shortcut2);
             ShortcutHandler.SendShortcutBarRefreshMessage(this.Owner.Client, barType, shortcut2);
         }
         else
         {
             ShortcutHandler.SendShortcutBarRemovedMessage(this.Owner.Client, barType, slot);
         }
         shortcut.Slot = newSlot;
         this.AddInternal(shortcut);
         ShortcutHandler.SendShortcutBarRefreshMessage(this.Owner.Client, barType, shortcut);
     }
 }