use of eidolons.client.cc.gui.neo.choice.PositionChoiceView in project Eidolons by IDemiurge.
the class UnitGroupMaster method mapPositions.
private static List<ObjAtCoordinate> mapPositions(List<ObjType> list, Entity hero) {
ChoiceSequence sequence = new ChoiceSequence();
Unit unit = null;
// posView.in
List<Unit> units = new ArrayList<>();
if (hero != null) {
if (hero instanceof Unit) {
unit = (Unit) hero;
} else {
unit = (new Unit((ObjType) hero));
}
units.add(unit);
}
for (ObjType type : list) {
if (type != null) {
units.add(new Unit(type));
}
}
PositionChoiceView posView = new PositionChoiceView(sequence, unit) {
@Override
protected boolean isReady() {
return false;
}
};
sequence.addView(posView);
Map<Unit, Coordinates> map = DC_Game.game.getDungeonMaster().getPositioner().getPartyCoordinates(units);
posView.setPartyCoordinates(map);
sequence.setManager(new SequenceManager() {
@Override
public void doneSelection() {
WaitMaster.receiveInput(WAIT_OPERATIONS.CUSTOM_SELECT, true);
}
@Override
public void cancelSelection() {
WaitMaster.receiveInput(WAIT_OPERATIONS.CUSTOM_SELECT, false);
}
});
sequence.start();
Launcher.setView(VIEWS.CHOICE);
boolean result = (boolean) WaitMaster.waitForInput(WAIT_OPERATIONS.CUSTOM_SELECT);
Launcher.initMenu(MAIN_MENU_ITEMS.FACTION);
Launcher.setView(VIEWS.MENU);
if (!result) {
return null;
}
DC_SoundMaster.playStandardSound(STD_SOUNDS.OK);
return ListMaster.toObjAtCoordinate(units);
}
Aggregations