Search in sources :

Example 1 with RespawnRequestEvent

use of org.terasology.engine.logic.players.event.RespawnRequestEvent in project Terasology by MovingBlocks.

the class DeathScreen method initialise.

@Override
public void initialise() {
    deathDetails = find("deathDetails", UILabel.class);
    WidgetUtil.trySubscribe(this, "respawn", widget -> {
        localPlayer.getClientEntity().send(new RespawnRequestEvent());
        getManager().closeScreen(DeathScreen.this);
    });
    WidgetUtil.trySubscribe(this, "settings", widget -> getManager().pushScreen("settingsMenuScreen"));
    WidgetUtil.trySubscribe(this, "mainMenu", widget -> {
        localPlayer.getClientEntity().send(new RespawnRequestEvent());
        gameEngine.changeState(new StateMainMenu());
    });
    WidgetUtil.trySubscribe(this, "exitGame", widget -> CoreRegistry.get(GameEngine.class).shutdown());
}
Also used : UILabel(org.terasology.nui.widgets.UILabel) RespawnRequestEvent(org.terasology.engine.logic.players.event.RespawnRequestEvent) StateMainMenu(org.terasology.engine.core.modes.StateMainMenu)

Aggregations

StateMainMenu (org.terasology.engine.core.modes.StateMainMenu)1 RespawnRequestEvent (org.terasology.engine.logic.players.event.RespawnRequestEvent)1 UILabel (org.terasology.nui.widgets.UILabel)1