Class PlatformMenuButton

java.lang.Object
net.dillon.dillonlib.platform.info.PlatformMenuButton

public class PlatformMenuButton extends Object
Stores menu button data.
  • Field Details

    • TITLE_SCREEN_BUTTON_CAP

      public static final int TITLE_SCREEN_BUTTON_CAP
      See Also:
    • PAUSE_SCREEN_BUTTON_CAP

      public static final int PAUSE_SCREEN_BUTTON_CAP
      See Also:
  • Method Details

    • of

      public static PlatformMenuButton of(boolean titleCondition, boolean pauseCondition, UpdatableSpriteButton menuButton, Consumer<net.minecraft.client.gui.components.SpriteIconButton> consumer)
      Creates a new PlatformMenuButton.
    • ofEmpty

      public static PlatformMenuButton ofEmpty(boolean titleCondition, boolean pauseCondition, UpdatableSpriteButton menuButton)
      Creates a new PlatformMenuButton, with an empty consumer.
    • titleOnlyEmpty

      public static PlatformMenuButton titleOnlyEmpty(boolean titleCondition, UpdatableSpriteButton menuButton)
      Creates a new PlatformMenuButton, only possibly rendering on the title screen, with an empty consumer.
    • pauseOnlyEmpty

      public static PlatformMenuButton pauseOnlyEmpty(boolean pauseCondition, UpdatableSpriteButton menuButton)
      Creates a new PlatformMenuButton, only possibly rendering on the pause screen, with an empty consumer.
    • titleOnly

      public static PlatformMenuButton titleOnly(boolean titleCondition, UpdatableSpriteButton menuButton, Consumer<net.minecraft.client.gui.components.SpriteIconButton> consumer)
      Creates a new PlatformMenuButton, only possibly rendering on the title screen.
    • pauseOnly

      public static PlatformMenuButton pauseOnly(boolean pauseCondition, UpdatableSpriteButton menuButton, Consumer<net.minecraft.client.gui.components.SpriteIconButton> consumer)
      Creates a new PlatformMenuButton, only possibly rendering on the pause screen.
    • isOnTitle

      public boolean isOnTitle()
      Returns:
      if the button can render on the Title screen.
    • isOnPause

      public boolean isOnPause()
      Returns:
      if the button can render on the Pause screen.
    • button

      public UpdatableSpriteButton button()
      Returns:
      the menu button.
    • consumer

      public Consumer<net.minecraft.client.gui.components.SpriteIconButton> consumer()
      Returns:
      the consumer for the menu button.
    • sortButtons

      public static void sortButtons(List<PlatformMenuButton> buttons)
      Sorts platform menu buttons in a correct order.