Merge pull request #7288 from zackhow/wiisettings

Android: Fix emulated wiimotes via controller
This commit is contained in:
Pierre Bourdon 2018-07-30 11:42:05 +02:00 committed by GitHub
commit 22108bbae7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 15 deletions

View File

@ -18,14 +18,14 @@ public enum MenuTag
GCPAD_2("gcpad", 1), GCPAD_2("gcpad", 1),
GCPAD_3("gcpad", 2), GCPAD_3("gcpad", 2),
GCPAD_4("gcpad", 3), GCPAD_4("gcpad", 3),
WIIMOTE_1("wiimote", 1), WIIMOTE_1("wiimote", 4),
WIIMOTE_2("wiimote", 2), WIIMOTE_2("wiimote", 5),
WIIMOTE_3("wiimote", 3), WIIMOTE_3("wiimote", 6),
WIIMOTE_4("wiimote", 4), WIIMOTE_4("wiimote", 7),
WIIMOTE_EXTENSION_1("wiimote_extension", 1), WIIMOTE_EXTENSION_1("wiimote_extension", 4),
WIIMOTE_EXTENSION_2("wiimote_extension", 2), WIIMOTE_EXTENSION_2("wiimote_extension", 5),
WIIMOTE_EXTENSION_3("wiimote_extension", 3), WIIMOTE_EXTENSION_3("wiimote_extension", 6),
WIIMOTE_EXTENSION_4("wiimote_extension", 4); WIIMOTE_EXTENSION_4("wiimote_extension", 7);
private String tag; private String tag;
private int subType = -1; private int subType = -1;

View File

@ -329,11 +329,11 @@ public final class SettingsFragmentPresenter
{ {
if (!mSettings.get(SettingsFile.SETTINGS_WIIMOTE).isEmpty()) if (!mSettings.get(SettingsFile.SETTINGS_WIIMOTE).isEmpty())
{ {
for (int i = 1; i <= 4; i++) for (int i = 0; i < 4; i++)
{ {
// TODO This wiimote_0 + i business is quite the hack. It should work, but only if the definitions are kept together and in order. // TODO This wiimote_0 + i business is quite the hack. It should work, but only if the definitions are kept together and in order.
Setting wiimoteSetting = mSettings.get(SettingsFile.SETTINGS_WIIMOTE).get(SettingsFile.SECTION_WIIMOTE + i).getSetting(SettingsFile.KEY_WIIMOTE_TYPE); Setting wiimoteSetting = mSettings.get(SettingsFile.SETTINGS_WIIMOTE).get(SettingsFile.SECTION_WIIMOTE + i).getSetting(SettingsFile.KEY_WIIMOTE_TYPE);
sl.add(new SingleChoiceSetting(SettingsFile.KEY_WIIMOTE_TYPE, SettingsFile.SECTION_WIIMOTE + i, SettingsFile.SETTINGS_WIIMOTE, R.string.wiimote_0 + i - 1, 0, R.array.wiimoteTypeEntries, R.array.wiimoteTypeValues, 0, wiimoteSetting, MenuTag.getWiimoteMenuTag(i))); sl.add(new SingleChoiceSetting(SettingsFile.KEY_WIIMOTE_TYPE, SettingsFile.SECTION_WIIMOTE + i, SettingsFile.SETTINGS_WIIMOTE, R.string.wiimote_4 + i, 0, R.array.wiimoteTypeEntries, R.array.wiimoteTypeValues, 0, wiimoteSetting, MenuTag.getWiimoteMenuTag(i+4)));
} }
} }
} }

View File

@ -23,11 +23,12 @@
<string name="analog_threshold">Analog Threshold (Low value = High sensitivity)</string> <string name="analog_threshold">Analog Threshold (Low value = High sensitivity)</string>
<!-- WARNING Do not move these controller entries AT ALL COSTS! They are indexed with ints, and an assumption <!-- WARNING Do not move these controller entries AT ALL COSTS! They are indexed with ints, and an assumption
is made that they are placed together so that we can access them sequentially in a loop. --> is made that they are placed together so that we can access them sequentially in a loop.
<string name="wiimote_0">Wii Remote 1</string> Wiimotes start at 4 since they are mapped to padID's 4-7 in the native code.-->
<string name="wiimote_1">Wii Remote 2</string> <string name="wiimote_4">Wii Remote 1</string>
<string name="wiimote_2">Wii Remote 3</string> <string name="wiimote_5">Wii Remote 2</string>
<string name="wiimote_3">Wii Remote 4</string> <string name="wiimote_6">Wii Remote 3</string>
<string name="wiimote_7">Wii Remote 4</string>
<!-- END WARNING --> <!-- END WARNING -->
<string name="wiimote_extensions">Extension</string> <string name="wiimote_extensions">Extension</string>