use of org.terasology.engine.modes.StateMainMenu in project Terasology by MovingBlocks.
the class TeraEd method run.
public void run() {
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
try {
for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (Exception e) {
// If Nimbus is not available, you can set the GUI to another look and feel.
logger.warn("Failed to set look and feel to Nimbus", e);
}
try {
LwjglPortlet lwjglPortlet = new LwjglPortlet();
PathManager.getInstance().useDefaultHomePath();
engine = new TerasologyEngineBuilder().add(new LwjglGraphics()).add(new LwjglTimer()).add(new LwjglAudio()).add(new LwjglInput()).add(lwjglPortlet).build();
sceneProperties = new SceneProperties(engine);
mainWindow = new MainWindow(this, engine);
lwjglPortlet.setCustomViewport(mainWindow.getViewport());
engine.subscribeToStateChange(mainWindow);
engine.run(new StateMainMenu());
} catch (Throwable t) {
logger.error("Uncaught Exception", t);
}
}
Aggregations