diff options
author | Juuz <6596629+Juuxel@users.noreply.github.com> | 2021-06-04 16:16:42 +0300 |
---|---|---|
committer | Juuz <6596629+Juuxel@users.noreply.github.com> | 2021-06-04 16:16:42 +0300 |
commit | 1aba27451ce4b95dc7a832938998c9d1581eee97 (patch) | |
tree | a66d52dd9fba3769f229622e52df61979c448718 | |
parent | 9ab901717e430a48db6e30d5117dd28f15ff8f72 (diff) | |
download | LibGui-1aba27451ce4b95dc7a832938998c9d1581eee97.tar.gz LibGui-1aba27451ce4b95dc7a832938998c9d1581eee97.tar.bz2 LibGui-1aba27451ce4b95dc7a832938998c9d1581eee97.zip |
Validate root panels automatically
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java | 4 | ||||
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java index df5108c..d6928ee 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java @@ -37,13 +37,13 @@ public class CottonClientScreen extends Screen implements CottonScreenImpl { protected WWidget lastResponder = null; public CottonClientScreen(GuiDescription description) { - super(new LiteralText("")); - this.description = description; + this(new LiteralText(""), description); } public CottonClientScreen(Text title, GuiDescription description) { super(title); this.description = description; + description.getRootPanel().validate(description); } public GuiDescription getDescription() { 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 9c344cd..dba1add 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 @@ -50,6 +50,7 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl height = 18*9; this.backgroundWidth = 18*9; this.backgroundHeight = 18*9; + description.getRootPanel().validate(description); } /* |