Search in sources :

Example 6 with CharacterFile

use of delta.games.lotro.character.CharacterFile in project lotro-companion by dmorcellet.

the class MainTestStashWindow method main.

/**
 * Basic main method for test.
 * @param args Not used.
 */
public static void main(String[] args) {
    LotroTestUtils utils = new LotroTestUtils();
    CharacterFile toon = utils.getMainToon();
    // Copy gear to stash
    ItemsStash stash = toon.getStash();
    CharacterData data = toon.getInfosManager().getLastCharacterDescription();
    CharacterEquipment gear = data.getEquipment();
    for (EQUIMENT_SLOT slot : EQUIMENT_SLOT.values()) {
        Item item = gear.getItemForSlot(slot);
        if (item != null) {
            Item clone = ItemFactory.clone(item);
            stash.addItem(clone);
        }
    }
    StashWindowController controller = new StashWindowController(toon);
    controller.show();
}
Also used : Item(delta.games.lotro.lore.items.Item) CharacterEquipment(delta.games.lotro.character.CharacterEquipment) ItemsStash(delta.games.lotro.character.storage.ItemsStash) CharacterData(delta.games.lotro.character.CharacterData) EQUIMENT_SLOT(delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT) LotroTestUtils(delta.games.lotro.character.log.LotroTestUtils) CharacterFile(delta.games.lotro.character.CharacterFile)

Example 7 with CharacterFile

use of delta.games.lotro.character.CharacterFile in project lotro-companion by dmorcellet.

the class MainTestWarbandStats method main.

/**
 * Basic main method for test.
 * @param args Not used.
 */
public static void main(String[] args) {
    LotroTestUtils utils = new LotroTestUtils();
    CharacterFile toon = utils.getToonByName("Allyriel");
    CharacterLog log = toon.getLastCharacterLog();
    if (log != null) {
        WarbandsStats stats = new WarbandsStats(log);
        stats.dump(System.out);
    }
}
Also used : LotroTestUtils(delta.games.lotro.character.log.LotroTestUtils) CharacterFile(delta.games.lotro.character.CharacterFile) CharacterLog(delta.games.lotro.character.log.CharacterLog)

Example 8 with CharacterFile

use of delta.games.lotro.character.CharacterFile in project lotro-companion by dmorcellet.

the class CraftingSynopsisPanelController method eventOccurred.

/**
 * Handle character events.
 * @param event Source event.
 */
@Override
public void eventOccurred(CharacterEvent event) {
    CharacterEventType type = event.getType();
    if (type == CharacterEventType.CHARACTER_CRAFTING_UPDATED) {
        CharacterFile toon = event.getToonFile();
        List<CharacterFile> currentToons = _tableController.getToons();
        if (currentToons.contains(toon)) {
            _tableController.updateToon(toon);
        }
    }
}
Also used : CharacterEventType(delta.games.lotro.character.events.CharacterEventType) CharacterFile(delta.games.lotro.character.CharacterFile)

Example 9 with CharacterFile

use of delta.games.lotro.character.CharacterFile in project lotro-companion by dmorcellet.

the class CraftingSynopsisTableController method updateRowItems.

private void updateRowItems() {
    _rowItems.clear();
    for (CharacterFile toon : _toons) {
        CraftingStatus craftingStatus = toon.getCraftingStatus();
        List<Profession> professions = craftingStatus.getProfessions();
        GuildStatus guildStatus = craftingStatus.getGuildStatus();
        Profession guild = guildStatus.getProfession();
        for (Profession profession : professions) {
            ProfessionStatus professionStatus = craftingStatus.getProfessionStatus(profession, true);
            GuildStatus displayedStatus = (profession == guild) ? guildStatus : null;
            CraftingSynopsisItem item = new CraftingSynopsisItem(toon, professionStatus, displayedStatus);
            _rowItems.add(item);
        }
    }
}
Also used : ProfessionStatus(delta.games.lotro.character.crafting.ProfessionStatus) Profession(delta.games.lotro.lore.crafting.Profession) GuildStatus(delta.games.lotro.character.crafting.GuildStatus) CraftingStatus(delta.games.lotro.character.crafting.CraftingStatus) CharacterFile(delta.games.lotro.character.CharacterFile)

Example 10 with CharacterFile

use of delta.games.lotro.character.CharacterFile in project lotro-companion by dmorcellet.

the class CharacterLevelPanelController method buildPanel.

private JPanel buildPanel() {
    JPanel panel = GuiFactory.buildBackgroundPanel(new BorderLayout());
    _chartController = new CharacterLevelChartController(_stats);
    JPanel chartPanel = _chartController.getPanel();
    panel.add(chartPanel, BorderLayout.CENTER);
    JPanel toonsControlPanel = GuiFactory.buildPanel(new GridBagLayout());
    {
        // Toons show/hide
        List<CharacterFile> toons = _stats.getToonsList();
        _toonSelectionController = new CharactersSelectorPanelController(toons);
        for (CharacterFile toon : toons) {
            _toonSelectionController.setToonSelected(toon, true);
            _toonSelectionController.setToonEnabled(toon, true);
        }
        _toonSelectionController.setGridConfiguration(1, 10);
        JPanel selectionPanel = _toonSelectionController.getPanel();
        GridBagConstraints c = new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
        toonsControlPanel.add(selectionPanel, c);
        _toonSelectionController.getListenersManager().addListener(this);
        // Choose toons button
        JButton chooser = GuiFactory.buildButton("Choose characters...");
        ActionListener al = new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                doChooseToons();
            }
        };
        chooser.addActionListener(al);
        chooser.setAlignmentY(Component.CENTER_ALIGNMENT);
        c.gridy++;
        toonsControlPanel.add(chooser, c);
    }
    panel.add(toonsControlPanel, BorderLayout.EAST);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) CharacterFile(delta.games.lotro.character.CharacterFile) BorderLayout(java.awt.BorderLayout) ActionListener(java.awt.event.ActionListener) CharactersSelectorPanelController(delta.games.lotro.gui.character.chooser.CharactersSelectorPanelController) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

CharacterFile (delta.games.lotro.character.CharacterFile)42 LotroTestUtils (delta.games.lotro.character.log.LotroTestUtils)13 ArrayList (java.util.ArrayList)11 CharactersManager (delta.games.lotro.character.CharactersManager)9 JPanel (javax.swing.JPanel)6 CharacterData (delta.games.lotro.character.CharacterData)5 CharacterLog (delta.games.lotro.character.log.CharacterLog)5 Preferences (delta.common.utils.misc.Preferences)4 TypedProperties (delta.common.utils.misc.TypedProperties)4 CraftingStatus (delta.games.lotro.character.crafting.CraftingStatus)3 CharacterEventType (delta.games.lotro.character.events.CharacterEventType)3 File (java.io.File)3 CellDataProvider (delta.common.ui.swing.tables.CellDataProvider)2 TableColumnController (delta.common.ui.swing.tables.TableColumnController)2 CharacterInfosManager (delta.games.lotro.character.CharacterInfosManager)2 CharacterSummary (delta.games.lotro.character.CharacterSummary)2 ProfessionStatus (delta.games.lotro.character.crafting.ProfessionStatus)2 CharacterStatsComputer (delta.games.lotro.character.stats.CharacterStatsComputer)2 Profession (delta.games.lotro.lore.crafting.Profession)2 GridBagConstraints (java.awt.GridBagConstraints)2