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

public abstract class BattleRulesBaseScreen extends DropDownScreen implements IImportableContainer
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

    Fields
    Modifier and Type
    Field
    Description
    protected 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.
    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.
    protected DropDown<Tier>
    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

    Constructors
    Constructor
    Description
    Initializes a battle rules screen.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected 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
     
    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
     
    void
    Updates the screen with a new set of rules.

    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

      protected BattleRules rules
      The battle rules that are currently being edited in the screen.
    • textFields

      protected List<net.minecraft.client.gui.components.EditBox> textFields
      All text fields in the screen.
    • editingEnabled

      protected boolean editingEnabled
      Whether rules can be edited.
    • importExportButton

      protected net.minecraft.client.gui.components.Button importExportButton
      The button used to navigate to the import/export screen.
    • raiseToCapButton

      protected OnOffButton raiseToCapButton
      The button used to toggle the raise-to-cap rule.
    • battleTypeButton

      protected net.minecraft.client.gui.components.Button battleTypeButton
      The button used to switch between battle types.
    • fullHealButton

      protected OnOffButton fullHealButton
      The button used to toggle full healing.
    • teamPreviewButton

      protected OnOffButton teamPreviewButton
      The button used to toggle team preview.
    • critsButton

      protected OnOffButton critsButton
      The button used to toggle whether critical hits can occur.
    • exitableButton

      protected OnOffButton 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[] editButtons
      Buttons used to edit the rules.
    • ruleLabels

      protected List<DescriptiveText> ruleLabels
      Rule labels and their descriptions.
    • selectedClauses

      protected List<BattleClause> selectedClauses
      The clauses that have been selected to be included in the rules.
    • centerX

      protected int centerX
      The x coordinate of the screen's center.
    • centerY

      protected int centerY
      The y coordinate of the screen's center.
    • rectBottom

      protected int rectBottom
      The y coordinate of the bottom of the screen.
    • yChange

      protected int yChange
      Changes the default y coordinates of screen elements.
    • clauseListHeight

      protected int clauseListHeight
      The height of clause lists.
    • tierMenu

      protected DropDown<Tier> 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 class DropDownScreen
    • setRules

      public void setRules(BattleRules rules)
      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 class DropDownScreen
      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 interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      charTyped in interface net.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 class DropDownScreen
      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

      public String getExportText()
      Description copied from interface: IImportableContainer
      Gets exportable text for the current Pokémon.
      Specified by:
      getExportText in interface IImportableContainer
      Returns:
      Exportable text for the current Pokémon.
    • importText

      public String importText(String importText)
      Description copied from interface: IImportableContainer
      Parses import text and saves it to the current Pokémon.
      Specified by:
      importText in interface IImportableContainer
      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 class net.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 interface IImportableContainer
      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 class DropDownScreen
      Returns:
      Whether drop-down menus are disabled and uninteractable.