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