mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 23:28:52 -04:00
[Custom controls] Special buttons fix; Fix key index
This commit is contained in:
parent
54341d7cfe
commit
9e6fbfd2d7
@ -147,7 +147,7 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
||||
if (properties.keycode < 0) {
|
||||
spinnerKeycode.setSelection(properties.keycode + 5);
|
||||
} else {
|
||||
spinnerKeycode.setSelection(AndroidLWJGLKeycode.getIndexByLWJGLKey(properties.keycode + 2));
|
||||
spinnerKeycode.setSelection(AndroidLWJGLKeycode.getIndexByLWJGLKey(properties.keycode + 5));
|
||||
}
|
||||
spinnerKeycode.setOnItemSelectedListener(new Spinner.OnItemSelectedListener(){
|
||||
|
||||
@ -173,7 +173,7 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
||||
if (editName.getText().toString().isEmpty()) {
|
||||
editName.setError(view.getResources().getString(R.string.global_error_field_empty));
|
||||
} else {
|
||||
properties.keycode = AndroidLWJGLKeycode.getKeyIndex(spinnerKeycode.getSelectedItemPosition()) - 2;
|
||||
properties.keycode = AndroidLWJGLKeycode.getKeyIndex(spinnerKeycode.getSelectedItemPosition()) - 5;
|
||||
properties.name = editName.getText().toString();
|
||||
properties.hidden = checkHidden.isChecked();
|
||||
|
||||
|
@ -93,6 +93,10 @@ public class ControlData implements Cloneable
|
||||
}
|
||||
|
||||
public ControlData clone() {
|
||||
return new ControlData(name, keycode, x, y, width, height);
|
||||
if (this instanceof DynamicControlData) {
|
||||
return new DynamicControlData(name, keycode, ((DynamicControlData) this).dynamicX, ((DynamicControlData) this).dynamicY, width, height);
|
||||
} else {
|
||||
return new ControlData(name, keycode, x, y, width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ public class DynamicControlData extends ControlData {
|
||||
* bigger device or vice versa.
|
||||
*/
|
||||
|
||||
private String dynamicX, dynamicY;
|
||||
public String dynamicX, dynamicY;
|
||||
|
||||
public DynamicControlData() {
|
||||
this("", LWJGLGLFWKeycode.GLFW_KEY_UNKNOWN);
|
||||
|
Loading…
x
Reference in New Issue
Block a user