Implement GUI Stacking feature. (#8130)

You can now use `mc.pushGuiLayer` and `mc.popGuiLayer` to manage the layers.
mc.setScreen behaves such that if called with a non-null screen it replaces the entire stack, and if called with null it closes the entire stack.
This commit is contained in:
gigaherz authored and GitHub committed 2021-10-04 19:15:56 -07:00
1 parent fd544dd414
commit 9944a8252a
7 files changed
+258 -2

No files matched your search

@@ -0,0 +1,39 @@
/*
* Minecraft Forge
* Copyright (c) 2016-2021.
*
* 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.extensions;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
import net.minecraftforge.client.ForgeHooksClient;
public interface IForgeMinecraft
{
private Minecraft self() { return (Minecraft)this; }
default void pushGuiLayer(Screen screen)
{
ForgeHooksClient.pushGuiLayer(self(), screen);
}
default void popGuiLayer()
{
ForgeHooksClient.popGuiLayer(self());
}
}