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.BuildingControl building last tapped.floatAnimation data for crosshair.booleanDown tracking for panning.final floatDistance to edge of screen to start panning.Whether no recipe was available when switching to break mode.intPosition where the player started dragging a line.intPosition where the player started dragging a line.Last placed plan.mindustry.gen.TeamcfloatbooleanVarious modes that aren't enums for some reason.floatAnimation scale for line.intPosition where the player started dragging a line.intPosition where the player started dragging a line.booleanWhether manual shooting (point with finger) is enabled.Current place mode.arc.math.geom.Vec2arc.math.geom.PositionPayload target being moved to.booleanVarious modes that aren't enums for some reason.booleanVarious modes that aren't enums for some reason.arc.struct.Seq<BuildPlan>Place plans to be removed.booleanVarious modes that aren't enums for some reason.booleanWhether the player is currently shifting all placed tiles.floatUsed for shifting build plans.floatUsed for shifting build plans.mindustry.gen.TeamcCurrent thing being shot at.arc.math.geom.Vec2mindustry.gen.UnitUnit last tapped, or null if last tap was not on a unit.arc.math.geom.Vec2Fields 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 voidautoPan()voidbuildPlacementUI(arc.scene.ui.layout.Table table) voidbuildUI(arc.scene.Group group) voidvoidprotected voidvoiddrawTop()booleanbooleanbooleanbooleanbooleanlongPress(float x, float y) booleanpan(float x, float y, float deltaX, float deltaY) booleanpanStop(float x, float y, int pointer, arc.input.KeyCode button) protected intprotected intbooleanbooleantap(float x, float y, int count, arc.input.KeyCode button) booleantouchDown(int screenX, int screenY, int pointer, arc.input.KeyCode button) booleantouchUp(int screenX, int screenY, int pointer, arc.input.KeyCode button) voidupdate()protected voidupdateMovement(mindustry.gen.Unit unit) voidvoiduseSchematic(Schematic schem, boolean checkHidden) booleanzoom(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, 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, selectedCommandBuildings, 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, useSchematic, validBreak, validPlace, validPlace, validPlaceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface arc.input.GestureDetector.GestureListener
fling, pinch, pinchStop, touchDownMethods inherited from interface arc.input.InputProcessor
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:
buildPlacementUIin classInputHandler
-
showCancel
public boolean showCancel() -
hasSchematic
public boolean hasSchematic() -
buildUI
public void buildUI(arc.scene.Group group) - Overrides:
buildUIin classInputHandler
-
drawBottom
public void drawBottom()- Overrides:
drawBottomin classInputHandler
-
drawTop
public void drawTop()- Overrides:
drawTopin classInputHandler
-
drawOverSelect
public void drawOverSelect()- Overrides:
drawOverSelectin classInputHandler
-
drawPlan
- Overrides:
drawPlanin classInputHandler
-
isRebuildSelecting
public boolean isRebuildSelecting()- Overrides:
isRebuildSelectingin classInputHandler
-
schemOriginX
protected int schemOriginX()- Overrides:
schemOriginXin classInputHandler
-
schemOriginY
protected int schemOriginY()- Overrides:
schemOriginYin classInputHandler
-
isPlacing
public boolean isPlacing()- Overrides:
isPlacingin classInputHandler
-
isBreaking
public boolean isBreaking()- Overrides:
isBreakingin classInputHandler
-
useSchematic
- Specified by:
useSchematicin classInputHandler
-
touchDown
public boolean touchDown(int screenX, int screenY, int pointer, arc.input.KeyCode button) - Specified by:
touchDownin interfacearc.input.InputProcessor
-
touchUp
public boolean touchUp(int screenX, int screenY, int pointer, arc.input.KeyCode button) - Specified by:
touchUpin interfacearc.input.InputProcessor
-
longPress
public boolean longPress(float x, float y) - Specified by:
longPressin interfacearc.input.GestureDetector.GestureListener
-
tap
public boolean tap(float x, float y, int count, arc.input.KeyCode button) - Specified by:
tapin interfacearc.input.GestureDetector.GestureListener
-
updateState
public void updateState()- Overrides:
updateStatein classInputHandler
-
update
public void update()- Overrides:
updatein classInputHandler
-
autoPan
protected void autoPan() -
pan
public boolean pan(float x, float y, float deltaX, float deltaY) - Specified by:
panin interfacearc.input.GestureDetector.GestureListener
-
panStop
public boolean panStop(float x, float y, int pointer, arc.input.KeyCode button) - Specified by:
panStopin interfacearc.input.GestureDetector.GestureListener
-
zoom
public boolean zoom(float initialDistance, float distance) - Specified by:
zoomin interfacearc.input.GestureDetector.GestureListener
-
updateMovement
protected void updateMovement(mindustry.gen.Unit unit)
-