Search in sources :

Example 11 with CharacterEvent

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

the class CharacterSummaryPanelController method editSummary.

private void editSummary() {
    CharacterSummaryDialogController dialog = new CharacterSummaryDialogController(_parent, _summary);
    CharacterSummary summary = dialog.editModal();
    if (summary != null) {
        _toon.saveSummary(_summary);
        CharacterEvent event = new CharacterEvent(CharacterEventType.CHARACTER_SUMMARY_UPDATED, _toon, null);
        EventsManager.invokeEvent(event);
    }
}
Also used : CharacterSummary(delta.games.lotro.character.CharacterSummary) CharacterEvent(delta.games.lotro.character.events.CharacterEvent) CharacterSummaryDialogController(delta.games.lotro.gui.character.summary.CharacterSummaryDialogController)

Example 12 with CharacterEvent

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

the class BuffEditionPanelController method add.

private void add() {
    BuffsManager buffs = _toon.getBuffs();
    List<Buff> possibleBuffs = BuffRegistry.getInstance().buildBuffSelection(_toon, buffs);
    Buff buff = BuffChoiceWindowController.selectBuff(_parentWindow, possibleBuffs, null);
    if (buff != null) {
        BuffInstance buffInstance = buff.buildInstance();
        buffs.addBuff(buffInstance);
        BuffIconController controller = buildBuffController(buffInstance);
        _buffControllers.add(controller);
        // Broadcast toon update event...
        CharacterEvent event = new CharacterEvent(CharacterEventType.CHARACTER_DATA_UPDATED, null, _toon);
        EventsManager.invokeEvent(event);
    }
}
Also used : BuffInstance(delta.games.lotro.character.stats.buffs.BuffInstance) CharacterEvent(delta.games.lotro.character.events.CharacterEvent) Buff(delta.games.lotro.character.stats.buffs.Buff) BuffsManager(delta.games.lotro.character.stats.buffs.BuffsManager)

Example 13 with CharacterEvent

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

the class BuffEditionPanelController method remove.

private void remove(int index) {
    BuffsManager buffs = _toon.getBuffs();
    buffs.removeBuffAt(index);
    _buffControllers.remove(index);
    // Update UI
    updateIconsPanel();
    // Broadcast toon update event...
    CharacterEvent event = new CharacterEvent(CharacterEventType.CHARACTER_DATA_UPDATED, null, _toon);
    EventsManager.invokeEvent(event);
}
Also used : CharacterEvent(delta.games.lotro.character.events.CharacterEvent) BuffsManager(delta.games.lotro.character.stats.buffs.BuffsManager)

Example 14 with CharacterEvent

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

the class BuffEditionPanelController method updateTier.

private void updateTier(int index) {
    BuffsManager buffs = _toon.getBuffs();
    BuffInstance buff = buffs.getBuffAt(index);
    List<Integer> tiers = buff.getBuff().getImpl().getTiers();
    if ((tiers != null) && (tiers.size() > 0)) {
        Integer currentTier = buff.getTier();
        int currentTierIndex = tiers.indexOf(currentTier);
        if (currentTierIndex != -1) {
            currentTierIndex++;
            if (currentTierIndex == tiers.size()) {
                currentTierIndex = 0;
            }
            buff.setTier(tiers.get(currentTierIndex));
            _buffControllers.get(index).update();
            // Broadcast toon update event...
            CharacterEvent event = new CharacterEvent(CharacterEventType.CHARACTER_DATA_UPDATED, null, _toon);
            EventsManager.invokeEvent(event);
        }
    }
}
Also used : BuffInstance(delta.games.lotro.character.stats.buffs.BuffInstance) CharacterEvent(delta.games.lotro.character.events.CharacterEvent) BuffsManager(delta.games.lotro.character.stats.buffs.BuffsManager)

Example 15 with CharacterEvent

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

the class CharacterReputationDialogController method okImpl.

@Override
protected void okImpl() {
    _toon.saveReputation();
    // Broadcast reputation update event...
    CharacterEvent event = new CharacterEvent(CharacterEventType.CHARACTER_REPUTATION_UPDATED, _toon, null);
    EventsManager.invokeEvent(event);
}
Also used : CharacterEvent(delta.games.lotro.character.events.CharacterEvent)

Aggregations

CharacterEvent (delta.games.lotro.character.events.CharacterEvent)17 CharacterData (delta.games.lotro.character.CharacterData)4 CharacterInfosManager (delta.games.lotro.character.CharacterInfosManager)3 BuffsManager (delta.games.lotro.character.stats.buffs.BuffsManager)3 CharacterSummary (delta.games.lotro.character.CharacterSummary)2 BuffInstance (delta.games.lotro.character.stats.buffs.BuffInstance)2 FlowLayout (java.awt.FlowLayout)2 JPanel (javax.swing.JPanel)2 ItemSelectionListener (delta.common.ui.swing.combobox.ItemSelectionListener)1 DateEditionController (delta.common.ui.swing.text.dates.DateEditionController)1 DefaultWindowController (delta.common.ui.swing.windows.DefaultWindowController)1 WindowController (delta.common.ui.swing.windows.WindowController)1 CharacterEquipment (delta.games.lotro.character.CharacterEquipment)1 SlotContents (delta.games.lotro.character.CharacterEquipment.SlotContents)1 CharacterFile (delta.games.lotro.character.CharacterFile)1 CharactersManager (delta.games.lotro.character.CharactersManager)1 CharacterXMLParser (delta.games.lotro.character.io.xml.CharacterXMLParser)1 CharacterStatsComputer (delta.games.lotro.character.stats.CharacterStatsComputer)1 STAT (delta.games.lotro.character.stats.STAT)1 Buff (delta.games.lotro.character.stats.buffs.Buff)1