Ejemplo n.º 1
0
        private KeymapType GetTypeFromAction(KeymapAction action)
        {
            switch (action)
            {
            case KeymapAction.Cockeyed:
            case KeymapAction.Happy:
            case KeymapAction.Sarcastic:
            case KeymapAction.Crying:
            case KeymapAction.Outraged:
            case KeymapAction.Shocked:
            case KeymapAction.Annoyed:
                return(KeymapType.BasicFace);

            case KeymapAction.PickUp:
            case KeymapAction.Sit:
            case KeymapAction.Attack:
            case KeymapAction.Jump:
            case KeymapAction.NpcChat:
                return(KeymapType.BasicAction);

            case KeymapAction.EquipmentMenu:
            case KeymapAction.ItemMenu:
            case KeymapAction.AbilityMenu:
            case KeymapAction.SkillMenu:
            case KeymapAction.BuddyList:
            case KeymapAction.WorldMap:
            case KeymapAction.Messenger:
            case KeymapAction.MiniMap:
            case KeymapAction.QuestMenu:
            case KeymapAction.SetKey:
            case KeymapAction.AllChat:
            case KeymapAction.WhisperChat:
            case KeymapAction.PartyChat:
            case KeymapAction.BuddyChat:
            case KeymapAction.Shortcut:
            case KeymapAction.QuickSlot:
            case KeymapAction.ExpandChat:
            case KeymapAction.GuildList:
            case KeymapAction.GuildChat:
            case KeymapAction.PartyList:
            case KeymapAction.QuestHelper:
            case KeymapAction.SpouseChat:
            case KeymapAction.MonsterBook:
            case KeymapAction.CashShop:
            case KeymapAction.AllianceChat:
            case KeymapAction.PartySearch:
            case KeymapAction.FamilyList:
            case KeymapAction.Medal:
                return(KeymapType.Menu);
            }


            return(KeymapType.None);
        }
Ejemplo n.º 2
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;
        }
Ejemplo n.º 3
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.
            {
            }
        }
Ejemplo n.º 4
0
 public Shortcut(Datum datum)
 {
     this.Key    = (KeymapKey)datum["Key"];
     this.Type   = (KeymapType)datum["Type"];
     this.Action = (KeymapAction)datum["Action"];
 }