Package org.terasology.rendering.nui.layers.mainMenu.savedGames

Examples of org.terasology.rendering.nui.layers.mainMenu.savedGames.GameInfo


        });

        WidgetUtil.trySubscribe(this, "load", new ActivateEventListener() {
            @Override
            public void onActivated(UIWidget button) {
                GameInfo gameInfo = gameList.getSelection();
                if (gameInfo != null) {
                    loadGame(gameInfo);
                }
            }
        });

        WidgetUtil.trySubscribe(this, "delete", new ActivateEventListener() {
            @Override
            public void onActivated(UIWidget button) {
                GameInfo gameInfo = gameList.getSelection();
                if (gameInfo != null) {
                    Path world = PathManager.getInstance().getSavePath(gameInfo.getManifest().getTitle());
                    try {
                        FilesUtil.recursiveDelete(world);
                        gameList.getList().remove(gameInfo);
                        gameList.setSelection(null);
                    } catch (Exception e) {
View Full Code Here


            }
        }
    }

    private static GameManifest getLatestGameManifest() {
        GameInfo latestGame = null;
        List<GameInfo> savedGames = GameProvider.getSavedGames();
        for (GameInfo savedGame : savedGames) {
            if (latestGame == null || savedGame.getTimestamp().after(latestGame.getTimestamp())) {
                latestGame = savedGame;
            }
        }

        if (latestGame == null) {
            return null;
        }

        return latestGame.getManifest();
    }
View Full Code Here

TOP

Related Classes of org.terasology.rendering.nui.layers.mainMenu.savedGames.GameInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.