Class BattleScreen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
com.pixelmonmod.pixelmon.client.camera.CameraScreen
com.pixelmonmod.pixelmon.client.camera.ChattableCameraScreen
com.pixelmonmod.pixelmon.client.gui.battles.BattleScreen
- 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
GUI for battles.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.Screen.NarratableSearchResult
-
Field Summary
Modifier and TypeFieldDescriptionThe client-side battle manager.static final int
static final int
The Pixelmon overlay accompanying the GUI.boolean
Fields inherited from class com.pixelmonmod.pixelmon.client.camera.ChattableCameraScreen
chat
Fields inherited from class net.minecraft.client.gui.screens.Screen
BACKGROUND_LOCATION, children, font, height, minecraft, renderables, screenExecutor, title, width
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
actionPerformed
(net.minecraft.client.gui.components.Button button) boolean
applyItemToPokemonFromKeyPress
(int keyCode) boolean
canSelectTarget
(Attack attack) Checks if a target needs to be selected for the attack.boolean
charTyped
(char key, int keyCode) boolean
chooseAttackUsingKeyPress
(int attackID) boolean
chooseBagSectionOrItemToUseFromKeyPress
(int keyCode) boolean
boolean
chooseLeftRightArrowsInMenuFromKeyPress
(int keyCode) boolean
boolean
boolean
choosePokemonToSendOutFromKeyPress
(int keyCode) boolean
boolean
boolean
static void
drawHealthBar
(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, int width, int height, float health, int maxHealth) Draws a Pokémon's health bar.int
Gets the height of the battle GUI.int
Gets the width of the battle GUI.boolean
hoverAttackTargetFromKeyPress
(int keyCode) boolean
hoverBagOrPokemonMenuItemFromKeyPress
(int keyCode) void
init()
boolean
isTargeted
(UUID uuid) boolean
keyPressed
(int keyCode, int scanCode, int modifiers) boolean
mouseClicked
(double mouseX, double mouseY, int mouseButton) boolean
pressEnterToConfirmForfeiting
(int keyCode) boolean
pressEscapeToGoBackInMenu
(int keyCode) void
removed()
void
render
(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) Draws the screen and all the components in it.void
resize
(net.minecraft.client.Minecraft mc, int w, int h) void
Closes the battle GUI.static void
boolean
scrollBattleLogUpOrDownFromKeyPress
(int keyCode) void
Changes the current screen immediately, without waiting for a tick update.boolean
setTargeting
(PixelmonClientData pig, Attack attack, int opponentTarget, int userTarget) Sets the targets of an attack.boolean
void
tick()
boolean
Methods inherited from class com.pixelmonmod.pixelmon.client.camera.ChattableCameraScreen
mouseDragged, mouseMoved, mouseReleased, mouseScrolled
Methods inherited from class com.pixelmonmod.pixelmon.client.camera.CameraScreen
getCamera, isPauseScreen, renderBackground, renderDirtBackground
Methods inherited from class net.minecraft.client.gui.screens.Screen
added, addEventWidget, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearWidgets, confirmLink, createArrowEvent, createTabEvent, findNarratableWidget, getBackgroundMusic, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, hideWidgets, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, narrationEnabled, onClose, onFilesDrop, openLink, rebuildWidgets, removeWidget, renderTransparentBackground, renderWithTooltip, repositionElements, runNarration, scheduleNarration, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, shouldRunNarration, suppressNarration, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, 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
getChildAt, getCurrentFocusPath, isFocused, keyReleased, magicalSpecialHackyFocus, nextFocusPath, setFocused
Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
bm
The client-side battle manager. -
pokemonOverlay
The Pixelmon overlay accompanying the GUI. -
battleLog
-
showGlobalInfo
public boolean showGlobalInfo -
MIN_HEIGHT_FOR_COMBINED_BACKGROUND_AND_POPUP
public static final int MIN_HEIGHT_FOR_COMBINED_BACKGROUND_AND_POPUP- See Also:
-
MIN_WIDTH_FOR_COMBINED_BACKGROUND_AND_POPUP
public static final int MIN_WIDTH_FOR_COMBINED_BACKGROUND_AND_POPUP- See Also:
-
-
Constructor Details
-
BattleScreen
public BattleScreen()Initializes the GUI and its possible screens.
-
-
Method Details
-
init
public void init()- Overrides:
init
in classChattableCameraScreen
-
restoreSettingsAndClose
public void restoreSettingsAndClose()Closes the battle GUI. -
restoreSettingsAndCloseStatic
-
removed
public void removed()- Overrides:
removed
in classChattableCameraScreen
-
selectScreenImmediate
Changes the current screen immediately, without waiting for a tick update.- Parameters:
mode
- The screen to change to.
-
drawHealthBar
public static void drawHealthBar(net.minecraft.client.gui.GuiGraphics graphics, int x, int y, int width, int height, float health, int maxHealth) Draws a Pokémon's health bar.- Parameters:
x
- The x coordinate of the health bar.y
- The y coordinate of the health bar.width
- The width of the health bar.height
- The height of the health bar.health
- The current hp of the Pokémon.maxHealth
- The maximum hp of the Pokémon.
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) - Specified by:
keyPressed
in interfacenet.minecraft.client.gui.components.events.ContainerEventHandler
- Specified by:
keyPressed
in interfacenet.minecraft.client.gui.components.events.GuiEventListener
- Overrides:
keyPressed
in classChattableCameraScreen
-
charTyped
public boolean charTyped(char key, int keyCode) - Specified by:
charTyped
in interfacenet.minecraft.client.gui.components.events.ContainerEventHandler
- Specified by:
charTyped
in interfacenet.minecraft.client.gui.components.events.GuiEventListener
- Overrides:
charTyped
in classChattableCameraScreen
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) - Specified by:
mouseClicked
in interfacenet.minecraft.client.gui.components.events.ContainerEventHandler
- Specified by:
mouseClicked
in interfacenet.minecraft.client.gui.components.events.GuiEventListener
- Overrides:
mouseClicked
in classChattableCameraScreen
-
render
public void render(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) Draws the screen and all the components in it.- Specified by:
render
in interfacenet.minecraft.client.gui.components.Renderable
- Overrides:
render
in classChattableCameraScreen
-
tick
public void tick()- Overrides:
tick
in classChattableCameraScreen
-
getGuiWidth
public int getGuiWidth()Gets the width of the battle GUI.- Returns:
- The width of the battle GUI.
-
getGuiHeight
public int getGuiHeight()Gets the height of the battle GUI.- Returns:
- The height of the battle GUI.
-
canSelectTarget
Checks if a target needs to be selected for the attack.- Parameters:
attack
- The attack being selected.- Returns:
- Whether a target needs to be selected for the attack.
-
setTargeting
public boolean setTargeting(PixelmonClientData pig, Attack attack, int opponentTarget, int userTarget) Sets the targets of an attack.- Parameters:
attack
- The attack to target.opponentTarget
- The index of the opponent that the player is targeting, or -1 if the player is not targeting an opponent.userTarget
- The index of the allied Pokémon that the player is targeting, or -1 if the player is not targeting an ally.- Returns:
- Whether the player is hovering their mouse over a potential target.
-
isTargeted
-
showTargeting
public boolean showTargeting() -
actionPerformed
protected void actionPerformed(net.minecraft.client.gui.components.Button button) -
resize
public void resize(net.minecraft.client.Minecraft mc, int w, int h) - Overrides:
resize
in classnet.minecraft.client.gui.screens.Screen
-
chooseAttackUsingKeyPress
public boolean chooseAttackUsingKeyPress(int attackID) -
toggleAttackGimmickUsingKeyPress
public boolean toggleAttackGimmickUsingKeyPress() -
chooseBagUsingKeyPress
public boolean chooseBagUsingKeyPress() -
closeBagUsingKeyPress
public boolean closeBagUsingKeyPress() -
chooseBagSectionOrItemToUseFromKeyPress
public boolean chooseBagSectionOrItemToUseFromKeyPress(int keyCode) -
applyItemToPokemonFromKeyPress
public boolean applyItemToPokemonFromKeyPress(int keyCode) -
chooseToFleeOrForfeitUsingKeyPress
public boolean chooseToFleeOrForfeitUsingKeyPress() -
chooseNoToForfeitingUsingKeyPress
public boolean chooseNoToForfeitingUsingKeyPress() -
pressEnterToConfirmForfeiting
public boolean pressEnterToConfirmForfeiting(int keyCode) -
choosePokemonTeamUsingKeyPress
public boolean choosePokemonTeamUsingKeyPress() -
closePokemonTeamUsingKeyPress
public boolean closePokemonTeamUsingKeyPress() -
choosePokemonToSendOutFromKeyPress
public boolean choosePokemonToSendOutFromKeyPress(int keyCode) -
scrollBattleLogUpOrDownFromKeyPress
public boolean scrollBattleLogUpOrDownFromKeyPress(int keyCode) -
hoverBagOrPokemonMenuItemFromKeyPress
public boolean hoverBagOrPokemonMenuItemFromKeyPress(int keyCode) -
hoverAttackTargetFromKeyPress
public boolean hoverAttackTargetFromKeyPress(int keyCode) -
chooseLeftRightArrowsInMenuFromKeyPress
public boolean chooseLeftRightArrowsInMenuFromKeyPress(int keyCode) -
pressEscapeToGoBackInMenu
public boolean pressEscapeToGoBackInMenu(int keyCode)
-