Class InventoryNavigationComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.input.InputComponent
com.csse3200.game.components.inventory.InventoryNavigationComponent
- All Implemented Interfaces:
com.badlogic.gdx.input.GestureDetector.GestureListener
,com.badlogic.gdx.InputProcessor
Input component for handling keyboard navigation within the inventory screen.
Handles arrow key input to move selection around the inventory grid and manages
all selection state and tooltip display.
-
Field Summary
Fields inherited from class com.csse3200.game.input.InputComponent
priority
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Disables navigation and hides tooltipvoid
Enables navigation and shows initial tooltipint
int
Gets the current selection coordinates for the UI to highlightint
Gets the currently selected slot index (0-based, row-major order)boolean
boolean
keyDown
(int keycode) Triggers player events on specific keycodes.void
setInventoryTab
(InventoryTab inventoryTab) Sets the inventory tab that this component controlsMethods inherited from class com.csse3200.game.input.InputComponent
create, dispose, fling, getPriority, keyTyped, keyUp, longPress, mouseMoved, pan, panStop, pinch, pinchStop, pinchStopHandled, scrolled, setPriority, tap, touchCancelled, touchDown, touchDown, touchDragged, touchUp, zoom
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
InventoryNavigationComponent
-
-
Method Details
-
getSelectedSlotIndex
public int getSelectedSlotIndex()Gets the currently selected slot index (0-based, row-major order) -
getSelectedRow
public int getSelectedRow()Gets the current selection coordinates for the UI to highlight -
getSelectedCol
public int getSelectedCol() -
keyDown
public boolean keyDown(int keycode) Triggers player events on specific keycodes.- Specified by:
keyDown
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
keyDown
in classInputComponent
- Parameters:
keycode
- key pressed- Returns:
- whether the input was processed
- See Also:
-
setInventoryTab
Sets the inventory tab that this component controls