Search in sources :

Example 11 with VirtueId

use of delta.games.lotro.common.VirtueId in project lotro-companion by dmorcellet.

the class VirtuesEditionPanelController method setVirtues.

/**
 * Set the virtues to show.
 * @param set Virtues to show.
 */
public void setVirtues(VirtuesSet set) {
    // Set tiers
    for (VirtueId virtueId : VirtueId.values()) {
        VirtueEditionUiController ui = _virtues.get(virtueId);
        int tier = set.getVirtueRank(virtueId);
        ui.setTier(tier);
    }
    // Set selected virtues
    _selectedVirtues.setVirtues(set);
    layoutSelectedVirtues();
}
Also used : VirtueId(delta.games.lotro.common.VirtueId)

Example 12 with VirtueId

use of delta.games.lotro.common.VirtueId in project lotro-companion by dmorcellet.

the class DeedFilterController method buildVirtuesCombobox.

private ComboBoxController<VirtueId> buildVirtuesCombobox() {
    ComboBoxController<VirtueId> combo = DeedUiUtils.buildVirtueCombo();
    ItemSelectionListener<VirtueId> listener = new ItemSelectionListener<VirtueId>() {

        @Override
        public void itemSelected(VirtueId virtueId) {
            VirtueRewardFilter filter = _filter.getVirtueFilter();
            filter.setVirtueId(virtueId);
            filterUpdated();
        }
    };
    combo.addListener(listener);
    return combo;
}
Also used : VirtueId(delta.games.lotro.common.VirtueId) ItemSelectionListener(delta.common.ui.swing.combobox.ItemSelectionListener) VirtueRewardFilter(delta.games.lotro.common.rewards.filters.VirtueRewardFilter)

Example 13 with VirtueId

use of delta.games.lotro.common.VirtueId in project lotro-companion by dmorcellet.

the class DeedFilterController method setFilter.

private void setFilter() {
    // Name
    DeedNameFilter nameFilter = _filter.getNameFilter();
    String contains = nameFilter.getPattern();
    if (contains != null) {
        _contains.setText(contains);
    }
    // Type
    DeedTypeFilter typeFilter = _filter.getTypeFilter();
    DeedType type = typeFilter.getDeedType();
    _type.selectItem(type);
    // Category
    DeedCategoryFilter categoryFilter = _filter.getCategoryFilter();
    String category = categoryFilter.getDeedCategory();
    _category.selectItem(category);
    // Requirements:
    // - class
    DeedClassRequirementFilter classFilter = _filter.getClassFilter();
    CharacterClass requiredClass = classFilter.getCharacterClass();
    _class.selectItem(requiredClass);
    // - race
    DeedRaceRequirementFilter raceFilter = _filter.getRaceFilter();
    Race requiredRace = raceFilter.getRace();
    _race.selectItem(requiredRace);
    // Rewards:
    // Reputation
    ReputationRewardFilter factionFilter = _filter.getReputationFilter();
    Faction faction = factionFilter.getFaction();
    _reputation.selectItem(faction);
    // LOTRO points
    LotroPointsRewardFilter lotroPointsFilter = _filter.getLotroPointsFilter();
    Boolean lotroPoints = lotroPointsFilter.getHasLotroPointsFlag();
    _lotroPoints.selectItem(lotroPoints);
    // Class point
    ClassPointRewardFilter classPointFilter = _filter.getClassPointsFilter();
    Boolean classPoint = classPointFilter.getHasClassPointFlag();
    _classPoints.selectItem(classPoint);
    // Trait
    TraitRewardFilter traitFilter = _filter.getTraitFilter();
    String trait = traitFilter.getTrait();
    _trait.selectItem(trait);
    // Skill
    SkillRewardFilter skillFilter = _filter.getSkillFilter();
    String skill = skillFilter.getSkill();
    _skill.selectItem(skill);
    // Title
    TitleRewardFilter titleFilter = _filter.getTitleFilter();
    String title = titleFilter.getTitle();
    _title.selectItem(title);
    // Virtue
    VirtueRewardFilter virtueFilter = _filter.getVirtueFilter();
    VirtueId virtueId = virtueFilter.getVirtueId();
    _virtue.selectItem(virtueId);
    // Emote
    EmoteRewardFilter emoteFilter = _filter.getEmoteFilter();
    String emote = emoteFilter.getEmote();
    _emote.selectItem(emote);
    // Item
    ItemRewardFilter itemFilter = _filter.getItemFilter();
    Integer itemId = itemFilter.getItemId();
    _item.selectItem(itemId);
}
Also used : DeedRaceRequirementFilter(delta.games.lotro.lore.deeds.filters.DeedRaceRequirementFilter) TitleRewardFilter(delta.games.lotro.common.rewards.filters.TitleRewardFilter) DeedTypeFilter(delta.games.lotro.lore.deeds.filters.DeedTypeFilter) CharacterClass(delta.games.lotro.common.CharacterClass) SkillRewardFilter(delta.games.lotro.common.rewards.filters.SkillRewardFilter) EmoteRewardFilter(delta.games.lotro.common.rewards.filters.EmoteRewardFilter) TraitRewardFilter(delta.games.lotro.common.rewards.filters.TraitRewardFilter) VirtueId(delta.games.lotro.common.VirtueId) ReputationRewardFilter(delta.games.lotro.common.rewards.filters.ReputationRewardFilter) Race(delta.games.lotro.common.Race) DeedCategoryFilter(delta.games.lotro.lore.deeds.filters.DeedCategoryFilter) LotroPointsRewardFilter(delta.games.lotro.common.rewards.filters.LotroPointsRewardFilter) DeedClassRequirementFilter(delta.games.lotro.lore.deeds.filters.DeedClassRequirementFilter) DeedNameFilter(delta.games.lotro.lore.deeds.filters.DeedNameFilter) DeedType(delta.games.lotro.lore.deeds.DeedType) ItemRewardFilter(delta.games.lotro.common.rewards.filters.ItemRewardFilter) Faction(delta.games.lotro.lore.reputation.Faction) ClassPointRewardFilter(delta.games.lotro.common.rewards.filters.ClassPointRewardFilter) VirtueRewardFilter(delta.games.lotro.common.rewards.filters.VirtueRewardFilter)

Example 14 with VirtueId

use of delta.games.lotro.common.VirtueId in project lotro-companion by dmorcellet.

the class VirtuesStats method handleRewards.

private void handleRewards(String id, Rewards rewards) {
    Virtue[] virtues = rewards.getVirtues();
    if (virtues != null) {
        for (Virtue virtue : virtues) {
            VirtueId virtueId = virtue.getIdentifier();
            List<String> items = _virtues.get(virtueId);
            if (items == null) {
                items = new ArrayList<String>();
                _virtues.put(virtueId, items);
            }
            items.add(id);
        }
    }
}
Also used : VirtueId(delta.games.lotro.common.VirtueId) Virtue(delta.games.lotro.common.Virtue)

Example 15 with VirtueId

use of delta.games.lotro.common.VirtueId in project lotro-tools by dmorcellet.

the class RewardsHTMLParser method parseVirtuesReward.

private void parseVirtuesReward(Element rewardDiv, Rewards rewards) {
    List<Element> as = rewardDiv.getAllElements(HTMLElementName.A);
    int size = (as != null) ? as.size() : 0;
    int nbItems = size / 2;
    if (nbItems * 2 == size) {
        for (int i = 0; i < nbItems; i++) {
            String name = null;
            String virtueIdentifier = null;
            // String iconURL=null;
            Element firstA = as.get(2 * i + 1);
            String url = firstA.getAttributeValue("href");
            if ((url != null) && (url.startsWith(VIRTUE_URL_SEED))) {
                virtueIdentifier = url.substring(VIRTUE_URL_SEED.length()).trim();
            }
            name = CharacterReference.decodeCollapseWhiteSpace(firstA.getContent());
            if ((name != null) && (virtueIdentifier != null)) {
                VirtueId virtueId = VirtueId.valueOf(virtueIdentifier.toUpperCase());
                Virtue virtue = new Virtue(virtueId, 1);
                rewards.addVirtue(virtue);
            }
        }
    } else {
        _logger.warn(_objectId + ": virtue with " + size + " anchor tags!");
    }
/*
<div class="questReward">
<div>
<strong>Virtues:</strong>
</div>
<div>
<a href="/wiki/Trait:Patience">
<img class="icon" src="http://content.turbine.com/sites/lorebook.lotro.com/images/icons/trait/trait_virtue_patience.png">
</a>
<a href="/wiki/Trait:Patience">Patience</a>
</div>
</div>
 */
}
Also used : VirtueId(delta.games.lotro.common.VirtueId) Element(net.htmlparser.jericho.Element) Virtue(delta.games.lotro.common.Virtue)

Aggregations

VirtueId (delta.games.lotro.common.VirtueId)17 Virtue (delta.games.lotro.common.Virtue)6 ArrayList (java.util.ArrayList)3 Rewards (delta.games.lotro.common.Rewards)2 VirtueRewardFilter (delta.games.lotro.common.rewards.filters.VirtueRewardFilter)2 DeedDescription (delta.games.lotro.lore.deeds.DeedDescription)2 Faction (delta.games.lotro.lore.reputation.Faction)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ComboBoxController (delta.common.ui.swing.combobox.ComboBoxController)1 ItemSelectionListener (delta.common.ui.swing.combobox.ItemSelectionListener)1 CharacterFile (delta.games.lotro.character.CharacterFile)1 CharacterLog (delta.games.lotro.character.log.CharacterLog)1 LotroTestUtils (delta.games.lotro.character.log.LotroTestUtils)1 VirtuesSet (delta.games.lotro.character.stats.virtues.VirtuesSet)1 CharacterClass (delta.games.lotro.common.CharacterClass)1 Race (delta.games.lotro.common.Race)1 ReputationItem (delta.games.lotro.common.ReputationItem)1 Title (delta.games.lotro.common.Title)1 Trait (delta.games.lotro.common.Trait)1