use of eidolons.libgdx.DialogScenario in project Eidolons by IDemiurge.
the class UnitViewFactory method createListener.
public static ClickListener createListener(BattleFieldObject bfObj) {
return new BattleClickListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
// event.getButton() == Input.Buttons.RIGHT;
return true;
}
@Override
public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
if (IntroTestLauncher.running) {
ScenarioMetaMaster m = new ScenarioMetaMaster("Pride and Treachery");
// new LinearDialogue();
GameDialogue dialogue = null;
dialogue = bfObj.getGame().getMetaMaster().getDialogueFactory().getDialogue("Interrogation");
List<DialogScenario> list = SceneFactory.getScenes(dialogue);
GuiEventManager.trigger(GuiEventType.DIALOG_SHOW, list);
}
if (event.getButton() == Input.Buttons.RIGHT) {
GuiEventManager.trigger(CREATE_RADIAL_MENU, bfObj);
event.handle();
event.stop();
} else {
if (event.getButton() == Buttons.LEFT)
if (isAlt() || isShift() || isControl())
try {
DefaultActionHandler.leftClickUnit(isShift(), isControl(), bfObj);
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
GuiEventManager.trigger(RADIAL_MENU_CLOSE);
}
}
};
}
use of eidolons.libgdx.DialogScenario in project Eidolons by IDemiurge.
the class CombatScriptExecutor method doDialogue.
private boolean doDialogue(Ref ref, String[] args) {
GameDialogue dialogue = getGame().getMetaMaster().getDialogueFactory().getDialogue(args[0]);
List<DialogScenario> list = SceneFactory.getScenes(dialogue);
GuiEventManager.trigger(GuiEventType.DIALOG_SHOW, new DialogueHandler(dialogue, getGame(), list));
return true;
}
use of eidolons.libgdx.DialogScenario in project Eidolons by IDemiurge.
the class GameScreen method initDialogue.
protected void initDialogue() {
GuiEventManager.bind(DIALOG_SHOW, obj -> {
DialogueHandler handler = (DialogueHandler) obj.get();
final List<DialogScenario> list = handler.getList();
if (dialogsStage == null) {
dialogsStage = new ChainedStage(viewPort, getBatch(), list);
updateInputController();
} else {
dialogsStage.play(list);
}
dialogsStage.setDialogueHandler(handler);
});
}
use of eidolons.libgdx.DialogScenario in project Eidolons by IDemiurge.
the class SceneFactory method getScenes.
public static List<DialogScenario> getScenes(List<SpeechData> fullData) {
Speech speech;
// speech.getFormattedText()
List<DialogScenario> list = new ArrayList<>();
// for (String substring : StringMaster.open(data)) {
TextureRegion backTexture = null;
for (SpeechData data : fullData) {
TextureRegion portraitTexture = null;
String message = null;
boolean skippable = true;
Integer time = -1;
message = data.getValue(SPEECH_VALUE.MESSAGE);
if (!StringMaster.isEmpty(data.getValue(SPEECH_VALUE.ACTOR)))
portraitTexture = TextureCache.getOrCreateR(DialogueActorMaster.getActor(data.getValue(SPEECH_VALUE.ACTOR)).getImagePath());
if (!StringMaster.isEmpty(data.getValue(SPEECH_VALUE.BACKGROUND)))
backTexture = TextureCache.getOrCreateR(data.getValue(SPEECH_VALUE.BACKGROUND));
list.add(new DialogScenario(time, skippable, backTexture, message, portraitTexture));
}
return list;
}
Aggregations