use of org.terasology.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 -> {
CoreRegistry.get(LocalPlayer.class).getClientEntity().send(new RespawnRequestEvent());
getManager().closeScreen(DeathScreen.this);
});
WidgetUtil.trySubscribe(this, "settings", widget -> getManager().pushScreen("settingsMenuScreen"));
WidgetUtil.trySubscribe(this, "mainMenu", widget -> {
CoreRegistry.get(LocalPlayer.class).getClientEntity().send(new RespawnRequestEvent());
CoreRegistry.get(GameEngine.class).changeState(new StateMainMenu());
});
WidgetUtil.trySubscribe(this, "exitGame", widget -> CoreRegistry.get(GameEngine.class).shutdown());
}
Aggregations