Unlink custom from JS-Dpad, Rename appropriately
The preference name was a little misleading. The preference has the same functionality, but was named to imply an inverse functionality. It is now disabled by default, which may need to be reversed if the number of games requiring the feature to split the two controls is outweighed by the number for which the feature disables joystick functionality.
This commit is contained in:
parent
223f818a33
commit
f3fde06548
|
@ -150,11 +150,7 @@ public class GL2JNIActivity extends Activity {
|
|||
String id = pad.portId[playerNum];
|
||||
pad.custom[playerNum] = prefs.getBoolean(Gamepad.pref_js_modified + id, false);
|
||||
pad.compat[playerNum] = prefs.getBoolean(Gamepad.pref_js_compat + id, false);
|
||||
if (pad.custom[playerNum] || pad.compat[playerNum]) {
|
||||
pad.joystick[playerNum] = prefs.getBoolean(Gamepad.pref_js_separate + id, false);
|
||||
} else {
|
||||
pad.joystick[playerNum] = true;
|
||||
}
|
||||
pad.joystick[playerNum] = prefs.getBoolean(Gamepad.pref_js_merged + id, false);
|
||||
if (InputDevice.getDevice(joy).getName()
|
||||
.contains(Gamepad.controllers_gamekey)) {
|
||||
if (pad.custom[playerNum]) {
|
||||
|
|
|
@ -162,11 +162,7 @@ public class GL2JNINative extends NativeActivity {
|
|||
String id = pad.portId[playerNum];
|
||||
pad.custom[playerNum] = prefs.getBoolean(Gamepad.pref_js_modified + id, false);
|
||||
pad.compat[playerNum] = prefs.getBoolean(Gamepad.pref_js_compat + id, false);
|
||||
if (pad.custom[playerNum] || pad.compat[playerNum]) {
|
||||
pad.joystick[playerNum] = prefs.getBoolean(Gamepad.pref_js_separate + id, false);
|
||||
} else {
|
||||
pad.joystick[playerNum] = true;
|
||||
}
|
||||
pad.joystick[playerNum] = prefs.getBoolean(Gamepad.pref_js_merged + id, false);
|
||||
if (InputDevice.getDevice(joy).getName()
|
||||
.contains(Gamepad.controllers_gamekey)) {
|
||||
// if (pad.custom[playerNum]) {
|
||||
|
|
|
@ -105,7 +105,7 @@ public class InputModFragment extends Fragment {
|
|||
public void onCheckedChanged(CompoundButton buttonView,
|
||||
boolean isChecked) {
|
||||
mPrefs.edit()
|
||||
.putBoolean(Gamepad.pref_js_separate + player,
|
||||
.putBoolean(Gamepad.pref_js_merged + player,
|
||||
isChecked).commit();
|
||||
}
|
||||
};
|
||||
|
@ -118,11 +118,6 @@ public class InputModFragment extends Fragment {
|
|||
mPrefs.edit()
|
||||
.putBoolean(Gamepad.pref_js_modified + player,
|
||||
isChecked).commit();
|
||||
if (isChecked) {
|
||||
switchJoystickDpadEnabled.setEnabled(true);
|
||||
} else if (!switchCompatibilityEnabled.isChecked()) {
|
||||
switchJoystickDpadEnabled.setEnabled(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -576,7 +571,7 @@ public class InputModFragment extends Fragment {
|
|||
|
||||
private void updateController(String player) {
|
||||
switchJoystickDpadEnabled.setChecked(mPrefs.getBoolean(
|
||||
Gamepad.pref_js_separate + player, false));
|
||||
Gamepad.pref_js_merged + player, false));
|
||||
switchModifiedLayoutEnabled.setChecked(mPrefs.getBoolean(
|
||||
Gamepad.pref_js_modified + player, false));
|
||||
switchCompatibilityEnabled.setChecked(mPrefs.getBoolean(
|
||||
|
|
|
@ -21,7 +21,7 @@ public class Gamepad {
|
|||
|
||||
public static final String pref_js_modified = "modified_key_layout";
|
||||
public static final String pref_js_compat = "controller_compat";
|
||||
public static final String pref_js_separate = "separate_joystick";
|
||||
public static final String pref_js_merged = "merged_joystick";
|
||||
public static final String pref_js_rbuttons = "right_buttons";
|
||||
|
||||
public static final String pref_button_a = "a_button";
|
||||
|
@ -226,7 +226,7 @@ public class Gamepad {
|
|||
for (int n = 0; n < 4; n++) {
|
||||
if (compat[n]) {
|
||||
String id = portId[n];
|
||||
joystick[n] = prefs.getBoolean(Gamepad.pref_js_separate + id, false);
|
||||
joystick[n] = prefs.getBoolean(Gamepad.pref_js_merged + id, false);
|
||||
getCompatibilityMap(n, portId[n], prefs);
|
||||
initJoyStickLayout(n);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue