use of gmgen.pluginmgr.messages.CombatHasBeenInitiatedMessage in project pcgen by PCGen.
the class ExperienceAdjusterPlugin method handleMessage.
/**
* listens to messages from the GMGen system, and handles them as needed
* @param message the source of the event from the system
*/
@Override
public void handleMessage(PCGenMessage message) {
if (message instanceof CombatHasBeenInitiatedMessage) {
if (message.getSource() == this) {
CombatHasBeenInitiatedMessage cmessage = (CombatHasBeenInitiatedMessage) message;
if (initList == null) {
initList = cmessage.getCombat();
}
eaModel.setCombat(initList);
}
update();
} else if (message instanceof FocusOrStateChangeOccurredMessage) {
if (isActive()) {
experienceToolsItem.setEnabled(false);
if (initList == null) {
messageHandler.handleMessage(new CombatHasBeenInitiatedMessage(this));
}
update();
} else {
experienceToolsItem.setEnabled(true);
}
} else if (message instanceof FileMenuSaveMessage) {
if (isActive()) {
handleExportButton();
}
}
}
Aggregations