mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 01:04:24 +00:00
Add GuiContainer Foreground render event. (#4127)
This commit is contained in:
1 parent
2f7f2e7bc1
commit
099bbd479a
3 files changed
+155
-13
No files matched your search
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
/**
|
||||
* Event class for handling GuiContainer specific events.
|
||||
*/
|
||||
public class GuiContainerEvent extends Event
|
||||
{
|
||||
|
||||
private final GuiContainer guiContainer;
|
||||
|
||||
public GuiContainerEvent(GuiContainer guiContainer)
|
||||
{
|
||||
this.guiContainer = guiContainer;
|
||||
}
|
||||
|
||||
public GuiContainer getGuiContainer()
|
||||
{
|
||||
return guiContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
* This event is fired directly after the GuiContainer has draw any foreground elements,
|
||||
* But before the "dragged" stack, and before any tooltips.
|
||||
* This is useful for any slot / item specific overlays.
|
||||
* Things that need to be on top of All GUI elements but bellow tooltips and dragged stacks.
|
||||
*/
|
||||
public static class DrawForeground extends GuiContainerEvent
|
||||
{
|
||||
private final int mouseX;
|
||||
private final int mouseY;
|
||||
|
||||
/**
|
||||
* Called directly after the GuiContainer has drawn any foreground elements.
|
||||
*
|
||||
* @param guiContainer The container.
|
||||
* @param mouseX The current X position of the players mouse.
|
||||
* @param mouseY The current Y position of the players mouse.
|
||||
*/
|
||||
public DrawForeground(GuiContainer guiContainer, int mouseX, int mouseY)
|
||||
{
|
||||
super(guiContainer);
|
||||
this.mouseX = mouseX;
|
||||
this.mouseY = mouseY;
|
||||
}
|
||||
|
||||
public int getMouseX()
|
||||
{
|
||||
return mouseX;
|
||||
}
|
||||
|
||||
public int getMouseY()
|
||||
{
|
||||
return mouseY;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user