Class BattleRulesBaseScreen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
com.pixelmonmod.pixelmon.client.gui.widgets.DropDownScreen
com.pixelmonmod.pixelmon.client.gui.battles.rules.BattleRulesBaseScreen
- All Implemented Interfaces:
IImportableContainer,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
- Direct Known Subclasses:
BattleRulesFixedScreen,BattleRulesPlayerScreen
Base screen for selecting rules for a battle.
-
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 TypeFieldDescriptionprotected net.minecraft.client.gui.components.ButtonThe button used to switch between battle types.protected intThe x coordinate of the screen's center.protected intThe y coordinate of the screen's center.protected intThe height of clause lists.protected OnOffButtonThe button used to toggle whether critical hits can occur.protected net.minecraft.client.gui.components.Button[]Buttons used to edit the rules.protected booleanWhether rules can be edited.protected OnOffButtonThe button used to toggle whether players can exit the Battle Screen and walk around during a battle.protected OnOffButtonThe button used to toggle full healing.protected net.minecraft.client.gui.components.ButtonThe button used to navigate to the import/export screen.protected OnOffButtonThe button used to toggle the raise-to-cap rule.protected intThe y coordinate of the bottom of the screen.protected List<DescriptiveText>Rule labels and their descriptions.protected BattleRulesThe battle rules that are currently being edited in the screen.protected List<BattleClause>The clauses that have been selected to be included in the rules.protected OnOffButtonThe button used to toggle team preview.protected List<net.minecraft.client.gui.components.EditBox>All text fields in the screen.The drop-down menu for tier selection.protected intChanges the default y coordinates of screen elements.Fields inherited from class com.pixelmonmod.pixelmon.client.gui.widgets.DropDownScreen
dropDownManager, guiLeft, guiTop, xSize, ySizeFields inherited from class net.minecraft.client.gui.screens.Screen
BACKGROUND_LOCATION, children, font, height, minecraft, 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) booleancharTyped(char key, int keyCode) protected voiddimScreen(net.minecraft.client.gui.GuiGraphics graphics) Darkens the whole screen.protected booleanChecks if drop-down menus are disabled and uninteractable.protected voiddrawBackgroundUnderMenus(net.minecraft.client.gui.GuiGraphics graphics, float partialTicks, int mouseX, int mouseY) Draws the screen background under the drop-down menus.protected intReturns the height of the background rectangle.Gets exportable text for the current Pokémon.net.minecraft.client.gui.screens.ScreenReturns the screen containing the import/export.protected voidhighlightButtons(net.minecraft.client.gui.GuiGraphics graphics, int highlightOffsetX, int bottomOffset) Highlights a part of the screen where buttons appear.importText(String importText) Parses import text and saves it to the current Pokémon.voidinit()booleanmouseClickedUnderMenus(double x, double y, int mouseButton) Handles mouse input when a drop-down menu is not clicked.protected voidRegisters entered fields in the screen into the rules object.voidremoved()voidsetRules(BattleRules rules) Updates the screen with a new set of rules.Methods inherited from class com.pixelmonmod.pixelmon.client.gui.widgets.DropDownScreen
addDropDown, drawGuiContainerBackgroundLayer, drawGuiContainerForegroundLayer, isPauseScreen, mouseClicked, mouseDragged, mouseScrolled, removeDropDown, renderMethods 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, keyPressed, narrationEnabled, onClose, onFilesDrop, openLink, rebuildWidgets, removeWidget, renderBackground, renderDirtBackground, renderTransparentBackground, renderWithTooltip, repositionElements, resize, runNarration, scheduleNarration, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, shouldRunNarration, suppressNarration, tick, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, 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, magicalSpecialHackyFocus, mouseReleased, nextFocusPath, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMovedMethods inherited from interface com.pixelmonmod.pixelmon.client.gui.pokemoneditor.IImportableContainer
getPokemon, setPokemonMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
rules
The battle rules that are currently being edited in the screen. -
textFields
All text fields in the screen. -
editingEnabled
protected boolean editingEnabledWhether rules can be edited. -
importExportButton
protected net.minecraft.client.gui.components.Button importExportButtonThe button used to navigate to the import/export screen. -
raiseToCapButton
The button used to toggle the raise-to-cap rule. -
battleTypeButton
protected net.minecraft.client.gui.components.Button battleTypeButtonThe button used to switch between battle types. -
fullHealButton
The button used to toggle full healing. -
teamPreviewButton
The button used to toggle team preview. -
critsButton
The button used to toggle whether critical hits can occur. -
exitableButton
The button used to toggle whether players can exit the Battle Screen and walk around during a battle. -
editButtons
protected net.minecraft.client.gui.components.Button[] editButtonsButtons used to edit the rules. -
ruleLabels
Rule labels and their descriptions. -
selectedClauses
The clauses that have been selected to be included in the rules. -
centerX
protected int centerXThe x coordinate of the screen's center. -
centerY
protected int centerYThe y coordinate of the screen's center. -
rectBottom
protected int rectBottomThe y coordinate of the bottom of the screen. -
yChange
protected int yChangeChanges the default y coordinates of screen elements. -
clauseListHeight
protected int clauseListHeightThe height of clause lists. -
tierMenu
The drop-down menu for tier selection.
-
-
Constructor Details
-
BattleRulesBaseScreen
public BattleRulesBaseScreen()Initializes a battle rules screen.
-
-
Method Details
-
init
public void init()- Overrides:
initin classDropDownScreen
-
setRules
Updates the screen with a new set of rules.- Parameters:
rules- The rules to update the screen with.
-
drawBackgroundUnderMenus
protected void drawBackgroundUnderMenus(net.minecraft.client.gui.GuiGraphics graphics, float partialTicks, int mouseX, int mouseY) Description copied from class:DropDownScreenDraws the screen background under the drop-down menus. Disables mouse hovering if over a menu.- Specified by:
drawBackgroundUnderMenusin classDropDownScreenpartialTicks- The current number of partial ticks.mouseX- The x coordinate of the mouse.mouseY- The y coordinate of the mouse.
-
getBackgroundHeight
protected int getBackgroundHeight()Returns the height of the background rectangle.- Returns:
- The height of the background rectangle.
-
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
-
mouseClickedUnderMenus
public boolean mouseClickedUnderMenus(double x, double y, int mouseButton) Description copied from class:DropDownScreenHandles mouse input when a drop-down menu is not clicked.- Overrides:
mouseClickedUnderMenusin classDropDownScreen- Parameters:
x- The x coordinate of the mouse.y- The y coordinate of the mouse.mouseButton- The index of the clicked button.
-
actionPerformed
protected void actionPerformed(net.minecraft.client.gui.components.Button button) -
registerRules
protected void registerRules()Registers entered fields in the screen into the rules object. -
getExportText
Description copied from interface:IImportableContainerGets exportable text for the current Pokémon.- Specified by:
getExportTextin interfaceIImportableContainer- Returns:
- Exportable text for the current Pokémon.
-
importText
Description copied from interface:IImportableContainerParses import text and saves it to the current Pokémon.- Specified by:
importTextin interfaceIImportableContainer- Parameters:
importText- The text to save to the current Pokémon.- Returns:
- Null if the import was successful, or an error description if the import failed.
-
removed
public void removed()- Overrides:
removedin classnet.minecraft.client.gui.screens.Screen
-
dimScreen
protected void dimScreen(net.minecraft.client.gui.GuiGraphics graphics) Darkens the whole screen. -
highlightButtons
protected void highlightButtons(net.minecraft.client.gui.GuiGraphics graphics, int highlightOffsetX, int bottomOffset) Highlights a part of the screen where buttons appear.- Parameters:
highlightOffsetX- Half of the width of the highlight box.bottomOffset- The offset from the bottom of the box that the top of the highlight will be at.
-
getScreen
public net.minecraft.client.gui.screens.Screen getScreen()Description copied from interface:IImportableContainerReturns the screen containing the import/export.- Specified by:
getScreenin interfaceIImportableContainer- Returns:
- The screen containing the import/export.
-
disableMenus
protected boolean disableMenus()Description copied from class:DropDownScreenChecks if drop-down menus are disabled and uninteractable.- Overrides:
disableMenusin classDropDownScreen- Returns:
- Whether drop-down menus are disabled and uninteractable.
-