Package mindustry.input
Class MobileInput
java.lang.Object
mindustry.input.InputHandler
mindustry.input.MobileInput
- All Implemented Interfaces:
arc.input.GestureDetector.GestureListener
,arc.input.InputProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionmindustry.gen.Building
Control building last tapped.float
Animation data for crosshair.boolean
Down tracking for panning.final float
Distance to edge of screen to start panning.Whether no recipe was available when switching to break mode.int
Position where the player started dragging a line.int
Position where the player started dragging a line.Last placed plan.mindustry.gen.Teamc
float
boolean
Various modes that aren't enums for some reason.float
Animation scale for line.int
Position where the player started dragging a line.int
Position where the player started dragging a line.boolean
Whether manual shooting (point with finger) is enabled.Current place mode.arc.math.geom.Vec2
arc.math.geom.Position
Payload target being moved to.boolean
Various modes that aren't enums for some reason.boolean
Various modes that aren't enums for some reason.arc.struct.Seq<BuildPlan>
Place plans to be removed.boolean
Various modes that aren't enums for some reason.boolean
Whether the player is currently shifting all placed tiles.float
Used for shifting build plans.float
Used for shifting build plans.mindustry.gen.Teamc
Current thing being shot at.arc.math.geom.Vec2
mindustry.gen.Unit
Unit last tapped, or null if last tap was not on a unit.arc.math.geom.Vec2
Fields inherited from class mindustry.input.InputHandler
block, bplan, buildWasAutoPaused, commandBuildings, commandMode, commandRect, commandRectX, commandRectY, config, controlGroups, controlInterval, controlledType, detector, droppingItem, inputLocks, inv, isBuilding, itemDepositCooldown, lastPlans, lastSchematic, lastUnit, line, linePlans, logicCamPan, logicCamSpeed, logicCutscene, logicCutsceneZoom, overrideLineRotation, planConfig, recentRespawnTimer, resultplan, rotation, selectedUnits, selectPlans, spectating, tappedOne, uiGroup, wasShooting
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
autoPan()
void
buildPlacementUI
(arc.scene.ui.layout.Table table) void
buildUI
(arc.scene.Group group) void
void
protected void
void
drawTop()
boolean
boolean
boolean
boolean
boolean
longPress
(float x, float y) boolean
pan
(float x, float y, float deltaX, float deltaY) boolean
panStop
(float x, float y, int pointer, arc.input.KeyCode button) protected int
protected int
boolean
boolean
tap
(float x, float y, int count, arc.input.KeyCode button) boolean
touchDown
(int screenX, int screenY, int pointer, arc.input.KeyCode button) boolean
touchUp
(int screenX, int screenY, int pointer, arc.input.KeyCode button) void
update()
protected void
updateMovement
(mindustry.gen.Unit unit) void
void
useSchematic
(Schematic schem) boolean
zoom
(float initialDistance, float distance) Methods inherited from class mindustry.input.InputHandler
add, addLock, allPlans, breakBlock, buildingControlSelect, canDropItem, canShoot, checkUnit, clearItems, commandBuilding, commandTap, commandTap, commandUnits, createItemTransfer, deletePlans, drawArrow, drawArrow, drawBreaking, drawBreaking, drawBreakSelection, drawBreakSelection, drawBreakSelection, drawCommand, drawCommanded, drawCommanded, drawOverlapCheck, drawOverPlan, drawOverPlan, drawPlan, drawPlan, drawRebuildSelection, drawSelected, drawSelection, drawSelection, drawUnitSelection, dropItem, flipPlans, flushPlans, flushPlansReverse, flushSelectPlans, getMouseX, getMouseY, getPlan, getPlan, isDroppingItem, isUsingSchematic, locked, mouseAngle, multiUnitSelect, onConfigurable, panCamera, payloadDropped, pickedBuildPayload, pickedUnitPayload, planMatches, rebuildArea, remove, removeQueueBlock, removeSelection, removeSelection, removeSelection, removeSelection, requestBuildPayload, requestDropPayload, requestItem, requestUnitPayload, rotateBlock, rotatePlans, selectedBlock, selectedCommandUnit, selectedCommandUnits, selectedCommandUnits, selectedControlBuild, selectedEnemyUnit, selectedUnit, selectTypedUnits, selectUnitsRect, setItem, setUnitCommand, setUnitStance, showSchematicSave, spectate, takeItems, tapCommandUnit, tileConfig, tileTap, transferInventory, transferItemEffect, transferItemTo, transferItemToUnit, tryBreakBlock, tryDropItems, tryDropPayload, tryPickupPayload, unitBuildingControlSelect, unitClear, unitControl, unitEnteredPayload, updateLine, updateLine, validBreak, validPlace, validPlace, validPlace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface arc.input.GestureDetector.GestureListener
fling, pinch, pinchStop, touchDown
Methods inherited from interface arc.input.InputProcessor
connected, disconnected, keyDown, keyTyped, keyUp, mouseMoved, scrolled, touchDragged
-
Field Details
-
edgePan
public final float edgePanDistance to edge of screen to start panning. -
vector
public arc.math.geom.Vec2 vector -
movement
public arc.math.geom.Vec2 movement -
targetPos
public arc.math.geom.Vec2 targetPos -
lastZoom
public float lastZoom -
lineStartX
public int lineStartXPosition where the player started dragging a line. -
lineStartY
public int lineStartYPosition where the player started dragging a line. -
lastLineX
public int lastLineXPosition where the player started dragging a line. -
lastLineY
public int lastLineYPosition where the player started dragging a line. -
lineScale
public float lineScaleAnimation scale for line. -
crosshairScale
public float crosshairScaleAnimation data for crosshair. -
lastTarget
public mindustry.gen.Teamc lastTarget -
shiftDeltaX
public float shiftDeltaXUsed for shifting build plans. -
shiftDeltaY
public float shiftDeltaYUsed for shifting build plans. -
removals
Place plans to be removed. -
selecting
public boolean selectingWhether the player is currently shifting all placed tiles. -
lineMode
public boolean lineModeVarious modes that aren't enums for some reason. This should be cleaned up. -
schematicMode
public boolean schematicModeVarious modes that aren't enums for some reason. This should be cleaned up. -
rebuildMode
public boolean rebuildModeVarious modes that aren't enums for some reason. This should be cleaned up. -
queueCommandMode
public boolean queueCommandModeVarious modes that aren't enums for some reason. This should be cleaned up. -
mode
Current place mode. -
lastBlock
Whether no recipe was available when switching to break mode. -
lastPlaced
Last placed plan. Used for drawing block overlay. -
down
public boolean downDown tracking for panning. -
manualShooting
public boolean manualShootingWhether manual shooting (point with finger) is enabled. -
target
@Nullable public mindustry.gen.Teamc targetCurrent thing being shot at. -
payloadTarget
@Nullable public arc.math.geom.Position payloadTargetPayload target being moved to. Can be a position (for dropping), or a unit/block. -
unitTapped
@Nullable public mindustry.gen.Unit unitTappedUnit last tapped, or null if last tap was not on a unit. -
buildingTapped
@Nullable public mindustry.gen.Building buildingTappedControl building last tapped.
-
-
Constructor Details
-
MobileInput
public MobileInput()
-
-
Method Details
-
buildPlacementUI
public void buildPlacementUI(arc.scene.ui.layout.Table table) - Overrides:
buildPlacementUI
in classInputHandler
-
showCancel
public boolean showCancel() -
hasSchematic
public boolean hasSchematic() -
buildUI
public void buildUI(arc.scene.Group group) - Overrides:
buildUI
in classInputHandler
-
drawBottom
public void drawBottom()- Overrides:
drawBottom
in classInputHandler
-
drawTop
public void drawTop()- Overrides:
drawTop
in classInputHandler
-
drawOverSelect
public void drawOverSelect()- Overrides:
drawOverSelect
in classInputHandler
-
drawPlan
- Overrides:
drawPlan
in classInputHandler
-
isRebuildSelecting
public boolean isRebuildSelecting()- Overrides:
isRebuildSelecting
in classInputHandler
-
schemOriginX
protected int schemOriginX()- Overrides:
schemOriginX
in classInputHandler
-
schemOriginY
protected int schemOriginY()- Overrides:
schemOriginY
in classInputHandler
-
isPlacing
public boolean isPlacing()- Overrides:
isPlacing
in classInputHandler
-
isBreaking
public boolean isBreaking()- Overrides:
isBreaking
in classInputHandler
-
useSchematic
- Overrides:
useSchematic
in classInputHandler
-
touchDown
public boolean touchDown(int screenX, int screenY, int pointer, arc.input.KeyCode button) - Specified by:
touchDown
in interfacearc.input.InputProcessor
-
touchUp
public boolean touchUp(int screenX, int screenY, int pointer, arc.input.KeyCode button) - Specified by:
touchUp
in interfacearc.input.InputProcessor
-
longPress
public boolean longPress(float x, float y) - Specified by:
longPress
in interfacearc.input.GestureDetector.GestureListener
-
tap
public boolean tap(float x, float y, int count, arc.input.KeyCode button) - Specified by:
tap
in interfacearc.input.GestureDetector.GestureListener
-
updateState
public void updateState()- Overrides:
updateState
in classInputHandler
-
update
public void update()- Overrides:
update
in classInputHandler
-
autoPan
protected void autoPan() -
pan
public boolean pan(float x, float y, float deltaX, float deltaY) - Specified by:
pan
in interfacearc.input.GestureDetector.GestureListener
-
panStop
public boolean panStop(float x, float y, int pointer, arc.input.KeyCode button) - Specified by:
panStop
in interfacearc.input.GestureDetector.GestureListener
-
zoom
public boolean zoom(float initialDistance, float distance) - Specified by:
zoom
in interfacearc.input.GestureDetector.GestureListener
-
updateMovement
protected void updateMovement(mindustry.gen.Unit unit)
-