use of org.terasology.engine.rendering.nui.layers.mainMenu.videoSettings.RenderingModuleSettingScreen in project Terasology by MovingBlocks.
the class StartPlayingScreen method initialise.
@Override
public void initialise() {
setAnimationSystem(MenuAnimationSystems.createDefaultSwipeAnimation());
WidgetUtil.trySubscribe(this, "close", button -> triggerBackAnimation());
WidgetUtil.trySubscribe(this, "play", button -> {
universeWrapper.setTargetWorld(targetWorld);
final GameManifest gameManifest = GameManifestProvider.createGameManifest(universeWrapper, moduleManager, config);
if (gameManifest != null) {
gameEngine.changeState(new StateLoading(gameManifest, (universeWrapper.getLoadingAsServer()) ? NetworkMode.DEDICATED_SERVER : NetworkMode.NONE));
} else {
getManager().createScreen(MessagePopup.ASSET_URI, MessagePopup.class).setMessage("Error", "Can't create new game!");
}
SimpleUri uri;
WorldInfo worldInfo;
// gameManifest.addWorld(worldInfo);
int i = 0;
for (WorldSetupWrapper world : worldSetupWrappers) {
if (world != targetWorld) {
i++;
uri = world.getWorldGeneratorInfo().getUri();
worldInfo = new WorldInfo(TerasologyConstants.MAIN_WORLD + i, world.getWorldName().toString(), world.getWorldGenerator().getWorldSeed(), (long) (WorldTime.DAY_LENGTH * WorldTime.NOON_OFFSET), uri);
gameManifest.addWorld(worldInfo);
config.getUniverseConfig().addWorldManager(worldInfo);
}
}
gameEngine.changeState(new StateLoading(gameManifest, (universeWrapper.getLoadingAsServer()) ? NetworkMode.DEDICATED_SERVER : NetworkMode.NONE));
});
WidgetUtil.trySubscribe(this, "mainMenu", button -> {
getManager().pushScreen("engine:mainMenuScreen");
});
WidgetUtil.trySubscribe(this, "renderingSettings", button -> {
RenderingModuleSettingScreen renderingModuleSettingScreen = (RenderingModuleSettingScreen) getManager().getScreen(RenderingModuleSettingScreen.ASSET_URI);
if (renderingModuleSettingScreen == null) {
renderingModuleSettingScreen = getManager().createScreen(RenderingModuleSettingScreen.ASSET_URI, RenderingModuleSettingScreen.class);
renderingModuleSettingScreen.setSubContext(this.subContext);
renderingModuleSettingScreen.postInit();
}
triggerForwardAnimation(renderingModuleSettingScreen);
});
}
Aggregations