Class MultiSelectPCMode

java.lang.Object
com.pixelmonmod.pixelmon.client.gui.pc.PCMode
com.pixelmonmod.pixelmon.client.gui.pc.MultiSelectPCMode

public class MultiSelectPCMode extends PCMode
  • Field Details

    • name

      protected static final String name
      See Also:
    • color

      protected Color color
    • areaSelectStart

      protected StoragePosition areaSelectStart
    • areaSelectEnd

      protected StoragePosition areaSelectEnd
    • cherrySelected

      protected ArrayList<StoragePosition> cherrySelected
    • selectedPositions

      protected ArrayList<com.mojang.datafixers.util.Pair<StoragePosition,StoragePosition>> selectedPositions
      An ArrayList containing pairs of DisplayPosition, PositionInStorage. This is needed for when you need to display or calculate mutation based on a temporary display, rather than the actual positions. (e.g. when grabbing multiple Pokemon from Search). For most cases, these are the same. Use getSelectedPositions() to get a list of the actual StoragePositions (every pair's second value)
    • selectedPokemonList

      protected ArrayList<Pokemon> selectedPokemonList
  • Constructor Details

  • Method Details

    • activate

      public void activate(@Nullable ArrayList<StoragePosition> positionsToLoad)
      Performs any actions necessary to initiate Mode. An ArrayList of StoragePositions can be passed to be loaded.
      Specified by:
      activate in class PCMode
    • deactivate

      public boolean deactivate()
      Performs any actions necessary to deactivate Mode. Disregarding unsuccessful deactivation can lead to unwanted behaviour!
      Specified by:
      deactivate in class PCMode
      Returns:
      Whether Mode could be deactivated.
    • getSelectedPositions

      public ArrayList<StoragePosition> getSelectedPositions()
      Specified by:
      getSelectedPositions in class PCMode
    • setSelectedPositions

      public void setSelectedPositions(@Nullable ArrayList<StoragePosition> selectedPositions)
    • hasSelected

      public boolean hasSelected()
      Overrides:
      hasSelected in class PCMode
    • isSelected

      protected boolean isSelected(@Nullable StoragePosition position)
      Overrides:
      isSelected in class PCMode
    • onStorageUpdated

      public void onStorageUpdated(PCStorage newStorage)
      Specified by:
      onStorageUpdated in class PCMode
    • onBoxUpdated

      public void onBoxUpdated(int newBoxNumber)
      Overrides:
      onBoxUpdated in class PCMode
    • areaSelectStart

      protected void areaSelectStart(@Nullable StoragePosition position, boolean allowEmptyStart)
    • areaSelectStart

      protected void areaSelectStart(@Nullable StoragePosition position)
    • areaSelectEnd

      protected void areaSelectEnd(@Nullable StoragePosition position)
    • cherrySelect

      protected boolean cherrySelect(StoragePosition position)
    • cherryDeselect

      protected void cherryDeselect(StoragePosition position)
    • confirmCherrySelection

      protected void confirmCherrySelection()
    • finishMultiSelect

      protected void finishMultiSelect()
    • selectAll

      protected void selectAll()
    • isAreaSelecting

      protected boolean isAreaSelecting()
    • isCherrySelecting

      protected boolean isCherrySelecting()
    • isSelectingMultiple

      protected boolean isSelectingMultiple()
    • setSelectedPositionsFromArea

      protected void setSelectedPositionsFromArea(StoragePosition start, StoragePosition end)
    • clearSelected

      public void clearSelected()
      Specified by:
      clearSelected in class PCMode
    • refreshSelectedPositions

      protected void refreshSelectedPositions()
      Updates selectedPositions based on selectedPokemon. Used when storage changes, eg. grabbing Pokemon from search and bringing them into normal storage
    • onMouseClicked

      public boolean onMouseClicked(int mouseButton, @Nullable StoragePosition position)
      Specified by:
      onMouseClicked in class PCMode
      Returns:
      Whether the event was consumed
    • onMouseReleased

      public boolean onMouseReleased(int mouseButton, @Nullable StoragePosition position)
      Overrides:
      onMouseReleased in class PCMode
      Returns:
      Whether the event was consumed
    • onBoxClicked

      public boolean onBoxClicked(int mouseButton, int boxIndex)
      Specified by:
      onBoxClicked in class PCMode
    • onKeyPress

      public boolean onKeyPress(int keyCode, int scanCode, int modifiers)
      Overrides:
      onKeyPress in class PCMode
      Returns:
      Whether the input was consumed or not
    • redo

      public boolean redo(List<StoragePosition> positionsBefore, List<StoragePosition> positionsAfter)
    • undo

      public boolean undo(List<StoragePosition> positionsBefore, List<StoragePosition> positionsAfter)
    • drawPosition

      protected void drawPosition(net.minecraft.client.gui.GuiGraphics graphics, float xPos, float yPos, float width, float height, StoragePosition position, int mouseX, int mouseY)
      Overrides:
      drawPosition in class PCMode
    • drawBox

      protected void drawBox(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY)
      Overrides:
      drawBox in class PCMode
    • drawSelectionArea

      protected void drawSelectionArea(net.minecraft.client.gui.GuiGraphics graphics, int l, int t, int r, int b)
    • drawCursor

      public void drawCursor(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY)
      Overrides:
      drawCursor in class PCMode