Feat|Refactor: New control editing workflow

The new worflow is mostly focused on the ability to change in real time visual features of a button.
It also brings a new *export* button to easily export controls you made.
This commit is contained in:
Boulay Mathias 2022-11-05 16:18:44 +01:00
parent 53cd15ac7d
commit d1c88a19e0
41 changed files with 2082 additions and 2310 deletions

View file

@ -29,6 +29,8 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import net.kdt.pojavlaunch.customcontrols.ControlLayout;
import net.kdt.pojavlaunch.utils.MathUtils;
import net.kdt.pojavlaunch.customcontrols.gamepad.Gamepad;
@ -207,6 +209,9 @@ public class MinecraftGLSurface extends View {
*/
@Override
public boolean onTouchEvent(MotionEvent e) {
// Kinda need to send this back to the layout
if(((ControlLayout)getParent()).getModifiable()) return false;
// Looking for a mouse to handle, won't have an effect if no mouse exists.
for (int i = 0; i < e.getPointerCount(); i++) {
if(e.getToolType(i) != MotionEvent.TOOL_TYPE_MOUSE && e.getToolType(i) != MotionEvent.TOOL_TYPE_STYLUS ) continue;