mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 15:48:26 -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) {
|
if (properties.keycode < 0) {
|
||||||
spinnerKeycode.setSelection(properties.keycode + 5);
|
spinnerKeycode.setSelection(properties.keycode + 5);
|
||||||
} else {
|
} else {
|
||||||
spinnerKeycode.setSelection(AndroidLWJGLKeycode.getIndexByLWJGLKey(properties.keycode + 2));
|
spinnerKeycode.setSelection(AndroidLWJGLKeycode.getIndexByLWJGLKey(properties.keycode + 5));
|
||||||
}
|
}
|
||||||
spinnerKeycode.setOnItemSelectedListener(new Spinner.OnItemSelectedListener(){
|
spinnerKeycode.setOnItemSelectedListener(new Spinner.OnItemSelectedListener(){
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ public class ActionPopupWindow extends PinnedPopupWindow implements OnClickListe
|
|||||||
if (editName.getText().toString().isEmpty()) {
|
if (editName.getText().toString().isEmpty()) {
|
||||||
editName.setError(view.getResources().getString(R.string.global_error_field_empty));
|
editName.setError(view.getResources().getString(R.string.global_error_field_empty));
|
||||||
} else {
|
} else {
|
||||||
properties.keycode = AndroidLWJGLKeycode.getKeyIndex(spinnerKeycode.getSelectedItemPosition()) - 2;
|
properties.keycode = AndroidLWJGLKeycode.getKeyIndex(spinnerKeycode.getSelectedItemPosition()) - 5;
|
||||||
properties.name = editName.getText().toString();
|
properties.name = editName.getText().toString();
|
||||||
properties.hidden = checkHidden.isChecked();
|
properties.hidden = checkHidden.isChecked();
|
||||||
|
|
||||||
|
@ -93,6 +93,10 @@ public class ControlData implements Cloneable
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ControlData clone() {
|
public ControlData clone() {
|
||||||
|
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);
|
return new ControlData(name, keycode, x, y, width, height);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ public class DynamicControlData extends ControlData {
|
|||||||
* bigger device or vice versa.
|
* bigger device or vice versa.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String dynamicX, dynamicY;
|
public String dynamicX, dynamicY;
|
||||||
|
|
||||||
public DynamicControlData() {
|
public DynamicControlData() {
|
||||||
this("", LWJGLGLFWKeycode.GLFW_KEY_UNKNOWN);
|
this("", LWJGLGLFWKeycode.GLFW_KEY_UNKNOWN);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user