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;
}
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;
}
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;
}
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);
}
}
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;
}
Aggregations