Class DropDownManager
java.lang.Object
com.pixelmonmod.pixelmon.client.gui.widgets.DropDownManager
Manages a collection of
DropDown
on a screen.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDropDown
(DropDown dropDown) 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
removeDropDown
(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.
-