Search in sources :

Example 11 with Item

use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.

the class EquipmentPanelController method handleCopyToStash.

private void handleCopyToStash(EQUIMENT_SLOT slot) {
    CharacterEquipment equipment = _toonData.getEquipment();
    SlotContents contents = equipment.getSlotContents(slot, false);
    if (contents != null) {
        Item item = contents.getItem();
        if (item != null) {
            ItemsStash stash = _toon.getStash();
            Item newItem = ItemFactory.clone(item);
            stash.addItem(newItem);
            Integer stashId = newItem.getStashIdentifier();
            item.setStashIdentifier(stashId);
            _toon.saveStash();
            // Broadcast stash update event...
            CharacterEvent event = new CharacterEvent(CharacterEventType.CHARACTER_STASH_UPDATED, _toon, null);
            EventsManager.invokeEvent(event);
        }
    }
}
Also used : SlotContents(delta.games.lotro.character.CharacterEquipment.SlotContents) JMenuItem(javax.swing.JMenuItem) Item(delta.games.lotro.lore.items.Item) CharacterEquipment(delta.games.lotro.character.CharacterEquipment) ItemsStash(delta.games.lotro.character.storage.ItemsStash) CharacterEvent(delta.games.lotro.character.events.CharacterEvent)

Example 12 with Item

use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.

the class EquipmentPanelController method updateIcons.

/**
 * Update contents.
 */
private void updateIcons() {
    for (EQUIMENT_SLOT slot : EQUIMENT_SLOT.values()) {
        Item item = getItemForSlot(slot);
        EquipmentSlotIconController iconController = _icons.get(slot);
        iconController.setItem(item);
        JButton button = _buttons.get(slot);
        ImageIcon icon = iconController.getIcon();
        button.setIcon(icon);
        String tooltipText = iconController.getTooltip();
        button.setToolTipText(tooltipText);
    }
}
Also used : JMenuItem(javax.swing.JMenuItem) Item(delta.games.lotro.lore.items.Item) ImageIcon(javax.swing.ImageIcon) EQUIMENT_SLOT(delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT) JButton(javax.swing.JButton)

Example 13 with Item

use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.

the class EquipmentPanelController method handleEditItem.

private void handleEditItem(EQUIMENT_SLOT slot) {
    Item item = getItemForSlot(slot);
    if (item != null) {
        ItemEditionWindowController ctrl = new ItemEditionWindowController(_parentWindow, item);
        ctrl.show(true);
        refreshToon();
    }
}
Also used : JMenuItem(javax.swing.JMenuItem) Item(delta.games.lotro.lore.items.Item) ItemEditionWindowController(delta.games.lotro.gui.items.ItemEditionWindowController)

Example 14 with Item

use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.

the class EquipmentPanelController method buildRightClickListener.

private MouseListener buildRightClickListener() {
    class PopClickListener extends MouseAdapter {

        @Override
        public void mousePressed(MouseEvent e) {
            if (e.isPopupTrigger())
                doPop(e);
        }

        @Override
        public void mouseReleased(MouseEvent e) {
            if (e.isPopupTrigger())
                doPop(e);
        }

        private void doPop(MouseEvent e) {
            EQUIMENT_SLOT slot = findSlotForButton((Component) e.getSource());
            Item item = getItemForSlot(slot);
            _contextMenu.getComponent(0).setEnabled(item != null);
            _contextMenu.show(e.getComponent(), e.getX(), e.getY());
        }
    }
    return new PopClickListener();
}
Also used : JMenuItem(javax.swing.JMenuItem) Item(delta.games.lotro.lore.items.Item) MouseEvent(java.awt.event.MouseEvent) EQUIMENT_SLOT(delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT) MouseAdapter(java.awt.event.MouseAdapter)

Example 15 with Item

use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.

the class EquipmentPanelController method getItemForSlot.

private Item getItemForSlot(EQUIMENT_SLOT slot) {
    CharacterEquipment equipment = _toonData.getEquipment();
    Item item = equipment.getItemForSlot(slot);
    return item;
}
Also used : JMenuItem(javax.swing.JMenuItem) Item(delta.games.lotro.lore.items.Item) CharacterEquipment(delta.games.lotro.character.CharacterEquipment)

Aggregations

Item (delta.games.lotro.lore.items.Item)105 ArrayList (java.util.ArrayList)29 HashMap (java.util.HashMap)19 File (java.io.File)17 FixedDecimalsInteger (delta.games.lotro.utils.FixedDecimalsInteger)16 Armour (delta.games.lotro.lore.items.Armour)15 LegendaryItem (delta.games.lotro.lore.items.legendary.LegendaryItem)12 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)11 ArmourType (delta.games.lotro.lore.items.ArmourType)8 EquipmentLocation (delta.games.lotro.lore.items.EquipmentLocation)8 Weapon (delta.games.lotro.lore.items.Weapon)8 JMenuItem (javax.swing.JMenuItem)8 EQUIMENT_SLOT (delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT)7 CharacterClass (delta.games.lotro.common.CharacterClass)7 ItemsManager (delta.games.lotro.lore.items.ItemsManager)7 CharacterEquipment (delta.games.lotro.character.CharacterEquipment)6 ItemsStash (delta.games.lotro.character.storage.ItemsStash)6 WeaponType (delta.games.lotro.lore.items.WeaponType)6 ItemQuality (delta.games.lotro.lore.items.ItemQuality)5 List (java.util.List)5