mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2026-08-28 05:45:03 -06:00
[Custom controls] Special buttons fix; Fix key index
This commit is contained in:
parent
54341d7cfe
commit
9e6fbfd2d7
3 changed files with 8 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue