|
@@ -191,6 +191,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
|
protected void onMainPause() {}
|
|
protected void onMainPause() {}
|
|
protected void onMainResume() {}
|
|
protected void onMainResume() {}
|
|
protected void onMainDestroy() {}
|
|
protected void onMainDestroy() {}
|
|
|
|
+ protected boolean onMainBackPressed() { return false; }
|
|
|
|
|
|
protected void onGLDrawFrame(GL10 gl) {}
|
|
protected void onGLDrawFrame(GL10 gl) {}
|
|
protected void onGLSurfaceChanged(GL10 gl, int width, int height) {} // singletons will always miss first onGLSurfaceChanged call
|
|
protected void onGLSurfaceChanged(GL10 gl, int width, int height) {} // singletons will always miss first onGLSurfaceChanged call
|
|
@@ -727,9 +728,19 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
|
*/
|
|
*/
|
|
|
|
|
|
@Override public void onBackPressed() {
|
|
@Override public void onBackPressed() {
|
|
|
|
+ boolean shouldQuit = true;
|
|
|
|
+
|
|
|
|
+ for(int i=0;i<singleton_count;i++) {
|
|
|
|
+ if (singletons[i].onMainBackPressed()) {
|
|
|
|
+ shouldQuit = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
System.out.printf("** BACK REQUEST!\n");
|
|
System.out.printf("** BACK REQUEST!\n");
|
|
- GodotLib.quit();
|
|
|
|
|
|
+
|
|
|
|
+ if (shouldQuit) {
|
|
|
|
+ GodotLib.quit();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public void forceQuit() {
|
|
public void forceQuit() {
|