Search in sources :

Example 1 with Buff

use of delta.games.lotro.character.stats.buffs.Buff in project lotro-companion by dmorcellet.

the class BuffChoiceWindowController method selectBuff.

/**
 * Show the buff selection dialog.
 * @param parent Parent controller.
 * @param possibleBuffs Possible buffs.
 * @param selectedBuff Selected buff.
 * @return The selected buff or <code>null</code> if the window was closed or canceled.
 */
public static Buff selectBuff(WindowController parent, List<Buff> possibleBuffs, Buff selectedBuff) {
    BuffChoiceWindowController controller = new BuffChoiceWindowController(parent, possibleBuffs);
    if (parent != null) {
        controller.getWindow().setLocationRelativeTo(parent.getWindow());
    }
    Buff chosenBuff = controller.doShow(selectedBuff);
    return chosenBuff;
}
Also used : Buff(delta.games.lotro.character.stats.buffs.Buff)

Example 2 with Buff

use of delta.games.lotro.character.stats.buffs.Buff in project lotro-companion by dmorcellet.

the class BuffChoiceWindowController method doShow.

private Buff doShow(Buff selectedBuff) {
    // Set selection
    _tableController.selectBuff(selectedBuff);
    // Show modal
    Buff chosenBuff = editModal();
    return chosenBuff;
}
Also used : Buff(delta.games.lotro.character.stats.buffs.Buff)

Example 3 with Buff

use of delta.games.lotro.character.stats.buffs.Buff in project lotro-companion by dmorcellet.

the class BuffIconController method buildToolTip.

private String buildToolTip() {
    Buff buff = _buff.getBuff();
    StringBuilder sb = new StringBuilder();
    sb.append(buff.getLabel()).append(EndOfLine.NATIVE_EOL);
    BasicStatsSet stats = _buff.getStats(_toon);
    if (stats != null) {
        for (STAT stat : stats.getStats()) {
            String name = stat.getName();
            String value = stats.getStat(stat).toString();
            sb.append(name).append(": ").append(value).append(EndOfLine.NATIVE_EOL);
        }
    }
    String text = sb.toString().trim();
    String html = "<html>" + text.replace(EndOfLine.NATIVE_EOL, "<br>") + "</html>";
    return html;
}
Also used : STAT(delta.games.lotro.character.stats.STAT) Buff(delta.games.lotro.character.stats.buffs.Buff) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet)

Example 4 with Buff

use of delta.games.lotro.character.stats.buffs.Buff 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 5 with Buff

use of delta.games.lotro.character.stats.buffs.Buff in project lotro-companion by dmorcellet.

the class BuffsFilterController method getCategories.

private List<String> getCategories() {
    Set<String> categories = new HashSet<String>();
    for (Buff buff : _buffs) {
        String category = buff.getCategory();
        if (category != null) {
            categories.add(category);
        }
    }
    List<String> ret = new ArrayList<String>();
    ret.addAll(categories);
    Collections.sort(ret);
    return ret;
}
Also used : ArrayList(java.util.ArrayList) Buff(delta.games.lotro.character.stats.buffs.Buff) HashSet(java.util.HashSet)

Aggregations

Buff (delta.games.lotro.character.stats.buffs.Buff)6 BuffsManager (delta.games.lotro.character.stats.buffs.BuffsManager)2 CharacterData (delta.games.lotro.character.CharacterData)1 CharacterEvent (delta.games.lotro.character.events.CharacterEvent)1 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)1 STAT (delta.games.lotro.character.stats.STAT)1 BuffInstance (delta.games.lotro.character.stats.buffs.BuffInstance)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1