Updated constructors fcontrolData with a default pos to the center

This commit is contained in:
SerpentSpirale 2021-05-11 22:09:45 +02:00
parent d0b75ee888
commit 5de6ba4633
2 changed files with 9 additions and 3 deletions

View File

@ -84,11 +84,15 @@ public class ControlData implements Cloneable
public Object specialButtonListener;
public ControlData() {
this("", new int[]{LWJGLGLFWKeycode.GLFW_KEY_UNKNOWN}, 0, 0);
this("button");
}
public ControlData(String name){
this(name, new int[] {});
}
public ControlData(String name, int[] keycodes) {
this(name, keycodes, 0, 0);
this(name, keycodes, Tools.currentDisplayMetrics.widthPixels/2, Tools.currentDisplayMetrics.heightPixels/2);
}
public ControlData(String name, int[] keycodes, float x, float y) {

View File

@ -1,5 +1,7 @@
package net.kdt.pojavlaunch.customcontrols;
import net.kdt.pojavlaunch.Tools;
import java.util.ArrayList;
import static net.kdt.pojavlaunch.customcontrols.ControlDrawerData.Orientation.DOWN;
@ -57,7 +59,7 @@ public class ControlDrawerData {
}
public ControlDrawerData(ArrayList<ControlData> buttonProperties){
this(buttonProperties, new ControlData());
this(buttonProperties, new ControlData("Drawer", new int[] {}, Tools.currentDisplayMetrics.widthPixels/2, Tools.currentDisplayMetrics.heightPixels/2));
}
public ControlDrawerData(ArrayList<ControlData> buttonProperties, ControlData properties){