mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 14:25:37 +00:00
Android: Fix touchscreen controller settings unpausing
This commit is contained in:
parent
49345a300c
commit
6e9a35806d
|
@ -517,9 +517,7 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
|
|||
|
||||
private void showTouchscreenControllerMenu() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
if (mGameTitle != null && !mGameTitle.isEmpty())
|
||||
builder.setTitle(mGameTitle);
|
||||
|
||||
builder.setTitle(R.string.dialog_touchscreen_controller_settings);
|
||||
builder.setItems(R.array.emulation_touchscreen_menu, (dialogInterface, i) -> {
|
||||
switch (i) {
|
||||
case 0: // Change Type
|
||||
|
@ -554,7 +552,10 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
|
|||
AlertDialog.Builder subBuilder = mTouchscreenController.createOpacityDialog(this);
|
||||
subBuilder.setOnDismissListener(dialog -> onMenuClosed());
|
||||
subBuilder.create().show();
|
||||
} else {
|
||||
onMenuClosed();
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -564,25 +565,30 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
|
|||
AlertDialog.Builder subBuilder = mTouchscreenController.createAddRemoveButtonDialog(this);
|
||||
subBuilder.setOnDismissListener(dialog -> onMenuClosed());
|
||||
subBuilder.create().show();
|
||||
} else {
|
||||
onMenuClosed();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: // Edit Layout
|
||||
{
|
||||
if (mTouchscreenController != null)
|
||||
if (mTouchscreenController != null) {
|
||||
// we deliberately don't call onMenuClosed() here to keep the system paused.
|
||||
// but we need to re-enable immersive mode to get proper editing.
|
||||
enableFullscreenImmersive();
|
||||
mTouchscreenController.startLayoutEditing();
|
||||
} else {
|
||||
// no controller
|
||||
onMenuClosed();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
builder.setOnDismissListener(dialogInterface -> onMenuClosed());
|
||||
builder.setOnCancelListener(dialogInterface -> onMenuClosed());
|
||||
builder.create().show();
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
private void showPatchesMenu() {
|
||||
|
|
|
@ -352,6 +352,10 @@ public class TouchscreenControllerView extends FrameLayout {
|
|||
mMovingName = null;
|
||||
mMovingLastX = 0.0f;
|
||||
mMovingLastY = 0.0f;
|
||||
|
||||
// unpause if we're paused (from the setting)
|
||||
if (AndroidHostInterface.getInstance().isEmulationThreadPaused())
|
||||
AndroidHostInterface.getInstance().pauseEmulationThread(false);
|
||||
}
|
||||
|
||||
private boolean handleEditingTouchEvent(MotionEvent event) {
|
||||
|
|
|
@ -225,4 +225,5 @@
|
|||
<string name="dialog_touchscreen_controller_type">Touchscreen Controller Type</string>
|
||||
<string name="dialog_touchscreen_controller_opacity">Touchscreen Controller Opacity</string>
|
||||
<string name="dialog_touchscreen_controller_buttons">Touchscreen Controller Buttons</string>
|
||||
<string name="dialog_touchscreen_controller_settings">Touchscreen Controller Settings</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue