Search in sources :

Example 1 with CharacterSex

use of delta.games.lotro.common.CharacterSex 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 CharacterSex

use of delta.games.lotro.common.CharacterSex 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 3 with CharacterSex

use of delta.games.lotro.common.CharacterSex 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 4 with CharacterSex

use of delta.games.lotro.common.CharacterSex 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)

Example 5 with CharacterSex

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

the class CharacterSummaryPanelController method update.

/**
 * Update contents.
 */
public void update() {
    if (_summary != null) {
        // Name/region
        String name = _summary.getName();
        String region = _summary.getRegion();
        String text = name;
        if ((region != null) && (region.length() > 0)) {
            text = text + " of " + region;
        }
        _nameLabel.setText(text);
        // Level
        int level = _summary.getLevel();
        _levelLabel.setText(String.valueOf(level));
        // Character icon
        Race race = _summary.getRace();
        CharacterSex sex = _summary.getCharacterSex();
        ImageIcon characterIcon = LotroIconsManager.getCharacterIcon(race, sex);
        _characterIconLabel.setIcon(characterIcon);
    }
}
Also used : ImageIcon(javax.swing.ImageIcon) Race(delta.games.lotro.common.Race) CharacterSex(delta.games.lotro.common.CharacterSex)

Aggregations

CharacterSex (delta.games.lotro.common.CharacterSex)6 Race (delta.games.lotro.common.Race)6 CharacterClass (delta.games.lotro.common.CharacterClass)4 ImageIcon (javax.swing.ImageIcon)3 CharacterData (delta.games.lotro.character.CharacterData)1 CharacterFile (delta.games.lotro.character.CharacterFile)1 CharactersManager (delta.games.lotro.character.CharactersManager)1 CharacterStatsComputer (delta.games.lotro.character.stats.CharacterStatsComputer)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 JButton (javax.swing.JButton)1 JPanel (javax.swing.JPanel)1