Search in sources :

Example 1 with DeedType

use of delta.games.lotro.lore.deeds.DeedType in project lotro-companion by dmorcellet.

the class DeedDisplayPanelController method setItem.

/**
 * Set the deed to display.
 */
private void setItem() {
    String name = _deed.getName();
    // Name
    _name.setText(name);
    // Type
    DeedType type = _deed.getType();
    _type.setText((type != null) ? type.toString() : "-");
    // Icon
    ImageIcon icon = LotroIconsManager.getDeedTypeIcon(type);
    _icon.setIcon(icon);
    // Category
    String category = _deed.getCategory();
    _category.setText((category != null) ? category : "");
    // Requirements
    String requirements = buildRequirementString();
    _requirements.setText(requirements);
    // Description
    _description.setText(_deed.getDescription());
    _description.setEditable(false);
    _description.setCaretPosition(0);
    // Objectives
    _objectives.setText(_deed.getObjectives());
    _objectives.setEditable(false);
    _objectives.setCaretPosition(0);
}
Also used : ImageIcon(javax.swing.ImageIcon) DeedType(delta.games.lotro.lore.deeds.DeedType)

Example 2 with DeedType

use of delta.games.lotro.lore.deeds.DeedType in project lotro-tools by dmorcellet.

the class LotroCompendiumDeedsLoader method handleType.

private void handleType(DeedDescription deed, String type) {
    CharacterClass characterClass = null;
    DeedType deedType = null;
    if ("Minstrel".equals(type)) {
        deedType = DeedType.CLASS;
        characterClass = CharacterClass.MINSTREL;
    }
    if ("Hunter".equals(type)) {
        deedType = DeedType.CLASS;
        characterClass = CharacterClass.HUNTER;
    }
    if ("Lore-master".equals(type)) {
        deedType = DeedType.CLASS;
        characterClass = CharacterClass.LORE_MASTER;
    }
    if ("Captain".equals(type)) {
        deedType = DeedType.CLASS;
        characterClass = CharacterClass.CAPTAIN;
    }
    if ("Warden".equals(type)) {
        deedType = DeedType.CLASS;
        characterClass = CharacterClass.WARDEN;
    }
    if ("Champion".equals(type)) {
        deedType = DeedType.CLASS;
        characterClass = CharacterClass.CHAMPION;
    }
    if ("Rune-keeper".equals(type)) {
        deedType = DeedType.CLASS;
        characterClass = CharacterClass.RUNE_KEEPER;
    }
    if ("Burglar".equals(type)) {
        deedType = DeedType.CLASS;
        characterClass = CharacterClass.BURGLAR;
    }
    if ("Guardian".equals(type)) {
        deedType = DeedType.CLASS;
        characterClass = CharacterClass.GUARDIAN;
    }
    if ("Event".equals(type))
        deedType = DeedType.EVENT;
    if ("Explorer".equals(type))
        deedType = DeedType.EXPLORER;
    if ("Lore".equals(type))
        deedType = DeedType.LORE;
    if ("Slayer".equals(type))
        deedType = DeedType.SLAYER;
    if ("Reputation".equals(type))
        deedType = DeedType.REPUTATION;
    if (deedType == null) {
        String name = deed.getName();
        if (name != null) {
            if (name.toLowerCase().indexOf("slayer") != -1) {
                deedType = DeedType.SLAYER;
            }
        }
    }
    deed.setType(deedType);
    deed.setRequiredClass(characterClass);
}
Also used : DeedType(delta.games.lotro.lore.deeds.DeedType) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 3 with DeedType

use of delta.games.lotro.lore.deeds.DeedType in project lotro-tools by dmorcellet.

the class LotroWikiDeedPageParser method handleCategories.

private void handleCategories(DeedDescription deed, String deedType, String deedSubType, String regionalSub) {
    DeedType type = null;
    String category = null;
    // Fixes
    if ("Halls of Crafting".equals(deedSubType))
        deedType = "Instances";
    if ("Instance".equals(deedType))
        deedType = "Instances";
    if ("the Wastes".equals(deedSubType))
        deedSubType = "The Wastes";
    if ("meta".equals(deedType))
        deedType = "Meta";
    if ("quest".equals(deedType))
        deedType = "Quest";
    if ("Racial".equals(deedType))
        deedType = "Race";
    if ("Tower of Orthanc".equals(regionalSub))
        regionalSub = "The Tower of Orthanc";
    if ("The Tower of Orthanc".equals(regionalSub))
        deedType = "Instances";
    if ("Skirmish".equals(deedSubType)) {
        deedType = "Skirmish";
        deedSubType = "";
    }
    // Class deeds
    CharacterClass requiredClass = null;
    if ("Class".equals(deedType)) {
        type = DeedType.CLASS;
        category = deedSubType;
        requiredClass = extractClass(category);
    }
    // Type
    if ("Slayer".equals(regionalSub))
        type = DeedType.SLAYER;
    else if ("Explorer".equals(regionalSub))
        type = DeedType.EXPLORER;
    else if ("Lore".equals(regionalSub))
        type = DeedType.LORE;
    else if ("Quest".equals(regionalSub))
        type = DeedType.QUEST;
    else if ("Event".equals(regionalSub))
        type = DeedType.EVENT;
    else if ("Reputation".equals(regionalSub))
        type = DeedType.REPUTATION;
    else if ("Meta".equals(regionalSub))
        type = null;
    if ("Exploration".equals(deedType))
        type = DeedType.EXPLORER;
    else if ("Slayer".equals(deedType))
        type = DeedType.SLAYER;
    else if ("Race".equals(deedType))
        category = "Racial";
    else if ("Lore".equals(deedType))
        type = DeedType.LORE;
    else if ("Epic".equals(deedType))
        category = "Epic";
    else if ("Skirmish".equals(deedType))
        category = "Skirmish";
    else if ("Skirmish Instances".equals(deedType))
        category = "Skirmish";
    else if ("Summer Festival".equals(deedType))
        category = "Event:Summer Festival";
    else if ("Hidden".equals(deedType))
        category = "Hidden";
    if ("Epic".equals(deedSubType))
        category = "Epic";
    else if ("Event".equals(deedSubType))
        type = DeedType.EVENT;
    else if ("LOTRO Anniversary".equals(deedSubType)) {
        category = "Event:LOTRO Anniversary";
        deedType = "";
    }
    if ("Regional".equals(deedType)) {
        if ((deedSubType != null) && (deedSubType.length() > 0)) {
            category = "Region:" + deedSubType;
        }
    } else if (("Meta".equals(deedType)) || ("Slayer".equals(deedType)) || ("Social".equals(deedType)) || ("Quest".equals(deedType)) || ("Quest".equals(deedType))) {
        // Special
        if ("Host of the West (Faction)".equals(deedSubType))
            deedSubType = "The Wastes";
        category = getPrefixForZone(deedSubType);
        if (category != null) {
            category = category + ":" + deedSubType;
        }
        if ("Western Gondor City Watch".equals(deedSubType)) {
            type = DeedType.QUEST;
            category = "Region:Dol Amroth:City Watch";
        }
    } else if ("Instances".equals(deedType)) {
        category = "Instances:" + deedSubType;
    } else if ("Hobby".equals(deedType)) {
        type = DeedType.HOBBY;
        category = regionalSub;
    } else if ("Gorgoroth Meta".equals(deedType)) {
        type = null;
        category = "Region:Gorgoroth";
    }
    if ((("".equals(deedType)) && ("Reputation".equals(regionalSub))) || ("Reputation".equals(deedType))) {
        type = DeedType.REPUTATION;
    }
    if ((type != null) || (category != null)) {
        deed.setType(type);
        deed.setCategory(category);
    }
    deed.setRequiredClass(requiredClass);
}
Also used : DeedType(delta.games.lotro.lore.deeds.DeedType) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 4 with DeedType

use of delta.games.lotro.lore.deeds.DeedType in project lotro-companion by dmorcellet.

the class DeedFilterController method buildDeedPanel.

private JPanel buildDeedPanel() {
    JPanel panel = GuiFactory.buildPanel(new GridBagLayout());
    int y = 0;
    JPanel line1Panel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEADING, 0, 0));
    // Label filter
    {
        JPanel containsPanel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEADING, 5, 0));
        containsPanel.add(GuiFactory.buildLabel("Name filter:"));
        _contains = GuiFactory.buildTextField("");
        _contains.setColumns(20);
        containsPanel.add(_contains);
        TextListener listener = new TextListener() {

            @Override
            public void textChanged(String newText) {
                if (newText.length() == 0)
                    newText = null;
                DeedNameFilter nameFilter = _filter.getNameFilter();
                nameFilter.setPattern(newText);
                filterUpdated();
            }
        };
        _textController = new DynamicTextEditionController(_contains, listener);
        line1Panel.add(containsPanel);
    }
    GridBagConstraints c = new GridBagConstraints(0, y, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0);
    panel.add(line1Panel, c);
    y++;
    JPanel line2Panel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEADING, 5, 0));
    // Type
    {
        JLabel label = GuiFactory.buildLabel("Type:");
        line2Panel.add(label);
        _type = DeedUiUtils.buildDeedTypeCombo();
        ItemSelectionListener<DeedType> typeListener = new ItemSelectionListener<DeedType>() {

            @Override
            public void itemSelected(DeedType type) {
                DeedTypeFilter typeFilter = _filter.getTypeFilter();
                typeFilter.setDeedType(type);
                filterUpdated();
            }
        };
        _type.addListener(typeListener);
        line2Panel.add(_type.getComboBox());
    }
    // Category
    {
        JLabel label = GuiFactory.buildLabel("Category:");
        line2Panel.add(label);
        _category = DeedUiUtils.buildCategoryCombo();
        ItemSelectionListener<String> categoryListener = new ItemSelectionListener<String>() {

            @Override
            public void itemSelected(String category) {
                DeedCategoryFilter categoryFilter = _filter.getCategoryFilter();
                categoryFilter.setDeedCategory(category);
                filterUpdated();
            }
        };
        _category.addListener(categoryListener);
        line2Panel.add(_category.getComboBox());
    }
    c = new GridBagConstraints(0, y, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0);
    panel.add(line2Panel, c);
    y++;
    return panel;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) FlowLayout(java.awt.FlowLayout) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) ItemSelectionListener(delta.common.ui.swing.combobox.ItemSelectionListener) JLabel(javax.swing.JLabel) TextListener(delta.common.ui.swing.text.TextListener) DeedTypeFilter(delta.games.lotro.lore.deeds.filters.DeedTypeFilter) DynamicTextEditionController(delta.common.ui.swing.text.DynamicTextEditionController) DeedCategoryFilter(delta.games.lotro.lore.deeds.filters.DeedCategoryFilter) DeedNameFilter(delta.games.lotro.lore.deeds.filters.DeedNameFilter) DeedType(delta.games.lotro.lore.deeds.DeedType)

Example 5 with DeedType

use of delta.games.lotro.lore.deeds.DeedType 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)

Aggregations

DeedType (delta.games.lotro.lore.deeds.DeedType)6 CharacterClass (delta.games.lotro.common.CharacterClass)3 DeedCategoryFilter (delta.games.lotro.lore.deeds.filters.DeedCategoryFilter)2 DeedNameFilter (delta.games.lotro.lore.deeds.filters.DeedNameFilter)2 DeedTypeFilter (delta.games.lotro.lore.deeds.filters.DeedTypeFilter)2 ComboBoxController (delta.common.ui.swing.combobox.ComboBoxController)1 ItemSelectionListener (delta.common.ui.swing.combobox.ItemSelectionListener)1 DynamicTextEditionController (delta.common.ui.swing.text.DynamicTextEditionController)1 TextListener (delta.common.ui.swing.text.TextListener)1 Race (delta.games.lotro.common.Race)1 VirtueId (delta.games.lotro.common.VirtueId)1 ClassPointRewardFilter (delta.games.lotro.common.rewards.filters.ClassPointRewardFilter)1 EmoteRewardFilter (delta.games.lotro.common.rewards.filters.EmoteRewardFilter)1 ItemRewardFilter (delta.games.lotro.common.rewards.filters.ItemRewardFilter)1 LotroPointsRewardFilter (delta.games.lotro.common.rewards.filters.LotroPointsRewardFilter)1 ReputationRewardFilter (delta.games.lotro.common.rewards.filters.ReputationRewardFilter)1 SkillRewardFilter (delta.games.lotro.common.rewards.filters.SkillRewardFilter)1 TitleRewardFilter (delta.games.lotro.common.rewards.filters.TitleRewardFilter)1 TraitRewardFilter (delta.games.lotro.common.rewards.filters.TraitRewardFilter)1 VirtueRewardFilter (delta.games.lotro.common.rewards.filters.VirtueRewardFilter)1