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
FieldsModifier and TypeFieldDescriptionThe client-side battle manager.static final intstatic final intThe Pixelmon overlay accompanying the GUI.booleanFields inherited from class com.pixelmonmod.pixelmon.client.camera.ChattableCameraScreen
chatFields 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, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactionPerformed(net.minecraft.client.gui.components.Button button) booleanapplyItemToPokemonFromKeyPress(int keyCode) booleancanSelectTarget(Attack attack) Checks if a target needs to be selected for the attack.booleancharTyped(char key, int keyCode) booleanchooseAttackUsingKeyPress(int attackID) booleanchooseBagSectionOrItemToUseFromKeyPress(int keyCode) booleanbooleanchooseLeftRightArrowsInMenuFromKeyPress(int keyCode) booleanbooleanbooleanchoosePokemonToSendOutFromKeyPress(int keyCode) booleanbooleanbooleanstatic voiddrawHealthBar(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.intGets the height of the battle GUI.intGets the width of the battle GUI.booleanhoverAttackTargetFromKeyPress(int keyCode) booleanhoverBagOrPokemonMenuItemFromKeyPress(int keyCode) voidinit()booleanisTargeted(UUID uuid) booleankeyPressed(int keyCode, int scanCode, int modifiers) booleanmouseClicked(double mouseX, double mouseY, int mouseButton) booleanpressEnterToConfirmForfeiting(int keyCode) booleanpressEscapeToGoBackInMenu(int keyCode) voidremoved()voidrender(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) Draws the screen and all the components in it.voidresize(net.minecraft.client.Minecraft mc, int w, int h) voidCloses the battle GUI.static voidbooleanscrollBattleLogUpOrDownFromKeyPress(int keyCode) voidChanges the current screen immediately, without waiting for a tick update.voidsetMode(BattleMode mode) booleansetTargeting(PixelmonClientData pig, Attack attack, int opponentTarget, int userTarget) Sets the targets of an attack.booleanvoidtick()booleanMethods inherited from class com.pixelmonmod.pixelmon.client.camera.ChattableCameraScreen
mouseDragged, mouseMoved, mouseReleased, mouseScrolledMethods inherited from class com.pixelmonmod.pixelmon.client.camera.CameraScreen
getCamera, isPauseScreen, onCameraInitialized, renderBackground, renderMenuBackgroundMethods 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, isSelectAll, isValidCharacterForName, onClose, onFilesDrop, rebuildWidgets, removeWidget, renderBlurredBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltip, repositionElements, setInitialFocus, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatus, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
getChildAt, getCurrentFocusPath, isFocused, keyReleased, nextFocusPath, setFocusedMethods 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
-
setMode
-
init
public void init()- Overrides:
initin classChattableCameraScreen
-
restoreSettingsAndClose
public void restoreSettingsAndClose()Closes the battle GUI. -
restoreSettingsAndCloseStatic
-
removed
public void removed()- Overrides:
removedin 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:
keyPressedin interfacenet.minecraft.client.gui.components.events.ContainerEventHandler- Specified by:
keyPressedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Overrides:
keyPressedin classChattableCameraScreen
-
charTyped
public boolean charTyped(char key, int keyCode) - Specified by:
charTypedin interfacenet.minecraft.client.gui.components.events.ContainerEventHandler- Specified by:
charTypedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Overrides:
charTypedin classChattableCameraScreen
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) - Specified by:
mouseClickedin interfacenet.minecraft.client.gui.components.events.ContainerEventHandler- Specified by:
mouseClickedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Overrides:
mouseClickedin 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:
renderin interfacenet.minecraft.client.gui.components.Renderable- Overrides:
renderin classChattableCameraScreen
-
tick
public void tick()- Overrides:
tickin 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:
resizein 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)
-