Class DropDownManager

java.lang.Object
com.pixelmonmod.pixelmon.client.gui.widgets.DropDownManager

public class DropDownManager extends Object
Manages a collection of DropDown on a screen.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a drop-down menu to the manager.
    void
    Removes all drop-down menus from the manager.
    void
    drawDropDowns(net.minecraft.client.gui.GuiGraphics graphics, float partialTicks, int mouseX, int mouseY)
    Draws each active drop-down menu and handles mouse inputs.
    boolean
    isMouseOver(int mouseX, int mouseY)
    Checks if the mouse is over any drop-down menus.
    boolean
    mouseClicked(double mouseX, double mouseY, int mouseButton)
    Focuses or unfocuses drop-down menus when the mouse is clicked.
    boolean
    mouseScrolled(double mouseX, double mouseY, double delta)
     
    void
    Removes a drop-down menu from the manager.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DropDownManager

      public DropDownManager()
  • Method Details

    • drawDropDowns

      public void drawDropDowns(net.minecraft.client.gui.GuiGraphics graphics, float partialTicks, int mouseX, int mouseY)
      Draws each active drop-down menu and handles mouse inputs.
      Parameters:
      partialTicks - The current number of partial ticks.
      mouseX - The mouse's x coordinate.
      mouseY - The mouse's y coordinate.
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int mouseButton)
      Focuses or unfocuses drop-down menus when the mouse is clicked.
      Parameters:
      mouseX - The mouse's x coordinate.
      mouseY - The mouse's y coordinate.
      mouseButton - The index of the clicked mouse button.
      Returns:
      Whether the mouse selected any drop-down menus.
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double delta)
    • addDropDown

      public void addDropDown(DropDown dropDown)
      Adds a drop-down menu to the manager.
      Parameters:
      dropDown - The drop-down menu to add.
    • removeDropDown

      public void removeDropDown(DropDown dropDown)
      Removes a drop-down menu from the manager.
      Parameters:
      dropDown - The drop-down menu to remove.
    • clearDropDowns

      public void clearDropDowns()
      Removes all drop-down menus from the manager.
    • isMouseOver

      public boolean isMouseOver(int mouseX, int mouseY)
      Checks if the mouse is over any drop-down menus.
      Parameters:
      mouseX - The x coordinate of the mouse.
      mouseY - The y coordinate of the mouse.
      Returns:
      Whether the mouse is over any drop-down menus.