mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-16 02:59:49 +01:00
Touch control layout: Confirm before resetting
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c7c5fc0ac6
commit
c3db109525
1 file changed
+14
-7
@@ -591,14 +591,21 @@ ViewLayoutMode TouchControlLayoutScreen::LayoutMode() const {
|
||||
}
|
||||
|
||||
void TouchControlLayoutScreen::OnReset(UI::EventParams &e) {
|
||||
INFO_LOG(Log::G3D, "Resetting touch control layout to default.");
|
||||
auto co = GetI18NCategory(I18NCat::CONTROLS);
|
||||
auto di = GetI18NCategory(I18NCat::DIALOG);
|
||||
screenManager()->push(new UI::MessagePopupScreen(di->T("Reset"), co->T("Are you sure you want to reset the touch control layout?"), di->T("Reset"), di->T("Cancel"), [this](bool yes) {
|
||||
if (!yes) {
|
||||
return;
|
||||
}
|
||||
INFO_LOG(Log::G3D, "Resetting touch control layout to default.");
|
||||
|
||||
const Bounds &bounds = GetLayoutBounds(*screenManager()->getUIContext());
|
||||
const DeviceOrientation orientation = GetDeviceOrientation();
|
||||
TouchControlConfig &touch = g_Config.GetTouchControlsConfig(orientation);
|
||||
touch.ResetLayout();
|
||||
InitPadLayout(&touch, orientation, bounds.w, bounds.h);
|
||||
RecreateViews();
|
||||
const Bounds &bounds = GetLayoutBounds(*screenManager()->getUIContext());
|
||||
const DeviceOrientation orientation = GetDeviceOrientation();
|
||||
TouchControlConfig &touch = g_Config.GetTouchControlsConfig(orientation);
|
||||
touch.ResetLayout();
|
||||
InitPadLayout(&touch, orientation, bounds.w, bounds.h);
|
||||
RecreateViews();
|
||||
}));
|
||||
};
|
||||
|
||||
void TouchControlLayoutScreen::dialogFinished(const Screen *dialog, DialogResult result) {
|
||||
|
||||
Reference in new issue
Block a user