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
,BattleRulesNPCEditorScreen
,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
Modifier and TypeFieldDescriptionprotected net.minecraft.client.gui.components.Button
The button used to switch between battle types.protected int
The x coordinate of the screen's center.protected int
The y coordinate of the screen's center.protected int
The height of clause lists.protected OnOffButton
The button used to toggle whether critical hits can occur.protected net.minecraft.client.gui.components.Button[]
Buttons used to edit the rules.protected boolean
Whether rules can be edited.protected OnOffButton
The button used to toggle whether players can exit the Battle Screen and walk around during a battle.protected OnOffButton
The button used to toggle full healing.protected net.minecraft.client.gui.components.Button
The button used to navigate to the import/export screen.protected OnOffButton
The button used to toggle the raise-to-cap rule.protected int
The y coordinate of the bottom of the screen.protected List<DescriptiveText>
Rule labels and their descriptions.protected BattleRules
The 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 OnOffButton
The 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 int
Changes the default y coordinates of screen elements.Fields inherited from class com.pixelmonmod.pixelmon.client.gui.widgets.DropDownScreen
dropDownManager, guiLeft, guiTop, xSize, ySize
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
charTyped
(char key, int keyCode) protected void
dimScreen
(net.minecraft.client.gui.GuiGraphics graphics) Darkens the whole screen.protected boolean
Checks if drop-down menus are disabled and uninteractable.protected void
drawBackgroundUnderMenus
(net.minecraft.client.gui.GuiGraphics graphics, float partialTicks, int mouseX, int mouseY) Draws the screen background under the drop-down menus.protected int
Returns the height of the background rectangle.Gets exportable text for the current Pokémon.net.minecraft.client.gui.screens.Screen
Returns the screen containing the import/export.protected void
highlightButtons
(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.void
init()
boolean
mouseClickedUnderMenus
(double x, double y, int mouseButton) Handles mouse input when a drop-down menu is not clicked.protected void
Registers entered fields in the screen into the rules object.void
removed()
void
setRules
(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, render
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, 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, 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, mouseReleased, nextFocusPath, setFocused
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMoved
Methods inherited from interface com.pixelmonmod.pixelmon.client.gui.pokemoneditor.IImportableContainer
getPokemon, setPokemon
Methods 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:
init
in 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:DropDownScreen
Draws the screen background under the drop-down menus. Disables mouse hovering if over a menu.- Specified by:
drawBackgroundUnderMenus
in classDropDownScreen
partialTicks
- 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:
charTyped
in interfacenet.minecraft.client.gui.components.events.ContainerEventHandler
- Specified by:
charTyped
in interfacenet.minecraft.client.gui.components.events.GuiEventListener
-
mouseClickedUnderMenus
public boolean mouseClickedUnderMenus(double x, double y, int mouseButton) Description copied from class:DropDownScreen
Handles mouse input when a drop-down menu is not clicked.- Overrides:
mouseClickedUnderMenus
in 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:IImportableContainer
Gets exportable text for the current Pokémon.- Specified by:
getExportText
in interfaceIImportableContainer
- Returns:
- Exportable text for the current Pokémon.
-
importText
Description copied from interface:IImportableContainer
Parses import text and saves it to the current Pokémon.- Specified by:
importText
in 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:
removed
in 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:IImportableContainer
Returns the screen containing the import/export.- Specified by:
getScreen
in interfaceIImportableContainer
- Returns:
- The screen containing the import/export.
-
disableMenus
protected boolean disableMenus()Description copied from class:DropDownScreen
Checks if drop-down menus are disabled and uninteractable.- Overrides:
disableMenus
in classDropDownScreen
- Returns:
- Whether drop-down menus are disabled and uninteractable.
-