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.Cursor
Current cursor type.boolean
Whether player is currently deleting removal plans.int
Most recently selected control group by indexlong
Time of most recent control group selectionint
Last known line positions.int
Last known line positions.Whether selecting mode is active.boolean
Whether player is currently deleting removal plans.arc.math.geom.Vec2
float
Mouse pan speed.boolean
Whether player is currently deleting removal plans.float
Mouse pan speed.float
Mouse pan speed.Previously selected tile.int
Last known line positions.int
Last known line positions.int
Position where the player started dragging a line.int
Position where the player started dragging a line.long
Delta time between consecutive clicks.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 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 TypeMethodDescriptionvoid
buildPlacementUI
(arc.scene.ui.layout.Table table) void
buildUI
(arc.scene.Group group) void
void
drawTop()
float
float
boolean
void
panCamera
(arc.math.geom.Vec2 position) Forces the camera to a position and enables panning on desktop.boolean
boolean
tap
(float x, float y, int count, arc.input.KeyCode button) boolean
touchDown
(float x, float y, int pointer, arc.input.KeyCode button) void
update()
protected void
updateMovement
(mindustry.gen.Unit unit) void
void
useSchematic
(Schematic schem) 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, 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, 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, longPress, pan, panStop, pinch, pinchStop, zoom
Methods inherited from interface arc.input.InputProcessor
connected, disconnected, 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
-
-
Constructor Details
-
DesktopInput
public DesktopInput()
-
-
Method Details
-
buildUI
public void buildUI(arc.scene.Group group) - Overrides:
buildUI
in classInputHandler
-
drawTop
public void drawTop()- Overrides:
drawTop
in classInputHandler
-
drawBottom
public void drawBottom()- Overrides:
drawBottom
in classInputHandler
-
update
public void update()- Overrides:
update
in classInputHandler
-
useSchematic
- Overrides:
useSchematic
in classInputHandler
-
isBreaking
public boolean isBreaking()- Overrides:
isBreaking
in classInputHandler
-
buildPlacementUI
public void buildPlacementUI(arc.scene.ui.layout.Table table) - Overrides:
buildPlacementUI
in 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:
selectedBlock
in classInputHandler
-
getMouseX
public float getMouseX()- Overrides:
getMouseX
in classInputHandler
-
getMouseY
public float getMouseY()- Overrides:
getMouseY
in classInputHandler
-
updateState
public void updateState()- Overrides:
updateState
in classInputHandler
-
panCamera
public void panCamera(arc.math.geom.Vec2 position) Description copied from class:InputHandler
Forces the camera to a position and enables panning on desktop.- Overrides:
panCamera
in classInputHandler
-
updateMovement
protected void updateMovement(mindustry.gen.Unit unit)
-