Search in sources :

Example 1 with CharacterEquipment

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

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

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

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

the class EquipmentPanelController method handleRemoveItem.

private void handleRemoveItem(EQUIMENT_SLOT slot) {
    CharacterEquipment equipment = _toonData.getEquipment();
    SlotContents contents = equipment.getSlotContents(slot, false);
    if (contents != null) {
        contents.setItem(null);
        contents.setItemId(null);
    }
    refreshToon();
}
Also used : SlotContents(delta.games.lotro.character.CharacterEquipment.SlotContents) CharacterEquipment(delta.games.lotro.character.CharacterEquipment)

Example 5 with CharacterEquipment

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

CharacterEquipment (delta.games.lotro.character.CharacterEquipment)9 Item (delta.games.lotro.lore.items.Item)6 EQUIMENT_SLOT (delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT)5 SlotContents (delta.games.lotro.character.CharacterEquipment.SlotContents)5 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)3 JMenuItem (javax.swing.JMenuItem)3 CharacterData (delta.games.lotro.character.CharacterData)2 ItemsStash (delta.games.lotro.character.storage.ItemsStash)2 CharacterClass (delta.games.lotro.common.CharacterClass)2 Race (delta.games.lotro.common.Race)2 CharacterFile (delta.games.lotro.character.CharacterFile)1 CharacterEvent (delta.games.lotro.character.events.CharacterEvent)1 LotroTestUtils (delta.games.lotro.character.log.LotroTestUtils)1 STAT (delta.games.lotro.character.stats.STAT)1 EssencesSet (delta.games.lotro.lore.items.essences.EssencesSet)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 Element (net.htmlparser.jericho.Element)1 Element (org.w3c.dom.Element)1 NamedNodeMap (org.w3c.dom.NamedNodeMap)1