Search in sources :

Example 1 with EQUIMENT_SLOT

use of delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT in project lotro-companion by dmorcellet.

the class MainTestStashWindow method main.

/**
 * Basic main method for test.
 * @param args Not used.
 */
public static void main(String[] args) {
    LotroTestUtils utils = new LotroTestUtils();
    CharacterFile toon = utils.getMainToon();
    // Copy gear to stash
    ItemsStash stash = toon.getStash();
    CharacterData data = toon.getInfosManager().getLastCharacterDescription();
    CharacterEquipment gear = data.getEquipment();
    for (EQUIMENT_SLOT slot : EQUIMENT_SLOT.values()) {
        Item item = gear.getItemForSlot(slot);
        if (item != null) {
            Item clone = ItemFactory.clone(item);
            stash.addItem(clone);
        }
    }
    StashWindowController controller = new StashWindowController(toon);
    controller.show();
}
Also used : Item(delta.games.lotro.lore.items.Item) CharacterEquipment(delta.games.lotro.character.CharacterEquipment) ItemsStash(delta.games.lotro.character.storage.ItemsStash) CharacterData(delta.games.lotro.character.CharacterData) EQUIMENT_SLOT(delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT) LotroTestUtils(delta.games.lotro.character.log.LotroTestUtils) CharacterFile(delta.games.lotro.character.CharacterFile)

Example 2 with EQUIMENT_SLOT

use of delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT in project lotro-companion by dmorcellet.

the class AllEssencesEditionPanelController method initEditors.

private void initEditors() {
    CharacterEquipment equipment = _toon.getEquipment();
    for (EQUIMENT_SLOT slot : EQUIMENT_SLOT.values()) {
        SingleItemEssencesEditionController controller = new SingleItemEssencesEditionController(_parent, slot);
        Item item = equipment.getItemForSlot(slot);
        controller.setItem(item);
        _editors.add(controller);
    }
}
Also used : Item(delta.games.lotro.lore.items.Item) CharacterEquipment(delta.games.lotro.character.CharacterEquipment) EQUIMENT_SLOT(delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT)

Example 3 with EQUIMENT_SLOT

use of delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT 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 4 with EQUIMENT_SLOT

use of delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT in project lotro-companion by dmorcellet.

the class EquipmentPanelController method initPositions.

private void initPositions() {
    _iconPositions = new HashMap<EQUIMENT_SLOT, Dimension>();
    int x = X_COLUMN_1;
    int y = Y_START;
    _iconPositions.put(EQUIMENT_SLOT.LEFT_EAR, new Dimension(x, y));
    y += DELTA_Y;
    _iconPositions.put(EQUIMENT_SLOT.NECK, new Dimension(x, y));
    y += DELTA_Y;
    _iconPositions.put(EQUIMENT_SLOT.LEFT_WRIST, new Dimension(x, y));
    y += DELTA_Y;
    _iconPositions.put(EQUIMENT_SLOT.LEFT_FINGER, new Dimension(x, y));
    x = X_COLUMN_2;
    y = Y_START;
    _iconPositions.put(EQUIMENT_SLOT.RIGHT_EAR, new Dimension(x, y));
    y += DELTA_Y;
    _iconPositions.put(EQUIMENT_SLOT.POCKET, new Dimension(x, y));
    y += DELTA_Y;
    _iconPositions.put(EQUIMENT_SLOT.RIGHT_WRIST, new Dimension(x, y));
    y += DELTA_Y;
    _iconPositions.put(EQUIMENT_SLOT.RIGHT_FINGER, new Dimension(x, y));
    x = X_COLUMN_3;
    y = Y_START;
    _iconPositions.put(EQUIMENT_SLOT.HEAD, new Dimension(x, y));
    y += DELTA_Y;
    _iconPositions.put(EQUIMENT_SLOT.BREAST, new Dimension(x, y));
    y += DELTA_Y;
    _iconPositions.put(EQUIMENT_SLOT.HANDS, new Dimension(x, y));
    y += DELTA_Y;
    _iconPositions.put(EQUIMENT_SLOT.LEGS, new Dimension(x, y));
    x = X_COLUMN_4;
    y = Y_START;
    _iconPositions.put(EQUIMENT_SLOT.SHOULDER, new Dimension(x, y));
    y += DELTA_Y;
    _iconPositions.put(EQUIMENT_SLOT.BACK, new Dimension(x, y));
    y += DELTA_Y;
    y += DELTA_Y;
    _iconPositions.put(EQUIMENT_SLOT.FEET, new Dimension(x, y));
    x = X_ROW;
    y = Y_ROW;
    _iconPositions.put(EQUIMENT_SLOT.MAIN_MELEE, new Dimension(x, y));
    x += DELTA_X;
    _iconPositions.put(EQUIMENT_SLOT.OTHER_MELEE, new Dimension(x, y));
    x += DELTA_X;
    _iconPositions.put(EQUIMENT_SLOT.RANGED, new Dimension(x, y));
    x += DELTA_X;
    _iconPositions.put(EQUIMENT_SLOT.TOOL, new Dimension(x, y));
    x += DELTA_X;
    _iconPositions.put(EQUIMENT_SLOT.CLASS_ITEM, new Dimension(x, y));
}
Also used : EQUIMENT_SLOT(delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT) Dimension(java.awt.Dimension)

Example 5 with EQUIMENT_SLOT

use of delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT 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)

Aggregations

EQUIMENT_SLOT (delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT)12 Item (delta.games.lotro.lore.items.Item)7 CharacterEquipment (delta.games.lotro.character.CharacterEquipment)5 CharacterClass (delta.games.lotro.common.CharacterClass)4 CharacterData (delta.games.lotro.character.CharacterData)3 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)3 JMenuItem (javax.swing.JMenuItem)3 SlotContents (delta.games.lotro.character.CharacterEquipment.SlotContents)2 ItemsStash (delta.games.lotro.character.storage.ItemsStash)2 Race (delta.games.lotro.common.Race)2 Dimension (java.awt.Dimension)2 List (java.util.List)2 ImageIcon (javax.swing.ImageIcon)2 JButton (javax.swing.JButton)2 Preferences (delta.common.utils.misc.Preferences)1 TypedProperties (delta.common.utils.misc.TypedProperties)1 CharacterFile (delta.games.lotro.character.CharacterFile)1 LotroTestUtils (delta.games.lotro.character.log.LotroTestUtils)1 STAT (delta.games.lotro.character.stats.STAT)1 ItemChoiceTableColumnsManager (delta.games.lotro.gui.items.ItemChoiceTableColumnsManager)1