Package mindustry.input
Class DesktopInput
java.lang.Object
mindustry.input.InputHandler
mindustry.input.DesktopInput
- All Implemented Interfaces:
arc.input.GestureDetector.GestureListener,arc.input.InputProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionarc.Graphics.CursorCurrent cursor type.booleanWhether player is currently deleting removal plans.intMost recently selected control group by indexlongTime of most recent control group selectionintLast known line positions.intLast known line positions.longTime of most recent payload pickup/drop key holdlongTime of most recent payload pickup/drop key pressWhether selecting mode is active.booleanWhether player is currently deleting removal plans.arc.math.geom.Vec2floatMouse pan speed.booleanWhether player is currently deleting removal plans.floatMouse pan speed.floatMouse pan speed.Previously selected tile.intLast known line positions.intLast known line positions.intPosition where the player started dragging a line.intPosition where the player started dragging a line.longDelta time between consecutive clicks.floatAnimation scale for line.intPosition where the player started dragging a line.intPosition where the player started dragging a line.booleanWhether player is currently deleting removal plans.Selected build plan for movement.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 TypeMethodDescriptionvoidbuildPlacementUI(arc.scene.ui.layout.Table table) voidbuildUI(arc.scene.Group group) voidvoiddrawTop()floatfloatbooleanvoidpanCamera(arc.math.geom.Vec2 position) Forces the camera to a position and enables panning on desktop.booleanbooleantap(float x, float y, int count, arc.input.KeyCode button) booleantouchDown(float x, float y, int pointer, arc.input.KeyCode button) voidupdate()protected voidupdateMovement(mindustry.gen.Unit unit) voidvoiduseSchematic(Schematic schem, boolean checkHidden) 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, drawOverSelect, drawPlan, drawPlan, drawPlan, drawRebuildSelection, drawSelected, drawSelection, drawSelection, drawUnitSelection, dropItem, flipPlans, flushPlans, flushPlansReverse, flushSelectPlans, getPlan, getPlan, isDroppingItem, isPlacing, isRebuildSelecting, isUsingSchematic, locked, mouseAngle, multiUnitSelect, onConfigurable, payloadDropped, pickedBuildPayload, pickedUnitPayload, planMatches, rebuildArea, remove, removeQueueBlock, removeSelection, removeSelection, removeSelection, removeSelection, requestBuildPayload, requestDropPayload, requestItem, requestUnitPayload, rotateBlock, rotatePlans, schemOriginX, schemOriginY, 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, longPress, pan, panStop, pinch, pinchStop, zoomMethods inherited from interface arc.input.InputProcessor
keyDown, keyTyped, keyUp, mouseMoved, scrolled, touchDown, touchDragged, touchUp
-
Field Details
-
movement
public arc.math.geom.Vec2 movement -
cursorType
public arc.Graphics.Cursor cursorTypeCurrent cursor type. -
selectX
public int selectXPosition where the player started dragging a line. -
selectY
public int selectYPosition where the player started dragging a line. -
schemX
public int schemXPosition where the player started dragging a line. -
schemY
public int schemYPosition where the player started dragging a line. -
lastLineX
public int lastLineXLast known line positions. -
lastLineY
public int lastLineYLast known line positions. -
schematicX
public int schematicXLast known line positions. -
schematicY
public int schematicYLast known line positions. -
mode
Whether selecting mode is active. -
selectScale
public float selectScaleAnimation scale for line. -
splan
Selected build plan for movement. -
deleting
public boolean deletingWhether player is currently deleting removal plans. -
shouldShoot
public boolean shouldShootWhether player is currently deleting removal plans. -
panning
public boolean panningWhether player is currently deleting removal plans. -
movedPlan
public boolean movedPlanWhether player is currently deleting removal plans. -
panScale
public float panScaleMouse pan speed. -
panSpeed
public float panSpeedMouse pan speed. -
panBoostSpeed
public float panBoostSpeedMouse pan speed. -
selectMillis
public long selectMillisDelta time between consecutive clicks. -
prevSelected
Previously selected tile. -
lastCtrlGroup
public int lastCtrlGroupMost recently selected control group by index -
lastCtrlGroupSelectMillis
public long lastCtrlGroupSelectMillisTime of most recent control group selection -
lastPayloadKeyTapMillis
public long lastPayloadKeyTapMillisTime of most recent payload pickup/drop key press -
lastPayloadKeyHoldMillis
public long lastPayloadKeyHoldMillisTime of most recent payload pickup/drop key hold
-
-
Constructor Details
-
DesktopInput
public DesktopInput()
-
-
Method Details
-
buildUI
public void buildUI(arc.scene.Group group) - Overrides:
buildUIin classInputHandler
-
drawTop
public void drawTop()- Overrides:
drawTopin classInputHandler
-
drawBottom
public void drawBottom()- Overrides:
drawBottomin classInputHandler
-
update
public void update()- Overrides:
updatein classInputHandler
-
useSchematic
- Specified by:
useSchematicin classInputHandler
-
isBreaking
public boolean isBreaking()- Overrides:
isBreakingin classInputHandler
-
buildPlacementUI
public void buildPlacementUI(arc.scene.ui.layout.Table table) - Overrides:
buildPlacementUIin classInputHandler
-
tap
public boolean tap(float x, float y, int count, arc.input.KeyCode button) -
touchDown
public boolean touchDown(float x, float y, int pointer, arc.input.KeyCode button) -
selectedBlock
public boolean selectedBlock()- Overrides:
selectedBlockin classInputHandler
-
getMouseX
public float getMouseX()- Overrides:
getMouseXin classInputHandler
-
getMouseY
public float getMouseY()- Overrides:
getMouseYin classInputHandler
-
updateState
public void updateState()- Overrides:
updateStatein classInputHandler
-
panCamera
public void panCamera(arc.math.geom.Vec2 position) Description copied from class:InputHandlerForces the camera to a position and enables panning on desktop.- Overrides:
panCamerain classInputHandler
-
updateMovement
protected void updateMovement(mindustry.gen.Unit unit)
-