mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-30 13:58:03 +03:00
Android: Add Default and Clear actions for controllers
This commit is contained in:
parent
ea3200d4ba
commit
8b78f73e80
4 changed files with 52 additions and 0 deletions
|
@ -31,6 +31,10 @@ public class EmulatedController
|
|||
|
||||
public native void updateSingleControlReference(ControlReference controlReference);
|
||||
|
||||
public native void loadDefaultSettings();
|
||||
|
||||
public native void clearSettings();
|
||||
|
||||
public static native EmulatedController getGcPad(int controllerIndex);
|
||||
|
||||
public static native EmulatedController getWiimote(int controllerIndex);
|
||||
|
|
|
@ -1213,6 +1213,13 @@ public final class SettingsFragmentPresenter
|
|||
mView.setMappingAllDevices(newValue);
|
||||
}
|
||||
}, R.string.input_device_all_devices, R.string.input_device_all_devices_description));
|
||||
|
||||
sl.add(new RunRunnable(mContext, R.string.input_reset_to_default,
|
||||
R.string.input_reset_to_default_description, R.string.input_reset_warning, 0, true,
|
||||
() -> loadDefaultControllerSettings(controller)));
|
||||
|
||||
sl.add(new RunRunnable(mContext, R.string.input_clear, R.string.input_clear_description,
|
||||
R.string.input_reset_warning, 0, true, () -> clearControllerSettings(controller)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1280,6 +1287,18 @@ public final class SettingsFragmentPresenter
|
|||
}
|
||||
}
|
||||
|
||||
private void loadDefaultControllerSettings(EmulatedController controller)
|
||||
{
|
||||
controller.loadDefaultSettings();
|
||||
mView.getAdapter().notifyAllSettingsChanged();
|
||||
}
|
||||
|
||||
private void clearControllerSettings(EmulatedController controller)
|
||||
{
|
||||
controller.clearSettings();
|
||||
mView.getAdapter().notifyAllSettingsChanged();
|
||||
}
|
||||
|
||||
private static int getLogVerbosityEntries()
|
||||
{
|
||||
// Value obtained from LogLevel in Common/Logging/Log.h
|
||||
|
|
|
@ -30,6 +30,11 @@
|
|||
<string name="input_device">Device</string>
|
||||
<string name="input_device_all_devices">Create Mappings for Other Devices</string>
|
||||
<string name="input_device_all_devices_description">Detects inputs from all devices, not just the selected device.</string>
|
||||
<string name="input_reset_to_default">Default</string>
|
||||
<string name="input_reset_to_default_description">Reset settings for this controller to the default.</string>
|
||||
<string name="input_clear">Clear</string>
|
||||
<string name="input_clear_description">Clear settings for this controller.</string>
|
||||
<string name="input_reset_warning">Are you sure? Your current controller settings will be deleted.</string>
|
||||
|
||||
<string name="input_binding">Input Binding</string>
|
||||
<string name="input_binding_description">Press or move an input to bind it to %1$s.</string>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue