Search in sources :

Example 1 with DialogScenario

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);
            }
        }
    };
}
Also used : ScenarioMetaMaster(eidolons.game.battlecraft.logic.meta.scenario.ScenarioMetaMaster) GameDialogue(eidolons.game.battlecraft.logic.meta.scenario.dialogue.GameDialogue) DialogScenario(eidolons.libgdx.DialogScenario) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) BattleClickListener(eidolons.libgdx.bf.mouse.BattleClickListener)

Example 2 with DialogScenario

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;
}
Also used : GameDialogue(eidolons.game.battlecraft.logic.meta.scenario.dialogue.GameDialogue) DialogScenario(eidolons.libgdx.DialogScenario) DialogueHandler(eidolons.game.battlecraft.logic.meta.scenario.dialogue.DialogueHandler)

Example 3 with DialogScenario

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);
    });
}
Also used : ChainedStage(eidolons.libgdx.stage.ChainedStage) DialogScenario(eidolons.libgdx.DialogScenario) DialogueHandler(eidolons.game.battlecraft.logic.meta.scenario.dialogue.DialogueHandler)

Example 4 with DialogScenario

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;
}
Also used : TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) ArrayList(java.util.ArrayList) Speech(eidolons.game.battlecraft.logic.meta.scenario.dialogue.speech.Speech) DialogScenario(eidolons.libgdx.DialogScenario) SpeechData(main.data.dialogue.SpeechData)

Aggregations

DialogScenario (eidolons.libgdx.DialogScenario)4 DialogueHandler (eidolons.game.battlecraft.logic.meta.scenario.dialogue.DialogueHandler)2 GameDialogue (eidolons.game.battlecraft.logic.meta.scenario.dialogue.GameDialogue)2 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)1 ScenarioMetaMaster (eidolons.game.battlecraft.logic.meta.scenario.ScenarioMetaMaster)1 Speech (eidolons.game.battlecraft.logic.meta.scenario.dialogue.speech.Speech)1 BattleClickListener (eidolons.libgdx.bf.mouse.BattleClickListener)1 ChainedStage (eidolons.libgdx.stage.ChainedStage)1 ArrayList (java.util.ArrayList)1 SpeechData (main.data.dialogue.SpeechData)1