java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
All Implemented Interfaces:
net.minecraft.client.gui.components.events.ContainerEventHandler, net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.Renderable, net.minecraft.client.gui.components.TabOrderedElement

public class ChooseAttack extends BattleScreen
Created by Jay113355 on 10/16/2020.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
     

    Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.client.gui.battles.battleScreens.BattleScreen

    BattleScreen.ActionButton, BattleScreen.EnumBattleButton

    Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen

    net.minecraft.client.gui.screens.Screen.NarratableSearchResult
  • Field Summary

    Fields inherited from class com.pixelmonmod.pixelmon.client.gui.battles.battleScreens.BattleScreen

    BACKGROUND, DETAILS, MENU_BAG, MENU_BAG_DISABLED, MENU_BAG_ICON, MENU_POKE, MENU_POKE_DISABLED, MENU_POKE_ICON, MENU_RUN, MENU_RUN_DISABLED, MENU_RUN_ICON

    Fields inherited from class com.pixelmonmod.pixelmon.client.gui.battles.battleScreens.BattleBaseScreen

    bm, mode, parent

    Fields inherited from class net.minecraft.client.gui.screens.Screen

    children, CUBE_MAP, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, PANORAMA, renderables, screenExecutor, title, width

    Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    DOUBLE_CLICK_THRESHOLD_MS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes the battle screen.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    click(int width, int height, double mouseX, double mouseY)
    Handles a click input.
    void
     
    boolean
    clickedOnMoveButton(PixelmonClientData pixelmon, ChooseAttack.MoveButton button, double mouseX, double mouseY)
     
    void
     
    void
     
    boolean
    keyPressed(int keyCode, int scanCode, int modifiers)
     
    void
    render(net.minecraft.client.gui.GuiGraphics graphics, int width, int height, int mouseX, int mouseY, float partialTicks)
    Draws the battle screen.
    void
    renderBackground(net.minecraft.client.gui.GuiGraphics graphics, int width, int height, int mouseX, int mouseY, int vOffset)
     
    boolean
    renderMoveButtonsAndTargeting(PixelmonClientData pixelmon, int mouseX, int mouseY, boolean hovering, int bwidth)
    Renders boxes in the GUI of all the moves that a Pixelmon has that the player can choose from.
    void
    setTargetWhenCursorHoversOverNothing(PixelmonClientData pixelmonClientData, int mouseX, int mouseY)
    If a player's cursor is not hovering over a move on the battle screen, this takes the first move that the current Pokémon has, and sets the targeting information in the BattleScreen to that.
    boolean
     

    Methods inherited from class com.pixelmonmod.pixelmon.client.gui.battles.battleScreens.BattleScreen

    drawButtons, handleButtonClick

    Methods inherited from class com.pixelmonmod.pixelmon.client.gui.battles.battleScreens.BattleBaseScreen

    disablesChat, getMode, isScreen

    Methods inherited from class net.minecraft.client.gui.screens.Screen

    added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearTooltipForNextRenderPass, clearWidgets, createArrowEvent, createTabEvent, findNarratableWidget, getBackgroundMusic, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, onClose, onFilesDrop, rebuildWidgets, removed, removeWidget, render, renderBackground, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltip, repositionElements, resize, setInitialFocus, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, tick, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatus, wrapScreenError

    Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler

    getFocused, isDragging, setDragging, setFocused

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler

    charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocused

    Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    mouseMoved

    Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • Constructor Details

    • ChooseAttack

      public ChooseAttack(BattleScreen parent, BattleMode mode)
      Initializes the battle screen.
      Parameters:
      parent - The battle GUI that the screen is a part of.
  • Method Details

    • init

      public void init()
      Overrides:
      init in class BattleScreen
    • render

      public void render(net.minecraft.client.gui.GuiGraphics graphics, int width, int height, int mouseX, int mouseY, float partialTicks)
      Draws the battle screen.
      Specified by:
      render in class BattleBaseScreen
      Parameters:
      graphics - The current transformation context.
      width - The width of the GUI.
      height - The height of the GUI.
      mouseX - The x coordinate of the cursor.
      mouseY - The y coordinate of the cursor.
      partialTicks - The current partial ticks.
    • renderMoveButtonsAndTargeting

      public boolean renderMoveButtonsAndTargeting(PixelmonClientData pixelmon, int mouseX, int mouseY, boolean hovering, int bwidth)
      Renders boxes in the GUI of all the moves that a Pixelmon has that the player can choose from.

      Also sets where the white triangles pointing to each Pixelmon's health bar should render, based on whether the player is hovering their cursor over a move.

      Renders Struggle if the Pixelmon is incapable of using any other move.

      Parameters:
      pixelmon - The Pixelmon that a move is being chosen for.
      mouseX - The x coordinate of the cursor.
      mouseY - The y coordinate of the cursor.
      hovering - Whether the cursor is hovering over a button.
      bwidth - The width of a button.
      Returns:
      Whether the cursor is hovering over a button.
    • setTargetWhenCursorHoversOverNothing

      public void setTargetWhenCursorHoversOverNothing(PixelmonClientData pixelmonClientData, int mouseX, int mouseY)
      If a player's cursor is not hovering over a move on the battle screen, this takes the first move that the current Pokémon has, and sets the targeting information in the BattleScreen to that.
      Parameters:
      pixelmonClientData - The Pokémon that a player is currently choosing a move for.
      mouseX - The cursor's x coordinate.
      mouseY - The cursor's y coordinate.
    • renderBackground

      public void renderBackground(net.minecraft.client.gui.GuiGraphics graphics, int width, int height, int mouseX, int mouseY, int vOffset)
      Overrides:
      renderBackground in class BattleScreen
    • click

      public void click(int width, int height, double mouseX, double mouseY)
      Handles a click input.
      Specified by:
      click in class BattleBaseScreen
      Parameters:
      width - The width of the GUI.
      height - The height of the GUI.
      mouseX - The x coordinate of the cursor.
      mouseY - The y coordinate of the cursor.
    • clickedOnEvoButton

      public void clickedOnEvoButton(PixelmonClientData pixelmon)
    • clickedOnMoveButton

      public boolean clickedOnMoveButton(PixelmonClientData pixelmon, ChooseAttack.MoveButton button, double mouseX, double mouseY)
    • usingStruggle

      public boolean usingStruggle(PixelmonClientData pixelmon, ChooseAttack.MoveButton button)
    • handleTargetSelection

      public void handleTargetSelection(PixelmonClientData pixelmon, ChooseAttack.MoveButton button)
    • keyPressed

      public boolean keyPressed(int keyCode, int scanCode, int modifiers)
      Specified by:
      keyPressed in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      keyPressed in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      keyPressed in class net.minecraft.client.gui.screens.Screen