Merge pull request #2412 from DeltaNedas/input
make input fields public
This commit is contained in:
@@ -27,21 +27,21 @@ import static mindustry.Vars.*;
|
|||||||
import static mindustry.input.PlaceMode.*;
|
import static mindustry.input.PlaceMode.*;
|
||||||
|
|
||||||
public class DesktopInput extends InputHandler{
|
public class DesktopInput extends InputHandler{
|
||||||
private Vec2 movement = new Vec2();
|
public Vec2 movement = new Vec2();
|
||||||
/** Current cursor type. */
|
/** Current cursor type. */
|
||||||
private Cursor cursorType = SystemCursor.arrow;
|
public Cursor cursorType = SystemCursor.arrow;
|
||||||
/** Position where the player started dragging a line. */
|
/** Position where the player started dragging a line. */
|
||||||
private int selectX, selectY, schemX, schemY;
|
public int selectX, selectY, schemX, schemY;
|
||||||
/** Last known line positions.*/
|
/** Last known line positions.*/
|
||||||
private int lastLineX, lastLineY, schematicX, schematicY;
|
public int lastLineX, lastLineY, schematicX, schematicY;
|
||||||
/** Whether selecting mode is active. */
|
/** Whether selecting mode is active. */
|
||||||
private PlaceMode mode;
|
public PlaceMode mode;
|
||||||
/** Animation scale for line. */
|
/** Animation scale for line. */
|
||||||
private float selectScale;
|
public float selectScale;
|
||||||
/** Selected build request for movement. */
|
/** Selected build request for movement. */
|
||||||
private @Nullable BuildPlan sreq;
|
public @Nullable BuildPlan sreq;
|
||||||
/** Whether player is currently deleting removal requests. */
|
/** Whether player is currently deleting removal requests. */
|
||||||
private boolean deleting = false, shouldShoot = false;
|
public boolean deleting = false, shouldShoot = false;
|
||||||
|
|
||||||
private boolean panning = false;
|
private boolean panning = false;
|
||||||
|
|
||||||
|
|||||||
@@ -62,13 +62,13 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
public boolean isBuilding = true, buildWasAutoPaused = false;
|
public boolean isBuilding = true, buildWasAutoPaused = false;
|
||||||
public @Nullable UnitType controlledType;
|
public @Nullable UnitType controlledType;
|
||||||
|
|
||||||
protected @Nullable Schematic lastSchematic;
|
public @Nullable Schematic lastSchematic;
|
||||||
protected GestureDetector detector;
|
public GestureDetector detector;
|
||||||
protected PlaceLine line = new PlaceLine();
|
public PlaceLine line = new PlaceLine();
|
||||||
protected BuildPlan resultreq;
|
public BuildPlan resultreq;
|
||||||
protected BuildPlan brequest = new BuildPlan();
|
public BuildPlan brequest = new BuildPlan();
|
||||||
protected Seq<BuildPlan> lineRequests = new Seq<>();
|
public Seq<BuildPlan> lineRequests = new Seq<>();
|
||||||
protected Seq<BuildPlan> selectRequests = new Seq<>();
|
public Seq<BuildPlan> selectRequests = new Seq<>();
|
||||||
|
|
||||||
//methods to override
|
//methods to override
|
||||||
|
|
||||||
|
|||||||
@@ -31,39 +31,39 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
/** Maximum speed the player can pan. */
|
/** Maximum speed the player can pan. */
|
||||||
private static final float maxPanSpeed = 1.3f;
|
private static final float maxPanSpeed = 1.3f;
|
||||||
/** Distance to edge of screen to start panning. */
|
/** Distance to edge of screen to start panning. */
|
||||||
private final float edgePan = Scl.scl(60f);
|
public final float edgePan = Scl.scl(60f);
|
||||||
|
|
||||||
//gesture data
|
//gesture data
|
||||||
private Vec2 vector = new Vec2(), movement = new Vec2(), targetPos = new Vec2();
|
public Vec2 vector = new Vec2(), movement = new Vec2(), targetPos = new Vec2();
|
||||||
private float lastZoom = -1;
|
public float lastZoom = -1;
|
||||||
|
|
||||||
/** Position where the player started dragging a line. */
|
/** Position where the player started dragging a line. */
|
||||||
private int lineStartX, lineStartY, lastLineX, lastLineY;
|
public int lineStartX, lineStartY, lastLineX, lastLineY;
|
||||||
|
|
||||||
/** Animation scale for line. */
|
/** Animation scale for line. */
|
||||||
private float lineScale;
|
public float lineScale;
|
||||||
/** Animation data for crosshair. */
|
/** Animation data for crosshair. */
|
||||||
private float crosshairScale;
|
public float crosshairScale;
|
||||||
private Teamc lastTarget;
|
public Teamc lastTarget;
|
||||||
/** Used for shifting build requests. */
|
/** Used for shifting build requests. */
|
||||||
private float shiftDeltaX, shiftDeltaY;
|
public float shiftDeltaX, shiftDeltaY;
|
||||||
|
|
||||||
/** Place requests to be removed. */
|
/** Place requests to be removed. */
|
||||||
private Seq<BuildPlan> removals = new Seq<>();
|
public Seq<BuildPlan> removals = new Seq<>();
|
||||||
/** Whether or not the player is currently shifting all placed tiles. */
|
/** Whether or not the player is currently shifting all placed tiles. */
|
||||||
private boolean selecting;
|
public boolean selecting;
|
||||||
/** Whether the player is currently in line-place mode. */
|
/** Whether the player is currently in line-place mode. */
|
||||||
private boolean lineMode, schematicMode;
|
public boolean lineMode, schematicMode;
|
||||||
/** Current place mode. */
|
/** Current place mode. */
|
||||||
private PlaceMode mode = none;
|
public PlaceMode mode = none;
|
||||||
/** Whether no recipe was available when switching to break mode. */
|
/** Whether no recipe was available when switching to break mode. */
|
||||||
private Block lastBlock;
|
public Block lastBlock;
|
||||||
/** Last placed request. Used for drawing block overlay. */
|
/** Last placed request. Used for drawing block overlay. */
|
||||||
private BuildPlan lastPlaced;
|
public BuildPlan lastPlaced;
|
||||||
/** Down tracking for panning.*/
|
/** Down tracking for panning.*/
|
||||||
private boolean down = false;
|
public boolean down = false;
|
||||||
|
|
||||||
private Teamc target, moveTarget;
|
public Teamc target, moveTarget;
|
||||||
|
|
||||||
//region utility methods
|
//region utility methods
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user