use of eidolons.client.cc.gui.neo.choice.ScenarioModeChoiceView 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();
}
});
}
Aggregations