Class DropDownManager
java.lang.Object
com.pixelmonmod.pixelmon.client.gui.widgets.DropDownManager
Manages a collection of
DropDown on a screen.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDropDown(DropDown dropDown) Adds a drop-down menu to the manager.voidRemoves all drop-down menus from the manager.voiddrawDropDowns(net.minecraft.client.gui.GuiGraphics graphics, float partialTicks, int mouseX, int mouseY) Draws each active drop-down menu and handles mouse inputs.booleanisMouseOver(int mouseX, int mouseY) Checks if the mouse is over any drop-down menus.booleanmouseClicked(double mouseX, double mouseY, int mouseButton) Focuses or unfocuses drop-down menus when the mouse is clicked.booleanmouseScrolled(double mouseX, double mouseY, double delta) voidremoveDropDown(DropDown dropDown) Removes a drop-down menu from the manager.
-
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
Adds a drop-down menu to the manager.- Parameters:
dropDown- The drop-down menu to add.
-
removeDropDown
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.
-