diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-06-05 17:59:04 +0300 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-06-05 17:59:04 +0300 |
commit | d866f96541b03c80fbc417c5ab5e87d7189bb723 (patch) | |
tree | ee3e15da45fa5b0c8d2d614076dbac74cebe4847 | |
parent | 2318d06b49ebacd29a7071f5c3ac5bc0b18a5646 (diff) | |
download | LibGui-d866f96541b03c80fbc417c5ab5e87d7189bb723.tar.gz LibGui-d866f96541b03c80fbc417c5ab5e87d7189bb723.tar.bz2 LibGui-d866f96541b03c80fbc417c5ab5e87d7189bb723.zip |
CottonInventoryScreen: Add constructor with screen title, document
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java index a8327c2..5744aba 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java @@ -7,21 +7,42 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.LiteralText; import net.minecraft.text.Style; +import net.minecraft.text.Text; import org.lwjgl.glfw.GLFW; import io.github.cottonmc.cotton.gui.CottonInventoryController; import io.github.cottonmc.cotton.gui.widget.WPanel; import io.github.cottonmc.cotton.gui.widget.WWidget; +/** + * A screen for a {@link CottonInventoryController}. + * + * @param <T> the controller type + */ public class CottonInventoryScreen<T extends CottonInventoryController> extends HandledScreen<T> implements TextHoverRendererScreen { protected CottonInventoryController description; - public static final int PADDING = 8; protected WWidget lastResponder = null; - protected WWidget focus = null; - - public CottonInventoryScreen(T container, PlayerEntity player) { - super(container, player.inventory, new LiteralText("")); - this.description = container; + + /** + * Constructs a new screen without a title. + * + * @param description the GUI description + * @param player the player + */ + public CottonInventoryScreen(T description, PlayerEntity player) { + this(description, player, new LiteralText("")); + } + + /** + * Constructs a new screen. + * + * @param description the GUI description + * @param player the player + * @param title the screen title + */ + public CottonInventoryScreen(T description, PlayerEntity player, Text title) { + super(description, player.inventory, title); + this.description = description; width = 18*9; height = 18*9; this.backgroundWidth = 18*9; |