@Override public Choices generateChoices(Interaction interaction) throws AbortInteraction, ContextDataRequired, GeneralInteractionError, PageFailure { Choices choices = new Choices(this, interaction); GroupHelper helper = new GroupHelper(interaction); VariablePrefixer variable = new VariablePrefixer(this, interaction); // list all the skills for which this group doesn't have an existing bonus Set<SkillType> existingBonuses = helper.record.getSkillBonuses(); for (SkillType skill : SkillType.values()) { if (skill == SkillType.ALL) continue; if (existingBonuses.contains(skill)) continue; choices.addInternalChoice(WordUtils.capitalizeFully(skill.toString()), skill.toString()); } // add a 'cancel' choice as well choices.addCancel(variable.define("cancel")); return choices; }
@Override public Choices generateChoices(Interaction interaction) throws AbortInteraction, PageFailure, ContextDataRequired, GeneralInteractionError { interaction.addBookmark(this); Choices choices = new Choices(this, interaction); VariablePrefixer variable = new VariablePrefixer(this, interaction); choices.addPageChoice(variable.define("change_name"), new GroupModifySpecialName()); choices.addPageChoice(variable.define("change_skill"), new GroupModifySpecialSkill()); choices.addPageChoice(variable.define("change_amount"), new GroupModifySpecialAmount()); choices.addPageChoice( variable.define("change_requirement"), new GroupModifySpecialityRequirement()); choices.addCancel(variable.define("cancel")); return choices; }