use of delta.games.lotro.character.CharactersManager in project lotro-companion by dmorcellet.
the class CharacterLevelPanelController method doChooseToons.
private void doChooseToons() {
CharactersManager manager = CharactersManager.getInstance();
List<CharacterFile> toons = manager.getAllToons();
List<CharacterFile> selectedToons = _stats.getToonsList();
List<CharacterFile> enabledToons = new ArrayList<CharacterFile>();
for (CharacterFile toon : toons) {
// if (toon.hasLog())
{
enabledToons.add(toon);
}
}
List<CharacterFile> newSelectedToons = CharactersSelectorWindowController.selectToons(_parentController, toons, selectedToons, enabledToons);
if (newSelectedToons != null) {
for (CharacterFile toon : newSelectedToons) {
if (selectedToons.contains(toon)) {
selectedToons.remove(toon);
} else {
_stats.addToon(toon);
_toonSelectionController.addToon(toon, true);
_toonSelectionController.setToonEnabled(toon, true);
}
}
for (CharacterFile removedToon : selectedToons) {
_stats.removeToon(removedToon);
_toonSelectionController.removeToon(removedToon);
}
_toonSelectionController.refresh();
_chartController.refresh();
}
}
use of delta.games.lotro.character.CharactersManager 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!");
}
}
use of delta.games.lotro.character.CharactersManager in project lotro-companion by dmorcellet.
the class MainTestReputationSynopsis method doIt.
private void doIt() {
CharactersManager mgr = CharactersManager.getInstance();
List<CharacterFile> allToons = mgr.getAllToons();
ReputationSynopsisTableController table = new ReputationSynopsisTableController(null);
table.setToons(allToons);
JTable jtable = table.getTable();
JScrollPane scroll = GuiFactory.buildScrollPane(jtable);
DefaultWindowController w = new DefaultWindowController();
w.getFrame().add(scroll);
w.getFrame().pack();
w.show();
}
use of delta.games.lotro.character.CharactersManager in project lotro-companion by dmorcellet.
the class CraftingSynopsisPanelController method doChooseToons.
private void doChooseToons() {
CharactersManager manager = CharactersManager.getInstance();
List<CharacterFile> toons = manager.getAllToons();
List<CharacterFile> selectedToons = _tableController.getToons();
List<CharacterFile> newSelectedToons = CharactersChooserController.selectToons(_parent, toons, selectedToons);
if (newSelectedToons != null) {
_tableController.setToons(newSelectedToons);
}
}
use of delta.games.lotro.character.CharactersManager in project lotro-companion by dmorcellet.
the class WarbandsPanelController method doChooseToons.
private void doChooseToons() {
CharactersManager manager = CharactersManager.getInstance();
List<CharacterFile> toons = manager.getAllToons();
List<CharacterFile> selectedToons = _tableController.getToons();
List<CharacterFile> enabledToons = new ArrayList<CharacterFile>();
for (CharacterFile toon : toons) {
if (toon.hasLog()) {
enabledToons.add(toon);
}
}
List<CharacterFile> newSelectedToons = CharactersChooserController.selectToons(_parent, enabledToons, selectedToons);
if (newSelectedToons != null) {
_tableController.refresh(newSelectedToons);
}
}
Aggregations