Search in sources :

Example 11 with Relic

use of delta.games.lotro.lore.items.legendary.relics.Relic in project lotro-companion by dmorcellet.

the class RelicsEditionPanelController method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();
    // Relic icon button
    int index = _buttons.indexOf(source);
    if (index != -1) {
        Relic initialRelic = _legAttrs.getRelics().get(index);
        RelicType type = RELIC_TYPES[index];
        Relic relic = RelicChoiceWindowController.selectRelic(_parent, type, initialRelic);
        if (relic != null) {
            _legAttrs.slotRelic(relic);
            update();
        }
    } else {
        index = _deleteButtons.indexOf(source);
        if (index != -1) {
            RelicType type = RELIC_TYPES[index];
            if (type == RelicType.SETTING)
                _legAttrs.setSetting(null);
            if (type == RelicType.GEM)
                _legAttrs.setGem(null);
            if (type == RelicType.RUNE)
                _legAttrs.setRune(null);
            if (type == RelicType.CRAFTED_RELIC)
                _legAttrs.setCraftedRelic(null);
            update();
        }
    }
}
Also used : Relic(delta.games.lotro.lore.items.legendary.relics.Relic) RelicType(delta.games.lotro.lore.items.legendary.relics.RelicType)

Example 12 with Relic

use of delta.games.lotro.lore.items.legendary.relics.Relic in project lotro-tools by dmorcellet.

the class RelicsIndexPageParser method handleTable.

private void handleTable(String categoryName, Segment source, String id, Integer level, RelicType defaultType) {
    Element table = findRelicsTable(source, id);
    if (table != null) {
        RelicsCategory category = _relicsMgr.getRelicCategory(categoryName, true);
        List<Element> trs = JerichoHtmlUtils.findElementsByTagName(table, HTMLElementName.TR);
        for (Element tr : trs) {
            Relic relic = handleTableRow(tr, level, defaultType);
            if (relic != null) {
                category.addRelic(relic);
            }
        }
    } else {
        System.err.println("Cannot find table: " + id);
    }
}
Also used : Relic(delta.games.lotro.lore.items.legendary.relics.Relic) RelicsCategory(delta.games.lotro.lore.items.legendary.relics.RelicsCategory) Element(net.htmlparser.jericho.Element)

Example 13 with Relic

use of delta.games.lotro.lore.items.legendary.relics.Relic in project lotro-tools by dmorcellet.

the class LotroPlanMordorRelicsLoader method itemToRelic.

private Relic itemToRelic(Item item) {
    String name = item.getName();
    if (name.startsWith("-"))
        name = name.substring(1);
    name = name.trim();
    Integer requiredLevel = item.getItemLevel();
    RelicType type = getRelicTypeFromName(name);
    Relic relic = new Relic(name, type, requiredLevel);
    BasicStatsSet stats = relic.getStats();
    stats.setStats(item.getStats());
    return relic;
}
Also used : Relic(delta.games.lotro.lore.items.legendary.relics.Relic) RelicType(delta.games.lotro.lore.items.legendary.relics.RelicType) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet)

Aggregations

Relic (delta.games.lotro.lore.items.legendary.relics.Relic)13 RelicType (delta.games.lotro.lore.items.legendary.relics.RelicType)3 RelicsCategory (delta.games.lotro.lore.items.legendary.relics.RelicsCategory)3 RelicsManager (delta.games.lotro.lore.items.legendary.relics.RelicsManager)3 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)2 GridBagConstraints (java.awt.GridBagConstraints)2 GridBagLayout (java.awt.GridBagLayout)2 Insets (java.awt.Insets)2 ImageIcon (javax.swing.ImageIcon)2 JButton (javax.swing.JButton)2 JLabel (javax.swing.JLabel)2 JPanel (javax.swing.JPanel)2 Element (net.htmlparser.jericho.Element)2 Item (delta.games.lotro.lore.items.Item)1 LotroPlanItemsDbLoader (delta.games.lotro.tools.lore.items.lotroplan.LotroPlanItemsDbLoader)1 LotroPlanMordorRelicsLoader (delta.games.lotro.tools.lore.items.lotroplan.relics.LotroPlanMordorRelicsLoader)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 ArrayList (java.util.ArrayList)1 TitledBorder (javax.swing.border.TitledBorder)1