Search in sources :

Example 1 with ScreenData

use of eidolons.libgdx.screens.ScreenData in project Eidolons by IDemiurge.

the class Crawler method main.

public static void main(String[] args) {
    FAST_DC.FAST_MODE = false;
    ExplorationMaster.setTestMode(true);
    DC_Engine.jarInit();
    FontMaster.init();
    GuiManager.init();
    int index = DialogMaster.optionChoice(launch_options, "Choose the type of Eidolons game you want to launch...");
    List<String> parts = null;
    if (index == 0) {
        String data = FileManager.readFile(launchDataPath);
        parts = StringMaster.openContainer(data);
        index = 1;
    }
    if (index == 2) {
    // random  = true;
    // parts = Collections.nCopies(2, "");
    } else if (index == 3) {
        FAST_DC.main(new String[] { "" + (Arrays.asList(PresetLauncher.LAUNCH_OPTIONS)).indexOf(StringMaster.getWellFormattedString(LAUNCH.EXPLORATION.toString())) });
        return;
    } else if (index == 4) {
        FAST_DC.main(new String[] { "" + (Arrays.asList(PresetLauncher.LAUNCH_OPTIONS)).indexOf(StringMaster.getWellFormattedString(LAUNCH.EXPLORATION_TEST.toString())) });
        return;
    }
    DemoLauncher.main(null);
    DC_Engine.mainMenuInit();
    String dungeon = parts == null ? "crawl" + new FileChooser(PathFinder.getDungeonLevelFolder() + "crawl").launch("", "") : parts.get(0);
    launchData += dungeon;
    dungeon = StringMaster.removePreviousPathSegments(dungeon, PathFinder.getDungeonLevelFolder());
    ScreenData data = new ScreenData(ScreenType.BATTLE, dungeon);
    GameLauncher launcher = new GameLauncher(GAME_SUBCLASS.TEST);
    Ref ref = new Ref();
    Condition conditions = new Conditions();
    launcher.PLAYER_PARTY = parts == null ? ListChooser.chooseType(DC_TYPE.CHARS, ref, conditions) : parts.get(1);
    launchData += StringMaster.SEPARATOR + launcher.PLAYER_PARTY;
    launcher.setDungeon(dungeon);
    launcher.PARTY_CODE = CODE.PRESET;
    launcher.ENEMY_CODE = CODE.NONE;
    GuiEventManager.trigger(GuiEventType.SWITCH_SCREEN, data);
    DC_Engine.gameStartInit();
    DC_Game game = launcher.initDC_Game();
    game.start(true);
    if (!StringMaster.isEmpty(launchData)) {
        FileManager.write(launchData, launchDataPath);
    }
}
Also used : Condition(main.elements.conditions.Condition) Ref(main.entity.Ref) FileChooser(main.swing.generic.components.editors.FileChooser) GameLauncher(eidolons.game.core.launch.GameLauncher) DC_Game(eidolons.game.core.game.DC_Game) Conditions(main.elements.conditions.Conditions) ScreenData(eidolons.libgdx.screens.ScreenData)

Example 2 with ScreenData

use of eidolons.libgdx.screens.ScreenData in project Eidolons by IDemiurge.

the class TutorialLauncher method main.

public static void main(String[] args) {
    DemoLauncher.main(null);
    DC_Engine.mainMenuInit();
    TutorialMetaMaster master = new TutorialMetaMaster("");
    master.init();
    ScreenData data = new ScreenData(ScreenType.BATTLE, "name");
    GuiEventManager.trigger(GuiEventType.SWITCH_SCREEN, data);
    DC_Engine.gameStartInit();
    master.preStart();
    // master.getGame().init( );
    master.getGame().dungeonInit();
    master.getGame().battleInit();
    master.getGame().start(true);
// DungeonScreen.getInstance().hideLoader();
}
Also used : TutorialMetaMaster(eidolons.game.battlecraft.logic.meta.tutorial.TutorialMetaMaster) ScreenData(eidolons.libgdx.screens.ScreenData)

Example 3 with ScreenData

use of eidolons.libgdx.screens.ScreenData in project Eidolons by IDemiurge.

the class NewGamePanel method updateAct.

@Override
public void updateAct(float delta) {
    final List<ScreenData> dataList = (List<ScreenData>) getUserObject();
    dataList.forEach(data -> {
        TextButton button = getMainMenuButton(data.getName());
        button.addListener(new ClickListener() {

            @Override
            public void clicked(InputEvent event, float x, float y) {
                if (choiceCallback != null) {
                    choiceCallback.accept(data);
                }
            }
        });
        add(button);
        row();
    });
    addEmptyRow(0, 30);
    back = getMainMenuButton("back");
    if (backListener != null) {
        back.addListener(backListener);
    }
    add(back);
}
Also used : TextButton(com.badlogic.gdx.scenes.scene2d.ui.TextButton) List(java.util.List) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener) SimpleClickListener(eidolons.libgdx.gui.SimpleClickListener) ScreenData(eidolons.libgdx.screens.ScreenData)

Example 4 with ScreenData

use of eidolons.libgdx.screens.ScreenData in project Eidolons by IDemiurge.

the class Launcher method launchDC.

public static void launchDC(String partyName, boolean forceBattleInit) {
    // initSave(Launcher.getLoadPath());
    /*
         * initObjectString buffs and dynamic params non-bf objects - items,
		 */
    DC_Game game = Eidolons.game;
    try {
        initFullData();
        boolean first = false;
        if (game == null) {
            first = true;
            DC_Engine.gameInit();
        }
        DemoLauncher.main(new String[] {});
        ScreenData data = new ScreenData(ScreenType.BATTLE, "Loading...");
        GuiEventManager.trigger(GuiEventType.SWITCH_SCREEN, data);
        Eidolons.initScenario(new ScenarioMetaMaster(ScenarioLauncher.CRAWL));
        try {
            Eidolons.mainGame.getMetaMaster().getGame().dungeonInit();
        } catch (Exception e) {
            main.system.ExceptionMaster.printStackTrace(e);
        }
        // GdxLauncher.main(new String[]{});
        game = Simulation.getGame();
        if (game == null) {
            game = new DC_Game(false);
        }
        game.init();
        game.setSimulation(true);
        CharacterCreator.getHeroManager().prebattleCleanSave();
        game.setSimulation(false);
        game.setDebugMode(isDEBUG_MODE_DEFAULT());
        if (CharacterCreator.isArcadeMode()) {
            PartyHelper.initArcade();
        }
        PartyHelper.getParty().setGame(game);
        if (forceBattleInit || !game.isBattleInit()) {
            game.battleInit();
        }
        game.start(first);
    } catch (Exception e) {
        main.system.ExceptionMaster.printStackTrace(e);
        game.setSimulation(true);
    }
    // setView(VIEWS.DC);
    try {
        createGame();
    } catch (Exception e) {
        main.system.ExceptionMaster.printStackTrace(e);
    }
}
Also used : ScenarioMetaMaster(eidolons.game.battlecraft.logic.meta.scenario.ScenarioMetaMaster) DC_Game(eidolons.game.core.game.DC_Game) ScreenData(eidolons.libgdx.screens.ScreenData)

Example 5 with ScreenData

use of eidolons.libgdx.screens.ScreenData in project Eidolons by IDemiurge.

the class MacroGameLoop method startBattle.

private void startBattle(Place entered) {
    // stop all the map related stuff
    /*
        we need
        1) dungeon level
        2) party data
        3)
         */
    // TODO blackout
    String name = ScenarioGenerator.generateScenarioType(entered).getName();
    // GuiEventManager.trigger(GuiEventType.SWITCH_SCREEN,
    // new ScreenData(ScreenType.PRE_BATTLE, "Wait..."));
    // Eidolons.initScenario(new ScenarioMetaMaster(name));
    ScreenData data = new ScreenData(ScreenType.BATTLE, // entered.getName()
    name);
    // new SceneFactory("Test")
    GuiEventManager.trigger(GuiEventType.SWITCH_SCREEN, data);
// DC_Engine.gameStartInit();
// Eidolons.mainGame.getMetaMaster().getGame().dungeonInit();
// Eidolons.mainGame.getMetaMaster().getGame().battleInit();
// Eidolons.mainGame.getMetaMaster().getGame().start(true);
}
Also used : ScreenData(eidolons.libgdx.screens.ScreenData)

Aggregations

ScreenData (eidolons.libgdx.screens.ScreenData)13 ScenarioMetaMaster (eidolons.game.battlecraft.logic.meta.scenario.ScenarioMetaMaster)2 DC_Game (eidolons.game.core.game.DC_Game)2 EventCallbackParam (main.system.EventCallbackParam)2 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)1 TextButton (com.badlogic.gdx.scenes.scene2d.ui.TextButton)1 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)1 TutorialMetaMaster (eidolons.game.battlecraft.logic.meta.tutorial.TutorialMetaMaster)1 GameLauncher (eidolons.game.core.launch.GameLauncher)1 SimpleClickListener (eidolons.libgdx.gui.SimpleClickListener)1 List (java.util.List)1 Condition (main.elements.conditions.Condition)1 Conditions (main.elements.conditions.Conditions)1 Ref (main.entity.Ref)1 FileChooser (main.swing.generic.components.editors.FileChooser)1