Beispiel #1
0
    protected override void AddLiveCooldown(ASpell spell)
    {
        base.AddLiveCooldown(spell);
        ActionBarSlot slot = actionBar.GetSlotOfSpell(spell);

        slot.InstantiateCooldown(GetLiveCooldown(spell));
    }
Beispiel #2
0
    public void MousePutDownOnActionBar(ActionBarSlot slot)
    {
        if (airItem == null)
        {
            return;
        }
        if (!(airItem.item is UsableItem))
        {
            airItem = null;
            return;
        }
        GameObject newGo = Instantiate(airItem.gameObject, slot.transform.position, Quaternion.identity, slot.transform.GetChild(0));

        slot.copiedItem   = newGo;
        slot.originalItem = airItem;
        slot.usableItem   = airItem.item;
        newGo.GetComponent <ItemUI>().onActionBar   = true;
        newGo.GetComponent <ItemUI>().actionBarSlot = slot;
        newGo.GetComponent <ItemUI>().SetPointer(airItem);
        newGo.GetComponent <Image>().sprite = airItem.item.inventoryIcon;
        if (airItem.onActionBar)
        {
            slot.originalItem = airItem.transform.parent.parent.GetComponent <ActionBarSlot>().originalItem;
            newGo.GetComponent <ItemUI>().SetPointer(airItem.GetPointer());
            newGo.GetComponent <Image>().sprite = airItem.GetPointer().item.inventoryIcon;
            Destroy(airItem.gameObject);
        }
        airItem = null;
    }
Beispiel #3
0
    protected override void RemoveLiveCooldown(LiveSpellCooldown lscd)
    {
        base.RemoveLiveCooldown(lscd);
        ActionBarSlot slot = actionBar.GetSlotOfSpell(lscd.Spell);

        slot.DestroyCooldown();
    }
Beispiel #4
0
        private static List<VirtualKeyCode> getKeys_ActionBarSlot(ActionBarSlot actionbarslot)
        {
            List<VirtualKeyCode> Buffer = new List<VirtualKeyCode>();

            switch (actionbarslot)
            {
                    case ActionBarSlot.LMB:
                    Buffer.Add(VirtualKeyCode.LBUTTON);
                    break;

                    case ActionBarSlot.RMB:
                    Buffer.Add(VirtualKeyCode.RBUTTON);
                    break;

                    case ActionBarSlot.Potion:
                    if (A_Collection.Preferences.Hotkeys.ModKey1_Potion != null)
                        Buffer.AddRange(getVirtualKeyCodes_byModkey(A_Collection.Preferences.Hotkeys.ModKey1_Potion.Value));
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_Potion != null)
                        Buffer.AddRange(getVirtualKeyCodes_byModkey(A_Collection.Preferences.Hotkeys.ModKey2_Potion.Value));

                    if (A_Collection.Preferences.Hotkeys.Key1_Potion != Key.Undefined)
                        Buffer.Add(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key1_Potion));
                    else if (A_Collection.Preferences.Hotkeys.Key2_Potion != Key.Undefined)
                        Buffer.Add(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key2_Potion));
                    break;

                case ActionBarSlot.Slot1:
                    if (A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill1 != null)
                        Buffer.AddRange(getVirtualKeyCodes_byModkey(A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill1.Value));
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill1 != null)
                        Buffer.AddRange(getVirtualKeyCodes_byModkey(A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill1.Value));

                    if (A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill1 != Key.Undefined)
                        Buffer.Add(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill1));
                    else if (A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill1 != Key.Undefined)
                        Buffer.Add(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill1));
                    break;

                case ActionBarSlot.Slot2:
                    if (A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill2 != null)
                        Buffer.AddRange(getVirtualKeyCodes_byModkey(A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill2.Value));
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill2 != null)
                        Buffer.AddRange(getVirtualKeyCodes_byModkey(A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill2.Value));

                    if (A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill2 != Key.Undefined)
                        Buffer.Add(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill2));
                    else if (A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill2 != Key.Undefined)
                        Buffer.Add(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill2));
                    break;

                case ActionBarSlot.Slot3:
                    if (A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill3 != null)
                        Buffer.AddRange(getVirtualKeyCodes_byModkey(A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill3.Value));
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill3 != null)
                        Buffer.AddRange(getVirtualKeyCodes_byModkey(A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill3.Value));

                    if (A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill3 != Key.Undefined)
                        Buffer.Add(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill3));
                    else if (A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill3 != Key.Undefined)
                        Buffer.Add(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill3));
                    break;

                case ActionBarSlot.Slot4:
                    if (A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill4 != null)
                        Buffer.AddRange(getVirtualKeyCodes_byModkey(A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill4.Value));
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill4 != null)
                        Buffer.AddRange(getVirtualKeyCodes_byModkey(A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill4.Value));

                    if (A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill4 != Key.Undefined)
                        Buffer.Add(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill4));
                    else if (A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill4 != Key.Undefined)
                        Buffer.Add(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill4));
                    break;
            }

            return Buffer;
        }