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();
}
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;
}
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);
}
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);
}
}
}
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>
*/
}
Aggregations