Search in sources :

Example 16 with Item

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

the class StashItemsTableController method buildDataProvider.

private DataProvider<Item> buildDataProvider() {
    DataProvider<Item> ret = new DataProvider<Item>() {

        @Override
        public Item getAt(int index) {
            ItemsStash stash = _toon.getStash();
            List<Item> items = stash.getItemsList();
            return items.get(index);
        }

        @Override
        public int getCount() {
            ItemsStash stash = _toon.getStash();
            List<Item> items = stash.getItemsList();
            return items.size();
        }
    };
    return ret;
}
Also used : CellDataProvider(delta.common.ui.swing.tables.CellDataProvider) DataProvider(delta.common.ui.swing.tables.DataProvider) Item(delta.games.lotro.lore.items.Item) ItemsStash(delta.games.lotro.character.storage.ItemsStash)

Example 17 with Item

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

the class DeedUiUtils method buildItemsCombo.

/**
 * Build a combo-box controller to choose an item name.
 * @return A new combo-box controller.
 */
public static ComboBoxController<Integer> buildItemsCombo() {
    ComboBoxController<Integer> ctrl = new ComboBoxController<Integer>();
    ctrl.addEmptyItem("");
    List<Item> items = DeedUtils.getItems();
    for (Item item : items) {
        ctrl.addItem(Integer.valueOf(item.getIdentifier()), item.getName());
    }
    ctrl.selectItem(null);
    return ctrl;
}
Also used : Item(delta.games.lotro.lore.items.Item) ComboBoxController(delta.common.ui.swing.combobox.ComboBoxController)

Example 18 with Item

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

the class EssencesEditionPanelController method getEssences.

/**
 * Get the selected essences.
 * @return a list of essences (with <code>null</code> items possible).
 */
public List<Item> getEssences() {
    List<Item> essences = new ArrayList<Item>();
    for (SingleEssenceEditionController ctrl : _essenceControllers) {
        Item essence = ctrl.getEssence();
        essences.add(essence);
    }
    return essences;
}
Also used : Item(delta.games.lotro.lore.items.Item) ArrayList(java.util.ArrayList)

Example 19 with Item

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

the class EssencesEditionPanelController method initFromItem.

/**
 * Initialize the managed panel with the given item.
 * @param item Item to set.
 */
public void initFromItem(Item item) {
    _essenceControllers.clear();
    int nbSlots = item.getEssencesCount();
    for (int i = 0; i < nbSlots; i++) {
        Item essence = item.getEssenceAt(i);
        SingleEssenceEditionController ctrl = new SingleEssenceEditionController(_parent, 1);
        ctrl.setEssence(essence);
        _essenceControllers.add(ctrl);
    }
    updateUi();
}
Also used : Item(delta.games.lotro.lore.items.Item)

Example 20 with Item

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

the class QuestsItemsLoader method handleItem.

private void handleItem(ObjectItem itemReference) {
    // Use name
    String name = itemReference.getName();
    Item item = _resolver.getItem(name);
    if (item == null) {
        // Use item 'key' (Wiki key)
        String url = itemReference.getObjectURL();
        if ((url != null) && (url.startsWith(WIKI_SEED))) {
            String itemKey = url.substring(WIKI_SEED.length());
            item = _resolver.getItem(itemKey);
        }
    }
    if (item == null) {
        // Use icon path
        String iconUrl = itemReference.getIconURL();
        if (iconUrl != null) {
            iconUrl = ItemsResolver.normalizeIconUrl(iconUrl);
            item = _resolver.getItem(iconUrl);
        }
    }
    if (item != null) {
        // Found!
        itemReference.setItemId(item.getIdentifier());
        itemReference.setIconURL(null);
        itemReference.setObjectURL(null);
        _resolved++;
    } else {
        // Not found!
        System.out.println("Not found: " + itemReference);
        _missed++;
    }
}
Also used : Item(delta.games.lotro.lore.items.Item) ObjectItem(delta.games.lotro.common.objects.ObjectItem)

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