use of eidolons.client.cc.gui.neo.choice.EnumChoiceView in project Eidolons by IDemiurge.
the class SkirmishMaster method newCustomSkirmish.
public static void newCustomSkirmish() {
ChoiceSequence cs = new ChoiceSequence();
new EnumChoiceView<>(cs, null, SKIRMISH_TYPE.class);
// battlefield
// max level
// nemesis groups
// objective
// filtering based on chosen template/type/bf
String info = "";
String data = "";
String path = PathFinder.getDungeonLevelFolder();
final Map<String, File> map = new HashMap<>();
for (File file : FileManager.getFilesFromDirectory(path, false)) {
data += file.getName() + ";";
map.put(file.getName(), file);
}
ListChoiceView battlefieldChoiceView = new ListChoiceView(cs, info, data) {
public Component getListCellRendererComponent(JList<? extends String> list, String value, int index, boolean isSelected, boolean cellHasFocus) {
return getBattlefieldImageAndText(map.get(value), value, isSelected);
}
};
// filter!
final ArrayList<OBJECTIVE_TYPE> allowed = new ArrayList<>();
EnumChoiceView<OBJECTIVE_TYPE> objectiveChoiceView = new EnumChoiceView<OBJECTIVE_TYPE>(cs, null, OBJECTIVE_TYPE.class) {
@Override
public boolean isOkBlocked() {
return allowed.contains(getSelectedItem());
}
};
cs.addView(battlefieldChoiceView);
// or mission?
cs.addView(objectiveChoiceView);
// mode choice
// dungeon choice? mission type choice?
cs.setManager(getChoiceMaster(map, battlefieldChoiceView, objectiveChoiceView));
cs.start();
}
Aggregations