Search in sources :

Example 1 with BFDataCreatedEvent

use of eidolons.libgdx.bf.BFDataCreatedEvent in project Eidolons by IDemiurge.

the class Spawner method spawnDone.

protected void spawnDone() {
    // TODO selective??
    // getGame().getMetaMaster().getPartyManager().getParty().getMembers()
    List<Unit> unitsList = new ArrayList<>();
    unitsList.addAll(game.getUnits());
    getFacingAdjuster().adjustFacing(unitsList);
    final Integer cellsX = game.getDungeon().getCellsX();
    final Integer cellsY = game.getDungeon().getCellsY();
    GuiEventManager.trigger(SCREEN_LOADED, new BFDataCreatedEvent(cellsX, cellsY, game.getBfObjects()));
// WaitMaster.waitForInput(WAIT_OPERATIONS.DUNGEON_SCREEN_READY);
}
Also used : ArrayList(java.util.ArrayList) BFDataCreatedEvent(eidolons.libgdx.bf.BFDataCreatedEvent) Unit(eidolons.entity.obj.unit.Unit)

Example 2 with BFDataCreatedEvent

use of eidolons.libgdx.bf.BFDataCreatedEvent in project Eidolons by IDemiurge.

the class DungeonScreen method afterLoad.

@Override
protected void afterLoad() {
    try {
        cam = (OrthographicCamera) viewPort.getCamera();
        controller = new DungeonInputController(cam);
        particleManager = new ParticleManager();
        soundMaster = new DC_SoundMaster(this);
        final BFDataCreatedEvent param = ((BFDataCreatedEvent) data.getParams().get());
        gridPanel = new GridPanel(param.getGridW(), param.getGridH()).init(param.getObjects());
    } catch (Exception e) {
        main.system.ExceptionMaster.printStackTrace(e);
    }
    gridStage.addActor(gridPanel);
    gridStage.addActor(particleManager.getEmitterMap());
    try {
        controller.setDefaultPos();
    } catch (Exception e) {
        main.system.ExceptionMaster.printStackTrace(e);
    }
    bindEvents();
    try {
        Unit unit = null;
        if (Eidolons.game.getMetaMaster() == null) {
            unit = Eidolons.game.getMetaMaster().getPartyManager().getParty().getLeader();
        } else
            unit = (Unit) Eidolons.game.getPlayer(true).getHeroObj();
        Vector2 unitPosition = GridMaster.getCenteredPos(unit.getCoordinates());
        cameraPan(unitPosition);
    } catch (Exception e) {
        main.system.ExceptionMaster.printStackTrace(e);
    }
    WaitMaster.receiveInput(WAIT_OPERATIONS.DUNGEON_SCREEN_READY, true);
    WaitMaster.markAsComplete(WAIT_OPERATIONS.DUNGEON_SCREEN_READY);
}
Also used : Vector2(com.badlogic.gdx.math.Vector2) DungeonInputController(eidolons.libgdx.bf.mouse.DungeonInputController) DC_SoundMaster(eidolons.system.audio.DC_SoundMaster) GridPanel(eidolons.libgdx.bf.grid.GridPanel) BFDataCreatedEvent(eidolons.libgdx.bf.BFDataCreatedEvent) ParticleManager(eidolons.libgdx.anims.particles.ParticleManager) Unit(eidolons.entity.obj.unit.Unit)

Aggregations

Unit (eidolons.entity.obj.unit.Unit)2 BFDataCreatedEvent (eidolons.libgdx.bf.BFDataCreatedEvent)2 Vector2 (com.badlogic.gdx.math.Vector2)1 ParticleManager (eidolons.libgdx.anims.particles.ParticleManager)1 GridPanel (eidolons.libgdx.bf.grid.GridPanel)1 DungeonInputController (eidolons.libgdx.bf.mouse.DungeonInputController)1 DC_SoundMaster (eidolons.system.audio.DC_SoundMaster)1 ArrayList (java.util.ArrayList)1