Class TradingScreen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
com.pixelmonmod.pixelmon.client.gui.TradingScreen
- 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 TradingScreen
extends net.minecraft.client.gui.screens.Screen
GUI when using a trade machine.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.Screen.NarratableSearchResult -
Field Summary
FieldsFields 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 TypeMethodDescriptionbooleandrawButtonReady(net.minecraft.client.gui.GuiGraphics matrix, double mouseX, double mouseY) Draws a button to mark the player as ready to trade.booleandrawButtonTrade(net.minecraft.client.gui.GuiGraphics matrix, double mouseX, double mouseY) Draws a button to allow the player to trade.voiddrawPokemonSelection(net.minecraft.client.gui.GuiGraphics matrix, double mouseX, double mouseY) Draws a rectangle around the selected Pokémon.booleanhoveredButtonReady(double mouseX, double mouseY) Checks if the mouse is hovering over the ready button.booleanhoveredButtonTrade(double mouseX, double mouseY) Checks if the mouse is hovering over the trade button.inthoveredPokemonSelectionIndex(double mouseX, double mouseY) Checks if the mouse is hovering over a Pokémon.booleanisOverCloseButton(double mouseX, double mouseY) Draws a button to close the GUI.booleanReturns true if this GUI should pause the game when it is displayed in single-playerbooleanmouseClicked(double mouseX, double mouseY, int mouseButton) voidremoved()voidrender(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) 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, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, keyPressed, onClose, onFilesDrop, rebuildWidgets, removeWidget, renderBackground, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltip, repositionElements, resize, setInitialFocus, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, tick, 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
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMovedMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
ready
public boolean readyWhether the player is ready to trade.
-
-
Constructor Details
-
TradingScreen
public TradingScreen(int x, int y, int z) Initializes the trade GUI.
-
-
Method Details
-
removed
public void removed()- Overrides:
removedin classnet.minecraft.client.gui.screens.Screen
-
render
public void render(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) - Specified by:
renderin interfacenet.minecraft.client.gui.components.Renderable- Overrides:
renderin classnet.minecraft.client.gui.screens.Screen
-
hoveredPokemonSelectionIndex
public int hoveredPokemonSelectionIndex(double mouseX, double mouseY) Checks if the mouse is hovering over a Pokémon.- Parameters:
mouseX- The x coordinate of the mouse.mouseY- The y coordinate of the mouse.- Returns:
- The index of the party Pokémon that the mouse is over, or -1 if not.
-
drawPokemonSelection
public void drawPokemonSelection(net.minecraft.client.gui.GuiGraphics matrix, double mouseX, double mouseY) Draws a rectangle around the selected Pokémon.- Parameters:
mouseX- The x coordinate of the mouse.mouseY- The y coordinate of the mouse.
-
hoveredButtonTrade
public boolean hoveredButtonTrade(double mouseX, double mouseY) Checks if the mouse is hovering over the trade button.- Parameters:
mouseX- The x coordinate of the mouse.mouseY- The y coordinate of the mouse.- Returns:
- Whether the coordinates of the mouse are within the bounds of the trade button.
-
drawButtonTrade
public boolean drawButtonTrade(net.minecraft.client.gui.GuiGraphics matrix, double mouseX, double mouseY) Draws a button to allow the player to trade.- Parameters:
mouseX- The x coordinate of the mouse.mouseY- The y coordinate of the mouse.- Returns:
- Whether the mouse is over the trade button.
-
isOverCloseButton
public boolean isOverCloseButton(double mouseX, double mouseY) Draws a button to close the GUI.- Parameters:
mouseX- The x coordinate of the mouse.mouseY- The y coordinate of the mouse.- Returns:
- Whether the mouse is over the close button.
-
hoveredButtonReady
public boolean hoveredButtonReady(double mouseX, double mouseY) Checks if the mouse is hovering over the ready button.- Parameters:
mouseX- The x coordinate of the mouse.mouseY- The y coordinate of the mouse.- Returns:
- Whether the coordinates of the mouse are within the boundaries of the ready button.
-
drawButtonReady
public boolean drawButtonReady(net.minecraft.client.gui.GuiGraphics matrix, double mouseX, double mouseY) Draws a button to mark the player as ready to trade.- Parameters:
mouseX- The x coordinate of the mouse.mouseY- The y coordinate of the mouse.- Returns:
- Whether the mouse is over the ready button.
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) -
isPauseScreen
public boolean isPauseScreen()Returns true if this GUI should pause the game when it is displayed in single-player- Overrides:
isPauseScreenin classnet.minecraft.client.gui.screens.Screen
-