Search in sources :

Example 1 with Speech

use of eidolons.game.battlecraft.logic.meta.scenario.dialogue.speech.Speech in project Eidolons by IDemiurge.

the class DialogueFactory method createDialogue.

public LinearDialogue createDialogue(String name, String idSequence) {
    Speech parent = null;
    Speech root = null;
    for (String ID : StringMaster.open(idSequence)) {
        Speech speech = getSpeech(StringMaster.getInteger(ID));
        String pathRoot = getFileRootPath();
        // PathFinder.getScenariosPath() +p +StringMaster.getPathSeparator()+
        // TextMaster.getLocale();
        String path = PathFinder.getEnginePath() + DialogueLineFormatter.getLinesFilePath(pathRoot);
        speech.getSpeechBuilder(path).buildSpeech(speech);
        if (root == null)
            root = speech;
        if (parent != null) {
            parent.addChild(speech);
            speech.init(master, parent);
        }
        parent = speech;
    }
    return new LinearDialogue(root, name);
}
Also used : Speech(eidolons.game.battlecraft.logic.meta.scenario.dialogue.speech.Speech)

Example 2 with Speech

use of eidolons.game.battlecraft.logic.meta.scenario.dialogue.speech.Speech in project Eidolons by IDemiurge.

the class SceneFactory method getScenes.

// TODO Speech?
public static List<DialogScenario> getScenes(GameDialogue dialogue) {
    Speech speech = dialogue.getRoot();
    List<SpeechData> fullData = new ArrayList<>();
    while (true) {
        fullData.add(speech.getData());
        if (speech.getChildren().isEmpty())
            break;
        speech = speech.getChildren().get(0);
    }
    return getScenes(fullData);
}
Also used : ArrayList(java.util.ArrayList) Speech(eidolons.game.battlecraft.logic.meta.scenario.dialogue.speech.Speech) SpeechData(main.data.dialogue.SpeechData)

Example 3 with Speech

use of eidolons.game.battlecraft.logic.meta.scenario.dialogue.speech.Speech 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

Speech (eidolons.game.battlecraft.logic.meta.scenario.dialogue.speech.Speech)3 ArrayList (java.util.ArrayList)2 SpeechData (main.data.dialogue.SpeechData)2 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 DialogScenario (eidolons.libgdx.DialogScenario)1