Skip to content

Commit b0ad456

Browse files
committed
no pause game when playing recorded game or tester bot is running
1 parent cf0d41a commit b0ad456

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

blade-engine/src/com/bladecoder/engine/BladeEngine.java

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@
1515
******************************************************************************/
1616
package com.bladecoder.engine;
1717

18-
import java.nio.IntBuffer;
19-
import java.text.MessageFormat;
18+
import java.nio.IntBuffer;
19+
import java.text.MessageFormat;
2020

21-
import com.bladecoder.engine.BladeEngine;
22-
23-
import com.badlogic.gdx.ApplicationListener;
24-
import com.badlogic.gdx.Gdx;
25-
import com.badlogic.gdx.graphics.GL20;
26-
import com.badlogic.gdx.utils.BufferUtils;
21+
import com.badlogic.gdx.ApplicationListener;
22+
import com.badlogic.gdx.Gdx;
23+
import com.badlogic.gdx.graphics.GL20;
24+
import com.badlogic.gdx.utils.BufferUtils;
2725
import com.bladecoder.engine.assets.EngineAssetManager;
2826
import com.bladecoder.engine.model.World;
2927
import com.bladecoder.engine.ui.SceneScreen;
@@ -167,10 +165,18 @@ public void resize(int width, int height) {
167165
}
168166

169167
@Override
170-
public void pause() {
171-
EngineLogger.debug("GAME PAUSE");
172-
ui.pause();
173-
World.getInstance().saveGameState();
168+
public void pause() {
169+
SceneScreen scnScr = (SceneScreen) ui.getScreen(Screens.SCENE_SCREEN);
170+
boolean bot = scnScr.getTesterBot().isEnabled();
171+
boolean r = scnScr.getRecorder().isPlaying();
172+
173+
if(!bot && !r) {
174+
EngineLogger.debug("GAME PAUSE");
175+
ui.pause();
176+
World.getInstance().saveGameState();
177+
} else {
178+
EngineLogger.debug("NOT PAUSING WHEN BOT IS RUNNING OR PLAYING RECORDED GAME");
179+
}
174180
}
175181

176182
@Override

0 commit comments

Comments
 (0)