Class ConfirmScreen

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement
Direct Known Subclasses:
ClientCommonPacketListenerImpl.PackConfirmScreen, ConfigurationScreen.TooltipConfirmScreen, ConfirmLinkScreen, DeathScreen.TitleConfirmScreen

public class ConfirmScreen extends Screen
  • Field Details

    • MARGIN

      private static final int MARGIN
      See Also:
    • message

      private final Component message
    • multilineMessage

      private MultiLineLabel multilineMessage
    • yesButton

      protected Component yesButton
      The text shown for the first button in GuiYesNo
    • noButton

      protected Component noButton
      The text shown for the second button in GuiYesNo
    • delayTicker

      private int delayTicker
    • callback

      protected final it.unimi.dsi.fastutil.booleans.BooleanConsumer callback
    • exitButtons

      private final List<Button> exitButtons
  • Constructor Details

    • ConfirmScreen

      public ConfirmScreen(it.unimi.dsi.fastutil.booleans.BooleanConsumer callback, Component title, Component message)
    • ConfirmScreen

      public ConfirmScreen(it.unimi.dsi.fastutil.booleans.BooleanConsumer callback, Component title, Component message, Component yesButton, Component noButton)
  • Method Details

    • getNarrationMessage

      public Component getNarrationMessage()
      Overrides:
      getNarrationMessage in class Screen
    • init

      protected void init()
      Overrides:
      init in class Screen
    • addButtons

      protected void addButtons(int y)
    • addExitButton

      protected void addExitButton(Button exitButton)
    • render

      public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick)
      Renders the graphical user interface (GUI) element.
      Specified by:
      render in interface Renderable
      Overrides:
      render in class Screen
      Parameters:
      guiGraphics - the GuiGraphics object used for rendering.
      mouseX - the x-coordinate of the mouse cursor.
      mouseY - the y-coordinate of the mouse cursor.
      partialTick - the partial tick time.
    • titleTop

      private int titleTop()
    • messageTop

      private int messageTop()
    • messageHeight

      private int messageHeight()
    • setDelay

      public void setDelay(int ticksUntilEnable)
      Sets the number of ticks to wait before enabling the buttons.
    • tick

      public void tick()
      Overrides:
      tick in class Screen
    • shouldCloseOnEsc

      public boolean shouldCloseOnEsc()
      Overrides:
      shouldCloseOnEsc in class Screen
    • keyPressed

      public boolean keyPressed(int keyCode, int scanCode, int modifiers)
      Description copied from class: Screen
      Called when a keyboard key is pressed within the GUI element.

      Specified by:
      keyPressed in interface ContainerEventHandler
      Specified by:
      keyPressed in interface GuiEventListener
      Overrides:
      keyPressed in class Screen
      Parameters:
      keyCode - the key code of the pressed key.
      scanCode - the scan code of the pressed key.
      modifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.