DEADSOFTWARE

Fix 'Load game' button
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / GameScreen.java
index 682319d184b3e7cbf1a562f8350ff4dead48e7bd..37dc45e9a438fb415510d1d241ce5af1ad1c0c98 100644 (file)
@@ -53,24 +53,29 @@ public class GameScreen implements Screen {
                 menu();
                 break;
 
-            case GOTO_NEW_GAME:
+            case NEW_GAME:
                 gameProc = new GameProc();
                 renderer = gameProc.renderer;
                 Gdx.input.setInputProcessor(new InputHandlerGame(gameProc));
                 CaveGame.STATE = AppState.GAME_PLAY;
                 break;
 
-            case GOTO_LOAD_GAME:_GAME:
+            case LOAD_GAME:
                 gameProc = GameSaver.load();
                 renderer = gameProc.renderer;
                 Gdx.input.setInputProcessor(new InputHandlerGame(gameProc));
                 CaveGame.STATE = AppState.GAME_PLAY;
                 break;
 
+            case SAVE_GAME:
+                GameSaver.save(gameProc);
+                CaveGame.STATE = AppState.MENU_MAIN;
+                break;
+
             case GOTO_MENU:
+                menuRenderer = new MenuRenderer(CaveGame.TOUCH?320:480);
                 renderer = menuRenderer;
                 Gdx.input.setInputProcessor(new InputHandlerMenu(menuRenderer));
-                CaveGame.STATE = AppState.MENU_MAIN;
                 break;
         }
         renderer.render();