use of eidolons.client.dc.SequenceManager in project Eidolons by IDemiurge.
the class ScenarioPrecombatMaster method newScenario.
public static void newScenario() {
final ScenarioChoiceView scv = new ScenarioChoiceView();
final ChoiceSequence choiceSequence = new ChoiceSequence(scv);
final ScenarioModeChoiceView smcv = new ScenarioModeChoiceView(choiceSequence, SCENARIO_MODES.class);
// TODO only if there are choices!
choiceSequence.addView(smcv);
choiceSequence.start();
choiceSequence.setManager(new SequenceManager() {
@Override
public void doneSelection() {
ObjType type = scv.getSelectedItem();
scenario = new Scenario(type);
SCENARIO_MODES mode = smcv.getSelectedItem();
if (mode == SCENARIO_MODES.STORY_MODE) {
String prop = scenario.getProperty(MACRO_PROPS.MISSION_PARTY);
List<Unit> heroes;
if (!DataManager.isTypeName(prop, DC_TYPE.PARTY)) {
prop = scenario.getProperty(MACRO_PROPS.MISSION_CUSTOM_PARTY);
heroes = new ArrayList<>();
String leaderName = prop.split(";")[0];
Unit leader = Launcher.getMainManager().initSelectedHero(leaderName);
// prop = prop.replace(leaderName, "");
// for (String s : StringMaster.open(prop)) {
// }
heroes.add(leader);
PartyHelper.newParty(leader);
Launcher.getMainManager().launchHC();
return;
} else {
heroes = PartyHelper.loadParty(prop);
}
Launcher.getMainManager().launchHC(heroes);
return;
}
Launcher.resetView(VIEWS.MENU);
}
@Override
public void cancelSelection() {
Launcher.getMainManager().exitToMainMenu();
}
});
}
use of eidolons.client.dc.SequenceManager 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);
}
use of eidolons.client.dc.SequenceManager in project Eidolons by IDemiurge.
the class HC_Controls method testFightLaunch.
private void testFightLaunch() {
ChoiceSequence choiceSequence = new ChoiceSequence();
choiceSequence.addView(new PrincipleChoiceView(choiceSequence, hero));
choiceSequence.setManager(new SequenceManager() {
@Override
public void doneSelection() {
Launcher.resetView(VIEWS.HC);
}
@Override
public void cancelSelection() {
Launcher.resetView(VIEWS.HC);
}
});
choiceSequence.start();
// choose a dungeon freely?
// test profiles , enemy presets
// DC_Game.game.getDungeonMaster().initDungeonLevelChoice();
}
use of eidolons.client.dc.SequenceManager in project Eidolons by IDemiurge.
the class SkirmishMaster method getChoiceMaster.
private static SequenceManager getChoiceMaster(final Map<String, File> map, final ListChoiceView battlefieldChoiceView, final EnumChoiceView<OBJECTIVE_TYPE> objectiveChoiceView) {
return new SequenceManager() {
@Override
public void doneSelection() {
WaitMaster.receiveInput(WAIT_OPERATIONS.CUSTOM_SELECT, true);
Object bfName = battlefieldChoiceView.getSelectedItem();
File file = map.get(bfName);
if (!file.isFile()) {
return;
}
// Dungeon dungeon = DungeonBuilder.buildDungeon(FileManager.readFile(file));
// specified where? used
ObjType missionType = new ObjType();
// for
// what?
OBJECTIVE_TYPE objective = objectiveChoiceView.getSelectedItem();
// initSkirmish(missionType, dungeon);
Launcher.resetView(VIEWS.MENU);
}
@Override
public void cancelSelection() {
WaitMaster.receiveInput(WAIT_OPERATIONS.CUSTOM_SELECT, false);
Launcher.getMainManager().exitToMainMenu();
}
};
}
use of eidolons.client.dc.SequenceManager in project Eidolons by IDemiurge.
the class DemoManager method initHero.
private static void initHero() {
// TODO JUST USE 'CHOOSE CENTER HERO' ?
List<ObjType> demoHeroes = new ArrayList<>();
DataManager.getTypesSubGroup(DC_TYPE.CHARS, "Demo");
Unit entity = null;
ChoiceSequence sequence = new ChoiceSequence();
sequence.addView(new EntityChoiceView(sequence, entity, demoHeroes) {
@Override
public String getInfo() {
return null;
}
@Override
protected PROPERTY getPROP() {
return null;
}
// @Override
// protected Condition getFilterConditions() {
// // return new NumericCondition("level");
// }
@Override
protected VALUE getFilterValue() {
return null;
}
protected OBJ_TYPE getTYPE() {
return DC_TYPE.CHARS;
}
});
sequence.setManager(new SequenceManager() {
@Override
public void doneSelection() {
WaitMaster.receiveInput(WAIT_OPERATIONS.SELECTION, sequence.getValue());
Launcher.resetView(VIEWS.HC);
// setLeader()
PartyHelper.loadParty(demoParty);
// initSelectedHero();
// newParty();
// launchHC();
}
@Override
public void cancelSelection() {
}
});
sequence.start();
}
Aggregations