Example #1
0
        public Shortcut(KeymapKey key, KeymapAction action, KeymapType type = KeymapType.None)
        {
            this.Key = key;

            if (type == KeymapType.None)
            {
                this.Type = this.GetTypeFromAction(action);
            }
            else
            {
                this.Type = type;
            }

            this.Action = action;
        }
Example #2
0
        public void Change(Packet iPacket)
        {
            int mode  = iPacket.ReadInt();
            int count = iPacket.ReadInt();

            if (mode == 0)
            {
                if (count == 0)
                {
                    return;
                }

                for (int i = 0; i < count; i++)
                {
                    KeymapKey    key    = (KeymapKey)iPacket.ReadInt();
                    KeymapType   type   = (KeymapType)iPacket.ReadByte();
                    KeymapAction action = (KeymapAction)iPacket.ReadInt();

                    if (this.Contains(key))
                    {
                        if (type == KeymapType.None)
                        {
                            this.Remove(key);
                        }
                        else
                        {
                            this[key].Type   = type;
                            this[key].Action = action;
                        }
                    }
                    else
                    {
                        this.Add(new Shortcut(key, action, type));
                    }
                }
            }
            else if (mode == 1) // NOTE: Pet automatic mana potion.
            {
            }
            else if (mode == 2) // NOTE: Pet automatic mana potion.
            {
            }
        }