Search in sources :

Example 1 with Race

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

the class NewToonDialogController method okImpl.

@Override
protected void okImpl() {
    String toonName = _toonName.getText();
    String server = _server.getSelectedItem();
    CharacterClass cClass = _class.getComboBoxController().getSelectedItem();
    Race race = _race.getSelectedItem();
    CharacterSex sex = _sex.getSelectedItem();
    CharacterData info = new CharacterData();
    info.setName(toonName);
    info.setServer(server);
    info.setCharacterClass(cClass);
    info.setCharacterSex(sex);
    info.setRace(race);
    info.setLevel(1);
    info.setDate(Long.valueOf(System.currentTimeMillis()));
    // Compute stats
    CharacterStatsComputer computer = new CharacterStatsComputer();
    info.getStats().setStats(computer.getStats(info));
    CharactersManager manager = CharactersManager.getInstance();
    CharacterFile toon = manager.addToon(info);
    if (toon == null) {
        showErrorMessage("Character creation failed!");
    }
}
Also used : CharactersManager(delta.games.lotro.character.CharactersManager) CharacterData(delta.games.lotro.character.CharacterData) CharacterStatsComputer(delta.games.lotro.character.stats.CharacterStatsComputer) Race(delta.games.lotro.common.Race) CharacterSex(delta.games.lotro.common.CharacterSex) CharacterFile(delta.games.lotro.character.CharacterFile) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 2 with Race

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

the class QuestsCompletionStats method loadQuestIdentifiers.

private void loadQuestIdentifiers() {
    QuestsManager qm = QuestsManager.getInstance();
    QuestsIndex index = qm.getIndex();
    if (index != null) {
        QuestCategory category = index.getCategory(_category);
        if (category != null) {
            QuestSummary[] summaries = category.getQuests();
            for (QuestSummary summary : summaries) {
                int id = summary.getIdentifier();
                QuestDescription q = qm.getQuest(id);
                if (q != null) {
                    boolean useIt = true;
                    if (USE_CLASS_RESTRICTIONS) {
                        List<String> classes = q.getRequiredClasses();
                        if ((classes != null) && (classes.size() > 0)) {
                            CharacterClass cClass = _character.getCharacterClass();
                            String className = cClass.getKey();
                            if (classes.contains(className)) {
                                useIt = true;
                            } else {
                                String key = q.getKey();
                                if (_logger.isInfoEnabled()) {
                                    _logger.info("Ignored quest [" + key + "]. Class=" + className + ", Required:" + classes);
                                }
                                useIt = false;
                            }
                        }
                    }
                    if (USE_RACE_RESTRICTIONS) {
                        List<String> races = q.getRequiredRaces();
                        if ((races != null) && (races.size() > 0)) {
                            Race cRace = _character.getRace();
                            String raceName = cRace.getLabel();
                            if (races.contains(raceName)) {
                                useIt = true;
                            } else {
                                String key = q.getKey();
                                if (_logger.isInfoEnabled()) {
                                    _logger.info("Ignored quest [" + key + "]. Race=" + raceName + ", Required:" + races);
                                }
                                useIt = false;
                            }
                        }
                    }
                    if (!USE_INSTANCES) {
                        boolean instanced = q.isInstanced();
                        if (instanced) {
                            useIt = false;
                        }
                    }
                    if (useIt) {
                        _expectedIds.add(Integer.valueOf(id));
                    }
                }
            }
            _nbExpectedQuests = _expectedIds.size();
        }
    }
}
Also used : QuestDescription(delta.games.lotro.lore.quests.QuestDescription) QuestsManager(delta.games.lotro.lore.quests.QuestsManager) Race(delta.games.lotro.common.Race) QuestsIndex(delta.games.lotro.lore.quests.index.QuestsIndex) QuestCategory(delta.games.lotro.lore.quests.index.QuestCategory) QuestSummary(delta.games.lotro.lore.quests.index.QuestSummary) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 3 with Race

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

the class CharacterMainAttrsEditionPanelController method updateSexDisplay.

/**
 * Update sex display.
 */
public void updateSexDisplay() {
    Race race = _toon.getRace();
    CharacterSex sex = getCharacterSex();
    ImageIcon characterIcon = LotroIconsManager.getCharacterIcon(race, sex);
    _raceIcon.setIcon(characterIcon);
}
Also used : ImageIcon(javax.swing.ImageIcon) Race(delta.games.lotro.common.Race) CharacterSex(delta.games.lotro.common.CharacterSex)

Example 4 with Race

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

the class CharacterSummaryDialogController method okImpl.

@Override
protected void okImpl() {
    String toonName = _toonName.getText();
    _data.setName(toonName);
    String server = _server.getSelectedItem();
    _data.setServer(server);
    CharacterClass cClass = _class.getSelectedItem();
    _data.setCharacterClass(cClass);
    Race race = _race.getSelectedItem();
    _data.setRace(race);
    CharacterSex sex = _sex.getSelectedItem();
    _data.setCharacterSex(sex);
    String region = _region.getComboBoxController().getSelectedItem();
    _data.setRegion(region);
    int level = _level.getSelectedItem().intValue();
    _data.setLevel(level);
}
Also used : Race(delta.games.lotro.common.Race) CharacterSex(delta.games.lotro.common.CharacterSex) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 5 with Race

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

the class CharacterSummaryDialogController method initData.

private void initData() {
    // Toon name
    String name = _data.getName();
    _toonName.setText(name);
    // Server
    String server = _data.getServer();
    _server.selectItem(server);
    // Class
    CharacterClass characterClass = _data.getCharacterClass();
    _class.selectItem(characterClass);
    // Race
    Race race = _data.getRace();
    _race.selectItem(race);
    _region.setRace(race);
    // Sex
    CharacterSex sex = _data.getCharacterSex();
    _sex.selectItem(sex);
    // Region
    String region = _data.getRegion();
    _region.getComboBoxController().selectItem(region);
    // Level
    int level = _data.getLevel();
    _level.selectItem(Integer.valueOf(level));
}
Also used : Race(delta.games.lotro.common.Race) CharacterSex(delta.games.lotro.common.CharacterSex) CharacterClass(delta.games.lotro.common.CharacterClass)

Aggregations

Race (delta.games.lotro.common.Race)13 CharacterClass (delta.games.lotro.common.CharacterClass)9 CharacterSex (delta.games.lotro.common.CharacterSex)6 ImageIcon (javax.swing.ImageIcon)3 ItemSelectionListener (delta.common.ui.swing.combobox.ItemSelectionListener)2 CharacterData (delta.games.lotro.character.CharacterData)2 CharacterEquipment (delta.games.lotro.character.CharacterEquipment)2 EQUIMENT_SLOT (delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT)2 SlotContents (delta.games.lotro.character.CharacterEquipment.SlotContents)2 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)2 DeedRaceRequirementFilter (delta.games.lotro.lore.deeds.filters.DeedRaceRequirementFilter)2 GridBagConstraints (java.awt.GridBagConstraints)2 GridBagLayout (java.awt.GridBagLayout)2 Insets (java.awt.Insets)2 JPanel (javax.swing.JPanel)2 TypedProperties (delta.common.utils.misc.TypedProperties)1 CharacterFile (delta.games.lotro.character.CharacterFile)1 CharactersManager (delta.games.lotro.character.CharactersManager)1 CharacterStatsComputer (delta.games.lotro.character.stats.CharacterStatsComputer)1 STAT (delta.games.lotro.character.stats.STAT)1